Skip to content

Instantly share code, notes, and snippets.

@ernopp
Last active June 12, 2018 17:02
Show Gist options
  • Save ernopp/c23db278bdbce5d37a5e72dd2d3f0335 to your computer and use it in GitHub Desktop.
Save ernopp/c23db278bdbce5d37a5e72dd2d3f0335 to your computer and use it in GitHub Desktop.
/// <summary>Snippet for ListDeploymentsAsync</summary>
public async Task ListDeploymentsAsync_RequestObject()
{
// Snippet: ListDeploymentsAsync(ListDeploymentsRequest,CallSettings)
// Create client
DeploymentServiceClient deploymentServiceClient = await DeploymentServiceClient.CreateAsync();
// Initialize request argument(s)
ListDeploymentsRequest request = new ListDeploymentsRequest
{
ProjectName = "foobar",
};
// Make the request
PagedAsyncEnumerable<ListDeploymentsResponse, Deployment> response =
deploymentServiceClient.ListDeploymentsAsync(request);
// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((Deployment item) =>
{
// Do something with each item
Console.WriteLine(item);
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment