/// <summary>Snippet for Insert</summary> public void InsertRequestObject() { // Snippet: Insert(InsertInstanceTemplateRequest, CallSettings) // Create client InstanceTemplatesClient instanceTemplatesClient = InstanceTemplatesClient.Create(); // Initialize request argument(s) InsertInstanceTemplateRequest request = new InsertInstanceTemplateRequest { InstanceTemplateResource = new InstanceTemplate(), RequestId = "", Project = "", }; // Make the request lro::Operation <Operation, Operation> response = instanceTemplatesClient.Insert(request); // Poll until the returned long-running operation is complete lro::Operation <Operation, Operation> completedResponse = response.PollUntilCompleted(); // 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 = instanceTemplatesClient.PollOnceInsert(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 InsertAsync</summary> public async Task InsertAsync() { // Snippet: InsertAsync(string, InstanceTemplate, CallSettings) // Additional: InsertAsync(string, InstanceTemplate, CancellationToken) // Create client InstanceTemplatesClient instanceTemplatesClient = await InstanceTemplatesClient.CreateAsync(); // Initialize request argument(s) string project = ""; InstanceTemplate instanceTemplateResource = new InstanceTemplate(); // Make the request lro::Operation <Operation, Operation> response = await instanceTemplatesClient.InsertAsync(project, instanceTemplateResource); // 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 instanceTemplatesClient.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 Delete</summary> public void Delete() { // Snippet: Delete(string, string, CallSettings) // Create client InstanceTemplatesClient instanceTemplatesClient = InstanceTemplatesClient.Create(); // Initialize request argument(s) string project = ""; string instanceTemplate = ""; // Make the request lro::Operation <Operation, Operation> response = instanceTemplatesClient.Delete(project, instanceTemplate); // Poll until the returned long-running operation is complete lro::Operation <Operation, Operation> completedResponse = response.PollUntilCompleted(); // 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 = instanceTemplatesClient.PollOnceDelete(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 List</summary> public void List() { // Snippet: List(string, CallSettings) // Create client InstanceTemplatesClient instanceTemplatesClient = InstanceTemplatesClient.Create(); // Initialize request argument(s) string project = ""; // Make the request InstanceTemplateList response = instanceTemplatesClient.List(project); // End snippet }
/// <summary>Snippet for GetIamPolicy</summary> public void GetIamPolicy() { // Snippet: GetIamPolicy(string, string, CallSettings) // Create client InstanceTemplatesClient instanceTemplatesClient = InstanceTemplatesClient.Create(); // Initialize request argument(s) string project = ""; string resource = ""; // Make the request Policy response = instanceTemplatesClient.GetIamPolicy(project, resource); // End snippet }
/// <summary>Snippet for Delete</summary> public void Delete() { // Snippet: Delete(string, string, CallSettings) // Create client InstanceTemplatesClient instanceTemplatesClient = InstanceTemplatesClient.Create(); // Initialize request argument(s) string project = ""; string instanceTemplate = ""; // Make the request Operation response = instanceTemplatesClient.Delete(project, instanceTemplate); // End snippet }
/// <summary>Snippet for Insert</summary> public void Insert() { // Snippet: Insert(string, InstanceTemplate, CallSettings) // Create client InstanceTemplatesClient instanceTemplatesClient = InstanceTemplatesClient.Create(); // Initialize request argument(s) string project = ""; InstanceTemplate instanceTemplateResource = new InstanceTemplate(); // Make the request Operation response = instanceTemplatesClient.Insert(project, instanceTemplateResource); // End snippet }
/// <summary>Snippet for SetIamPolicy</summary> public void SetIamPolicy() { // Snippet: SetIamPolicy(string, string, GlobalSetPolicyRequest, CallSettings) // Create client InstanceTemplatesClient instanceTemplatesClient = InstanceTemplatesClient.Create(); // Initialize request argument(s) string project = ""; string resource = ""; GlobalSetPolicyRequest globalSetPolicyRequestResource = new GlobalSetPolicyRequest(); // Make the request Policy response = instanceTemplatesClient.SetIamPolicy(project, resource, globalSetPolicyRequestResource); // End snippet }
/// <summary>Snippet for TestIamPermissions</summary> public void TestIamPermissions() { // Snippet: TestIamPermissions(string, string, TestPermissionsRequest, CallSettings) // Create client InstanceTemplatesClient instanceTemplatesClient = InstanceTemplatesClient.Create(); // Initialize request argument(s) string project = ""; string resource = ""; TestPermissionsRequest testPermissionsRequestResource = new TestPermissionsRequest(); // Make the request TestPermissionsResponse response = instanceTemplatesClient.TestIamPermissions(project, resource, testPermissionsRequestResource); // End snippet }
/// <summary>Snippet for ListAsync</summary> public async Task ListRequestObjectAsync() { // Snippet: ListAsync(ListInstanceTemplatesRequest, CallSettings) // Create client InstanceTemplatesClient instanceTemplatesClient = await InstanceTemplatesClient.CreateAsync(); // Initialize request argument(s) ListInstanceTemplatesRequest request = new ListInstanceTemplatesRequest { OrderBy = "", Project = "", Filter = "", ReturnPartialSuccess = false, }; // Make the request PagedAsyncEnumerable <InstanceTemplateList, InstanceTemplate> response = instanceTemplatesClient.ListAsync(request); // Iterate over all response items, lazily performing RPCs as required await response.ForEachAsync((InstanceTemplate 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((InstanceTemplateList page) => { // Do something with each page of items Console.WriteLine("A page of results:"); foreach (InstanceTemplate 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 <InstanceTemplate> 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 (InstanceTemplate 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 ListAsync</summary> public async Task ListAsync() { // Snippet: ListAsync(string, CallSettings) // Additional: ListAsync(string, CancellationToken) // Create client InstanceTemplatesClient instanceTemplatesClient = await InstanceTemplatesClient.CreateAsync(); // Initialize request argument(s) string project = ""; // Make the request InstanceTemplateList response = await instanceTemplatesClient.ListAsync(project); // End snippet }
/// <summary>Snippet for GetIamPolicyAsync</summary> public async Task GetIamPolicyAsync() { // Snippet: GetIamPolicyAsync(string, string, CallSettings) // Additional: GetIamPolicyAsync(string, string, CancellationToken) // Create client InstanceTemplatesClient instanceTemplatesClient = await InstanceTemplatesClient.CreateAsync(); // Initialize request argument(s) string project = ""; string resource = ""; // Make the request Policy response = await instanceTemplatesClient.GetIamPolicyAsync(project, resource); // End snippet }
/// <summary>Snippet for Get</summary> public void GetRequestObject() { // Snippet: Get(GetInstanceTemplateRequest, CallSettings) // Create client InstanceTemplatesClient instanceTemplatesClient = InstanceTemplatesClient.Create(); // Initialize request argument(s) GetInstanceTemplateRequest request = new GetInstanceTemplateRequest { Project = "", InstanceTemplate = "", }; // Make the request InstanceTemplate response = instanceTemplatesClient.Get(request); // End snippet }
/// <summary>Snippet for DeleteAsync</summary> public async Task DeleteAsync() { // Snippet: DeleteAsync(string, string, CallSettings) // Additional: DeleteAsync(string, string, CancellationToken) // Create client InstanceTemplatesClient instanceTemplatesClient = await InstanceTemplatesClient.CreateAsync(); // Initialize request argument(s) string project = ""; string instanceTemplate = ""; // Make the request Operation response = await instanceTemplatesClient.DeleteAsync(project, instanceTemplate); // End snippet }
/// <summary>Snippet for InsertAsync</summary> public async Task InsertAsync() { // Snippet: InsertAsync(string, InstanceTemplate, CallSettings) // Additional: InsertAsync(string, InstanceTemplate, CancellationToken) // Create client InstanceTemplatesClient instanceTemplatesClient = await InstanceTemplatesClient.CreateAsync(); // Initialize request argument(s) string project = ""; InstanceTemplate instanceTemplateResource = new InstanceTemplate(); // Make the request Operation response = await instanceTemplatesClient.InsertAsync(project, instanceTemplateResource); // End snippet }
/// <summary>Snippet for TestIamPermissionsAsync</summary> public async Task TestIamPermissionsAsync() { // Snippet: TestIamPermissionsAsync(string, string, TestPermissionsRequest, CallSettings) // Additional: TestIamPermissionsAsync(string, string, TestPermissionsRequest, CancellationToken) // Create client InstanceTemplatesClient instanceTemplatesClient = await InstanceTemplatesClient.CreateAsync(); // Initialize request argument(s) string project = ""; string resource = ""; TestPermissionsRequest testPermissionsRequestResource = new TestPermissionsRequest(); // Make the request TestPermissionsResponse response = await instanceTemplatesClient.TestIamPermissionsAsync(project, resource, testPermissionsRequestResource); // End snippet }
/// <summary>Snippet for TestIamPermissions</summary> public void TestIamPermissionsRequestObject() { // Snippet: TestIamPermissions(TestIamPermissionsInstanceTemplateRequest, CallSettings) // Create client InstanceTemplatesClient instanceTemplatesClient = InstanceTemplatesClient.Create(); // Initialize request argument(s) TestIamPermissionsInstanceTemplateRequest request = new TestIamPermissionsInstanceTemplateRequest { Resource = "", Project = "", TestPermissionsRequestResource = new TestPermissionsRequest(), }; // Make the request TestPermissionsResponse response = instanceTemplatesClient.TestIamPermissions(request); // End snippet }
/// <summary>Snippet for SetIamPolicy</summary> public void SetIamPolicyRequestObject() { // Snippet: SetIamPolicy(SetIamPolicyInstanceTemplateRequest, CallSettings) // Create client InstanceTemplatesClient instanceTemplatesClient = InstanceTemplatesClient.Create(); // Initialize request argument(s) SetIamPolicyInstanceTemplateRequest request = new SetIamPolicyInstanceTemplateRequest { Resource = "", Project = "", GlobalSetPolicyRequestResource = new GlobalSetPolicyRequest(), }; // Make the request Policy response = instanceTemplatesClient.SetIamPolicy(request); // End snippet }
/// <summary>Snippet for Insert</summary> public void InsertRequestObject() { // Snippet: Insert(InsertInstanceTemplateRequest, CallSettings) // Create client InstanceTemplatesClient instanceTemplatesClient = InstanceTemplatesClient.Create(); // Initialize request argument(s) InsertInstanceTemplateRequest request = new InsertInstanceTemplateRequest { InstanceTemplateResource = new InstanceTemplate(), RequestId = "", Project = "", }; // Make the request Operation response = instanceTemplatesClient.Insert(request); // End snippet }
/// <summary>Snippet for Delete</summary> public void DeleteRequestObject() { // Snippet: Delete(DeleteInstanceTemplateRequest, CallSettings) // Create client InstanceTemplatesClient instanceTemplatesClient = InstanceTemplatesClient.Create(); // Initialize request argument(s) DeleteInstanceTemplateRequest request = new DeleteInstanceTemplateRequest { RequestId = "", Project = "", InstanceTemplate = "", }; // Make the request Operation response = instanceTemplatesClient.Delete(request); // End snippet }
/// <summary>Snippet for GetIamPolicy</summary> public void GetIamPolicyRequestObject() { // Snippet: GetIamPolicy(GetIamPolicyInstanceTemplateRequest, CallSettings) // Create client InstanceTemplatesClient instanceTemplatesClient = InstanceTemplatesClient.Create(); // Initialize request argument(s) GetIamPolicyInstanceTemplateRequest request = new GetIamPolicyInstanceTemplateRequest { Resource = "", Project = "", OptionsRequestedPolicyVersion = 0, }; // Make the request Policy response = instanceTemplatesClient.GetIamPolicy(request); // End snippet }
/// <summary>Snippet for GetAsync</summary> public async Task GetRequestObjectAsync() { // Snippet: GetAsync(GetInstanceTemplateRequest, CallSettings) // Additional: GetAsync(GetInstanceTemplateRequest, CancellationToken) // Create client InstanceTemplatesClient instanceTemplatesClient = await InstanceTemplatesClient.CreateAsync(); // Initialize request argument(s) GetInstanceTemplateRequest request = new GetInstanceTemplateRequest { Project = "", InstanceTemplate = "", }; // Make the request InstanceTemplate response = await instanceTemplatesClient.GetAsync(request); // End snippet }
/// <summary>Snippet for List</summary> public void List() { // Snippet: List(string, string, int?, CallSettings) // Create client InstanceTemplatesClient instanceTemplatesClient = InstanceTemplatesClient.Create(); // Initialize request argument(s) string project = ""; // Make the request PagedEnumerable <InstanceTemplateList, InstanceTemplate> response = instanceTemplatesClient.List(project); // Iterate over all response items, lazily performing RPCs as required foreach (InstanceTemplate item in response) { // Do something with each item Console.WriteLine(item); } // Or iterate over pages (of server-defined size), performing one RPC per page foreach (InstanceTemplateList page in response.AsRawResponses()) { // Do something with each page of items Console.WriteLine("A page of results:"); foreach (InstanceTemplate 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 <InstanceTemplate> singlePage = response.ReadPage(pageSize); // Do something with the page of items Console.WriteLine($"A page of {pageSize} results (unless it's the final page):"); foreach (InstanceTemplate 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 TestIamPermissionsAsync</summary> public async Task TestIamPermissionsRequestObjectAsync() { // Snippet: TestIamPermissionsAsync(TestIamPermissionsInstanceTemplateRequest, CallSettings) // Additional: TestIamPermissionsAsync(TestIamPermissionsInstanceTemplateRequest, CancellationToken) // Create client InstanceTemplatesClient instanceTemplatesClient = await InstanceTemplatesClient.CreateAsync(); // Initialize request argument(s) TestIamPermissionsInstanceTemplateRequest request = new TestIamPermissionsInstanceTemplateRequest { Resource = "", Project = "", TestPermissionsRequestResource = new TestPermissionsRequest(), }; // Make the request TestPermissionsResponse response = await instanceTemplatesClient.TestIamPermissionsAsync(request); // End snippet }
/// <summary>Snippet for DeleteAsync</summary> public async Task DeleteRequestObjectAsync() { // Snippet: DeleteAsync(DeleteInstanceTemplateRequest, CallSettings) // Additional: DeleteAsync(DeleteInstanceTemplateRequest, CancellationToken) // Create client InstanceTemplatesClient instanceTemplatesClient = await InstanceTemplatesClient.CreateAsync(); // Initialize request argument(s) DeleteInstanceTemplateRequest request = new DeleteInstanceTemplateRequest { RequestId = "", Project = "", InstanceTemplate = "", }; // Make the request Operation response = await instanceTemplatesClient.DeleteAsync(request); // End snippet }
/// <summary>Snippet for SetIamPolicyAsync</summary> public async Task SetIamPolicyRequestObjectAsync() { // Snippet: SetIamPolicyAsync(SetIamPolicyInstanceTemplateRequest, CallSettings) // Additional: SetIamPolicyAsync(SetIamPolicyInstanceTemplateRequest, CancellationToken) // Create client InstanceTemplatesClient instanceTemplatesClient = await InstanceTemplatesClient.CreateAsync(); // Initialize request argument(s) SetIamPolicyInstanceTemplateRequest request = new SetIamPolicyInstanceTemplateRequest { Resource = "", Project = "", GlobalSetPolicyRequestResource = new GlobalSetPolicyRequest(), }; // Make the request Policy response = await instanceTemplatesClient.SetIamPolicyAsync(request); // End snippet }
/// <summary>Snippet for GetIamPolicyAsync</summary> public async Task GetIamPolicyRequestObjectAsync() { // Snippet: GetIamPolicyAsync(GetIamPolicyInstanceTemplateRequest, CallSettings) // Additional: GetIamPolicyAsync(GetIamPolicyInstanceTemplateRequest, CancellationToken) // Create client InstanceTemplatesClient instanceTemplatesClient = await InstanceTemplatesClient.CreateAsync(); // Initialize request argument(s) GetIamPolicyInstanceTemplateRequest request = new GetIamPolicyInstanceTemplateRequest { Resource = "", Project = "", OptionsRequestedPolicyVersion = 0, }; // Make the request Policy response = await instanceTemplatesClient.GetIamPolicyAsync(request); // End snippet }
/// <summary>Snippet for List</summary> public void ListRequestObject() { // Snippet: List(ListInstanceTemplatesRequest, CallSettings) // Create client InstanceTemplatesClient instanceTemplatesClient = InstanceTemplatesClient.Create(); // Initialize request argument(s) ListInstanceTemplatesRequest request = new ListInstanceTemplatesRequest { PageToken = "", MaxResults = 0U, OrderBy = "", Project = "", Filter = "", ReturnPartialSuccess = false, }; // Make the request InstanceTemplateList response = instanceTemplatesClient.List(request); // End snippet }
/// <summary>Snippet for InsertAsync</summary> public async Task InsertRequestObjectAsync() { // Snippet: InsertAsync(InsertInstanceTemplateRequest, CallSettings) // Additional: InsertAsync(InsertInstanceTemplateRequest, CancellationToken) // Create client InstanceTemplatesClient instanceTemplatesClient = await InstanceTemplatesClient.CreateAsync(); // Initialize request argument(s) InsertInstanceTemplateRequest request = new InsertInstanceTemplateRequest { InstanceTemplateResource = new InstanceTemplate(), RequestId = "", Project = "", }; // Make the request Operation response = await instanceTemplatesClient.InsertAsync(request); // End snippet }
/// <summary>Snippet for ListAsync</summary> public async Task ListRequestObjectAsync() { // Snippet: ListAsync(ListInstanceTemplatesRequest, CallSettings) // Additional: ListAsync(ListInstanceTemplatesRequest, CancellationToken) // Create client InstanceTemplatesClient instanceTemplatesClient = await InstanceTemplatesClient.CreateAsync(); // Initialize request argument(s) ListInstanceTemplatesRequest request = new ListInstanceTemplatesRequest { PageToken = "", MaxResults = 0U, OrderBy = "", Project = "", Filter = "", ReturnPartialSuccess = false, }; // Make the request InstanceTemplateList response = await instanceTemplatesClient.ListAsync(request); // End snippet }