/// <summary>Snippet for GetIamPolicyAsync</summary> /// <remarks> /// This snippet has been automatically generated for illustrative purposes only. /// It may require modifications to work in your environment. /// </remarks> public async Task GetIamPolicyResourceNamesAsync() { // Create client CloudBillingClient cloudBillingClient = await CloudBillingClient.CreateAsync(); // Initialize request argument(s) IResourceName resource = new UnparsedResourceName("a/wildcard/resource"); // Make the request Policy response = await cloudBillingClient.GetIamPolicyAsync(resource); }
/// <summary>Snippet for CreateBillingAccountAsync</summary> /// <remarks> /// This snippet has been automatically generated for illustrative purposes only. /// It may require modifications to work in your environment. /// </remarks> public async Task CreateBillingAccountAsync() { // Create client CloudBillingClient cloudBillingClient = await CloudBillingClient.CreateAsync(); // Initialize request argument(s) BillingAccount billingAccount = new BillingAccount(); // Make the request BillingAccount response = await cloudBillingClient.CreateBillingAccountAsync(billingAccount); }
/// <summary>Snippet for GetBillingAccountAsync</summary> /// <remarks> /// This snippet has been automatically generated for illustrative purposes only. /// It may require modifications to work in your environment. /// </remarks> public async Task GetBillingAccountAsync() { // Create client CloudBillingClient cloudBillingClient = await CloudBillingClient.CreateAsync(); // Initialize request argument(s) string name = "billingAccounts/[BILLING_ACCOUNT]"; // Make the request BillingAccount response = await cloudBillingClient.GetBillingAccountAsync(name); }
/// <summary>Snippet for GetBillingAccountAsync</summary> /// <remarks> /// This snippet has been automatically generated for illustrative purposes only. /// It may require modifications to work in your environment. /// </remarks> public async Task GetBillingAccountResourceNamesAsync() { // Create client CloudBillingClient cloudBillingClient = await CloudBillingClient.CreateAsync(); // Initialize request argument(s) BillingAccountName name = BillingAccountName.FromBillingAccount("[BILLING_ACCOUNT]"); // Make the request BillingAccount response = await cloudBillingClient.GetBillingAccountAsync(name); }
/// <summary>Snippet for GetProjectBillingInfoAsync</summary> /// <remarks> /// This snippet has been automatically generated for illustrative purposes only. /// It may require modifications to work in your environment. /// </remarks> public async Task GetProjectBillingInfoAsync() { // Create client CloudBillingClient cloudBillingClient = await CloudBillingClient.CreateAsync(); // Initialize request argument(s) string name = ""; // Make the request ProjectBillingInfo response = await cloudBillingClient.GetProjectBillingInfoAsync(name); }
/// <summary>Snippet for GetIamPolicyAsync</summary> /// <remarks> /// This snippet has been automatically generated for illustrative purposes only. /// It may require modifications to work in your environment. /// </remarks> public async Task GetIamPolicyAsync() { // Create client CloudBillingClient cloudBillingClient = await CloudBillingClient.CreateAsync(); // Initialize request argument(s) string resource = "a/wildcard/resource"; // Make the request Policy response = await cloudBillingClient.GetIamPolicyAsync(resource); }
/// <summary>Snippet for TestIamPermissionsAsync</summary> /// <remarks> /// This snippet has been automatically generated for illustrative purposes only. /// It may require modifications to work in your environment. /// </remarks> public async Task TestIamPermissionsAsync() { // Create client CloudBillingClient cloudBillingClient = await CloudBillingClient.CreateAsync(); // Initialize request argument(s) string resource = "a/wildcard/resource"; IEnumerable <string> permissions = new string[] { "", }; // Make the request TestIamPermissionsResponse response = await cloudBillingClient.TestIamPermissionsAsync(resource, permissions); }
/// <summary>Snippet for UpdateProjectBillingInfoAsync</summary> /// <remarks> /// This snippet has been automatically generated for illustrative purposes only. /// It may require modifications to work in your environment. /// </remarks> public async Task UpdateProjectBillingInfoAsync() { // Create client CloudBillingClient cloudBillingClient = await CloudBillingClient.CreateAsync(); // Initialize request argument(s) string name = ""; ProjectBillingInfo projectBillingInfo = new ProjectBillingInfo(); // Make the request ProjectBillingInfo response = await cloudBillingClient.UpdateProjectBillingInfoAsync(name, projectBillingInfo); }
/// <summary>Snippet for GetProjectBillingInfoAsync</summary> /// <remarks> /// This snippet has been automatically generated for illustrative purposes only. /// It may require modifications to work in your environment. /// </remarks> public async Task GetProjectBillingInfoRequestObjectAsync() { // Create client CloudBillingClient cloudBillingClient = await CloudBillingClient.CreateAsync(); // Initialize request argument(s) GetProjectBillingInfoRequest request = new GetProjectBillingInfoRequest { Name = "", }; // Make the request ProjectBillingInfo response = await cloudBillingClient.GetProjectBillingInfoAsync(request); }
/// <summary>Snippet for GetBillingAccountAsync</summary> /// <remarks> /// This snippet has been automatically generated for illustrative purposes only. /// It may require modifications to work in your environment. /// </remarks> public async Task GetBillingAccountRequestObjectAsync() { // Create client CloudBillingClient cloudBillingClient = await CloudBillingClient.CreateAsync(); // Initialize request argument(s) GetBillingAccountRequest request = new GetBillingAccountRequest { BillingAccountName = BillingAccountName.FromBillingAccount("[BILLING_ACCOUNT]"), }; // Make the request BillingAccount response = await cloudBillingClient.GetBillingAccountAsync(request); }
/// <summary>Snippet for CreateBillingAccountAsync</summary> /// <remarks> /// This snippet has been automatically generated for illustrative purposes only. /// It may require modifications to work in your environment. /// </remarks> public async Task CreateBillingAccountRequestObjectAsync() { // Create client CloudBillingClient cloudBillingClient = await CloudBillingClient.CreateAsync(); // Initialize request argument(s) CreateBillingAccountRequest request = new CreateBillingAccountRequest { BillingAccount = new BillingAccount(), }; // Make the request BillingAccount response = await cloudBillingClient.CreateBillingAccountAsync(request); }
/// <summary>Snippet for SetIamPolicyAsync</summary> /// <remarks> /// This snippet has been automatically generated for illustrative purposes only. /// It may require modifications to work in your environment. /// </remarks> public async Task SetIamPolicyRequestObjectAsync() { // Create client CloudBillingClient cloudBillingClient = await CloudBillingClient.CreateAsync(); // Initialize request argument(s) SetIamPolicyRequest request = new SetIamPolicyRequest { ResourceAsResourceName = new UnparsedResourceName("a/wildcard/resource"), Policy = new Policy(), }; // Make the request Policy response = await cloudBillingClient.SetIamPolicyAsync(request); }
/// <summary>Snippet for TestIamPermissionsAsync</summary> /// <remarks> /// This snippet has been automatically generated for illustrative purposes only. /// It may require modifications to work in your environment. /// </remarks> public async Task TestIamPermissionsRequestObjectAsync() { // Create client CloudBillingClient cloudBillingClient = await CloudBillingClient.CreateAsync(); // Initialize request argument(s) TestIamPermissionsRequest request = new TestIamPermissionsRequest { ResourceAsResourceName = new UnparsedResourceName("a/wildcard/resource"), Permissions = { "", }, }; // Make the request TestIamPermissionsResponse response = await cloudBillingClient.TestIamPermissionsAsync(request); }
/// <summary>Snippet for ListProjectBillingInfoAsync</summary> /// <remarks> /// This snippet has been automatically generated for illustrative purposes only. /// It may require modifications to work in your environment. /// </remarks> public async Task ListProjectBillingInfoRequestObjectAsync() { // Create client CloudBillingClient cloudBillingClient = await CloudBillingClient.CreateAsync(); // Initialize request argument(s) ListProjectBillingInfoRequest request = new ListProjectBillingInfoRequest { BillingAccountName = BillingAccountName.FromBillingAccount("[BILLING_ACCOUNT]"), }; // Make the request PagedAsyncEnumerable <ListProjectBillingInfoResponse, ProjectBillingInfo> response = cloudBillingClient.ListProjectBillingInfoAsync(request); // Iterate over all response items, lazily performing RPCs as required await response.ForEachAsync((ProjectBillingInfo 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((ListProjectBillingInfoResponse page) => { // Do something with each page of items Console.WriteLine("A page of results:"); foreach (ProjectBillingInfo 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 <ProjectBillingInfo> 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 (ProjectBillingInfo 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; }
/// <summary>Snippet for ListBillingAccountsAsync</summary> /// <remarks> /// This snippet has been automatically generated for illustrative purposes only. /// It may require modifications to work in your environment. /// </remarks> public async Task ListBillingAccountsAsync() { // Create client CloudBillingClient cloudBillingClient = await CloudBillingClient.CreateAsync(); // Make the request PagedAsyncEnumerable <ListBillingAccountsResponse, BillingAccount> response = cloudBillingClient.ListBillingAccountsAsync(); // Iterate over all response items, lazily performing RPCs as required await response.ForEachAsync((BillingAccount 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((ListBillingAccountsResponse page) => { // Do something with each page of items Console.WriteLine("A page of results:"); foreach (BillingAccount 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 <BillingAccount> 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 (BillingAccount 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; }