/// <summary>Snippet for PatchAsync</summary> public async Task PatchAsync() { // Snippet: PatchAsync(string, string, TargetHttpProxy, CallSettings) // Additional: PatchAsync(string, string, TargetHttpProxy, CancellationToken) // Create client TargetHttpProxiesClient targetHttpProxiesClient = await TargetHttpProxiesClient.CreateAsync(); // Initialize request argument(s) string project = ""; string targetHttpProxy = ""; TargetHttpProxy targetHttpProxyResource = new TargetHttpProxy(); // Make the request lro::Operation <Operation, Operation> response = await targetHttpProxiesClient.PatchAsync(project, targetHttpProxy, targetHttpProxyResource); // Poll until the returned long-running operation is complete lro::Operation <Operation, Operation> completedResponse = await response.PollUntilCompletedAsync(); // Retrieve the operation result Operation result = completedResponse.Result; // Or get the name of the operation string operationName = response.Name; // This name can be stored, then the long-running operation retrieved later by name lro::Operation <Operation, Operation> retrievedResponse = await targetHttpProxiesClient.PollOncePatchAsync(operationName); // Check if the retrieved long-running operation has completed if (retrievedResponse.IsCompleted) { // If it has completed, then access the result Operation retrievedResult = retrievedResponse.Result; } // End snippet }
/// <summary>Snippet for AggregatedListAsync</summary> public async Task AggregatedListRequestObjectAsync() { // Snippet: AggregatedListAsync(AggregatedListTargetHttpProxiesRequest, CallSettings) // Create client TargetHttpProxiesClient targetHttpProxiesClient = await TargetHttpProxiesClient.CreateAsync(); // Initialize request argument(s) AggregatedListTargetHttpProxiesRequest request = new AggregatedListTargetHttpProxiesRequest { OrderBy = "", Project = "", Filter = "", IncludeAllScopes = false, ReturnPartialSuccess = false, }; // Make the request PagedAsyncEnumerable <TargetHttpProxyAggregatedList, KeyValuePair <string, TargetHttpProxiesScopedList> > response = targetHttpProxiesClient.AggregatedListAsync(request); // Iterate over all response items, lazily performing RPCs as required await response.ForEachAsync((KeyValuePair <string, TargetHttpProxiesScopedList> item) => { // Do something with each item Console.WriteLine(item); }); // Or iterate over pages (of server-defined size), performing one RPC per page await response.AsRawResponses().ForEachAsync((TargetHttpProxyAggregatedList page) => { // Do something with each page of items Console.WriteLine("A page of results:"); foreach (KeyValuePair <string, TargetHttpProxiesScopedList> item in page) { // Do something with each item Console.WriteLine(item); } }); // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required int pageSize = 10; Page <KeyValuePair <string, TargetHttpProxiesScopedList> > singlePage = await response.ReadPageAsync(pageSize); // Do something with the page of items Console.WriteLine($"A page of {pageSize} results (unless it's the final page):"); foreach (KeyValuePair <string, TargetHttpProxiesScopedList> item in singlePage) { // Do something with each item Console.WriteLine(item); } // Store the pageToken, for when the next page is required. string nextPageToken = singlePage.NextPageToken; // End snippet }
/// <summary>Snippet for AggregatedListAsync</summary> public async Task AggregatedListAsync() { // Snippet: AggregatedListAsync(string, CallSettings) // Additional: AggregatedListAsync(string, CancellationToken) // Create client TargetHttpProxiesClient targetHttpProxiesClient = await TargetHttpProxiesClient.CreateAsync(); // Initialize request argument(s) string project = ""; // Make the request TargetHttpProxyAggregatedList response = await targetHttpProxiesClient.AggregatedListAsync(project); // End snippet }
/// <summary>Snippet for InsertAsync</summary> public async Task InsertAsync() { // Snippet: InsertAsync(string, TargetHttpProxy, CallSettings) // Additional: InsertAsync(string, TargetHttpProxy, CancellationToken) // Create client TargetHttpProxiesClient targetHttpProxiesClient = await TargetHttpProxiesClient.CreateAsync(); // Initialize request argument(s) string project = ""; TargetHttpProxy targetHttpProxyResource = new TargetHttpProxy(); // Make the request Operation response = await targetHttpProxiesClient.InsertAsync(project, targetHttpProxyResource); // End snippet }
/// <summary>Snippet for GetAsync</summary> public async Task GetAsync() { // Snippet: GetAsync(string, string, CallSettings) // Additional: GetAsync(string, string, CancellationToken) // Create client TargetHttpProxiesClient targetHttpProxiesClient = await TargetHttpProxiesClient.CreateAsync(); // Initialize request argument(s) string project = ""; string targetHttpProxy = ""; // Make the request TargetHttpProxy response = await targetHttpProxiesClient.GetAsync(project, targetHttpProxy); // End snippet }
/// <summary>Snippet for SetUrlMapAsync</summary> public async Task SetUrlMapAsync() { // Snippet: SetUrlMapAsync(string, string, UrlMapReference, CallSettings) // Additional: SetUrlMapAsync(string, string, UrlMapReference, CancellationToken) // Create client TargetHttpProxiesClient targetHttpProxiesClient = await TargetHttpProxiesClient.CreateAsync(); // Initialize request argument(s) string project = ""; string targetHttpProxy = ""; UrlMapReference urlMapReferenceResource = new UrlMapReference(); // Make the request Operation response = await targetHttpProxiesClient.SetUrlMapAsync(project, targetHttpProxy, urlMapReferenceResource); // End snippet }
/// <summary>Snippet for ListAsync</summary> public async Task ListAsync() { // Snippet: ListAsync(string, string, int?, CallSettings) // Create client TargetHttpProxiesClient targetHttpProxiesClient = await TargetHttpProxiesClient.CreateAsync(); // Initialize request argument(s) string project = ""; // Make the request PagedAsyncEnumerable <TargetHttpProxyList, TargetHttpProxy> response = targetHttpProxiesClient.ListAsync(project); // Iterate over all response items, lazily performing RPCs as required await response.ForEachAsync((TargetHttpProxy item) => { // Do something with each item Console.WriteLine(item); }); // Or iterate over pages (of server-defined size), performing one RPC per page await response.AsRawResponses().ForEachAsync((TargetHttpProxyList page) => { // Do something with each page of items Console.WriteLine("A page of results:"); foreach (TargetHttpProxy item in page) { // Do something with each item Console.WriteLine(item); } }); // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required int pageSize = 10; Page <TargetHttpProxy> singlePage = await response.ReadPageAsync(pageSize); // Do something with the page of items Console.WriteLine($"A page of {pageSize} results (unless it's the final page):"); foreach (TargetHttpProxy item in singlePage) { // Do something with each item Console.WriteLine(item); } // Store the pageToken, for when the next page is required. string nextPageToken = singlePage.NextPageToken; // End snippet }
/// <summary>Snippet for GetAsync</summary> public async Task GetRequestObjectAsync() { // Snippet: GetAsync(GetTargetHttpProxyRequest, CallSettings) // Additional: GetAsync(GetTargetHttpProxyRequest, CancellationToken) // Create client TargetHttpProxiesClient targetHttpProxiesClient = await TargetHttpProxiesClient.CreateAsync(); // Initialize request argument(s) GetTargetHttpProxyRequest request = new GetTargetHttpProxyRequest { TargetHttpProxy = "", Project = "", }; // Make the request TargetHttpProxy response = await targetHttpProxiesClient.GetAsync(request); // End snippet }
/// <summary>Snippet for InsertAsync</summary> public async Task InsertRequestObjectAsync() { // Snippet: InsertAsync(InsertTargetHttpProxyRequest, CallSettings) // Additional: InsertAsync(InsertTargetHttpProxyRequest, CancellationToken) // Create client TargetHttpProxiesClient targetHttpProxiesClient = await TargetHttpProxiesClient.CreateAsync(); // Initialize request argument(s) InsertTargetHttpProxyRequest request = new InsertTargetHttpProxyRequest { TargetHttpProxyResource = new TargetHttpProxy(), RequestId = "", Project = "", }; // Make the request Operation response = await targetHttpProxiesClient.InsertAsync(request); // End snippet }
/// <summary>Snippet for DeleteAsync</summary> public async Task DeleteRequestObjectAsync() { // Snippet: DeleteAsync(DeleteTargetHttpProxyRequest, CallSettings) // Additional: DeleteAsync(DeleteTargetHttpProxyRequest, CancellationToken) // Create client TargetHttpProxiesClient targetHttpProxiesClient = await TargetHttpProxiesClient.CreateAsync(); // Initialize request argument(s) DeleteTargetHttpProxyRequest request = new DeleteTargetHttpProxyRequest { RequestId = "", TargetHttpProxy = "", Project = "", }; // Make the request Operation response = await targetHttpProxiesClient.DeleteAsync(request); // End snippet }
/// <summary>Snippet for SetUrlMapAsync</summary> public async Task SetUrlMapRequestObjectAsync() { // Snippet: SetUrlMapAsync(SetUrlMapTargetHttpProxyRequest, CallSettings) // Additional: SetUrlMapAsync(SetUrlMapTargetHttpProxyRequest, CancellationToken) // Create client TargetHttpProxiesClient targetHttpProxiesClient = await TargetHttpProxiesClient.CreateAsync(); // Initialize request argument(s) SetUrlMapTargetHttpProxyRequest request = new SetUrlMapTargetHttpProxyRequest { RequestId = "", TargetHttpProxy = "", Project = "", UrlMapReferenceResource = new UrlMapReference(), }; // Make the request Operation response = await targetHttpProxiesClient.SetUrlMapAsync(request); // End snippet }
/// <summary>Snippet for ListAsync</summary> public async Task ListRequestObjectAsync() { // Snippet: ListAsync(ListTargetHttpProxiesRequest, CallSettings) // Additional: ListAsync(ListTargetHttpProxiesRequest, CancellationToken) // Create client TargetHttpProxiesClient targetHttpProxiesClient = await TargetHttpProxiesClient.CreateAsync(); // Initialize request argument(s) ListTargetHttpProxiesRequest request = new ListTargetHttpProxiesRequest { PageToken = "", MaxResults = 0U, OrderBy = "", Project = "", Filter = "", ReturnPartialSuccess = false, }; // Make the request TargetHttpProxyList response = await targetHttpProxiesClient.ListAsync(request); // End snippet }
/// <summary>Snippet for SetUrlMapAsync</summary> public async Task SetUrlMapRequestObjectAsync() { // Snippet: SetUrlMapAsync(SetUrlMapTargetHttpProxyRequest, CallSettings) // Additional: SetUrlMapAsync(SetUrlMapTargetHttpProxyRequest, CancellationToken) // Create client TargetHttpProxiesClient targetHttpProxiesClient = await TargetHttpProxiesClient.CreateAsync(); // Initialize request argument(s) SetUrlMapTargetHttpProxyRequest request = new SetUrlMapTargetHttpProxyRequest { RequestId = "", TargetHttpProxy = "", Project = "", UrlMapReferenceResource = new UrlMapReference(), }; // Make the request lro::Operation <Operation, Operation> response = await targetHttpProxiesClient.SetUrlMapAsync(request); // Poll until the returned long-running operation is complete lro::Operation <Operation, Operation> completedResponse = await response.PollUntilCompletedAsync(); // Retrieve the operation result Operation result = completedResponse.Result; // Or get the name of the operation string operationName = response.Name; // This name can be stored, then the long-running operation retrieved later by name lro::Operation <Operation, Operation> retrievedResponse = await targetHttpProxiesClient.PollOnceSetUrlMapAsync(operationName); // Check if the retrieved long-running operation has completed if (retrievedResponse.IsCompleted) { // If it has completed, then access the result Operation retrievedResult = retrievedResponse.Result; } // End snippet }