airflow.providers.google.marketing_platform.operators.campaign_manager

This module contains Google CampaignManager operators.

Module Contents

Classes

GoogleCampaignManagerDeleteReportOperator

Deletes a report by its ID.

GoogleCampaignManagerDownloadReportOperator

Retrieves a report and uploads it to GCS bucket.

GoogleCampaignManagerInsertReportOperator

Creates a report.

GoogleCampaignManagerRunReportOperator

Runs a report.

GoogleCampaignManagerBatchInsertConversionsOperator

Inserts conversions.

GoogleCampaignManagerBatchUpdateConversionsOperator

Updates existing conversions.

class airflow.providers.google.marketing_platform.operators.campaign_manager.GoogleCampaignManagerDeleteReportOperator(*, profile_id, report_name=None, report_id=None, api_version='v4', gcp_conn_id='google_cloud_default', delegate_to=None, impersonation_chain=None, **kwargs)[source]

Bases: airflow.models.BaseOperator

Deletes a report by its ID.

See also

Check official API docs: https://developers.google.com/doubleclick-advertisers/rest/v4/reports/delete

See also

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

Parameters
  • profile_id (str) – The DFA user profile ID.

  • report_name (str | None) – The name of the report to delete.

  • report_id (str | None) – The ID of the report.

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

  • 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] = ('profile_id', 'report_id', 'report_name', 'api_version', 'gcp_conn_id', 'delegate_to',...[source]
execute(context)[source]

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.campaign_manager.GoogleCampaignManagerDownloadReportOperator(*, profile_id, report_id, file_id, bucket_name, report_name=None, gzip=True, chunk_size=10 * 1024 * 1024, api_version='v4', gcp_conn_id='google_cloud_default', delegate_to=None, impersonation_chain=None, **kwargs)[source]

Bases: airflow.models.BaseOperator

Retrieves a report and uploads it to GCS bucket.

See also

Check official API docs: https://developers.google.com/doubleclick-advertisers/rest/v4/reports/get

See also

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

Parameters
  • profile_id (str) – The DFA user profile ID.

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

  • file_id (str) – The ID of the report file.

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

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

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

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

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

  • 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] = ('profile_id', 'report_id', 'file_id', 'bucket_name', 'report_name', 'chunk_size',...[source]
execute(context)[source]

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.campaign_manager.GoogleCampaignManagerInsertReportOperator(*, profile_id, report, api_version='v4', gcp_conn_id='google_cloud_default', delegate_to=None, impersonation_chain=None, **kwargs)[source]

Bases: airflow.models.BaseOperator

Creates a report.

See also

Check official API docs: https://developers.google.com/doubleclick-advertisers/rest/v4/reports/insert

See also

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

Parameters
  • profile_id (str) – The DFA user profile ID.

  • report (dict[str, Any]) – Report to be created.

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

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

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.campaign_manager.GoogleCampaignManagerRunReportOperator(*, profile_id, report_id, synchronous=False, api_version='v4', gcp_conn_id='google_cloud_default', delegate_to=None, impersonation_chain=None, **kwargs)[source]

Bases: airflow.models.BaseOperator

Runs a report.

See also

Check official API docs: https://developers.google.com/doubleclick-advertisers/rest/v4/reports/run

See also

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

Parameters
  • profile_id (str) – The DFA profile ID.

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

  • synchronous (bool) – If set and true, tries to run the report synchronously.

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

  • 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] = ('profile_id', 'report_id', 'synchronous', 'api_version', 'gcp_conn_id', 'delegate_to',...[source]
execute(context)[source]

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.campaign_manager.GoogleCampaignManagerBatchInsertConversionsOperator(*, profile_id, conversions, encryption_entity_type, encryption_entity_id, encryption_source, max_failed_inserts=0, api_version='v4', gcp_conn_id='google_cloud_default', delegate_to=None, impersonation_chain=None, **kwargs)[source]

Bases: airflow.models.BaseOperator

Inserts conversions.

See also

Check official API docs: https://developers.google.com/doubleclick-advertisers/rest/v4/conversions/batchinsert

See also

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

Parameters
  • profile_id (str) – User profile ID associated with this request.

  • conversions (list[dict[str, Any]]) – Conversions to insert, should be type of Conversion: https://developers.google.com/doubleclick-advertisers/rest/v4/conversions

  • encryption_entity_type (str) – The encryption entity type. This should match the encryption configuration for ad serving or Data Transfer.

  • encryption_entity_id (int) – The encryption entity ID. This should match the encryption configuration for ad serving or Data Transfer.

  • encryption_source (str) – Describes whether the encrypted cookie was received from ad serving (the %m macro) or from Data Transfer.

  • max_failed_inserts (int) – The maximum number of conversions that failed to be inserted

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

  • 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] = ('profile_id', 'conversions', 'encryption_entity_type', 'encryption_entity_id',...[source]
execute(context)[source]

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.campaign_manager.GoogleCampaignManagerBatchUpdateConversionsOperator(*, profile_id, conversions, encryption_entity_type, encryption_entity_id, encryption_source, max_failed_updates=0, api_version='v4', gcp_conn_id='google_cloud_default', delegate_to=None, impersonation_chain=None, **kwargs)[source]

Bases: airflow.models.BaseOperator

Updates existing conversions.

See also

Check official API docs: https://developers.google.com/doubleclick-advertisers/rest/v4/conversions/batchupdate

See also

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

Parameters
  • profile_id (str) – User profile ID associated with this request.

  • conversions (list[dict[str, Any]]) – Conversations to update, should be type of Conversion: https://developers.google.com/doubleclick-advertisers/rest/v4/conversions

  • encryption_entity_type (str) – The encryption entity type. This should match the encryption configuration for ad serving or Data Transfer.

  • encryption_entity_id (int) – The encryption entity ID. This should match the encryption configuration for ad serving or Data Transfer.

  • encryption_source (str) – Describes whether the encrypted cookie was received from ad serving (the %m macro) or from Data Transfer.

  • max_failed_updates (int) – The maximum number of conversions that failed to be updated

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

  • 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] = ('profile_id', 'conversions', 'encryption_entity_type', 'encryption_entity_id',...[source]
execute(context)[source]

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?