Class: Google::Apis::CloudbillingV1beta::CloudbillingService

Inherits:
Google::Apis::Core::BaseService
  • Object
show all
Defined in:
lib/google/apis/cloudbilling_v1beta/service.rb

Overview

Cloud Billing API

Allows developers to manage billing for their Google Cloud Platform projects programmatically.

Examples:

require 'google/apis/cloudbilling_v1beta'

Cloudbilling = Google::Apis::CloudbillingV1beta # Alias the module
service = Cloudbilling::CloudbillingService.new

See Also:

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeCloudbillingService

Returns a new instance of CloudbillingService.



46
47
48
49
50
51
# File 'lib/google/apis/cloudbilling_v1beta/service.rb', line 46

def initialize
  super('https://cloudbilling.googleapis.com/', '',
        client_name: 'google-apis-cloudbilling_v1beta',
        client_version: Google::Apis::CloudbillingV1beta::GEM_VERSION)
  @batch_path = 'batch'
end

Instance Attribute Details

#keyString

Returns API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.

Returns:

  • (String)

    API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.



39
40
41
# File 'lib/google/apis/cloudbilling_v1beta/service.rb', line 39

def key
  @key
end

#quota_userString

Returns Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

Returns:

  • (String)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.



44
45
46
# File 'lib/google/apis/cloudbilling_v1beta/service.rb', line 44

def quota_user
  @quota_user
end

Instance Method Details

#estimate_cost_scenario_for_billing_account(billing_account, estimate_cost_scenario_for_billing_account_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::CloudbillingV1beta::EstimateCostScenarioForBillingAccountResponse

Use custom pricing in the estimate, using a CostScenario with a defined billingAccount.

Parameters:

  • billing_account (String)

    Resource name of the billing account for the cost estimate. The resource name has the form billingAccounts/billing_acount_id`. For example, billingAccounts/012345-567890-ABCDEFis the resource name for billing account 012345-567890-ABCDEF`. Must be specified.

  • estimate_cost_scenario_for_billing_account_request_object (Google::Apis::CloudbillingV1beta::EstimateCostScenarioForBillingAccountRequest) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



78
79
80
81
82
83
84
85
86
87
88
# File 'lib/google/apis/cloudbilling_v1beta/service.rb', line 78

def (,  = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v1beta/{+billingAccount}:estimateCostScenario', options)
  command.request_representation = Google::Apis::CloudbillingV1beta::EstimateCostScenarioForBillingAccountRequest::Representation
  command.request_object = 
  command.response_representation = Google::Apis::CloudbillingV1beta::EstimateCostScenarioForBillingAccountResponse::Representation
  command.response_class = Google::Apis::CloudbillingV1beta::EstimateCostScenarioForBillingAccountResponse
  command.params['billingAccount'] =  unless .nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#estimate_cost_scenario_with_list_price(estimate_cost_scenario_with_list_price_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::CloudbillingV1beta::EstimateCostScenarioWithListPriceResponse

Estimate list prices using a CostScenario without a defined billingAccount.

Parameters:

  • estimate_cost_scenario_with_list_price_request_object (Google::Apis::CloudbillingV1beta::EstimateCostScenarioWithListPriceRequest) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



109
110
111
112
113
114
115
116
117
118
# File 'lib/google/apis/cloudbilling_v1beta/service.rb', line 109

def estimate_cost_scenario_with_list_price(estimate_cost_scenario_with_list_price_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v1beta:estimateCostScenario', options)
  command.request_representation = Google::Apis::CloudbillingV1beta::EstimateCostScenarioWithListPriceRequest::Representation
  command.request_object = estimate_cost_scenario_with_list_price_request_object
  command.response_representation = Google::Apis::CloudbillingV1beta::EstimateCostScenarioWithListPriceResponse::Representation
  command.response_class = Google::Apis::CloudbillingV1beta::EstimateCostScenarioWithListPriceResponse
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end