Class: Google::Apis::BillingbudgetsV1beta1::CloudBillingBudgetService

Inherits:
Core::BaseService
  • Object
show all
Defined in:
generated/google/apis/billingbudgets_v1beta1/service.rb

Overview

Cloud Billing Budget API

The Cloud Billing Budget API stores Cloud Billing budgets, which define a budget plan and the rules to execute as spend is tracked against that plan.

Examples:

require 'google/apis/billingbudgets_v1beta1'

Billingbudgets = Google::Apis::BillingbudgetsV1beta1 # Alias the module
service = Billingbudgets::CloudBillingBudgetService.new

See Also:

Instance Attribute Summary collapse

Attributes inherited from Core::BaseService

#authorization, #base_path, #batch_path, #client, #client_options, #request_options, #root_url, #upload_path

Instance Method Summary collapse

Methods inherited from Core::BaseService

#batch, #batch_upload, #fetch_all, #http

Methods included from Core::Logging

#logger

Constructor Details

#initializeCloudBillingBudgetService


46
47
48
49
# File 'generated/google/apis/billingbudgets_v1beta1/service.rb', line 46

def initialize
  super('https://billingbudgets.googleapis.com/', '')
  @batch_path = 'batch'
end

Instance Attribute Details

#keyString


39
40
41
# File 'generated/google/apis/billingbudgets_v1beta1/service.rb', line 39

def key
  @key
end

#quota_userString


44
45
46
# File 'generated/google/apis/billingbudgets_v1beta1/service.rb', line 44

def quota_user
  @quota_user
end

Instance Method Details

#create_billing_account_budget(parent, google_cloud_billing_budgets_v1beta1_create_budget_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::BillingbudgetsV1beta1::GoogleCloudBillingBudgetsV1beta1Budget

Creates a new budget. See Quotas and limits for more information on the limits of the number of budgets you can create.

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Raises:


75
76
77
78
79
80
81
82
83
84
85
# File 'generated/google/apis/billingbudgets_v1beta1/service.rb', line 75

def (parent, google_cloud_billing_budgets_v1beta1_create_budget_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v1beta1/{+parent}/budgets', options)
  command.request_representation = Google::Apis::BillingbudgetsV1beta1::GoogleCloudBillingBudgetsV1beta1CreateBudgetRequest::Representation
  command.request_object = google_cloud_billing_budgets_v1beta1_create_budget_request_object
  command.response_representation = Google::Apis::BillingbudgetsV1beta1::GoogleCloudBillingBudgetsV1beta1Budget::Representation
  command.response_class = Google::Apis::BillingbudgetsV1beta1::GoogleCloudBillingBudgetsV1beta1Budget
  command.params['parent'] = parent unless parent.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#delete_billing_account_budget(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::BillingbudgetsV1beta1::GoogleProtobufEmpty

Deletes a budget. Returns successfully if already deleted.

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Raises:


108
109
110
111
112
113
114
115
116
# File 'generated/google/apis/billingbudgets_v1beta1/service.rb', line 108

def (name, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:delete, 'v1beta1/{+name}', options)
  command.response_representation = Google::Apis::BillingbudgetsV1beta1::GoogleProtobufEmpty::Representation
  command.response_class = Google::Apis::BillingbudgetsV1beta1::GoogleProtobufEmpty
  command.params['name'] = name unless name.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#get_billing_account_budget(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::BillingbudgetsV1beta1::GoogleCloudBillingBudgetsV1beta1Budget

Returns a budget.

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Raises:


139
140
141
142
143
144
145
146
147
# File 'generated/google/apis/billingbudgets_v1beta1/service.rb', line 139

def (name, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v1beta1/{+name}', options)
  command.response_representation = Google::Apis::BillingbudgetsV1beta1::GoogleCloudBillingBudgetsV1beta1Budget::Representation
  command.response_class = Google::Apis::BillingbudgetsV1beta1::GoogleCloudBillingBudgetsV1beta1Budget
  command.params['name'] = name unless name.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#list_billing_account_budgets(parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::BillingbudgetsV1beta1::GoogleCloudBillingBudgetsV1beta1ListBudgetsResponse

Returns a list of budgets for a billing account.

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Raises:


177
178
179
180
181
182
183
184
185
186
187
# File 'generated/google/apis/billingbudgets_v1beta1/service.rb', line 177

def (parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v1beta1/{+parent}/budgets', options)
  command.response_representation = Google::Apis::BillingbudgetsV1beta1::GoogleCloudBillingBudgetsV1beta1ListBudgetsResponse::Representation
  command.response_class = Google::Apis::BillingbudgetsV1beta1::GoogleCloudBillingBudgetsV1beta1ListBudgetsResponse
  command.params['parent'] = parent unless parent.nil?
  command.query['pageSize'] = page_size unless page_size.nil?
  command.query['pageToken'] = page_token unless page_token.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#patch_billing_account_budget(name, google_cloud_billing_budgets_v1beta1_update_budget_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::BillingbudgetsV1beta1::GoogleCloudBillingBudgetsV1beta1Budget

Updates a budget and returns the updated budget.

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Raises:


212
213
214
215
216
217
218
219
220
221
222
# File 'generated/google/apis/billingbudgets_v1beta1/service.rb', line 212

def (name, google_cloud_billing_budgets_v1beta1_update_budget_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:patch, 'v1beta1/{+name}', options)
  command.request_representation = Google::Apis::BillingbudgetsV1beta1::GoogleCloudBillingBudgetsV1beta1UpdateBudgetRequest::Representation
  command.request_object = google_cloud_billing_budgets_v1beta1_update_budget_request_object
  command.response_representation = Google::Apis::BillingbudgetsV1beta1::GoogleCloudBillingBudgetsV1beta1Budget::Representation
  command.response_class = Google::Apis::BillingbudgetsV1beta1::GoogleCloudBillingBudgetsV1beta1Budget
  command.params['name'] = name unless name.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end