/// <summary>Snippet for GetBudget</summary> /// <remarks> /// This snippet has been automatically generated for illustrative purposes only. /// It may require modifications to work in your environment. /// </remarks> public void GetBudgetResourceNames() { // Create client BudgetServiceClient budgetServiceClient = BudgetServiceClient.Create(); // Initialize request argument(s) BudgetName name = BudgetName.FromBillingAccountBudget("[BILLING_ACCOUNT]", "[BUDGET]"); // Make the request Budget response = budgetServiceClient.GetBudget(name); }
/// <summary>Snippet for GetBudget</summary> /// <remarks> /// This snippet has been automatically generated for illustrative purposes only. /// It may require modifications to work in your environment. /// </remarks> public void GetBudget() { // Create client BudgetServiceClient budgetServiceClient = BudgetServiceClient.Create(); // Initialize request argument(s) string name = "billingAccounts/[BILLING_ACCOUNT]/budgets/[BUDGET]"; // Make the request Budget response = budgetServiceClient.GetBudget(name); }
/// <summary>Snippet for CreateBudget</summary> /// <remarks> /// This snippet has been automatically generated for illustrative purposes only. /// It may require modifications to work in your environment. /// </remarks> public void CreateBudgetResourceNames() { // Create client BudgetServiceClient budgetServiceClient = BudgetServiceClient.Create(); // Initialize request argument(s) BillingAccountName parent = BillingAccountName.FromBillingAccount("[BILLING_ACCOUNT]"); Budget budget = new Budget(); // Make the request Budget response = budgetServiceClient.CreateBudget(parent, budget); }
/// <summary>Snippet for UpdateBudget</summary> /// <remarks> /// This snippet has been automatically generated for illustrative purposes only. /// It may require modifications to work in your environment. /// </remarks> public void UpdateBudget() { // Create client BudgetServiceClient budgetServiceClient = BudgetServiceClient.Create(); // Initialize request argument(s) Budget budget = new Budget(); FieldMask updateMask = new FieldMask(); // Make the request Budget response = budgetServiceClient.UpdateBudget(budget, updateMask); }
/// <summary>Snippet for CreateBudget</summary> /// <remarks> /// This snippet has been automatically generated for illustrative purposes only. /// It may require modifications to work in your environment. /// </remarks> public void CreateBudget() { // Create client BudgetServiceClient budgetServiceClient = BudgetServiceClient.Create(); // Initialize request argument(s) string parent = "billingAccounts/[BILLING_ACCOUNT]"; Budget budget = new Budget(); // Make the request Budget response = budgetServiceClient.CreateBudget(parent, budget); }
/// <summary>Snippet for DeleteBudget</summary> public void DeleteBudgetResourceNames() { // Snippet: DeleteBudget(BudgetName, CallSettings) // Create client BudgetServiceClient budgetServiceClient = BudgetServiceClient.Create(); // Initialize request argument(s) BudgetName name = BudgetName.FromBillingAccountBudget("[BILLING_ACCOUNT]", "[BUDGET]"); // Make the request budgetServiceClient.DeleteBudget(name); // End snippet }
/// <summary>Snippet for DeleteBudget</summary> public void DeleteBudget() { // Snippet: DeleteBudget(string, CallSettings) // Create client BudgetServiceClient budgetServiceClient = BudgetServiceClient.Create(); // Initialize request argument(s) string name = "billingAccounts/[BILLING_ACCOUNT]/budgets/[BUDGET]"; // Make the request budgetServiceClient.DeleteBudget(name); // End snippet }
/// <summary>Snippet for UpdateBudget</summary> public void UpdateBudget() { // Snippet: UpdateBudget(Budget, FieldMask, CallSettings) // Create client BudgetServiceClient budgetServiceClient = BudgetServiceClient.Create(); // Initialize request argument(s) Budget budget = new Budget(); FieldMask updateMask = new FieldMask(); // Make the request Budget response = budgetServiceClient.UpdateBudget(budget, updateMask); // End snippet }
/// <summary>Snippet for GetBudget</summary> /// <remarks> /// This snippet has been automatically generated for illustrative purposes only. /// It may require modifications to work in your environment. /// </remarks> public void GetBudgetRequestObject() { // Create client BudgetServiceClient budgetServiceClient = BudgetServiceClient.Create(); // Initialize request argument(s) GetBudgetRequest request = new GetBudgetRequest { BudgetName = BudgetName.FromBillingAccountBudget("[BILLING_ACCOUNT]", "[BUDGET]"), }; // Make the request Budget response = budgetServiceClient.GetBudget(request); }
/// <summary>Snippet for UpdateBudget</summary> /// <remarks> /// This snippet has been automatically generated for illustrative purposes only. /// It may require modifications to work in your environment. /// </remarks> public void UpdateBudgetRequestObject() { // Create client BudgetServiceClient budgetServiceClient = BudgetServiceClient.Create(); // Initialize request argument(s) UpdateBudgetRequest request = new UpdateBudgetRequest { Budget = new Budget(), UpdateMask = new FieldMask(), }; // Make the request Budget response = budgetServiceClient.UpdateBudget(request); }
/// <summary>Snippet for CreateBudget</summary> /// <remarks> /// This snippet has been automatically generated for illustrative purposes only. /// It may require modifications to work in your environment. /// </remarks> public void CreateBudgetRequestObject() { // Create client BudgetServiceClient budgetServiceClient = BudgetServiceClient.Create(); // Initialize request argument(s) CreateBudgetRequest request = new CreateBudgetRequest { ParentAsBillingAccountName = BillingAccountName.FromBillingAccount("[BILLING_ACCOUNT]"), Budget = new Budget(), }; // Make the request Budget response = budgetServiceClient.CreateBudget(request); }
/// <summary>Snippet for DeleteBudget</summary> public void DeleteBudgetRequestObject() { // Snippet: DeleteBudget(DeleteBudgetRequest, CallSettings) // Create client BudgetServiceClient budgetServiceClient = BudgetServiceClient.Create(); // Initialize request argument(s) DeleteBudgetRequest request = new DeleteBudgetRequest { BudgetName = BudgetName.FromBillingAccountBudget("[BILLING_ACCOUNT]", "[BUDGET]"), }; // Make the request budgetServiceClient.DeleteBudget(request); // End snippet }
/// <summary>Snippet for ListBudgets</summary> public void ListBudgetsRequestObject() { // Snippet: ListBudgets(ListBudgetsRequest, CallSettings) // Create client BudgetServiceClient budgetServiceClient = BudgetServiceClient.Create(); // Initialize request argument(s) ListBudgetsRequest request = new ListBudgetsRequest { ParentAsBillingAccountName = BillingAccountName.FromBillingAccount("[BILLING_ACCOUNT]"), }; // Make the request PagedEnumerable <ListBudgetsResponse, Budget> response = budgetServiceClient.ListBudgets(request); // Iterate over all response items, lazily performing RPCs as required foreach (Budget 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 (ListBudgetsResponse page in response.AsRawResponses()) { // Do something with each page of items Console.WriteLine("A page of results:"); foreach (Budget 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 <Budget> 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 (Budget 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 }