blob: 9e7938f340689934054ebe304dae3c099a1b126f [file] [log] [blame]
:mod:`airflow.providers.google.marketing_platform.hooks.campaign_manager`
=========================================================================
.. py:module:: airflow.providers.google.marketing_platform.hooks.campaign_manager
.. autoapi-nested-parse::
This module contains Google Campaign Manager hook.
Module Contents
---------------
.. py:class:: GoogleCampaignManagerHook(api_version: str = 'v3.3', gcp_conn_id: str = 'google_cloud_default', delegate_to: Optional[str] = None, impersonation_chain: Optional[Union[str, Sequence[str]]] = None)
Bases: :class:`airflow.providers.google.common.hooks.base_google.GoogleBaseHook`
Hook for Google Campaign Manager.
.. attribute:: _conn
:annotation: :Optional[Resource]
.. method:: get_conn(self)
Retrieves connection to Campaign Manager.
.. method:: delete_report(self, profile_id: str, report_id: str)
Deletes a report by its ID.
:param profile_id: The DFA user profile ID.
:type profile_id: str
:param report_id: The ID of the report.
:type report_id: str
.. method:: insert_report(self, profile_id: str, report: Dict[str, Any])
Creates a report.
:param profile_id: The DFA user profile ID.
:type profile_id: str
:param report: The report resource to be inserted.
:type report: Dict[str, Any]
.. method:: list_reports(self, profile_id: str, max_results: Optional[int] = None, scope: Optional[str] = None, sort_field: Optional[str] = None, sort_order: Optional[str] = None)
Retrieves list of reports.
:param profile_id: The DFA user profile ID.
:type profile_id: str
:param max_results: Maximum number of results to return.
:type max_results: Optional[int]
:param scope: The scope that defines which results are returned.
:type scope: Optional[str]
:param sort_field: The field by which to sort the list.
:type sort_field: Optional[str]
:param sort_order: Order of sorted results.
:type sort_order: Optional[str]
.. method:: patch_report(self, profile_id: str, report_id: str, update_mask: dict)
Updates a report. This method supports patch semantics.
:param profile_id: The DFA user profile ID.
:type profile_id: str
:param report_id: The ID of the report.
:type report_id: str
:param update_mask: The relevant portions of a report resource,
according to the rules of patch semantics.
:type update_mask: Dict
.. method:: run_report(self, profile_id: str, report_id: str, synchronous: Optional[bool] = None)
Runs a report.
:param profile_id: The DFA profile ID.
:type profile_id: str
:param report_id: The ID of the report.
:type report_id: str
:param synchronous: If set and true, tries to run the report synchronously.
:type synchronous: Optional[bool]
.. method:: update_report(self, profile_id: str, report_id: str)
Updates a report.
:param profile_id: The DFA user profile ID.
:type profile_id: str
:param report_id: The ID of the report.
:type report_id: str
.. method:: get_report(self, file_id: str, profile_id: str, report_id: str)
Retrieves a report file.
:param profile_id: The DFA user profile ID.
:type profile_id: str
:param report_id: The ID of the report.
:type report_id: str
:param file_id: The ID of the report file.
:type file_id: str
.. method:: get_report_file(self, file_id: str, profile_id: str, report_id: str)
Retrieves a media part of report file.
:param profile_id: The DFA user profile ID.
:type profile_id: str
:param report_id: The ID of the report.
:type report_id: str
:param file_id: The ID of the report file.
:type file_id: str
:return: googleapiclient.http.HttpRequest
.. staticmethod:: _conversions_batch_request(conversions: List[Dict[str, Any]], encryption_entity_type: str, encryption_entity_id: int, encryption_source: str, kind: str)
.. method:: conversions_batch_insert(self, profile_id: str, conversions: List[Dict[str, Any]], encryption_entity_type: str, encryption_entity_id: int, encryption_source: str, max_failed_inserts: int = 0)
Inserts conversions.
:param profile_id: User profile ID associated with this request.
:type profile_id: str
:param conversions: Conversations to insert, should by type of Conversation:
https://developers.google.com/doubleclick-advertisers/v3.3/conversions#resource
:type conversions: List[Dict[str, Any]]
:param encryption_entity_type: The encryption entity type. This should match the encryption
configuration for ad serving or Data Transfer.
:type encryption_entity_type: str
:param encryption_entity_id: The encryption entity ID. This should match the encryption
configuration for ad serving or Data Transfer.
:type encryption_entity_id: int
:param encryption_source: Describes whether the encrypted cookie was received from ad serving
(the %m macro) or from Data Transfer.
:type encryption_source: str
:param max_failed_inserts: The maximum number of conversions that failed to be inserted
:type max_failed_inserts: int
.. method:: conversions_batch_update(self, profile_id: str, conversions: List[Dict[str, Any]], encryption_entity_type: str, encryption_entity_id: int, encryption_source: str, max_failed_updates: int = 0)
Updates existing conversions.
:param profile_id: User profile ID associated with this request.
:type profile_id: str
:param conversions: Conversations to update, should by type of Conversation:
https://developers.google.com/doubleclick-advertisers/v3.3/conversions#resource
:type conversions: List[Dict[str, Any]]
:param encryption_entity_type: The encryption entity type. This should match the encryption
configuration for ad serving or Data Transfer.
:type encryption_entity_type: str
:param encryption_entity_id: The encryption entity ID. This should match the encryption
configuration for ad serving or Data Transfer.
:type encryption_entity_id: int
:param encryption_source: Describes whether the encrypted cookie was received from ad serving
(the %m macro) or from Data Transfer.
:type encryption_source: str
:param max_failed_updates: The maximum number of conversions that failed to be updated
:type max_failed_updates: int