Client for Google Cloud Billing API

class google.cloud.billing_v1.AggregationInfo(mapping=None, *, ignore_unknown_fields=False, **kwargs)

Represents the aggregation level and interval for pricing of a single SKU.

aggregation_level()

  • Type

    AggregationLevel

aggregation_interval()

  • Type

    AggregationInterval

aggregation_count()

The number of intervals to aggregate over. Example: If aggregation_level is “DAILY” and aggregation_count is 14, aggregation will be over 14 days.

class AggregationInterval(value)

The interval at which usage is aggregated to compute cost. Example: “MONTHLY” aggregation interval indicates that usage for tiered pricing is aggregated every month.

class AggregationLevel(value)

The level at which usage is aggregated to compute cost. Example: “ACCOUNT” aggregation level indicates that usage for tiered pricing is aggregated across all projects in a single account.

_delattr_(key)

Delete the value on the given field.

This is generally equivalent to setting a falsy value.

_eq_(other)

Return True if the messages are equal, False otherwise.

_ne_(other)

Return True if the messages are unequal, False otherwise.

_setattr_(key, value)

Set the value on the given field.

For well-known protocol buffer types which are marshalled, either the protocol buffer object or the Python equivalent is accepted.

class google.cloud.billing_v1.BillingAccount(mapping=None, *, ignore_unknown_fields=False, **kwargs)

A billing account in GCP Console. You can assign a billing account to one or more projects.

name()

The resource name of the billing account. The resource name has the form billingAccounts/{billing_account_id}. For example, billingAccounts/012345-567890-ABCDEF would be the resource name for billing account 012345-567890-ABCDEF.

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 will be unable to use paid services.

display_name()

The display name given to the billing account, such as My Billing Account. This name is displayed in the GCP Console.

master_billing_account()

If this account is a subaccount, then this will be the resource name of the master billing account that it is being resold through. Otherwise this will be empty.

_delattr_(key)

Delete the value on the given field.

This is generally equivalent to setting a falsy value.

_eq_(other)

Return True if the messages are equal, False otherwise.

_ne_(other)

Return True if the messages are unequal, False otherwise.

_setattr_(key, value)

Set the value on the given field.

For well-known protocol buffer types which are marshalled, either the protocol buffer object or the Python equivalent is accepted.

class google.cloud.billing_v1.Category(mapping=None, *, ignore_unknown_fields=False, **kwargs)

Represents the category hierarchy of a SKU.

service_display_name()

The display name of the service this SKU belongs to.

resource_family()

The type of product the SKU refers to. Example: “Compute”, “Storage”, “Network”, “ApplicationServices” etc.

resource_group()

A group classification for related SKUs. Example: “RAM”, “GPU”, “Prediction”, “Ops”, “GoogleEgress” etc.

usage_type()

Represents how the SKU is consumed. Example: “OnDemand”, “Preemptible”, “Commit1Mo”, “Commit1Yr” etc.

_delattr_(key)

Delete the value on the given field.

This is generally equivalent to setting a falsy value.

_eq_(other)

Return True if the messages are equal, False otherwise.

_ne_(other)

Return True if the messages are unequal, False otherwise.

_setattr_(key, value)

Set the value on the given field.

For well-known protocol buffer types which are marshalled, either the protocol buffer object or the Python equivalent is accepted.

class google.cloud.billing_v1.CloudBillingClient(*, credentials: Optional[google.auth.credentials.Credentials] = None, transport: Optional[Union[str, google.cloud.billing_v1.services.cloud_billing.transports.base.CloudBillingTransport]] = None, client_options: <module 'google.api_core.client_options' from '/workspace/python-billing/.nox/docfx/lib/python3.9/site-packages/google/api_core/client_options.py'> = ClientOptions: {'api_endpoint': 'cloudbilling.googleapis.com', 'client_cert_source': None, 'client_encrypted_cert_source': None, 'quota_project_id': None, 'credentials_file': None, 'scopes': None, 'api_key': None, 'api_audience': None})

Retrieves GCP Console billing accounts and associates them with projects.

Instantiate the cloud billing client.

  • Parameters

    • credentials (Optional[google.auth.credentials.Credentials]) – The authorization credentials to attach to requests. These credentials identify the application to the service; if none are specified, the client will attempt to ascertain the credentials from the environment.

    • transport (Union[str, **CloudBillingTransport]) – The transport to use. If set to None, a transport is chosen automatically.

    • client_options (ClientOptions) – Custom options for the client.

create_billing_account(request: Optional[google.cloud.billing_v1.types.cloud_billing.CreateBillingAccountRequest] = None, *, billing_account: Optional[google.cloud.billing_v1.types.cloud_billing.BillingAccount] = None, retry: google.api_core.retry.Retry = <_MethodDefault._DEFAULT_VALUE:

Creates a billing account. This method can only be used to create billing subaccounts by GCP resellers. When creating a subaccount, the current authenticated user must have the billing.accounts.update IAM permission on the master account, which is typically given to billing account administrators. This method will return an error if the master account has not been provisioned as a reseller account.

  • Parameters

    • request (CreateBillingAccountRequest) – The request object. Request message for CreateBillingAccount.

    • billing_account (BillingAccount) – Required. The billing account resource to create. Currently CreateBillingAccount only supports subaccount creation, so any created billing accounts must be under a provided master billing account. This corresponds to the billing_account field on the request instance; if request is provided, this should not be set.

    • retry (google.api_core.retry.Retry) – Designation of what errors, if any, should be retried.

    • timeout (float) – The timeout for this request.

    • metadata (Sequence[Tuple[str, *[str](https://python.readthedocs.io/en/latest/library/stdtypes.html#str)]*]) – Strings which should be sent along with the request as metadata.

  • Returns

    A billing account in GCP Console. You can assign a billing account to one or more projects.

  • Return type

    BillingAccount

classmethod from_service_account_file(filename: str, *args, **kwargs)

Creates an instance of this client using the provided credentials file.

  • Parameters

    • filename (str) – The path to the service account private key json file.

    • args – Additional arguments to pass to the constructor.

    • kwargs – Additional arguments to pass to the constructor.

  • Returns

    The constructed client.

  • Return type

    {@api.name}

classmethod from_service_account_json(filename: str, *args, **kwargs)

Creates an instance of this client using the provided credentials file.

  • Parameters

    • filename (str) – The path to the service account private key json file.

    • args – Additional arguments to pass to the constructor.

    • kwargs – Additional arguments to pass to the constructor.

  • Returns

    The constructed client.

  • Return type

    {@api.name}

get_billing_account(request: Optional[google.cloud.billing_v1.types.cloud_billing.GetBillingAccountRequest] = None, *, name: Optional[str] = None, retry: google.api_core.retry.Retry = <_MethodDefault._DEFAULT_VALUE:

Gets information about a billing account. The current authenticated user must be a viewer of the billing account.

  • Parameters

    • request (GetBillingAccountRequest) – The request object. Request message for GetBillingAccount.

    • name (str) – Required. The resource name of the billing account to retrieve. For example, billingAccounts/012345-567890-ABCDEF. This corresponds to the name field on the request instance; if request is provided, this should not be set.

    • retry (google.api_core.retry.Retry) – Designation of what errors, if any, should be retried.

    • timeout (float) – The timeout for this request.

    • metadata (Sequence[Tuple[str, *[str](https://python.readthedocs.io/en/latest/library/stdtypes.html#str)]*]) – Strings which should be sent along with the request as metadata.

  • Returns

    A billing account in GCP Console. You can assign a billing account to one or more projects.

  • Return type

    BillingAccount

get_iam_policy(request: Optional[google.iam.v1.iam_policy_pb2.GetIamPolicyRequest] = None, *, resource: Optional[str] = None, retry: google.api_core.retry.Retry = <_MethodDefault._DEFAULT_VALUE:

Gets the access control policy for a billing account. The caller must have the billing.accounts.getIamPolicy permission on the account, which is often given to billing account viewers.

  • Parameters

    • request (GetIamPolicyRequest) – The request object. Request message for GetIamPolicy method.

    • resource (str) – REQUIRED: The resource for which the policy is being requested. resource is usually specified as a path. For example, a Project resource is specified as projects/{project}. This corresponds to the resource field on the request instance; if request is provided, this should not be set.

    • retry (google.api_core.retry.Retry) – Designation of what errors, if any, should be retried.

    • timeout (float) – The timeout for this request.

    • metadata (Sequence[Tuple[str, *[str](https://python.readthedocs.io/en/latest/library/stdtypes.html#str)]*]) – Strings which should be sent along with the request as metadata.

  • Returns

    Defines an Identity and Access Management (IAM) policy. It is used to specify access control policies for Cloud Platform resources.

    A Policy consists of a list of bindings. A Binding binds a list of members to a role, where the members can be user accounts, Google groups, Google domains, and service accounts. A role is a named list of permissions defined by IAM.

    Example

    {
      "bindings": [
        {
          "role": "roles/owner",
          "members": [
            "user:mike@example.com",
            "group:admins@example.com",
            "domain:google.com",
            "serviceAccount:my-other-app@appspot.gserviceaccount.com",
          ]
        },
        {
          "role": "roles/viewer",
          "members": ["user:sean@example.com"]
        }
      ]
    }
    

    For a description of IAM and its features, see the IAM developer’s guide.

  • Return type

    Policy

get_project_billing_info(request: Optional[google.cloud.billing_v1.types.cloud_billing.GetProjectBillingInfoRequest] = None, *, name: Optional[str] = None, retry: google.api_core.retry.Retry = <_MethodDefault._DEFAULT_VALUE:

Gets the billing information for a project. The current authenticated user must have permission to view the project.

  • Parameters

    • request (GetProjectBillingInfoRequest) – The request object. Request message for GetProjectBillingInfo.

    • name (str) – Required. The resource name of the project for which billing information is retrieved. For example, projects/tokyo-rain-123. This corresponds to the name field on the request instance; if request is provided, this should not be set.

    • retry (google.api_core.retry.Retry) – Designation of what errors, if any, should be retried.

    • timeout (float) – The timeout for this request.

    • metadata (Sequence[Tuple[str, *[str](https://python.readthedocs.io/en/latest/library/stdtypes.html#str)]*]) – Strings which should be sent along with the request as metadata.

  • Returns

    Encapsulation of billing information for a GCP Console project. A project has at most one associated billing account at a time (but a billing account can be assigned to multiple projects).

  • Return type

    ProjectBillingInfo

list_billing_accounts(request: Optional[google.cloud.billing_v1.types.cloud_billing.ListBillingAccountsRequest] = None, *, retry: google.api_core.retry.Retry = <_MethodDefault._DEFAULT_VALUE:

Lists the billing accounts that the current authenticated user has permission to view.

list_project_billing_info(request: Optional[google.cloud.billing_v1.types.cloud_billing.ListProjectBillingInfoRequest] = None, *, name: Optional[str] = None, retry: google.api_core.retry.Retry = <_MethodDefault._DEFAULT_VALUE:

Lists the projects associated with a billing account. The current authenticated user must have the billing.resourceAssociations.list IAM permission, which is often given to billing account viewers.

  • Parameters

    • request (ListProjectBillingInfoRequest) – The request object. Request message for ListProjectBillingInfo.

    • name (str) – Required. The resource name of the billing account associated with the projects that you want to list. For example, billingAccounts/012345-567890-ABCDEF. This corresponds to the name field on the request instance; if request is provided, this should not be set.

    • retry (google.api_core.retry.Retry) – Designation of what errors, if any, should be retried.

    • timeout (float) – The timeout for this request.

    • metadata (Sequence[Tuple[str, *[str](https://python.readthedocs.io/en/latest/library/stdtypes.html#str)]*]) – Strings which should be sent along with the request as metadata.

  • Returns

    Request message for ListProjectBillingInfoResponse.

    Iterating over this object will yield results and resolve additional pages automatically.

  • Return type

    ListProjectBillingInfoPager

set_iam_policy(request: Optional[google.iam.v1.iam_policy_pb2.SetIamPolicyRequest] = None, *, resource: Optional[str] = None, retry: google.api_core.retry.Retry = <_MethodDefault._DEFAULT_VALUE:

Sets the access control policy for a billing account. Replaces any existing policy. The caller must have the billing.accounts.setIamPolicy permission on the account, which is often given to billing account administrators.

  • Parameters

    • request (SetIamPolicyRequest) – The request object. Request message for SetIamPolicy method.

    • resource (str) – REQUIRED: The resource for which the policy is being specified. resource is usually specified as a path. For example, a Project resource is specified as projects/{project}. This corresponds to the resource field on the request instance; if request is provided, this should not be set.

    • retry (google.api_core.retry.Retry) – Designation of what errors, if any, should be retried.

    • timeout (float) – The timeout for this request.

    • metadata (Sequence[Tuple[str, *[str](https://python.readthedocs.io/en/latest/library/stdtypes.html#str)]*]) – Strings which should be sent along with the request as metadata.

  • Returns

    Defines an Identity and Access Management (IAM) policy. It is used to specify access control policies for Cloud Platform resources.

    A Policy consists of a list of bindings. A Binding binds a list of members to a role, where the members can be user accounts, Google groups, Google domains, and service accounts. A role is a named list of permissions defined by IAM.

    Example

    {
      "bindings": [
        {
          "role": "roles/owner",
          "members": [
            "user:mike@example.com",
            "group:admins@example.com",
            "domain:google.com",
            "serviceAccount:my-other-app@appspot.gserviceaccount.com",
          ]
        },
        {
          "role": "roles/viewer",
          "members": ["user:sean@example.com"]
        }
      ]
    }
    

    For a description of IAM and its features, see the IAM developer’s guide.

  • Return type

    Policy

test_iam_permissions(request: Optional[google.iam.v1.iam_policy_pb2.TestIamPermissionsRequest] = None, *, resource: Optional[str] = None, permissions: Optional[Sequence[str]] = None, retry: google.api_core.retry.Retry = <_MethodDefault._DEFAULT_VALUE:

Tests the access control policy for a billing account. This method takes the resource and a set of permissions as input and returns the subset of the input permissions that the caller is allowed for that resource.

  • Parameters

    • request (TestIamPermissionsRequest) – The request object. Request message for TestIamPermissions method.

    • resource (str) – REQUIRED: The resource for which the policy detail is being requested. resource is usually specified as a path. For example, a Project resource is specified as projects/{project}. This corresponds to the resource field on the request instance; if request is provided, this should not be set.

    • permissions (Sequence[str]) – The set of permissions to check for the resource. Permissions with wildcards (such as ‘*’ or ‘storage.*’) are not allowed. For more information see IAM Overview. This corresponds to the permissions field on the request instance; if request is provided, this should not be set.

    • retry (google.api_core.retry.Retry) – Designation of what errors, if any, should be retried.

    • timeout (float) – The timeout for this request.

    • metadata (Sequence[Tuple[str, *[str](https://python.readthedocs.io/en/latest/library/stdtypes.html#str)]*]) – Strings which should be sent along with the request as metadata.

  • Returns

    Response message for TestIamPermissions method.

  • Return type

    TestIamPermissionsResponse

update_billing_account(request: Optional[google.cloud.billing_v1.types.cloud_billing.UpdateBillingAccountRequest] = None, *, name: Optional[str] = None, account: Optional[google.cloud.billing_v1.types.cloud_billing.BillingAccount] = None, retry: google.api_core.retry.Retry = <_MethodDefault._DEFAULT_VALUE:

Updates a billing account’s fields. Currently the only field that can be edited is display_name. The current authenticated user must have the billing.accounts.update IAM permission, which is typically given to the administrator of the billing account.

  • Parameters

    • request (UpdateBillingAccountRequest) – The request object. Request message for UpdateBillingAccount.

    • name (str) – Required. The name of the billing account resource to be updated. This corresponds to the name field on the request instance; if request is provided, this should not be set.

    • account (BillingAccount) – Required. The billing account resource to replace the resource on the server. This corresponds to the account field on the request instance; if request is provided, this should not be set.

    • retry (google.api_core.retry.Retry) – Designation of what errors, if any, should be retried.

    • timeout (float) – The timeout for this request.

    • metadata (Sequence[Tuple[str, *[str](https://python.readthedocs.io/en/latest/library/stdtypes.html#str)]*]) – Strings which should be sent along with the request as metadata.

  • Returns

    A billing account in GCP Console. You can assign a billing account to one or more projects.

  • Return type

    BillingAccount

update_project_billing_info(request: Optional[google.cloud.billing_v1.types.cloud_billing.UpdateProjectBillingInfoRequest] = None, *, name: Optional[str] = None, project_billing_info: Optional[google.cloud.billing_v1.types.cloud_billing.ProjectBillingInfo] = None, retry: google.api_core.retry.Retry = <_MethodDefault._DEFAULT_VALUE:

Sets or updates the billing account associated with a project. You specify the 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 the project and allows charges for resource usage. If the project already had a billing account, this method changes the billing account used for resource usage charges.

Note: Incurred charges that have not yet been reported in the transaction history of the GCP Console might be billed to the new billing account, even if the charge occurred before the new billing account was assigned to the project.

The current authenticated user must have ownership privileges for both the project and the billing account.

You can disable billing on the project by setting the billing_account_name field to empty. This action disassociates the current billing account from the project. Any billable activity of your in-use services will stop, and your application could stop functioning as expected. Any unbilled charges to date will be billed to the previously associated account. The current authenticated user must be either an owner of the project or an owner of the billing account for the project.

Note that associating a project with a closed billing account will have much the same effect as disabling billing on the project: any paid resources used by the project will be shut down. Thus, unless you wish to disable billing, you should always call this method with the name of an open billing account.

  • Parameters

    • request (UpdateProjectBillingInfoRequest) – The request object. Request message for UpdateProjectBillingInfo.

    • name (str) – Required. The resource name of the project associated with the billing information that you want to update. For example, projects/tokyo-rain-123. This corresponds to the name field on the request instance; if request is provided, this should not be set.

    • project_billing_info (ProjectBillingInfo) – The new billing information for the project. Read-only fields are ignored; thus, you can leave empty all fields except billing_account_name. This corresponds to the project_billing_info field on the request instance; if request is provided, this should not be set.

    • retry (google.api_core.retry.Retry) – Designation of what errors, if any, should be retried.

    • timeout (float) – The timeout for this request.

    • metadata (Sequence[Tuple[str, *[str](https://python.readthedocs.io/en/latest/library/stdtypes.html#str)]*]) – Strings which should be sent along with the request as metadata.

  • Returns

    Encapsulation of billing information for a GCP Console project. A project has at most one associated billing account at a time (but a billing account can be assigned to multiple projects).

  • Return type

    ProjectBillingInfo

class google.cloud.billing_v1.CloudCatalogClient(*, credentials: Optional[google.auth.credentials.Credentials] = None, transport: Optional[Union[str, google.cloud.billing_v1.services.cloud_catalog.transports.base.CloudCatalogTransport]] = None, client_options: <module 'google.api_core.client_options' from '/workspace/python-billing/.nox/docfx/lib/python3.9/site-packages/google/api_core/client_options.py'> = ClientOptions: {'api_endpoint': 'cloudbilling.googleapis.com', 'client_cert_source': None, 'client_encrypted_cert_source': None, 'quota_project_id': None, 'credentials_file': None, 'scopes': None, 'api_key': None, 'api_audience': None})

A catalog of Google Cloud Platform services and SKUs. Provides pricing information and metadata on Google Cloud Platform services and SKUs.

Instantiate the cloud catalog client.

  • Parameters

    • credentials (Optional[google.auth.credentials.Credentials]) – The authorization credentials to attach to requests. These credentials identify the application to the service; if none are specified, the client will attempt to ascertain the credentials from the environment.

    • transport (Union[str, **CloudCatalogTransport]) – The transport to use. If set to None, a transport is chosen automatically.

    • client_options (ClientOptions) – Custom options for the client.

classmethod from_service_account_file(filename: str, *args, **kwargs)

Creates an instance of this client using the provided credentials file.

  • Parameters

    • filename (str) – The path to the service account private key json file.

    • args – Additional arguments to pass to the constructor.

    • kwargs – Additional arguments to pass to the constructor.

  • Returns

    The constructed client.

  • Return type

    {@api.name}

classmethod from_service_account_json(filename: str, *args, **kwargs)

Creates an instance of this client using the provided credentials file.

  • Parameters

    • filename (str) – The path to the service account private key json file.

    • args – Additional arguments to pass to the constructor.

    • kwargs – Additional arguments to pass to the constructor.

  • Returns

    The constructed client.

  • Return type

    {@api.name}

list_services(request: Optional[google.cloud.billing_v1.types.cloud_catalog.ListServicesRequest] = None, *, retry: google.api_core.retry.Retry = <_MethodDefault._DEFAULT_VALUE:

Lists all public cloud services.

list_skus(request: Optional[google.cloud.billing_v1.types.cloud_catalog.ListSkusRequest] = None, *, parent: Optional[str] = None, retry: google.api_core.retry.Retry = <_MethodDefault._DEFAULT_VALUE:

Lists all publicly available SKUs for a given cloud service.

  • Parameters

    • request (ListSkusRequest) – The request object. Request message for ListSkus.

    • parent (str) – Required. The name of the service. Example: “services/DA34-426B-A397”. This corresponds to the parent field on the request instance; if request is provided, this should not be set.

    • retry (google.api_core.retry.Retry) – Designation of what errors, if any, should be retried.

    • timeout (float) – The timeout for this request.

    • metadata (Sequence[Tuple[str, *[str](https://python.readthedocs.io/en/latest/library/stdtypes.html#str)]*]) – Strings which should be sent along with the request as metadata.

  • Returns

    Response message for ListSkus.

    Iterating over this object will yield results and resolve additional pages automatically.

  • Return type

    ListSkusPager

class google.cloud.billing_v1.CreateBillingAccountRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)

Request message for CreateBillingAccount.

billing_account()

Required. The billing account resource to create. Currently CreateBillingAccount only supports subaccount creation, so any created billing accounts must be under a provided master billing account.

  • Type

    BillingAccount

_delattr_(key)

Delete the value on the given field.

This is generally equivalent to setting a falsy value.

_eq_(other)

Return True if the messages are equal, False otherwise.

_ne_(other)

Return True if the messages are unequal, False otherwise.

_setattr_(key, value)

Set the value on the given field.

For well-known protocol buffer types which are marshalled, either the protocol buffer object or the Python equivalent is accepted.

class google.cloud.billing_v1.GetBillingAccountRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)

Request message for GetBillingAccount.

name()

Required. The resource name of the billing account to retrieve. For example, billingAccounts/012345-567890-ABCDEF.

_delattr_(key)

Delete the value on the given field.

This is generally equivalent to setting a falsy value.

_eq_(other)

Return True if the messages are equal, False otherwise.

_ne_(other)

Return True if the messages are unequal, False otherwise.

_setattr_(key, value)

Set the value on the given field.

For well-known protocol buffer types which are marshalled, either the protocol buffer object or the Python equivalent is accepted.

class google.cloud.billing_v1.GetProjectBillingInfoRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)

Request message for GetProjectBillingInfo.

name()

Required. The resource name of the project for which billing information is retrieved. For example, projects/tokyo-rain-123.

_delattr_(key)

Delete the value on the given field.

This is generally equivalent to setting a falsy value.

_eq_(other)

Return True if the messages are equal, False otherwise.

_ne_(other)

Return True if the messages are unequal, False otherwise.

_setattr_(key, value)

Set the value on the given field.

For well-known protocol buffer types which are marshalled, either the protocol buffer object or the Python equivalent is accepted.

class google.cloud.billing_v1.ListBillingAccountsRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)

Request message for ListBillingAccounts.

page_size()

Requested page size. The maximum page size is 100; this is also the default.

page_token()

A token identifying a page of results to return. This should be a next_page_token value returned from a previous ListBillingAccounts call. If unspecified, the first page of results is returned.

filter()

Options for how to filter the returned billing accounts. Currently this only supports filtering for subaccounts under a single provided reseller billing account. (e.g. “master_billing_account=billingAccounts/012345-678901-ABCDEF”). Boolean algebra and other fields are not currently supported.

_delattr_(key)

Delete the value on the given field.

This is generally equivalent to setting a falsy value.

_eq_(other)

Return True if the messages are equal, False otherwise.

_ne_(other)

Return True if the messages are unequal, False otherwise.

_setattr_(key, value)

Set the value on the given field.

For well-known protocol buffer types which are marshalled, either the protocol buffer object or the Python equivalent is accepted.

class google.cloud.billing_v1.ListBillingAccountsResponse(mapping=None, *, ignore_unknown_fields=False, **kwargs)

Response message for ListBillingAccounts.

billing_accounts()

A list of billing accounts.

  • Type

    Sequence[BillingAccount]

next_page_token()

A token to retrieve the next page of results. To retrieve the next page, call ListBillingAccounts again with the page_token field set to this value. This field is empty if there are no more results to retrieve.

_delattr_(key)

Delete the value on the given field.

This is generally equivalent to setting a falsy value.

_eq_(other)

Return True if the messages are equal, False otherwise.

_ne_(other)

Return True if the messages are unequal, False otherwise.

_setattr_(key, value)

Set the value on the given field.

For well-known protocol buffer types which are marshalled, either the protocol buffer object or the Python equivalent is accepted.

class google.cloud.billing_v1.ListProjectBillingInfoRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)

Request message for ListProjectBillingInfo.

name()

Required. The resource name of the billing account associated with the projects that you want to list. For example, billingAccounts/012345-567890-ABCDEF.

page_size()

Requested page size. The maximum page size is 100; this is also the default.

page_token()

A token identifying a page of results to be returned. This should be a next_page_token value returned from a previous ListProjectBillingInfo call. If unspecified, the first page of results is returned.

_delattr_(key)

Delete the value on the given field.

This is generally equivalent to setting a falsy value.

_eq_(other)

Return True if the messages are equal, False otherwise.

_ne_(other)

Return True if the messages are unequal, False otherwise.

_setattr_(key, value)

Set the value on the given field.

For well-known protocol buffer types which are marshalled, either the protocol buffer object or the Python equivalent is accepted.

class google.cloud.billing_v1.ListProjectBillingInfoResponse(mapping=None, *, ignore_unknown_fields=False, **kwargs)

Request message for ListProjectBillingInfoResponse.

project_billing_info()

A list of ProjectBillingInfo resources representing the projects associated with the billing account.

  • Type

    Sequence[ProjectBillingInfo]

next_page_token()

A token to retrieve the next page of results. To retrieve the next page, call ListProjectBillingInfo again with the page_token field set to this value. This field is empty if there are no more results to retrieve.

_delattr_(key)

Delete the value on the given field.

This is generally equivalent to setting a falsy value.

_eq_(other)

Return True if the messages are equal, False otherwise.

_ne_(other)

Return True if the messages are unequal, False otherwise.

_setattr_(key, value)

Set the value on the given field.

For well-known protocol buffer types which are marshalled, either the protocol buffer object or the Python equivalent is accepted.

class google.cloud.billing_v1.ListServicesRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)

Request message for ListServices.

page_size()

Requested page size. Defaults to 5000.

page_token()

A token identifying a page of results to return. This should be a next_page_token value returned from a previous ListServices call. If unspecified, the first page of results is returned.

_delattr_(key)

Delete the value on the given field.

This is generally equivalent to setting a falsy value.

_eq_(other)

Return True if the messages are equal, False otherwise.

_ne_(other)

Return True if the messages are unequal, False otherwise.

_setattr_(key, value)

Set the value on the given field.

For well-known protocol buffer types which are marshalled, either the protocol buffer object or the Python equivalent is accepted.

class google.cloud.billing_v1.ListServicesResponse(mapping=None, *, ignore_unknown_fields=False, **kwargs)

Response message for ListServices.

services()

A list of services.

  • Type

    Sequence[Service]

next_page_token()

A token to retrieve the next page of results. To retrieve the next page, call ListServices again with the page_token field set to this value. This field is empty if there are no more results to retrieve.

_delattr_(key)

Delete the value on the given field.

This is generally equivalent to setting a falsy value.

_eq_(other)

Return True if the messages are equal, False otherwise.

_ne_(other)

Return True if the messages are unequal, False otherwise.

_setattr_(key, value)

Set the value on the given field.

For well-known protocol buffer types which are marshalled, either the protocol buffer object or the Python equivalent is accepted.

class google.cloud.billing_v1.ListSkusRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)

Request message for ListSkus.

parent()

Required. The name of the service. Example: “services/DA34-426B-A397”.

start_time()

Optional inclusive start time of the time range for which the pricing versions will be returned. Timestamps in the future are not allowed. The time range has to be within a single calendar month in America/Los_Angeles timezone. Time range as a whole is optional. If not specified, the latest pricing will be returned (up to 12 hours old at most).

  • Type

    Timestamp

end_time()

Optional exclusive end time of the time range for which the pricing versions will be returned. Timestamps in the future are not allowed. The time range has to be within a single calendar month in America/Los_Angeles timezone. Time range as a whole is optional. If not specified, the latest pricing will be returned (up to 12 hours old at most).

  • Type

    Timestamp

currency_code()

The ISO 4217 currency code for the pricing info in the response proto. Will use the conversion rate as of start_time. Optional. If not specified USD will be used.

page_size()

Requested page size. Defaults to 5000.

page_token()

A token identifying a page of results to return. This should be a next_page_token value returned from a previous ListSkus call. If unspecified, the first page of results is returned.

_delattr_(key)

Delete the value on the given field.

This is generally equivalent to setting a falsy value.

_eq_(other)

Return True if the messages are equal, False otherwise.

_ne_(other)

Return True if the messages are unequal, False otherwise.

_setattr_(key, value)

Set the value on the given field.

For well-known protocol buffer types which are marshalled, either the protocol buffer object or the Python equivalent is accepted.

class google.cloud.billing_v1.ListSkusResponse(mapping=None, *, ignore_unknown_fields=False, **kwargs)

Response message for ListSkus.

skus()

The list of public SKUs of the given service.

  • Type

    Sequence[Sku]

next_page_token()

A token to retrieve the next page of results. To retrieve the next page, call ListSkus again with the page_token field set to this value. This field is empty if there are no more results to retrieve.

_delattr_(key)

Delete the value on the given field.

This is generally equivalent to setting a falsy value.

_eq_(other)

Return True if the messages are equal, False otherwise.

_ne_(other)

Return True if the messages are unequal, False otherwise.

_setattr_(key, value)

Set the value on the given field.

For well-known protocol buffer types which are marshalled, either the protocol buffer object or the Python equivalent is accepted.

class google.cloud.billing_v1.PricingExpression(mapping=None, *, ignore_unknown_fields=False, **kwargs)

Expresses a mathematical pricing formula. For Example:-

usage_unit: GBy tiered_rates: [start_usage_amount: 20, unit_price: $10] [start_usage_amount: 100, unit_price: $5]

The above expresses a pricing formula where the first 20GB is free, the next 80GB is priced at $10 per GB followed by $5 per GB for additional usage.

usage_unit()

The short hand for unit of usage this pricing is specified in. Example: usage_unit of “GiBy” means that usage is specified in “Gibi Byte”.

usage_unit_description()

The unit of usage in human readable form. Example: “gibi byte”.

base_unit()

The base unit for the SKU which is the unit used in usage exports. Example: “By”.

base_unit_description()

The base unit in human readable form. Example: “byte”.

base_unit_conversion_factor()

Conversion factor for converting from price per usage_unit to price per base_unit, and start_usage_amount to start_usage_amount in base_unit. unit_price / base_unit_conversion_factor = price per base_unit. start_usage_amount * base_unit_conversion_factor = start_usage_amount in base_unit.

display_quantity()

The recommended quantity of units for displaying pricing info. When displaying pricing info it is recommended to display: (unit_price * display_quantity) per display_quantity usage_unit. This field does not affect the pricing formula and is for display purposes only. Example: If the unit_price is “0.0001 USD”, the usage_unit is “GB” and the display_quantity is “1000” then the recommended way of displaying the pricing info is “0.10 USD per 1000 GB”.

tiered_rates()

The list of tiered rates for this pricing. The total cost is computed by applying each of the tiered rates on usage. This repeated list is sorted by ascending order of start_usage_amount.

  • Type

    Sequence[TierRate]

class TierRate(mapping=None, *, ignore_unknown_fields=False, **kwargs)

The price rate indicating starting usage and its corresponding price.

start_usage_amount()

Usage is priced at this rate only after this amount. Example: start_usage_amount of 10 indicates that the usage will be priced at the unit_price after the first 10 usage_units.

unit_price()

The price per unit of usage. Example: unit_price of amount $10 indicates that each unit will cost $10.

  • Type

    Money

_delattr_(key)

Delete the value on the given field.

This is generally equivalent to setting a falsy value.

_eq_(other)

Return True if the messages are equal, False otherwise.

_ne_(other)

Return True if the messages are unequal, False otherwise.

_setattr_(key, value)

Set the value on the given field.

For well-known protocol buffer types which are marshalled, either the protocol buffer object or the Python equivalent is accepted.

_delattr_(key)

Delete the value on the given field.

This is generally equivalent to setting a falsy value.

_eq_(other)

Return True if the messages are equal, False otherwise.

_ne_(other)

Return True if the messages are unequal, False otherwise.

_setattr_(key, value)

Set the value on the given field.

For well-known protocol buffer types which are marshalled, either the protocol buffer object or the Python equivalent is accepted.

class google.cloud.billing_v1.PricingInfo(mapping=None, *, ignore_unknown_fields=False, **kwargs)

Represents the pricing information for a SKU at a single point of time.

effective_time()

The timestamp from which this pricing was effective within the requested time range. This is guaranteed to be greater than or equal to the start_time field in the request and less than the end_time field in the request. If a time range was not specified in the request this field will be equivalent to a time within the last 12 hours, indicating the latest pricing info.

  • Type

    Timestamp

summary()

An optional human readable summary of the pricing information, has a maximum length of 256 characters.

pricing_expression()

Expresses the pricing formula. See PricingExpression for an example.

  • Type

    PricingExpression

aggregation_info()

Aggregation Info. This can be left unspecified if the pricing expression doesn’t require aggregation.

  • Type

    AggregationInfo

currency_conversion_rate()

Conversion rate used for currency conversion, from USD to the currency specified in the request. This includes any surcharge collected for billing in non USD currency. If a currency is not specified in the request this defaults to 1.0. Example: USD * currency_conversion_rate = JPY

_delattr_(key)

Delete the value on the given field.

This is generally equivalent to setting a falsy value.

_eq_(other)

Return True if the messages are equal, False otherwise.

_ne_(other)

Return True if the messages are unequal, False otherwise.

_setattr_(key, value)

Set the value on the given field.

For well-known protocol buffer types which are marshalled, either the protocol buffer object or the Python equivalent is accepted.

class google.cloud.billing_v1.ProjectBillingInfo(mapping=None, *, ignore_unknown_fields=False, **kwargs)

Encapsulation of billing information for a GCP Console project. A project has at most one associated billing account at a time (but a billing account can be assigned to multiple projects).

name()

The resource name for the ProjectBillingInfo; has the form projects/{project_id}/billingInfo. For example, the resource name for the billing information for project tokyo-rain-123 would be projects/tokyo-rain-123/billingInfo. This field is read-only.

project_id()

The ID of the project that this ProjectBillingInfo represents, such as tokyo-rain-123. This is a convenience field so that you don’t need to parse the name field to obtain a project ID. This field is read-only.

billing_account_name()

The resource name of the billing account associated with the project, if any. For example, billingAccounts/012345-567890-ABCDEF.

billing_enabled()

True if the project is associated with an open billing account, to which usage on the project is charged. False if the project is associated with a closed billing account, or no billing account at all, and therefore cannot use paid services. This field is read-only.

_delattr_(key)

Delete the value on the given field.

This is generally equivalent to setting a falsy value.

_eq_(other)

Return True if the messages are equal, False otherwise.

_ne_(other)

Return True if the messages are unequal, False otherwise.

_setattr_(key, value)

Set the value on the given field.

For well-known protocol buffer types which are marshalled, either the protocol buffer object or the Python equivalent is accepted.

class google.cloud.billing_v1.Service(mapping=None, *, ignore_unknown_fields=False, **kwargs)

Encapsulates a single service in Google Cloud Platform.

name()

The resource name for the service. Example: “services/DA34-426B-A397”.

service_id()

The identifier for the service. Example: “DA34-426B-A397”.

display_name()

A human readable display name for this service.

business_entity_name()

The business under which the service is offered. Ex. “businessEntities/GCP”, “businessEntities/Maps”.

_delattr_(key)

Delete the value on the given field.

This is generally equivalent to setting a falsy value.

_eq_(other)

Return True if the messages are equal, False otherwise.

_ne_(other)

Return True if the messages are unequal, False otherwise.

_setattr_(key, value)

Set the value on the given field.

For well-known protocol buffer types which are marshalled, either the protocol buffer object or the Python equivalent is accepted.

class google.cloud.billing_v1.Sku(mapping=None, *, ignore_unknown_fields=False, **kwargs)

Encapsulates a single SKU in Google Cloud Platform

name()

The resource name for the SKU. Example: “services/DA34-426B-A397/skus/AA95-CD31-42FE”.

sku_id()

The identifier for the SKU. Example: “AA95-CD31-42FE”.

description()

A human readable description of the SKU, has a maximum length of 256 characters.

category()

The category hierarchy of this SKU, purely for organizational purpose.

  • Type

    Category

service_regions()

List of service regions this SKU is offered at. Example: “asia-east1” Service regions can be found at https://cloud.google.com/about/locations/

  • Type

    Sequence[str]

pricing_info()

A timeline of pricing info for this SKU in chronological order.

  • Type

    Sequence[PricingInfo]

service_provider_name()

Identifies the service provider. This is ‘Google’ for first party services in Google Cloud Platform.

_delattr_(key)

Delete the value on the given field.

This is generally equivalent to setting a falsy value.

_eq_(other)

Return True if the messages are equal, False otherwise.

_ne_(other)

Return True if the messages are unequal, False otherwise.

_setattr_(key, value)

Set the value on the given field.

For well-known protocol buffer types which are marshalled, either the protocol buffer object or the Python equivalent is accepted.

class google.cloud.billing_v1.UpdateBillingAccountRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)

Request message for UpdateBillingAccount.

name()

Required. The name of the billing account resource to be updated.

account()

Required. The billing account resource to replace the resource on the server.

  • Type

    BillingAccount

update_mask()

The update mask applied to the resource. Only “display_name” is currently supported.

  • Type

    FieldMask

_delattr_(key)

Delete the value on the given field.

This is generally equivalent to setting a falsy value.

_eq_(other)

Return True if the messages are equal, False otherwise.

_ne_(other)

Return True if the messages are unequal, False otherwise.

_setattr_(key, value)

Set the value on the given field.

For well-known protocol buffer types which are marshalled, either the protocol buffer object or the Python equivalent is accepted.

class google.cloud.billing_v1.UpdateProjectBillingInfoRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)

Request message for UpdateProjectBillingInfo.

name()

Required. The resource name of the project associated with the billing information that you want to update. For example, projects/tokyo-rain-123.

project_billing_info()

The new billing information for the project. Read-only fields are ignored; thus, you can leave empty all fields except billing_account_name.

  • Type

    ProjectBillingInfo

_delattr_(key)

Delete the value on the given field.

This is generally equivalent to setting a falsy value.

_eq_(other)

Return True if the messages are equal, False otherwise.

_ne_(other)

Return True if the messages are unequal, False otherwise.

_setattr_(key, value)

Set the value on the given field.

For well-known protocol buffer types which are marshalled, either the protocol buffer object or the Python equivalent is accepted.