airflow.providers.google.marketing_platform.hooks.search_ads

This module contains Google Search Ads 360 hook.

Classes

GoogleSearchAdsReportingHook

Hook for the Google Search Ads 360 Reporting API.

GoogleSearchAdsHook

Hook for Google Search Ads 360.

Module Contents

class airflow.providers.google.marketing_platform.hooks.search_ads.GoogleSearchAdsReportingHook(api_version=None, gcp_conn_id='google_search_ads_default', **kwargs)[source]

Bases: airflow.providers.google.common.hooks.base_google.GoogleBaseHook

Hook for the Google Search Ads 360 Reporting API.

default_api_version: str = 'v0'[source]
api_version = 'v0'[source]
get_credentials()[source]

Return the credential instance for search ads.

get_conn()[source]

Return connection for the hook.

property customer_service[source]
property fields_service[source]
search(customer_id, query, page_token=None, page_size=10000, return_total_results_count=False, summary_row_setting=None, validate_only=False)[source]

Search and download the report. Use pagination to download entire report.

Parameters:
  • customer_id (str) – The ID of the customer being queried.

  • query (str) – The query to execute.

  • page_token (str | None) – Token of the page to retrieve. If not specified, the first page of results will be returned. Use the value obtained from next_page_token in the previous response in order to request the next page of results.

  • page_size (int) – Number of elements to retrieve in a single page. When too large a page is requested, the server may decide to further limit the number of returned resources. Default is 10000.

  • return_total_results_count (bool) – If true, the total number of results that match the query ignoring the LIMIT clause will be included in the response. Default is false.

  • summary_row_setting (str | None) – Determines whether a summary row will be returned. By default, summary row is not returned. If requested, the summary row will be sent in a response by itself after all others query results are returned.

  • validate_only (bool) – If true, the request is validated but not executed. Default is false.

get_custom_column(customer_id, custom_column_id)[source]

Retrieve the requested custom column in full detail.

Parameters:
  • customer_id (str) – The customer id

  • custom_column_id (str) – The custom column id

list_custom_columns(customer_id)[source]

Retrieve all the custom columns associated with the customer in full detail.

Parameters:

customer_id (str) – The customer id

get_field(field_name)[source]

Retrieve the requested field details.

Parameters:

field_name (str) – The name of the field.

search_fields(query, page_token=None, page_size=10000)[source]

Retrieve all the fields that match with the given search.

Parameters:
  • query (str) – The query string to execute.

  • page_token (str | None) – Token of the page to retrieve. If not specified, the first page of results will be returned. Use the value obtained from next_page_token in the previous response in order to request the next page of results.

  • page_size (int | None) – Number of elements to retrieve in a single page. When too large a page is requested, the server may decide to further limit the number of returned resources. Default 10000.

class airflow.providers.google.marketing_platform.hooks.search_ads.GoogleSearchAdsHook(api_version='v2', gcp_conn_id='google_cloud_default', impersonation_chain=None, **kwargs)[source]

Bases: airflow.providers.google.common.hooks.base_google.GoogleBaseHook

Hook for Google Search Ads 360.

api_version = 'v2'[source]
get_conn()[source]

Retrieve connection to Google SearchAds.

Was this entry helpful?