/// <summary>Snippet for GetProjectBillingInfo</summary>
 /// <remarks>
 /// This snippet has been automatically generated for illustrative purposes only.
 /// It may require modifications to work in your environment.
 /// </remarks>
 public void GetProjectBillingInfo()
 {
     // Create client
     CloudBillingClient cloudBillingClient = CloudBillingClient.Create();
     // Initialize request argument(s)
     string name = "";
     // Make the request
     ProjectBillingInfo response = cloudBillingClient.GetProjectBillingInfo(name);
 }
 /// <summary>Snippet for UpdateProjectBillingInfo</summary>
 /// <remarks>
 /// This snippet has been automatically generated for illustrative purposes only.
 /// It may require modifications to work in your environment.
 /// </remarks>
 public void UpdateProjectBillingInfo()
 {
     // Create client
     CloudBillingClient cloudBillingClient = CloudBillingClient.Create();
     // Initialize request argument(s)
     string             name = "";
     ProjectBillingInfo projectBillingInfo = new ProjectBillingInfo();
     // Make the request
     ProjectBillingInfo response = cloudBillingClient.UpdateProjectBillingInfo(name, projectBillingInfo);
 }
示例#3
0
        /// <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 GetProjectBillingInfo</summary>
 /// <remarks>
 /// This snippet has been automatically generated for illustrative purposes only.
 /// It may require modifications to work in your environment.
 /// </remarks>
 public void GetProjectBillingInfoRequestObject()
 {
     // Create client
     CloudBillingClient cloudBillingClient = CloudBillingClient.Create();
     // Initialize request argument(s)
     GetProjectBillingInfoRequest request = new GetProjectBillingInfoRequest {
         Name = "",
     };
     // Make the request
     ProjectBillingInfo response = cloudBillingClient.GetProjectBillingInfo(request);
 }
示例#5
0
        /// <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);
        }
示例#7
0
        /// <summary>
        /// Sets or updates the billing account associated with a project. You specifythe new billing account by setting the `billing_account_name` in the`ProjectBillingInfo` resource to the resource name of a billing account.Associating a project with an open billing account enables billing on theproject and allows charges for resource usage. If the project already had abilling account, this method changes the billing account used for resourceusage charges.*Note:* Incurred charges that have not yet been reported in the transactionhistory of the Google Cloud Console may be billed to the new billingaccount, even if the charge occurred before the new billing account wasassigned to the project.The current authenticated user must have ownership privileges for both the[project](https://cloud.google.com/docs/permissions-overview#h.bgs0oxofvnoo) and the [billingaccount](https://support.google.com/cloud/answer/4430947).You can disable billing on the project by setting the`billing_account_name` field to empty. This action disassociates thecurrent billing account from the project. Any billable activity of yourin-use services will stop, and your application could stop functioning asexpected. Any unbilled charges to date will be billed to the previouslyassociated account. The current authenticated user must be either an ownerof the project or an owner of the billing account for the project.Note that associating a project with a *closed* billing account will havemuch the same effect as disabling billing on the project: any paidresources used by the project will be shut down. Thus, unless you wish todisable billing, you should always call this method with the name of an*open* billing account.
        /// Documentation https://developers.google.com/cloudbilling/v1/reference/projects/updateBillingInfo
        /// Generation Note: This does not always build corectly.  Google needs to standardise things I need to figuer out which ones are wrong.
        /// </summary>
        /// <param name="service">Authenticated Cloudbilling service.</param>
        /// <param name="name">The resource name of the project associated with the billing informationthat you want to update. For example, `projects/tokyo-rain-123`.</param>
        /// <param name="body">A valid Cloudbilling v1 body.</param>
        /// <returns>ProjectBillingInfoResponse</returns>
        public static ProjectBillingInfo UpdateBillingInfo(CloudbillingService service, string name, ProjectBillingInfo body)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }
                if (body == null)
                {
                    throw new ArgumentNullException("body");
                }
                if (name == null)
                {
                    throw new ArgumentNullException(name);
                }

                // Make the request.
                return(service.Projects.UpdateBillingInfo(body, name).Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request Projects.UpdateBillingInfo failed.", ex);
            }
        }