1
0
mirror of synced 2026-01-25 19:02:00 -05:00
Files
airbyte/airbyte-integrations/connectors/source-google-ads/source_google_ads/models.py
Cole Snodgrass 2e099acc52 update headers from 2022 -> 2023 (#22594)
* It's 2023!

* 2022 -> 2023

---------

Co-authored-by: evantahler <evan@airbyte.io>
2023-02-08 13:01:16 -08:00

30 lines
898 B
Python

#
# Copyright (c) 2023 Airbyte, Inc., all rights reserved.
#
from dataclasses import dataclass
from typing import Any, Iterable, Mapping, Union
from pendulum import timezone
from pendulum.tz.timezone import Timezone
@dataclass
class Customer:
id: str
time_zone: Union[timezone, str] = "local"
is_manager_account: bool = False
@classmethod
def from_accounts(cls, accounts: Iterable[Iterable[Mapping[str, Any]]]):
data_objects = []
for account_list in accounts:
for account in account_list:
time_zone_name = account.get("customer.time_zone")
tz = Timezone(time_zone_name) if time_zone_name else "local"
data_objects.append(
cls(id=str(account["customer.id"]), time_zone=tz, is_manager_account=bool(account.get("customer.manager")))
)
return data_objects