diff --git a/pyproject.toml b/pyproject.toml index 7d76970..027fa0d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "mercoa" -version = "v0.3.38" +version = "v0.3.39" description = "" readme = "README.md" authors = [] diff --git a/src/mercoa/core/client_wrapper.py b/src/mercoa/core/client_wrapper.py index 746a1fe..a3c4c67 100644 --- a/src/mercoa/core/client_wrapper.py +++ b/src/mercoa/core/client_wrapper.py @@ -23,7 +23,7 @@ def get_headers(self) -> typing.Dict[str, str]: headers: typing.Dict[str, str] = { "X-Fern-Language": "Python", "X-Fern-SDK-Name": "mercoa", - "X-Fern-SDK-Version": "v0.3.38", + "X-Fern-SDK-Version": "v0.3.39", } headers["Authorization"] = f"Bearer {self._get_token()}" return headers diff --git a/src/mercoa/entity/__init__.py b/src/mercoa/entity/__init__.py index 58e1340..2356eeb 100644 --- a/src/mercoa/entity/__init__.py +++ b/src/mercoa/entity/__init__.py @@ -21,6 +21,7 @@ ExternalAccountingSystemCompanyCreationRequest_Rutter, ExternalAccountingSystemCompanyResponse, ExternalAccountingSystemCompanyResponse_Codat, + ExternalAccountingSystemCompanyResponse_None, ExternalAccountingSystemCompanyResponse_Rutter, RutterCompanyCreationRequest, RutterCompanyResponse, @@ -35,6 +36,7 @@ "ExternalAccountingSystemCompanyCreationRequest_Rutter", "ExternalAccountingSystemCompanyResponse", "ExternalAccountingSystemCompanyResponse_Codat", + "ExternalAccountingSystemCompanyResponse_None", "ExternalAccountingSystemCompanyResponse_Rutter", "RutterCompanyCreationRequest", "RutterCompanyResponse", diff --git a/src/mercoa/entity/external_accounting_system/__init__.py b/src/mercoa/entity/external_accounting_system/__init__.py index 230247d..5155dd5 100644 --- a/src/mercoa/entity/external_accounting_system/__init__.py +++ b/src/mercoa/entity/external_accounting_system/__init__.py @@ -8,6 +8,7 @@ ExternalAccountingSystemCompanyCreationRequest_Rutter, ExternalAccountingSystemCompanyResponse, ExternalAccountingSystemCompanyResponse_Codat, + ExternalAccountingSystemCompanyResponse_None, ExternalAccountingSystemCompanyResponse_Rutter, RutterCompanyCreationRequest, RutterCompanyResponse, @@ -22,6 +23,7 @@ "ExternalAccountingSystemCompanyCreationRequest_Rutter", "ExternalAccountingSystemCompanyResponse", "ExternalAccountingSystemCompanyResponse_Codat", + "ExternalAccountingSystemCompanyResponse_None", "ExternalAccountingSystemCompanyResponse_Rutter", "RutterCompanyCreationRequest", "RutterCompanyResponse", diff --git a/src/mercoa/entity/external_accounting_system/client.py b/src/mercoa/entity/external_accounting_system/client.py index 6bb948f..111506c 100644 --- a/src/mercoa/entity/external_accounting_system/client.py +++ b/src/mercoa/entity/external_accounting_system/client.py @@ -28,6 +28,62 @@ class ExternalAccountingSystemClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper + def get( + self, entity_id: EntityId, *, request_options: typing.Optional[RequestOptions] = None + ) -> ExternalAccountingSystemCompanyResponse: + """ + Get the external accounting system connected to an entity + + Parameters + ---------- + entity_id : EntityId + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + ExternalAccountingSystemCompanyResponse + + Examples + -------- + from mercoa.client import Mercoa + + client = Mercoa( + token="YOUR_TOKEN", + ) + client.entity.external_accounting_system.get( + entity_id="ent_8545a84e-a45f-41bf-bdf1-33b42a55812c", + ) + """ + _response = self._client_wrapper.httpx_client.request( + f"entity/{jsonable_encoder(entity_id)}/external-accounting-system", + method="GET", + request_options=request_options, + ) + try: + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(ExternalAccountingSystemCompanyResponse, _response_json) # type: ignore + if "errorName" in _response_json: + if _response_json["errorName"] == "BadRequest": + raise BadRequest(pydantic_v1.parse_obj_as(str, _response_json["content"])) # type: ignore + if _response_json["errorName"] == "Unauthorized": + raise Unauthorized(pydantic_v1.parse_obj_as(str, _response_json["content"])) # type: ignore + if _response_json["errorName"] == "Forbidden": + raise Forbidden(pydantic_v1.parse_obj_as(str, _response_json["content"])) # type: ignore + if _response_json["errorName"] == "NotFound": + raise NotFound(pydantic_v1.parse_obj_as(str, _response_json["content"])) # type: ignore + if _response_json["errorName"] == "Conflict": + raise Conflict(pydantic_v1.parse_obj_as(str, _response_json["content"])) # type: ignore + if _response_json["errorName"] == "InternalServerError": + raise InternalServerError(pydantic_v1.parse_obj_as(str, _response_json["content"])) # type: ignore + if _response_json["errorName"] == "Unimplemented": + raise Unimplemented(pydantic_v1.parse_obj_as(str, _response_json["content"])) # type: ignore + raise ApiError(status_code=_response.status_code, body=_response_json) + def create( self, entity_id: EntityId, @@ -36,7 +92,7 @@ def create( request_options: typing.Optional[RequestOptions] = None, ) -> ExternalAccountingSystemCompanyResponse: """ - Create/Link an entity to an external accounting system like Codat or Rutter + Create/Link an entity to an external accounting system like Codat or Rutter. If the entity is already linked to an external accounting system, this will return the existing connection. Parameters ---------- @@ -170,7 +226,7 @@ def sync( Sync vendors from external accounting system. Default is to pull vendors from external system. bills : typing.Optional[SyncType] - Sync bills from external accounting system. Default is to not sync bills. + Sync bills from external accounting system. Default is to not sync bills. Invoices that already exist in both systems will not be updated, only new invoices not present in the other system will be created. gl_accounts : typing.Optional[SyncType] Sync GL accounts from external accounting system. Default is to pull GL accounts from external system. Pushing GL accounts is not supported. @@ -230,6 +286,62 @@ class AsyncExternalAccountingSystemClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper + async def get( + self, entity_id: EntityId, *, request_options: typing.Optional[RequestOptions] = None + ) -> ExternalAccountingSystemCompanyResponse: + """ + Get the external accounting system connected to an entity + + Parameters + ---------- + entity_id : EntityId + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + ExternalAccountingSystemCompanyResponse + + Examples + -------- + from mercoa.client import AsyncMercoa + + client = AsyncMercoa( + token="YOUR_TOKEN", + ) + await client.entity.external_accounting_system.get( + entity_id="ent_8545a84e-a45f-41bf-bdf1-33b42a55812c", + ) + """ + _response = await self._client_wrapper.httpx_client.request( + f"entity/{jsonable_encoder(entity_id)}/external-accounting-system", + method="GET", + request_options=request_options, + ) + try: + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(ExternalAccountingSystemCompanyResponse, _response_json) # type: ignore + if "errorName" in _response_json: + if _response_json["errorName"] == "BadRequest": + raise BadRequest(pydantic_v1.parse_obj_as(str, _response_json["content"])) # type: ignore + if _response_json["errorName"] == "Unauthorized": + raise Unauthorized(pydantic_v1.parse_obj_as(str, _response_json["content"])) # type: ignore + if _response_json["errorName"] == "Forbidden": + raise Forbidden(pydantic_v1.parse_obj_as(str, _response_json["content"])) # type: ignore + if _response_json["errorName"] == "NotFound": + raise NotFound(pydantic_v1.parse_obj_as(str, _response_json["content"])) # type: ignore + if _response_json["errorName"] == "Conflict": + raise Conflict(pydantic_v1.parse_obj_as(str, _response_json["content"])) # type: ignore + if _response_json["errorName"] == "InternalServerError": + raise InternalServerError(pydantic_v1.parse_obj_as(str, _response_json["content"])) # type: ignore + if _response_json["errorName"] == "Unimplemented": + raise Unimplemented(pydantic_v1.parse_obj_as(str, _response_json["content"])) # type: ignore + raise ApiError(status_code=_response.status_code, body=_response_json) + async def create( self, entity_id: EntityId, @@ -238,7 +350,7 @@ async def create( request_options: typing.Optional[RequestOptions] = None, ) -> ExternalAccountingSystemCompanyResponse: """ - Create/Link an entity to an external accounting system like Codat or Rutter + Create/Link an entity to an external accounting system like Codat or Rutter. If the entity is already linked to an external accounting system, this will return the existing connection. Parameters ---------- @@ -372,7 +484,7 @@ async def sync( Sync vendors from external accounting system. Default is to pull vendors from external system. bills : typing.Optional[SyncType] - Sync bills from external accounting system. Default is to not sync bills. + Sync bills from external accounting system. Default is to not sync bills. Invoices that already exist in both systems will not be updated, only new invoices not present in the other system will be created. gl_accounts : typing.Optional[SyncType] Sync GL accounts from external accounting system. Default is to pull GL accounts from external system. Pushing GL accounts is not supported. diff --git a/src/mercoa/entity/external_accounting_system/types/__init__.py b/src/mercoa/entity/external_accounting_system/types/__init__.py index 63e8c4c..e0313df 100644 --- a/src/mercoa/entity/external_accounting_system/types/__init__.py +++ b/src/mercoa/entity/external_accounting_system/types/__init__.py @@ -10,6 +10,7 @@ from .external_accounting_system_company_response import ( ExternalAccountingSystemCompanyResponse, ExternalAccountingSystemCompanyResponse_Codat, + ExternalAccountingSystemCompanyResponse_None, ExternalAccountingSystemCompanyResponse_Rutter, ) from .rutter_company_creation_request import RutterCompanyCreationRequest @@ -24,6 +25,7 @@ "ExternalAccountingSystemCompanyCreationRequest_Rutter", "ExternalAccountingSystemCompanyResponse", "ExternalAccountingSystemCompanyResponse_Codat", + "ExternalAccountingSystemCompanyResponse_None", "ExternalAccountingSystemCompanyResponse_Rutter", "RutterCompanyCreationRequest", "RutterCompanyResponse", diff --git a/src/mercoa/entity/external_accounting_system/types/external_accounting_system_company_response.py b/src/mercoa/entity/external_accounting_system/types/external_accounting_system_company_response.py index 60e2ccc..5a302d2 100644 --- a/src/mercoa/entity/external_accounting_system/types/external_accounting_system_company_response.py +++ b/src/mercoa/entity/external_accounting_system/types/external_accounting_system_company_response.py @@ -59,6 +59,33 @@ class Config: json_encoders = {dt.datetime: serialize_datetime} +class ExternalAccountingSystemCompanyResponse_None(pydantic_v1.BaseModel): + company_id: str = pydantic_v1.Field(alias="companyId") + type: typing.Literal["none"] = "none" + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs} + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs} + kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs} + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none) + ) + + class Config: + frozen = True + smart_union = True + allow_population_by_field_name = True + populate_by_name = True + extra = pydantic_v1.Extra.allow + json_encoders = {dt.datetime: serialize_datetime} + + ExternalAccountingSystemCompanyResponse = typing.Union[ - ExternalAccountingSystemCompanyResponse_Codat, ExternalAccountingSystemCompanyResponse_Rutter + ExternalAccountingSystemCompanyResponse_Codat, + ExternalAccountingSystemCompanyResponse_Rutter, + ExternalAccountingSystemCompanyResponse_None, ] diff --git a/src/mercoa/payment_method_types/types/payment_method_base_request.py b/src/mercoa/payment_method_types/types/payment_method_base_request.py index ee52c8e..e4c4f79 100644 --- a/src/mercoa/payment_method_types/types/payment_method_base_request.py +++ b/src/mercoa/payment_method_types/types/payment_method_base_request.py @@ -18,6 +18,13 @@ class PaymentMethodBaseRequest(pydantic_v1.BaseModel): If true, this payment method will be set as the default destination. Only one payment method can be set as the default destination. If another payment method is already set as the default destination, it will be unset. """ + external_accounting_system_id: typing.Optional[str] = pydantic_v1.Field( + alias="externalAccountingSystemId", default=None + ) + """ + ID for this payment method in the external accounting system (e.g Rutter or Codat) + """ + def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs} return super().json(**kwargs_with_defaults) diff --git a/src/mercoa/payment_method_types/types/payment_method_base_response.py b/src/mercoa/payment_method_types/types/payment_method_base_response.py index a053ada..09cb152 100644 --- a/src/mercoa/payment_method_types/types/payment_method_base_response.py +++ b/src/mercoa/payment_method_types/types/payment_method_base_response.py @@ -22,6 +22,13 @@ class PaymentMethodBaseResponse(pydantic_v1.BaseModel): """ supported_currencies: typing.List[CurrencyCode] = pydantic_v1.Field(alias="supportedCurrencies") + external_accounting_system_id: typing.Optional[str] = pydantic_v1.Field( + alias="externalAccountingSystemId", default=None + ) + """ + ID for this payment method in the external accounting system (e.g Rutter or Codat) + """ + created_at: dt.datetime = pydantic_v1.Field(alias="createdAt") updated_at: dt.datetime = pydantic_v1.Field(alias="updatedAt") diff --git a/src/mercoa/payment_method_types/types/payment_method_request.py b/src/mercoa/payment_method_types/types/payment_method_request.py index cf70489..b706103 100644 --- a/src/mercoa/payment_method_types/types/payment_method_request.py +++ b/src/mercoa/payment_method_types/types/payment_method_request.py @@ -37,6 +37,9 @@ class PaymentMethodRequest_BankAccount(pydantic_v1.BaseModel): check_options: typing.Optional[BankAccountCheckOptions] = pydantic_v1.Field(alias="checkOptions", default=None) default_source: typing.Optional[bool] = pydantic_v1.Field(alias="defaultSource", default=None) default_destination: typing.Optional[bool] = pydantic_v1.Field(alias="defaultDestination", default=None) + external_accounting_system_id: typing.Optional[str] = pydantic_v1.Field( + alias="externalAccountingSystemId", default=None + ) type: typing.Literal["bankAccount"] = "bankAccount" def json(self, **kwargs: typing.Any) -> str: @@ -81,6 +84,9 @@ class PaymentMethodRequest_Card(pydantic_v1.BaseModel): token: str default_source: typing.Optional[bool] = pydantic_v1.Field(alias="defaultSource", default=None) default_destination: typing.Optional[bool] = pydantic_v1.Field(alias="defaultDestination", default=None) + external_accounting_system_id: typing.Optional[str] = pydantic_v1.Field( + alias="externalAccountingSystemId", default=None + ) type: typing.Literal["card"] = "card" def json(self, **kwargs: typing.Any) -> str: @@ -126,6 +132,9 @@ class PaymentMethodRequest_Check(pydantic_v1.BaseModel): country: str default_source: typing.Optional[bool] = pydantic_v1.Field(alias="defaultSource", default=None) default_destination: typing.Optional[bool] = pydantic_v1.Field(alias="defaultDestination", default=None) + external_accounting_system_id: typing.Optional[str] = pydantic_v1.Field( + alias="externalAccountingSystemId", default=None + ) type: typing.Literal["check"] = "check" def json(self, **kwargs: typing.Any) -> str: @@ -169,6 +178,9 @@ class PaymentMethodRequest_Custom(pydantic_v1.BaseModel): data: typing.Dict[str, str] default_source: typing.Optional[bool] = pydantic_v1.Field(alias="defaultSource", default=None) default_destination: typing.Optional[bool] = pydantic_v1.Field(alias="defaultDestination", default=None) + external_accounting_system_id: typing.Optional[str] = pydantic_v1.Field( + alias="externalAccountingSystemId", default=None + ) type: typing.Literal["custom"] = "custom" def json(self, **kwargs: typing.Any) -> str: @@ -207,6 +219,9 @@ class PaymentMethodRequest_OffPlatform(pydantic_v1.BaseModel): default_source: typing.Optional[bool] = pydantic_v1.Field(alias="defaultSource", default=None) default_destination: typing.Optional[bool] = pydantic_v1.Field(alias="defaultDestination", default=None) + external_accounting_system_id: typing.Optional[str] = pydantic_v1.Field( + alias="externalAccountingSystemId", default=None + ) type: typing.Literal["offPlatform"] = "offPlatform" def json(self, **kwargs: typing.Any) -> str: diff --git a/src/mercoa/payment_method_types/types/payment_method_response.py b/src/mercoa/payment_method_types/types/payment_method_response.py index 0937d1b..f825aa4 100644 --- a/src/mercoa/payment_method_types/types/payment_method_response.py +++ b/src/mercoa/payment_method_types/types/payment_method_response.py @@ -57,6 +57,9 @@ class PaymentMethodResponse_BankAccount(pydantic_v1.BaseModel): is_default_source: bool = pydantic_v1.Field(alias="isDefaultSource") is_default_destination: bool = pydantic_v1.Field(alias="isDefaultDestination") supported_currencies: typing.List[CurrencyCode] = pydantic_v1.Field(alias="supportedCurrencies") + external_accounting_system_id: typing.Optional[str] = pydantic_v1.Field( + alias="externalAccountingSystemId", default=None + ) created_at: dt.datetime = pydantic_v1.Field(alias="createdAt") updated_at: dt.datetime = pydantic_v1.Field(alias="updatedAt") type: typing.Literal["bankAccount"] = "bankAccount" @@ -119,6 +122,9 @@ class PaymentMethodResponse_Card(pydantic_v1.BaseModel): is_default_source: bool = pydantic_v1.Field(alias="isDefaultSource") is_default_destination: bool = pydantic_v1.Field(alias="isDefaultDestination") supported_currencies: typing.List[CurrencyCode] = pydantic_v1.Field(alias="supportedCurrencies") + external_accounting_system_id: typing.Optional[str] = pydantic_v1.Field( + alias="externalAccountingSystemId", default=None + ) created_at: dt.datetime = pydantic_v1.Field(alias="createdAt") updated_at: dt.datetime = pydantic_v1.Field(alias="updatedAt") type: typing.Literal["card"] = "card" @@ -183,6 +189,9 @@ class PaymentMethodResponse_Check(pydantic_v1.BaseModel): is_default_source: bool = pydantic_v1.Field(alias="isDefaultSource") is_default_destination: bool = pydantic_v1.Field(alias="isDefaultDestination") supported_currencies: typing.List[CurrencyCode] = pydantic_v1.Field(alias="supportedCurrencies") + external_accounting_system_id: typing.Optional[str] = pydantic_v1.Field( + alias="externalAccountingSystemId", default=None + ) created_at: dt.datetime = pydantic_v1.Field(alias="createdAt") updated_at: dt.datetime = pydantic_v1.Field(alias="updatedAt") type: typing.Literal["check"] = "check" @@ -246,6 +255,9 @@ class PaymentMethodResponse_Custom(pydantic_v1.BaseModel): is_default_source: bool = pydantic_v1.Field(alias="isDefaultSource") is_default_destination: bool = pydantic_v1.Field(alias="isDefaultDestination") supported_currencies: typing.List[CurrencyCode] = pydantic_v1.Field(alias="supportedCurrencies") + external_accounting_system_id: typing.Optional[str] = pydantic_v1.Field( + alias="externalAccountingSystemId", default=None + ) created_at: dt.datetime = pydantic_v1.Field(alias="createdAt") updated_at: dt.datetime = pydantic_v1.Field(alias="updatedAt") type: typing.Literal["custom"] = "custom" @@ -303,6 +315,9 @@ class PaymentMethodResponse_OffPlatform(pydantic_v1.BaseModel): is_default_source: bool = pydantic_v1.Field(alias="isDefaultSource") is_default_destination: bool = pydantic_v1.Field(alias="isDefaultDestination") supported_currencies: typing.List[CurrencyCode] = pydantic_v1.Field(alias="supportedCurrencies") + external_accounting_system_id: typing.Optional[str] = pydantic_v1.Field( + alias="externalAccountingSystemId", default=None + ) created_at: dt.datetime = pydantic_v1.Field(alias="createdAt") updated_at: dt.datetime = pydantic_v1.Field(alias="updatedAt") type: typing.Literal["offPlatform"] = "offPlatform" diff --git a/src/mercoa/payment_method_types/types/payment_method_update_request.py b/src/mercoa/payment_method_types/types/payment_method_update_request.py index fcb7f5a..639dadd 100644 --- a/src/mercoa/payment_method_types/types/payment_method_update_request.py +++ b/src/mercoa/payment_method_types/types/payment_method_update_request.py @@ -33,6 +33,9 @@ class PaymentMethodUpdateRequest_Custom(pydantic_v1.BaseModel): data: typing.Optional[typing.Dict[str, str]] = None default_source: typing.Optional[bool] = pydantic_v1.Field(alias="defaultSource", default=None) default_destination: typing.Optional[bool] = pydantic_v1.Field(alias="defaultDestination", default=None) + external_accounting_system_id: typing.Optional[str] = pydantic_v1.Field( + alias="externalAccountingSystemId", default=None + ) type: typing.Literal["custom"] = "custom" def json(self, **kwargs: typing.Any) -> str: @@ -75,6 +78,9 @@ class PaymentMethodUpdateRequest_BankAccount(pydantic_v1.BaseModel): check_options: typing.Optional[BankAccountCheckOptions] = pydantic_v1.Field(alias="checkOptions", default=None) default_source: typing.Optional[bool] = pydantic_v1.Field(alias="defaultSource", default=None) default_destination: typing.Optional[bool] = pydantic_v1.Field(alias="defaultDestination", default=None) + external_accounting_system_id: typing.Optional[str] = pydantic_v1.Field( + alias="externalAccountingSystemId", default=None + ) type: typing.Literal["bankAccount"] = "bankAccount" def json(self, **kwargs: typing.Any) -> str: @@ -114,6 +120,9 @@ class PaymentMethodUpdateRequest_Card(pydantic_v1.BaseModel): default_source: typing.Optional[bool] = pydantic_v1.Field(alias="defaultSource", default=None) default_destination: typing.Optional[bool] = pydantic_v1.Field(alias="defaultDestination", default=None) + external_accounting_system_id: typing.Optional[str] = pydantic_v1.Field( + alias="externalAccountingSystemId", default=None + ) type: typing.Literal["card"] = "card" def json(self, **kwargs: typing.Any) -> str: @@ -153,6 +162,9 @@ class PaymentMethodUpdateRequest_Check(pydantic_v1.BaseModel): default_source: typing.Optional[bool] = pydantic_v1.Field(alias="defaultSource", default=None) default_destination: typing.Optional[bool] = pydantic_v1.Field(alias="defaultDestination", default=None) + external_accounting_system_id: typing.Optional[str] = pydantic_v1.Field( + alias="externalAccountingSystemId", default=None + ) type: typing.Literal["check"] = "check" def json(self, **kwargs: typing.Any) -> str: @@ -192,6 +204,9 @@ class PaymentMethodUpdateRequest_OffPlatform(pydantic_v1.BaseModel): default_source: typing.Optional[bool] = pydantic_v1.Field(alias="defaultSource", default=None) default_destination: typing.Optional[bool] = pydantic_v1.Field(alias="defaultDestination", default=None) + external_accounting_system_id: typing.Optional[str] = pydantic_v1.Field( + alias="externalAccountingSystemId", default=None + ) type: typing.Literal["offPlatform"] = "offPlatform" def json(self, **kwargs: typing.Any) -> str: