airflow.providers.google.marketing_platform.operators.search_ads

This module contains Google Search Ads operators.

Module Contents

Classes

GoogleSearchAdsInsertReportOperator

Inserts a report request into the reporting system.

GoogleSearchAdsDownloadReportOperator

Downloads a report to GCS bucket.

class airflow.providers.google.marketing_platform.operators.search_ads.GoogleSearchAdsInsertReportOperator(*, report, api_version='v2', gcp_conn_id='google_cloud_default', delegate_to=None, impersonation_chain=None, **kwargs)[source]

Bases: airflow.models.BaseOperator

Inserts a report request into the reporting system.

See also

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

Parameters
  • report (dict[str, Any]) – Report to be generated

  • 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.

  • delegate_to (str | None) – The account to impersonate using domain-wide delegation of authority, if any. For this to work, the service account making the request must have domain-wide delegation enabled.

  • impersonation_chain (str | 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 :Sequence[str] = ['report', 'impersonation_chain'][source]
template_ext :Sequence[str] = ['.json'][source]
prepare_template()[source]

Hook triggered 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]

This is the main method to derive when creating an operator. 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.search_ads.GoogleSearchAdsDownloadReportOperator(*, report_id, bucket_name, report_name=None, gzip=True, chunk_size=10 * 1024 * 1024, api_version='v2', gcp_conn_id='google_cloud_default', delegate_to=None, impersonation_chain=None, **kwargs)[source]

Bases: airflow.models.BaseOperator

Downloads a report to GCS bucket.

See also

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

Parameters
  • report_id (str) – ID of the report.

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

  • report_name (str | None) – The report name to set when uploading the local file. If not provided then report_id is used.

  • 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.

  • delegate_to (str | None) – The account to impersonate using domain-wide delegation of authority, if any. For this to work, the service account making the request must have domain-wide delegation enabled.

  • impersonation_chain (str | 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 :Sequence[str] = ['report_name', 'report_id', 'bucket_name', 'impersonation_chain'][source]
execute(context)[source]

This is the main method to derive when creating an operator. Context is the same dictionary used as when rendering jinja templates.

Refer to get_template_context for more context.

Was this entry helpful?