airflow.providers.google.marketing_platform.operators.bid_manager

This module contains operators for Bid Manager API part of the Google Display & Video 360.

Classes

GoogleBidManagerCreateQueryOperator

Creates a query.

GoogleBidManagerRunQueryOperator

Runs a stored query to generate a report.

GoogleBidManagerDeleteQueryOperator

Deletes a stored query as well as the associated stored reports.

GoogleBidManagerDownloadReportOperator

Retrieves a stored query.

Module Contents

class airflow.providers.google.marketing_platform.operators.bid_manager.GoogleBidManagerCreateQueryOperator(*, body, api_version='v2', gcp_conn_id='google_cloud_default', impersonation_chain=None, **kwargs)[source]

Bases: airflow.providers.google.version_compat.BaseOperator

Creates a query.

See also

For more information on how to use this operator, take a look at the guide: Creating a Query

See also

Check also the official API docs: https://developers.google.com/bid-manager/v2/queries/create

Parameters:
  • body (dict[str, Any]) – Report object passed to the request’s body as described here: https://developers.google.com/bid-manager/v2/queries#Query

  • api_version (str) – The version of the api that will be requested for example ‘v3’.

  • gcp_conn_id (str) – The connection ID to use when fetching connection info.

  • impersonation_chain (str | collections.abc.Sequence[str] | None) – Optional service account to impersonate using short-term credentials, or chained list of accounts required to get the access_token of the last account in the list, which will be impersonated in the request. If set as a string, the account must grant the originating account the Service Account Token Creator IAM role. If set as a sequence, the identities from the list must grant Service Account Token Creator IAM role to the directly preceding identity, with the first account from the list granting this role to the originating account (templated).

template_fields: collections.abc.Sequence[str] = ('body', 'impersonation_chain')[source]
template_ext: collections.abc.Sequence[str] = ('.json',)[source]
body[source]
api_version = 'v2'[source]
gcp_conn_id = 'google_cloud_default'[source]
impersonation_chain = None[source]
prepare_template()[source]

Execute after the templated fields get replaced by their content.

If you need your object to alter the content of the file before the template is rendered, it should override this method to do so.

execute(context)[source]

Derive when creating an operator.

The main method to execute the task. Context is the same dictionary used as when rendering jinja templates.

Refer to get_template_context for more context.

class airflow.providers.google.marketing_platform.operators.bid_manager.GoogleBidManagerRunQueryOperator(*, query_id, parameters=None, api_version='v2', gcp_conn_id='google_cloud_default', impersonation_chain=None, **kwargs)[source]

Bases: airflow.providers.google.version_compat.BaseOperator

Runs a stored query to generate a report.

See also

For more information on how to use this operator, take a look at the guide: Run Query

See also

Check also the official API docs: https://developers.google.com/bid-manager/v2/queries/run

Parameters:
  • query_id (str) – Query ID to run.

  • parameters (dict[str, Any] | None) – Parameters for running a report as described here: https://developers.google.com/bid-manager/v2/queries/run

  • api_version (str) – The version of the api that will be requested for example ‘v3’.

  • gcp_conn_id (str) – The connection ID to use when fetching connection info.

  • impersonation_chain (str | collections.abc.Sequence[str] | None) – Optional service account to impersonate using short-term credentials, or chained list of accounts required to get the access_token of the last account in the list, which will be impersonated in the request. If set as a string, the account must grant the originating account the Service Account Token Creator IAM role. If set as a sequence, the identities from the list must grant Service Account Token Creator IAM role to the directly preceding identity, with first account from the list granting this role to the originating account (templated).

template_fields: collections.abc.Sequence[str] = ('query_id', 'parameters', 'impersonation_chain')[source]
query_id[source]
api_version = 'v2'[source]
gcp_conn_id = 'google_cloud_default'[source]
parameters = None[source]
impersonation_chain = None[source]
execute(context)[source]

Derive when creating an operator.

The main method to execute the task. Context is the same dictionary used as when rendering jinja templates.

Refer to get_template_context for more context.

class airflow.providers.google.marketing_platform.operators.bid_manager.GoogleBidManagerDeleteQueryOperator(*, query_id, api_version='v2', gcp_conn_id='google_cloud_default', impersonation_chain=None, **kwargs)[source]

Bases: airflow.providers.google.version_compat.BaseOperator

Deletes a stored query as well as the associated stored reports.

See also

For more information on how to use this operator, take a look at the guide: Deleting a Query

See also

Check also the official API docs: https://developers.google.com/bid-manager/v2/queries/delete

Parameters:
  • query_id (str) – Query ID to delete.

  • api_version (str) – The version of the api that will be requested for example ‘v3’.

  • gcp_conn_id (str) – The connection ID to use when fetching connection info.

  • impersonation_chain (str | collections.abc.Sequence[str] | None) – Optional service account to impersonate using short-term credentials, or chained list of accounts required to get the access_token of the last account in the list, which will be impersonated in the request. If set as a string, the account must grant the originating account the Service Account Token Creator IAM role. If set as a sequence, the identities from the list must grant Service Account Token Creator IAM role to the directly preceding identity, with first account from the list granting this role to the originating account (templated).

template_fields: collections.abc.Sequence[str] = ('query_id', 'impersonation_chain')[source]
api_version = 'v2'[source]
gcp_conn_id = 'google_cloud_default'[source]
impersonation_chain = None[source]
query_id[source]
execute(context)[source]

Derive when creating an operator.

The main method to execute the task. Context is the same dictionary used as when rendering jinja templates.

Refer to get_template_context for more context.

class airflow.providers.google.marketing_platform.operators.bid_manager.GoogleBidManagerDownloadReportOperator(*, query_id, report_id, bucket_name, report_name=None, gzip=True, chunk_size=10 * 1024 * 1024, api_version='v2', gcp_conn_id='google_cloud_default', impersonation_chain=None, **kwargs)[source]

Bases: airflow.providers.google.version_compat.BaseOperator

Retrieves a stored query.

See also

For more information on how to use this operator, take a look at the guide: Downloading a report

See also

Check also the official API docs: https://developers.google.com/bid-manager/v2/queries/get

Parameters:
  • report_id (str) – Report ID to retrieve.

  • query_id (str) – Query ID for which report was generated..

  • bucket_name (str) – The bucket to upload to.

  • report_name (str | None) – The report name to set when uploading the local file.

  • chunk_size (int) – File will be downloaded in chunks of this many bytes.

  • gzip (bool) – Option to compress local file or file data for upload

  • api_version (str) – The version of the api that will be requested for example ‘v3’.

  • gcp_conn_id (str) – The connection ID to use when fetching connection info.

  • impersonation_chain (str | collections.abc.Sequence[str] | None) – Optional service account to impersonate using short-term credentials, or chained list of accounts required to get the access_token of the last account in the list, which will be impersonated in the request. If set as a string, the account must grant the originating account the Service Account Token Creator IAM role. If set as a sequence, the identities from the list must grant Service Account Token Creator IAM role to the directly preceding identity, with first account from the list granting this role to the originating account (templated).

template_fields: collections.abc.Sequence[str] = ('query_id', 'report_id', 'bucket_name', 'report_name', 'impersonation_chain')[source]
query_id[source]
report_id[source]
chunk_size = 10485760[source]
gzip = True[source]
bucket_name[source]
report_name = None[source]
api_version = 'v2'[source]
gcp_conn_id = 'google_cloud_default'[source]
impersonation_chain = None[source]
execute(context)[source]

Derive when creating an operator.

The main method to execute the task. Context is the same dictionary used as when rendering jinja templates.

Refer to get_template_context for more context.

Was this entry helpful?