diff --git a/pyproject.toml b/pyproject.toml index d88c4bd..ae6bc19 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "mercoa" -version = "0.4.1" +version = "0.4.2" description = "" readme = "README.md" authors = [] diff --git a/src/mercoa/core/client_wrapper.py b/src/mercoa/core/client_wrapper.py index e64dffd..ecf3587 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": "0.4.1", + "X-Fern-SDK-Version": "0.4.2", } headers["Authorization"] = f"Bearer {self._get_token()}" return headers diff --git a/src/mercoa/custom_payment_method_schema/client.py b/src/mercoa/custom_payment_method_schema/client.py index 5ce72ac..c86f99e 100644 --- a/src/mercoa/custom_payment_method_schema/client.py +++ b/src/mercoa/custom_payment_method_schema/client.py @@ -85,6 +85,7 @@ def create( is_source: bool, is_destination: bool, fields: typing.Sequence[CustomPaymentMethodSchemaField], + estimated_processing_time: typing.Optional[int] = OMIT, supported_currencies: typing.Optional[typing.Sequence[CurrencyCode]] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> CustomPaymentMethodSchemaResponse: @@ -103,6 +104,9 @@ def create( fields : typing.Sequence[CustomPaymentMethodSchemaField] + estimated_processing_time : typing.Optional[int] + Estimated time in days for this payment method to process a payments. Set as 0 for same-day payment methods, -1 for unknown processing time. + supported_currencies : typing.Optional[typing.Sequence[CurrencyCode]] List of currencies that this payment method supports. If not provided, the payment method will support only USD. @@ -153,6 +157,7 @@ def create( optional=False, ), ], + estimated_processing_time=0, ) """ _response = self._client_wrapper.httpx_client.request( @@ -162,6 +167,7 @@ def create( "name": name, "isSource": is_source, "isDestination": is_destination, + "estimatedProcessingTime": estimated_processing_time, "supportedCurrencies": supported_currencies, "fields": fields, }, @@ -199,6 +205,7 @@ def update( is_source: bool, is_destination: bool, fields: typing.Sequence[CustomPaymentMethodSchemaField], + estimated_processing_time: typing.Optional[int] = OMIT, supported_currencies: typing.Optional[typing.Sequence[CurrencyCode]] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> CustomPaymentMethodSchemaResponse: @@ -219,6 +226,9 @@ def update( fields : typing.Sequence[CustomPaymentMethodSchemaField] + estimated_processing_time : typing.Optional[int] + Estimated time in days for this payment method to process a payments. Set as 0 for same-day payment methods, -1 for unknown processing time. + supported_currencies : typing.Optional[typing.Sequence[CurrencyCode]] List of currencies that this payment method supports. If not provided, the payment method will support only USD. @@ -270,6 +280,7 @@ def update( optional=False, ), ], + estimated_processing_time=7, ) """ _response = self._client_wrapper.httpx_client.request( @@ -279,6 +290,7 @@ def update( "name": name, "isSource": is_source, "isDestination": is_destination, + "estimatedProcessingTime": estimated_processing_time, "supportedCurrencies": supported_currencies, "fields": fields, }, @@ -478,6 +490,7 @@ async def create( is_source: bool, is_destination: bool, fields: typing.Sequence[CustomPaymentMethodSchemaField], + estimated_processing_time: typing.Optional[int] = OMIT, supported_currencies: typing.Optional[typing.Sequence[CurrencyCode]] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> CustomPaymentMethodSchemaResponse: @@ -496,6 +509,9 @@ async def create( fields : typing.Sequence[CustomPaymentMethodSchemaField] + estimated_processing_time : typing.Optional[int] + Estimated time in days for this payment method to process a payments. Set as 0 for same-day payment methods, -1 for unknown processing time. + supported_currencies : typing.Optional[typing.Sequence[CurrencyCode]] List of currencies that this payment method supports. If not provided, the payment method will support only USD. @@ -546,6 +562,7 @@ async def create( optional=False, ), ], + estimated_processing_time=0, ) """ _response = await self._client_wrapper.httpx_client.request( @@ -555,6 +572,7 @@ async def create( "name": name, "isSource": is_source, "isDestination": is_destination, + "estimatedProcessingTime": estimated_processing_time, "supportedCurrencies": supported_currencies, "fields": fields, }, @@ -592,6 +610,7 @@ async def update( is_source: bool, is_destination: bool, fields: typing.Sequence[CustomPaymentMethodSchemaField], + estimated_processing_time: typing.Optional[int] = OMIT, supported_currencies: typing.Optional[typing.Sequence[CurrencyCode]] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> CustomPaymentMethodSchemaResponse: @@ -612,6 +631,9 @@ async def update( fields : typing.Sequence[CustomPaymentMethodSchemaField] + estimated_processing_time : typing.Optional[int] + Estimated time in days for this payment method to process a payments. Set as 0 for same-day payment methods, -1 for unknown processing time. + supported_currencies : typing.Optional[typing.Sequence[CurrencyCode]] List of currencies that this payment method supports. If not provided, the payment method will support only USD. @@ -663,6 +685,7 @@ async def update( optional=False, ), ], + estimated_processing_time=7, ) """ _response = await self._client_wrapper.httpx_client.request( @@ -672,6 +695,7 @@ async def update( "name": name, "isSource": is_source, "isDestination": is_destination, + "estimatedProcessingTime": estimated_processing_time, "supportedCurrencies": supported_currencies, "fields": fields, }, diff --git a/src/mercoa/entity_types/types/approval_policy_response.py b/src/mercoa/entity_types/types/approval_policy_response.py index 75a0c90..eea8b6a 100644 --- a/src/mercoa/entity_types/types/approval_policy_response.py +++ b/src/mercoa/entity_types/types/approval_policy_response.py @@ -14,6 +14,8 @@ class ApprovalPolicyResponse(pydantic_v1.BaseModel): """ Examples -------- + import datetime + from mercoa import ( ApprovalPolicyResponse, IdentifierList_RolesList, @@ -34,6 +36,12 @@ class ApprovalPolicyResponse(pydantic_v1.BaseModel): identifier_list=IdentifierList_RolesList(value=["Admin", "Controller"]), ), upstream_policy_id="root", + updated_at=datetime.datetime.fromisoformat( + "2024-01-02 00:00:00+00:00", + ), + created_at=datetime.datetime.fromisoformat( + "2024-01-01 00:00:00+00:00", + ), ) """ @@ -41,6 +49,8 @@ class ApprovalPolicyResponse(pydantic_v1.BaseModel): trigger: typing.List[Trigger] rule: Rule upstream_policy_id: ApprovalPolicyId = pydantic_v1.Field(alias="upstreamPolicyId") + created_at: dt.datetime = pydantic_v1.Field(alias="createdAt") + updated_at: dt.datetime = pydantic_v1.Field(alias="updatedAt") def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs} diff --git a/src/mercoa/invoice_types/types/find_invoice_response.py b/src/mercoa/invoice_types/types/find_invoice_response.py index 506cdc7..3747055 100644 --- a/src/mercoa/invoice_types/types/find_invoice_response.py +++ b/src/mercoa/invoice_types/types/find_invoice_response.py @@ -309,6 +309,12 @@ class FindInvoiceResponse(pydantic_v1.BaseModel): ), ), upstream_policy_id="root", + updated_at=datetime.datetime.fromisoformat( + "2024-01-02 00:00:00+00:00", + ), + created_at=datetime.datetime.fromisoformat( + "2024-01-01 00:00:00+00:00", + ), ) ], metadata={"key1": "value1", "key2": "value2"}, diff --git a/src/mercoa/invoice_types/types/invoice_response.py b/src/mercoa/invoice_types/types/invoice_response.py index 1fc55a9..42f7a78 100644 --- a/src/mercoa/invoice_types/types/invoice_response.py +++ b/src/mercoa/invoice_types/types/invoice_response.py @@ -316,6 +316,12 @@ class InvoiceResponse(pydantic_v1.BaseModel): ), ), upstream_policy_id="root", + updated_at=datetime.datetime.fromisoformat( + "2024-01-02 00:00:00+00:00", + ), + created_at=datetime.datetime.fromisoformat( + "2024-01-01 00:00:00+00:00", + ), ) ], metadata={"key1": "value1", "key2": "value2"}, diff --git a/src/mercoa/payment_method_types/types/custom_payment_method_schema_request.py b/src/mercoa/payment_method_types/types/custom_payment_method_schema_request.py index 5362098..d980383 100644 --- a/src/mercoa/payment_method_types/types/custom_payment_method_schema_request.py +++ b/src/mercoa/payment_method_types/types/custom_payment_method_schema_request.py @@ -50,6 +50,7 @@ class CustomPaymentMethodSchemaRequest(pydantic_v1.BaseModel): optional=False, ), ], + estimated_processing_time=0, ) """ @@ -64,6 +65,11 @@ class CustomPaymentMethodSchemaRequest(pydantic_v1.BaseModel): This payment method can be used as a payment destination for an invoice """ + estimated_processing_time: typing.Optional[int] = pydantic_v1.Field(alias="estimatedProcessingTime", default=None) + """ + Estimated time in days for this payment method to process a payments. Set as 0 for same-day payment methods, -1 for unknown processing time. + """ + supported_currencies: typing.Optional[typing.List[CurrencyCode]] = pydantic_v1.Field( alias="supportedCurrencies", default=None ) diff --git a/src/mercoa/payment_method_types/types/custom_payment_method_schema_response.py b/src/mercoa/payment_method_types/types/custom_payment_method_schema_response.py index c4124ad..d9373f5 100644 --- a/src/mercoa/payment_method_types/types/custom_payment_method_schema_response.py +++ b/src/mercoa/payment_method_types/types/custom_payment_method_schema_response.py @@ -60,6 +60,7 @@ class CustomPaymentMethodSchemaResponse(pydantic_v1.BaseModel): updated_at=datetime.datetime.fromisoformat( "2021-01-01 00:00:00+00:00", ), + estimated_processing_time=0, ) """ @@ -81,6 +82,11 @@ class CustomPaymentMethodSchemaResponse(pydantic_v1.BaseModel): """ fields: typing.List[CustomPaymentMethodSchemaField] + estimated_processing_time: int = pydantic_v1.Field(alias="estimatedProcessingTime") + """ + Estimated time in days for this payment method to process a payments. 0 is an same-day payment methods, -1 is unknown processing time. + """ + created_at: dt.datetime = pydantic_v1.Field(alias="createdAt") updated_at: dt.datetime = pydantic_v1.Field(alias="updatedAt") diff --git a/src/mercoa/webhooks/types/invoice_email_webhook.py b/src/mercoa/webhooks/types/invoice_email_webhook.py index 252dfbf..c687852 100644 --- a/src/mercoa/webhooks/types/invoice_email_webhook.py +++ b/src/mercoa/webhooks/types/invoice_email_webhook.py @@ -306,6 +306,12 @@ class InvoiceEmailWebhook(pydantic_v1.BaseModel): ), ), upstream_policy_id="root", + updated_at=datetime.datetime.fromisoformat( + "2024-01-02 00:00:00+00:00", + ), + created_at=datetime.datetime.fromisoformat( + "2024-01-01 00:00:00+00:00", + ), ) ], metadata={"key1": "value1", "key2": "value2"}, diff --git a/src/mercoa/webhooks/types/invoice_webhook.py b/src/mercoa/webhooks/types/invoice_webhook.py index ce2c4ce..5f63bf7 100644 --- a/src/mercoa/webhooks/types/invoice_webhook.py +++ b/src/mercoa/webhooks/types/invoice_webhook.py @@ -305,6 +305,12 @@ class InvoiceWebhook(pydantic_v1.BaseModel): ), ), upstream_policy_id="root", + updated_at=datetime.datetime.fromisoformat( + "2024-01-02 00:00:00+00:00", + ), + created_at=datetime.datetime.fromisoformat( + "2024-01-01 00:00:00+00:00", + ), ) ], metadata={"key1": "value1", "key2": "value2"},