Skip to content

vendor_connectors.google.billing

Google Cloud Billing operations.

This module provides operations for managing Google Cloud billing accounts and project billing associations.

GoogleBillingMixinMixin providing Google Cloud Billing operations.

class vendor_connectors.google.billing.GoogleBillingMixin

Section titled “class vendor_connectors.google.billing.GoogleBillingMixin”

Mixin providing Google Cloud Billing operations.

This mixin requires the base GoogleConnector class to provide:

  • get_billing_service()
  • logger

List Google Cloud billing accounts.

Args: filter_query: Optional filter query string. unhump_accounts: Convert keys to snake_case. Defaults to False.

Returns: List of billing account dictionaries.

Get a specific billing account.

Args: billing_account_id: The billing account ID.

Returns: Billing account dictionary or None if not found.

Get billing info for a project.

Args: project_id: The project ID.

Returns: Billing info dictionary or None if not set.

Link a project to a billing account.

Args: project_id: The project ID. billing_account_name: Billing account name (billingAccounts/ACCOUNT_ID).

Returns: Updated billing info dictionary.

Disable billing for a project.

Args: project_id: The project ID.

Returns: Updated billing info dictionary.

List projects linked to a billing account.

Args: billing_account_id: The billing account ID. unhump_projects: Convert keys to snake_case. Defaults to False.

Returns: List of project billing info dictionaries.

Get IAM policy for a billing account.

Args: billing_account_id: The billing account ID.

Returns: IAM policy dictionary.

Set IAM policy for a billing account.

Args: billing_account_id: The billing account ID. policy: IAM policy dictionary.

Returns: Updated IAM policy dictionary.

Get BigQuery billing export dataset configuration.

Args: project_id: The project ID containing the billing dataset. dataset_id: The dataset ID. Defaults to ‘billing_export’.

Returns: Dataset configuration dict or None if not found.

Set up BigQuery billing export for a billing account.

Creates the dataset if it doesn’t exist and returns configuration.

Args: billing_account_id: The billing account ID. project_id: Project to create the export dataset in. dataset_id: Dataset ID to use. Defaults to ‘billing_export’. location: Dataset location. Defaults to ‘US’.

Returns: Configuration dict with dataset info.