Skip to content

Commit

Permalink
Adjusts SSI metadata order
Browse files Browse the repository at this point in the history
  • Loading branch information
Mr-Lopes committed Nov 7, 2023
1 parent 80b5820 commit 9a6b2ca
Showing 1 changed file with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -128,38 +128,38 @@ def _do_upload(self, execution, offline_user_data_job_service, customer_id, curr
# 3. Runs the Job
offline_user_data_job_service.run_offline_user_data_job(resource_name = job_resource_name)

def _get_customer_id(self, account_config: AccountConfig, destination: Destination) -> str:
"""
If the customer_id is present on the destination, returns it, otherwise defaults to the account_config info.
"""
if len(destination.destination_metadata) >= 2 and len(destination.destination_metadata[1]) > 0:
return Utils.filter_text_only_numbers(destination.destination_metadata[1])
return account_config.google_ads_account_id

def _get_currency_code(self, destination: Destination) -> str:
"""
If the currency_code is present on the destination, return it, otherwise default to BRL.
"""
if len(destination.destination_metadata) >= 5 and len(destination.destination_metadata[3]) > 0:
return destination.destination_metadata[3]
return 'BRL'

def _get_customer_id(self, account_config: AccountConfig, destination: Destination) -> str:
"""
If the customer_id is present on the destination, returns it, otherwise defaults to the account_config info.
"""
if len(destination.destination_metadata) >= 5 and len(destination.destination_metadata[4]) > 0:
return Utils.filter_text_only_numbers(destination.destination_metadata[4])
return account_config.google_ads_account_id

def _get_user_data_consent(self, account_config: AccountConfig, destination: Destination) -> Optional[str]:
"""
Specifies whether user consent was obtained for the data you are uploading.
https://www.google.com/about/company/user-consent-policy
"""
if len(destination.destination_metadata) >= 6 and len(destination.destination_metadata[5]) > 0:
return destination.destination_metadata[5]
if len(destination.destination_metadata) >= 5 and len(destination.destination_metadata[4]) > 0:
return destination.destination_metadata[4]
return None

def _get_ad_personalization_consent(self, account_config: AccountConfig, destination: Destination) -> Optional[str]:
"""
Specifies whether user consent was obtained for the data you are uploading.
https://www.google.com/about/company/user-consent-policy
"""
if len(destination.destination_metadata) >= 6 and len(destination.destination_metadata[6]) > 0:
return destination.destination_metadata[6]
if len(destination.destination_metadata) >= 6 and len(destination.destination_metadata[5]) > 0:
return destination.destination_metadata[5]
return None

def _get_login_customer_id(self, account_config: AccountConfig, destination: Destination) -> str:
Expand Down

0 comments on commit 9a6b2ca

Please sign in to comment.