/// <summary>Snippet for PatchAsync</summary> public async Task PatchAsync() { // Snippet: PatchAsync(string, string, string, InterconnectAttachment, CallSettings) // Additional: PatchAsync(string, string, string, InterconnectAttachment, CancellationToken) // Create client InterconnectAttachmentsClient interconnectAttachmentsClient = await InterconnectAttachmentsClient.CreateAsync(); // Initialize request argument(s) string project = ""; string region = ""; string interconnectAttachment = ""; InterconnectAttachment interconnectAttachmentResource = new InterconnectAttachment(); // Make the request lro::Operation <Operation, Operation> response = await interconnectAttachmentsClient.PatchAsync(project, region, interconnectAttachment, interconnectAttachmentResource); // 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 interconnectAttachmentsClient.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(AggregatedListInterconnectAttachmentsRequest, CallSettings) // Create client InterconnectAttachmentsClient interconnectAttachmentsClient = await InterconnectAttachmentsClient.CreateAsync(); // Initialize request argument(s) AggregatedListInterconnectAttachmentsRequest request = new AggregatedListInterconnectAttachmentsRequest { OrderBy = "", Project = "", Filter = "", IncludeAllScopes = false, ReturnPartialSuccess = false, }; // Make the request PagedAsyncEnumerable <InterconnectAttachmentAggregatedList, KeyValuePair <string, InterconnectAttachmentsScopedList> > response = interconnectAttachmentsClient.AggregatedListAsync(request); // Iterate over all response items, lazily performing RPCs as required await response.ForEachAsync((KeyValuePair <string, InterconnectAttachmentsScopedList> 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((InterconnectAttachmentAggregatedList page) => { // Do something with each page of items Console.WriteLine("A page of results:"); foreach (KeyValuePair <string, InterconnectAttachmentsScopedList> 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, InterconnectAttachmentsScopedList> > 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, InterconnectAttachmentsScopedList> 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 InterconnectAttachmentsClient interconnectAttachmentsClient = await InterconnectAttachmentsClient.CreateAsync(); // Initialize request argument(s) string project = ""; // Make the request InterconnectAttachmentAggregatedList response = await interconnectAttachmentsClient.AggregatedListAsync(project); // End snippet }
/// <summary>Snippet for InsertAsync</summary> public async Task InsertAsync() { // Snippet: InsertAsync(string, string, InterconnectAttachment, CallSettings) // Additional: InsertAsync(string, string, InterconnectAttachment, CancellationToken) // Create client InterconnectAttachmentsClient interconnectAttachmentsClient = await InterconnectAttachmentsClient.CreateAsync(); // Initialize request argument(s) string project = ""; string region = ""; InterconnectAttachment interconnectAttachmentResource = new InterconnectAttachment(); // Make the request Operation response = await interconnectAttachmentsClient.InsertAsync(project, region, interconnectAttachmentResource); // End snippet }
/// <summary>Snippet for ListAsync</summary> public async Task ListAsync() { // Snippet: ListAsync(string, string, string, int?, CallSettings) // Create client InterconnectAttachmentsClient interconnectAttachmentsClient = await InterconnectAttachmentsClient.CreateAsync(); // Initialize request argument(s) string project = ""; string region = ""; // Make the request PagedAsyncEnumerable <InterconnectAttachmentList, InterconnectAttachment> response = interconnectAttachmentsClient.ListAsync(project, region); // Iterate over all response items, lazily performing RPCs as required await response.ForEachAsync((InterconnectAttachment 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((InterconnectAttachmentList page) => { // Do something with each page of items Console.WriteLine("A page of results:"); foreach (InterconnectAttachment 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 <InterconnectAttachment> 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 (InterconnectAttachment 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(GetInterconnectAttachmentRequest, CallSettings) // Additional: GetAsync(GetInterconnectAttachmentRequest, CancellationToken) // Create client InterconnectAttachmentsClient interconnectAttachmentsClient = await InterconnectAttachmentsClient.CreateAsync(); // Initialize request argument(s) GetInterconnectAttachmentRequest request = new GetInterconnectAttachmentRequest { Region = "", Project = "", InterconnectAttachment = "", }; // Make the request InterconnectAttachment response = await interconnectAttachmentsClient.GetAsync(request); // End snippet }
/// <summary>Snippet for PatchAsync</summary> public async Task PatchRequestObjectAsync() { // Snippet: PatchAsync(PatchInterconnectAttachmentRequest, CallSettings) // Additional: PatchAsync(PatchInterconnectAttachmentRequest, CancellationToken) // Create client InterconnectAttachmentsClient interconnectAttachmentsClient = await InterconnectAttachmentsClient.CreateAsync(); // Initialize request argument(s) PatchInterconnectAttachmentRequest request = new PatchInterconnectAttachmentRequest { RequestId = "", Region = "", InterconnectAttachmentResource = new InterconnectAttachment(), Project = "", InterconnectAttachment = "", }; // Make the request Operation response = await interconnectAttachmentsClient.PatchAsync(request); // End snippet }
/// <summary>Snippet for InsertAsync</summary> public async Task InsertRequestObjectAsync() { // Snippet: InsertAsync(InsertInterconnectAttachmentRequest, CallSettings) // Additional: InsertAsync(InsertInterconnectAttachmentRequest, CancellationToken) // Create client InterconnectAttachmentsClient interconnectAttachmentsClient = await InterconnectAttachmentsClient.CreateAsync(); // Initialize request argument(s) InsertInterconnectAttachmentRequest request = new InsertInterconnectAttachmentRequest { RequestId = "", Region = "", InterconnectAttachmentResource = new InterconnectAttachment(), Project = "", ValidateOnly = false, }; // Make the request lro::Operation <Operation, Operation> response = await interconnectAttachmentsClient.InsertAsync(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 interconnectAttachmentsClient.PollOnceInsertAsync(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(AggregatedListInterconnectAttachmentsRequest, CallSettings) // Additional: AggregatedListAsync(AggregatedListInterconnectAttachmentsRequest, CancellationToken) // Create client InterconnectAttachmentsClient interconnectAttachmentsClient = await InterconnectAttachmentsClient.CreateAsync(); // Initialize request argument(s) AggregatedListInterconnectAttachmentsRequest request = new AggregatedListInterconnectAttachmentsRequest { PageToken = "", MaxResults = 0U, OrderBy = "", Project = "", Filter = "", IncludeAllScopes = false, ReturnPartialSuccess = false, }; // Make the request InterconnectAttachmentAggregatedList response = await interconnectAttachmentsClient.AggregatedListAsync(request); // End snippet }