Class: Google::Apis::CloudbillingV1::BillingAccount

Inherits:
Object
  • Object
show all
Includes:
Google::Apis::Core::Hashable, Google::Apis::Core::JsonObjectSupport
Defined in:
lib/google/apis/cloudbilling_v1/classes.rb,
lib/google/apis/cloudbilling_v1/representations.rb,
lib/google/apis/cloudbilling_v1/representations.rb

Overview

A billing account in the Google Cloud Console. You can assign a billing account to one or more projects.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ BillingAccount

Returns a new instance of BillingAccount.



183
184
185
# File 'lib/google/apis/cloudbilling_v1/classes.rb', line 183

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#currency_codeString

Optional. The currency in which the billing account is billed and charged, represented as an ISO 4217 code such as USD. Billing account currency is determined at the time of billing account creation and cannot be updated subsequently, so this field should not be set on update requests. In addition, a subaccount always matches the currency of its parent billing account, so this field should not be set on subaccount creation requests. Clients can read this field to determine the currency of an existing billing account. Corresponds to the JSON property currencyCode

Returns:

  • (String)


142
143
144
# File 'lib/google/apis/cloudbilling_v1/classes.rb', line 142

def currency_code
  @currency_code
end

#display_nameString

The display name given to the billing account, such as My Billing Account. This name is displayed in the Google Cloud Console. Corresponds to the JSON property displayName

Returns:

  • (String)


148
149
150
# File 'lib/google/apis/cloudbilling_v1/classes.rb', line 148

def display_name
  @display_name
end

#master_billing_accountString

If this account is a subaccount, then this will be the resource name of the parent billing account that it is being resold through. Otherwise this will be empty. Corresponds to the JSON property masterBillingAccount

Returns:

  • (String)


155
156
157
# File 'lib/google/apis/cloudbilling_v1/classes.rb', line 155

def 
  @master_billing_account
end

#nameString

Output only. The resource name of the billing account. The resource name has the form billingAccounts/billing_account_id`. For example,billingAccounts/ 012345-567890-ABCDEFwould be the resource name for billing account012345- 567890-ABCDEF. Corresponds to the JSON propertyname`

Returns:

  • (String)


163
164
165
# File 'lib/google/apis/cloudbilling_v1/classes.rb', line 163

def name
  @name
end

#openBoolean Also known as: open?

Output only. True if the billing account is open, and will therefore be charged for any usage on associated projects. False if the billing account is closed, and therefore projects associated with it are unable to use paid services. Corresponds to the JSON property open

Returns:

  • (Boolean)


171
172
173
# File 'lib/google/apis/cloudbilling_v1/classes.rb', line 171

def open
  @open
end

#parentString

Output only. The billing account's parent resource identifier. Use the MoveBillingAccount method to update the account's parent resource if it is a organization. Format: - organizations/organization_id, for example, ` organizations/12345678` - `billingAccounts/`billing_account_id, for example, billingAccounts/012345-567890-ABCDEF Corresponds to the JSON property parent

Returns:

  • (String)


181
182
183
# File 'lib/google/apis/cloudbilling_v1/classes.rb', line 181

def parent
  @parent
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



188
189
190
191
192
193
194
195
# File 'lib/google/apis/cloudbilling_v1/classes.rb', line 188

def update!(**args)
  @currency_code = args[:currency_code] if args.key?(:currency_code)
  @display_name = args[:display_name] if args.key?(:display_name)
  @master_billing_account = args[:master_billing_account] if args.key?(:master_billing_account)
  @name = args[:name] if args.key?(:name)
  @open = args[:open] if args.key?(:open)
  @parent = args[:parent] if args.key?(:parent)
end