From edf37784a85bb1fb491ce335f2f8f562892c195e Mon Sep 17 00:00:00 2001 From: fern-api <115122769+fern-api[bot]@users.noreply.github.com> Date: Fri, 9 May 2025 18:04:09 +0000 Subject: [PATCH] SDK regeneration --- README.md | 3 +- pyproject.toml | 2 +- reference.md | 115 ++++++- requirements.txt | 2 +- src/monite/__init__.py | 2 + .../accounting/ledger_accounts/client.py | 12 +- .../accounting/ledger_accounts/raw_client.py | 12 +- .../accounting/synced_records/client.py | 12 +- .../accounting/synced_records/raw_client.py | 12 +- src/monite/accounting/tax_rates/client.py | 12 +- src/monite/accounting/tax_rates/raw_client.py | 12 +- src/monite/core/client_wrapper.py | 4 +- src/monite/core/pydantic_utilities.py | 2 +- src/monite/e_invoicing_connections/client.py | 124 +++++++- .../e_invoicing_connections/raw_client.py | 299 ++++++++++++++++++ src/monite/types/__init__.py | 2 + .../types/einvoicing_connection_response.py | 10 + src/monite/types/update_einvoicing_address.py | 42 +++ 18 files changed, 641 insertions(+), 38 deletions(-) create mode 100644 src/monite/types/update_einvoicing_address.py diff --git a/README.md b/README.md index fada801..3581edd 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,8 @@ import asyncio client = AsyncMonite(monite_version="YOUR_MONITE_VERSION", monite_entity_id="YOUR_MONITE_ENTITY_ID", token="YOUR_TOKEN", ) async def main() -> None: await client.products.create(name='name', ) -asyncio.run(main())``` +asyncio.run(main()) +``` ## Exception Handling diff --git a/pyproject.toml b/pyproject.toml index 6a8973a..7e8d533 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,7 +3,7 @@ name = "monite" [tool.poetry] name = "monite" -version = "0.5.2" +version = "0.5.3" description = "" readme = "README.md" authors = [] diff --git a/reference.md b/reference.md index 96719df..eb0152d 100644 --- a/reference.md +++ b/reference.md @@ -5159,6 +5159,22 @@ client.e_invoicing_connections.post_einvoicing_connections(address=EinvoicingAdd
+**is_receiver:** `typing.Optional[bool]` — Set to `true` if the entity needs to receive e-invoices. + +
+
+ +
+
+ +**is_sender:** `typing.Optional[bool]` — Set to `true` if the entity needs to send e-invoices. Either `is_sender` or `is_receiver` or both must be `true`. + +
+
+ +
+
+ **request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
@@ -5269,6 +5285,81 @@ client.e_invoicing_connections.delete_einvoicing_connections_id(einvoicing_conne
+ + + + +
client.e_invoicing_connections.patch_einvoicing_connections_id(...) +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from monite import Monite +client = Monite(monite_version="YOUR_MONITE_VERSION", monite_entity_id="YOUR_MONITE_ENTITY_ID", token="YOUR_TOKEN", ) +client.e_invoicing_connections.patch_einvoicing_connections_id(einvoicing_connection_id='einvoicing_connection_id', ) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**einvoicing_connection_id:** `str` + +
+
+ +
+
+ +**address:** `typing.Optional[UpdateEinvoicingAddress]` — Integration Address + +
+
+ +
+
+ +**is_receiver:** `typing.Optional[bool]` — Set to `true` if the entity needs to receive e-invoices. + +
+
+ +
+
+ +**is_sender:** `typing.Optional[bool]` — Set to `true` if the entity needs to send e-invoices. Either `is_sender` or `is_receiver` or both must be `true`. + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ +
@@ -24901,7 +24992,11 @@ client.accounting.synced_records.get(object_type="product", )
-**limit:** `typing.Optional[int]` — The number of items (0 .. 100) to return in a single page of the response. The response may contain fewer items if it is the last or only page. +**limit:** `typing.Optional[int]` + +The number of items (0 .. 250) to return in a single page of the response. Default is 100. The response may contain fewer items if it is the last or only page. + +When using pagination with a non-default `limit`, you must provide the `limit` value alongside `pagination_token` in all subsequent pagination requests. Unlike other query parameters, `limit` is not inferred from `pagination_token`.
@@ -24911,7 +25006,7 @@ client.accounting.synced_records.get(object_type="product", ) **pagination_token:** `typing.Optional[str]` -A pagination token obtained from a previous call to this endpoint. Use it to get the next or previous page of results for your initial query. If `pagination_token` is specified, all other query parameters are ignored and inferred from the initial query. +A pagination token obtained from a previous call to this endpoint. Use it to get the next or previous page of results for your initial query. If `pagination_token` is specified, all other query parameters except `limit` are ignored and inferred from the initial query. If not specified, the first page of results will be returned. @@ -25205,7 +25300,11 @@ client.accounting.tax_rates.get()
-**limit:** `typing.Optional[int]` — The number of items (0 .. 100) to return in a single page of the response. The response may contain fewer items if it is the last or only page. +**limit:** `typing.Optional[int]` + +The number of items (0 .. 250) to return in a single page of the response. Default is 100. The response may contain fewer items if it is the last or only page. + +When using pagination with a non-default `limit`, you must provide the `limit` value alongside `pagination_token` in all subsequent pagination requests. Unlike other query parameters, `limit` is not inferred from `pagination_token`.
@@ -25215,7 +25314,7 @@ client.accounting.tax_rates.get() **pagination_token:** `typing.Optional[str]` -A pagination token obtained from a previous call to this endpoint. Use it to get the next or previous page of results for your initial query. If `pagination_token` is specified, all other query parameters are ignored and inferred from the initial query. +A pagination token obtained from a previous call to this endpoint. Use it to get the next or previous page of results for your initial query. If `pagination_token` is specified, all other query parameters except `limit` are ignored and inferred from the initial query. If not specified, the first page of results will be returned. @@ -25364,7 +25463,11 @@ client.accounting.ledger_accounts.get()
-**limit:** `typing.Optional[int]` — The number of items (0 .. 100) to return in a single page of the response. The response may contain fewer items if it is the last or only page. +**limit:** `typing.Optional[int]` + +The number of items (0 .. 250) to return in a single page of the response. Default is 100. The response may contain fewer items if it is the last or only page. + +When using pagination with a non-default `limit`, you must provide the `limit` value alongside `pagination_token` in all subsequent pagination requests. Unlike other query parameters, `limit` is not inferred from `pagination_token`.
@@ -25374,7 +25477,7 @@ client.accounting.ledger_accounts.get() **pagination_token:** `typing.Optional[str]` -A pagination token obtained from a previous call to this endpoint. Use it to get the next or previous page of results for your initial query. If `pagination_token` is specified, all other query parameters are ignored and inferred from the initial query. +A pagination token obtained from a previous call to this endpoint. Use it to get the next or previous page of results for your initial query. If `pagination_token` is specified, all other query parameters except `limit` are ignored and inferred from the initial query. If not specified, the first page of results will be returned. diff --git a/requirements.txt b/requirements.txt index f502f1b..170f512 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ httpx>=0.21.2 pydantic>= 1.9.2 -pydantic-core==^2.18.2 +pydantic-core==2.18.2 typing_extensions>= 4.0.0 diff --git a/src/monite/__init__.py b/src/monite/__init__.py index fbd0cbc..0c72bb1 100644 --- a/src/monite/__init__.py +++ b/src/monite/__init__.py @@ -652,6 +652,7 @@ UnitResponse, UpdateCreditNote, UpdateCreditNotePayload, + UpdateEinvoicingAddress, UpdateEntityAddressSchema, UpdateEntityRequest, UpdateInvoice, @@ -1449,6 +1450,7 @@ "UnsupportedMediaTypeError", "UpdateCreditNote", "UpdateCreditNotePayload", + "UpdateEinvoicingAddress", "UpdateEntityAddressSchema", "UpdateEntityRequest", "UpdateInvoice", diff --git a/src/monite/accounting/ledger_accounts/client.py b/src/monite/accounting/ledger_accounts/client.py index 1b74aa4..17ac90d 100644 --- a/src/monite/accounting/ledger_accounts/client.py +++ b/src/monite/accounting/ledger_accounts/client.py @@ -44,10 +44,12 @@ def get( Sort order (ascending by default). Typically used together with the `sort` parameter. limit : typing.Optional[int] - The number of items (0 .. 100) to return in a single page of the response. The response may contain fewer items if it is the last or only page. + The number of items (0 .. 250) to return in a single page of the response. Default is 100. The response may contain fewer items if it is the last or only page. + + When using pagination with a non-default `limit`, you must provide the `limit` value alongside `pagination_token` in all subsequent pagination requests. Unlike other query parameters, `limit` is not inferred from `pagination_token`. pagination_token : typing.Optional[str] - A pagination token obtained from a previous call to this endpoint. Use it to get the next or previous page of results for your initial query. If `pagination_token` is specified, all other query parameters are ignored and inferred from the initial query. + A pagination token obtained from a previous call to this endpoint. Use it to get the next or previous page of results for your initial query. If `pagination_token` is specified, all other query parameters except `limit` are ignored and inferred from the initial query. If not specified, the first page of results will be returned. @@ -134,10 +136,12 @@ async def get( Sort order (ascending by default). Typically used together with the `sort` parameter. limit : typing.Optional[int] - The number of items (0 .. 100) to return in a single page of the response. The response may contain fewer items if it is the last or only page. + The number of items (0 .. 250) to return in a single page of the response. Default is 100. The response may contain fewer items if it is the last or only page. + + When using pagination with a non-default `limit`, you must provide the `limit` value alongside `pagination_token` in all subsequent pagination requests. Unlike other query parameters, `limit` is not inferred from `pagination_token`. pagination_token : typing.Optional[str] - A pagination token obtained from a previous call to this endpoint. Use it to get the next or previous page of results for your initial query. If `pagination_token` is specified, all other query parameters are ignored and inferred from the initial query. + A pagination token obtained from a previous call to this endpoint. Use it to get the next or previous page of results for your initial query. If `pagination_token` is specified, all other query parameters except `limit` are ignored and inferred from the initial query. If not specified, the first page of results will be returned. diff --git a/src/monite/accounting/ledger_accounts/raw_client.py b/src/monite/accounting/ledger_accounts/raw_client.py index 68bf733..fe446f3 100644 --- a/src/monite/accounting/ledger_accounts/raw_client.py +++ b/src/monite/accounting/ledger_accounts/raw_client.py @@ -39,10 +39,12 @@ def get( Sort order (ascending by default). Typically used together with the `sort` parameter. limit : typing.Optional[int] - The number of items (0 .. 100) to return in a single page of the response. The response may contain fewer items if it is the last or only page. + The number of items (0 .. 250) to return in a single page of the response. Default is 100. The response may contain fewer items if it is the last or only page. + + When using pagination with a non-default `limit`, you must provide the `limit` value alongside `pagination_token` in all subsequent pagination requests. Unlike other query parameters, `limit` is not inferred from `pagination_token`. pagination_token : typing.Optional[str] - A pagination token obtained from a previous call to this endpoint. Use it to get the next or previous page of results for your initial query. If `pagination_token` is specified, all other query parameters are ignored and inferred from the initial query. + A pagination token obtained from a previous call to this endpoint. Use it to get the next or previous page of results for your initial query. If `pagination_token` is specified, all other query parameters except `limit` are ignored and inferred from the initial query. If not specified, the first page of results will be returned. @@ -188,10 +190,12 @@ async def get( Sort order (ascending by default). Typically used together with the `sort` parameter. limit : typing.Optional[int] - The number of items (0 .. 100) to return in a single page of the response. The response may contain fewer items if it is the last or only page. + The number of items (0 .. 250) to return in a single page of the response. Default is 100. The response may contain fewer items if it is the last or only page. + + When using pagination with a non-default `limit`, you must provide the `limit` value alongside `pagination_token` in all subsequent pagination requests. Unlike other query parameters, `limit` is not inferred from `pagination_token`. pagination_token : typing.Optional[str] - A pagination token obtained from a previous call to this endpoint. Use it to get the next or previous page of results for your initial query. If `pagination_token` is specified, all other query parameters are ignored and inferred from the initial query. + A pagination token obtained from a previous call to this endpoint. Use it to get the next or previous page of results for your initial query. If `pagination_token` is specified, all other query parameters except `limit` are ignored and inferred from the initial query. If not specified, the first page of results will be returned. diff --git a/src/monite/accounting/synced_records/client.py b/src/monite/accounting/synced_records/client.py index e19a28f..bf23516 100644 --- a/src/monite/accounting/synced_records/client.py +++ b/src/monite/accounting/synced_records/client.py @@ -59,10 +59,12 @@ def get( Sort order (ascending by default). Typically used together with the `sort` parameter. limit : typing.Optional[int] - The number of items (0 .. 100) to return in a single page of the response. The response may contain fewer items if it is the last or only page. + The number of items (0 .. 250) to return in a single page of the response. Default is 100. The response may contain fewer items if it is the last or only page. + + When using pagination with a non-default `limit`, you must provide the `limit` value alongside `pagination_token` in all subsequent pagination requests. Unlike other query parameters, `limit` is not inferred from `pagination_token`. pagination_token : typing.Optional[str] - A pagination token obtained from a previous call to this endpoint. Use it to get the next or previous page of results for your initial query. If `pagination_token` is specified, all other query parameters are ignored and inferred from the initial query. + A pagination token obtained from a previous call to this endpoint. Use it to get the next or previous page of results for your initial query. If `pagination_token` is specified, all other query parameters except `limit` are ignored and inferred from the initial query. If not specified, the first page of results will be returned. @@ -224,10 +226,12 @@ async def get( Sort order (ascending by default). Typically used together with the `sort` parameter. limit : typing.Optional[int] - The number of items (0 .. 100) to return in a single page of the response. The response may contain fewer items if it is the last or only page. + The number of items (0 .. 250) to return in a single page of the response. Default is 100. The response may contain fewer items if it is the last or only page. + + When using pagination with a non-default `limit`, you must provide the `limit` value alongside `pagination_token` in all subsequent pagination requests. Unlike other query parameters, `limit` is not inferred from `pagination_token`. pagination_token : typing.Optional[str] - A pagination token obtained from a previous call to this endpoint. Use it to get the next or previous page of results for your initial query. If `pagination_token` is specified, all other query parameters are ignored and inferred from the initial query. + A pagination token obtained from a previous call to this endpoint. Use it to get the next or previous page of results for your initial query. If `pagination_token` is specified, all other query parameters except `limit` are ignored and inferred from the initial query. If not specified, the first page of results will be returned. diff --git a/src/monite/accounting/synced_records/raw_client.py b/src/monite/accounting/synced_records/raw_client.py index d3392f9..6ace964 100644 --- a/src/monite/accounting/synced_records/raw_client.py +++ b/src/monite/accounting/synced_records/raw_client.py @@ -55,10 +55,12 @@ def get( Sort order (ascending by default). Typically used together with the `sort` parameter. limit : typing.Optional[int] - The number of items (0 .. 100) to return in a single page of the response. The response may contain fewer items if it is the last or only page. + The number of items (0 .. 250) to return in a single page of the response. Default is 100. The response may contain fewer items if it is the last or only page. + + When using pagination with a non-default `limit`, you must provide the `limit` value alongside `pagination_token` in all subsequent pagination requests. Unlike other query parameters, `limit` is not inferred from `pagination_token`. pagination_token : typing.Optional[str] - A pagination token obtained from a previous call to this endpoint. Use it to get the next or previous page of results for your initial query. If `pagination_token` is specified, all other query parameters are ignored and inferred from the initial query. + A pagination token obtained from a previous call to this endpoint. Use it to get the next or previous page of results for your initial query. If `pagination_token` is specified, all other query parameters except `limit` are ignored and inferred from the initial query. If not specified, the first page of results will be returned. @@ -308,10 +310,12 @@ async def get( Sort order (ascending by default). Typically used together with the `sort` parameter. limit : typing.Optional[int] - The number of items (0 .. 100) to return in a single page of the response. The response may contain fewer items if it is the last or only page. + The number of items (0 .. 250) to return in a single page of the response. Default is 100. The response may contain fewer items if it is the last or only page. + + When using pagination with a non-default `limit`, you must provide the `limit` value alongside `pagination_token` in all subsequent pagination requests. Unlike other query parameters, `limit` is not inferred from `pagination_token`. pagination_token : typing.Optional[str] - A pagination token obtained from a previous call to this endpoint. Use it to get the next or previous page of results for your initial query. If `pagination_token` is specified, all other query parameters are ignored and inferred from the initial query. + A pagination token obtained from a previous call to this endpoint. Use it to get the next or previous page of results for your initial query. If `pagination_token` is specified, all other query parameters except `limit` are ignored and inferred from the initial query. If not specified, the first page of results will be returned. diff --git a/src/monite/accounting/tax_rates/client.py b/src/monite/accounting/tax_rates/client.py index 2a58be3..5ac747a 100644 --- a/src/monite/accounting/tax_rates/client.py +++ b/src/monite/accounting/tax_rates/client.py @@ -44,10 +44,12 @@ def get( Sort order (ascending by default). Typically used together with the `sort` parameter. limit : typing.Optional[int] - The number of items (0 .. 100) to return in a single page of the response. The response may contain fewer items if it is the last or only page. + The number of items (0 .. 250) to return in a single page of the response. Default is 100. The response may contain fewer items if it is the last or only page. + + When using pagination with a non-default `limit`, you must provide the `limit` value alongside `pagination_token` in all subsequent pagination requests. Unlike other query parameters, `limit` is not inferred from `pagination_token`. pagination_token : typing.Optional[str] - A pagination token obtained from a previous call to this endpoint. Use it to get the next or previous page of results for your initial query. If `pagination_token` is specified, all other query parameters are ignored and inferred from the initial query. + A pagination token obtained from a previous call to this endpoint. Use it to get the next or previous page of results for your initial query. If `pagination_token` is specified, all other query parameters except `limit` are ignored and inferred from the initial query. If not specified, the first page of results will be returned. @@ -134,10 +136,12 @@ async def get( Sort order (ascending by default). Typically used together with the `sort` parameter. limit : typing.Optional[int] - The number of items (0 .. 100) to return in a single page of the response. The response may contain fewer items if it is the last or only page. + The number of items (0 .. 250) to return in a single page of the response. Default is 100. The response may contain fewer items if it is the last or only page. + + When using pagination with a non-default `limit`, you must provide the `limit` value alongside `pagination_token` in all subsequent pagination requests. Unlike other query parameters, `limit` is not inferred from `pagination_token`. pagination_token : typing.Optional[str] - A pagination token obtained from a previous call to this endpoint. Use it to get the next or previous page of results for your initial query. If `pagination_token` is specified, all other query parameters are ignored and inferred from the initial query. + A pagination token obtained from a previous call to this endpoint. Use it to get the next or previous page of results for your initial query. If `pagination_token` is specified, all other query parameters except `limit` are ignored and inferred from the initial query. If not specified, the first page of results will be returned. diff --git a/src/monite/accounting/tax_rates/raw_client.py b/src/monite/accounting/tax_rates/raw_client.py index d2ff579..15f38fc 100644 --- a/src/monite/accounting/tax_rates/raw_client.py +++ b/src/monite/accounting/tax_rates/raw_client.py @@ -39,10 +39,12 @@ def get( Sort order (ascending by default). Typically used together with the `sort` parameter. limit : typing.Optional[int] - The number of items (0 .. 100) to return in a single page of the response. The response may contain fewer items if it is the last or only page. + The number of items (0 .. 250) to return in a single page of the response. Default is 100. The response may contain fewer items if it is the last or only page. + + When using pagination with a non-default `limit`, you must provide the `limit` value alongside `pagination_token` in all subsequent pagination requests. Unlike other query parameters, `limit` is not inferred from `pagination_token`. pagination_token : typing.Optional[str] - A pagination token obtained from a previous call to this endpoint. Use it to get the next or previous page of results for your initial query. If `pagination_token` is specified, all other query parameters are ignored and inferred from the initial query. + A pagination token obtained from a previous call to this endpoint. Use it to get the next or previous page of results for your initial query. If `pagination_token` is specified, all other query parameters except `limit` are ignored and inferred from the initial query. If not specified, the first page of results will be returned. @@ -188,10 +190,12 @@ async def get( Sort order (ascending by default). Typically used together with the `sort` parameter. limit : typing.Optional[int] - The number of items (0 .. 100) to return in a single page of the response. The response may contain fewer items if it is the last or only page. + The number of items (0 .. 250) to return in a single page of the response. Default is 100. The response may contain fewer items if it is the last or only page. + + When using pagination with a non-default `limit`, you must provide the `limit` value alongside `pagination_token` in all subsequent pagination requests. Unlike other query parameters, `limit` is not inferred from `pagination_token`. pagination_token : typing.Optional[str] - A pagination token obtained from a previous call to this endpoint. Use it to get the next or previous page of results for your initial query. If `pagination_token` is specified, all other query parameters are ignored and inferred from the initial query. + A pagination token obtained from a previous call to this endpoint. Use it to get the next or previous page of results for your initial query. If `pagination_token` is specified, all other query parameters except `limit` are ignored and inferred from the initial query. If not specified, the first page of results will be returned. diff --git a/src/monite/core/client_wrapper.py b/src/monite/core/client_wrapper.py index c97465d..11b507c 100644 --- a/src/monite/core/client_wrapper.py +++ b/src/monite/core/client_wrapper.py @@ -24,10 +24,10 @@ def __init__( def get_headers(self) -> typing.Dict[str, str]: headers: typing.Dict[str, str] = { - "User-Agent": "monite/0.5.2", + "User-Agent": "monite/0.5.3", "X-Fern-Language": "Python", "X-Fern-SDK-Name": "monite", - "X-Fern-SDK-Version": "0.5.2", + "X-Fern-SDK-Version": "0.5.3", } headers["x-monite-version"] = self._monite_version if self._monite_entity_id is not None: diff --git a/src/monite/core/pydantic_utilities.py b/src/monite/core/pydantic_utilities.py index 60a2c71..0360ef4 100644 --- a/src/monite/core/pydantic_utilities.py +++ b/src/monite/core/pydantic_utilities.py @@ -181,7 +181,7 @@ def deep_union_pydantic_dicts(source: Dict[str, Any], destination: Dict[str, Any if IS_PYDANTIC_V2: - class V2RootModel(UniversalBaseModel, pydantic.RootModel): # type: ignore[name-defined, type-arg] + class V2RootModel(UniversalBaseModel, pydantic.RootModel): # type: ignore[misc, name-defined, type-arg] pass UniversalRootModel: TypeAlias = V2RootModel # type: ignore[misc] diff --git a/src/monite/e_invoicing_connections/client.py b/src/monite/e_invoicing_connections/client.py index d9438cf..8c5d404 100644 --- a/src/monite/e_invoicing_connections/client.py +++ b/src/monite/e_invoicing_connections/client.py @@ -9,6 +9,7 @@ from ..types.einvoicing_address import EinvoicingAddress from ..types.einvoicing_connection_response import EinvoicingConnectionResponse from ..types.einvoicing_network_credentials_response import EinvoicingNetworkCredentialsResponse +from ..types.update_einvoicing_address import UpdateEinvoicingAddress from .raw_client import AsyncRawEInvoicingConnectionsClient, RawEInvoicingConnectionsClient # this is used as the default value for optional parameters @@ -58,6 +59,8 @@ def post_einvoicing_connections( *, address: EinvoicingAddress, entity_vat_id_id: typing.Optional[str] = OMIT, + is_receiver: typing.Optional[bool] = OMIT, + is_sender: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> EinvoicingConnectionResponse: """ @@ -69,6 +72,12 @@ def post_einvoicing_connections( entity_vat_id_id : typing.Optional[str] Entity VAT ID identifier for the integration + is_receiver : typing.Optional[bool] + Set to `true` if the entity needs to receive e-invoices. + + is_sender : typing.Optional[bool] + Set to `true` if the entity needs to send e-invoices. Either `is_sender` or `is_receiver` or both must be `true`. + request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -85,7 +94,11 @@ def post_einvoicing_connections( client.e_invoicing_connections.post_einvoicing_connections(address=EinvoicingAddress(address_line1='address_line1', city='city', country="DE", postal_code='postal_code', ), ) """ _response = self._raw_client.post_einvoicing_connections( - address=address, entity_vat_id_id=entity_vat_id_id, request_options=request_options + address=address, + entity_vat_id_id=entity_vat_id_id, + is_receiver=is_receiver, + is_sender=is_sender, + request_options=request_options, ) return _response.data @@ -142,6 +155,52 @@ def delete_einvoicing_connections_id( ) return _response.data + def patch_einvoicing_connections_id( + self, + einvoicing_connection_id: str, + *, + address: typing.Optional[UpdateEinvoicingAddress] = OMIT, + is_receiver: typing.Optional[bool] = OMIT, + is_sender: typing.Optional[bool] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> EinvoicingConnectionResponse: + """ + Parameters + ---------- + einvoicing_connection_id : str + + address : typing.Optional[UpdateEinvoicingAddress] + Integration Address + + is_receiver : typing.Optional[bool] + Set to `true` if the entity needs to receive e-invoices. + + is_sender : typing.Optional[bool] + Set to `true` if the entity needs to send e-invoices. Either `is_sender` or `is_receiver` or both must be `true`. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + EinvoicingConnectionResponse + Successful Response + + Examples + -------- + from monite import Monite + client = Monite(monite_version="YOUR_MONITE_VERSION", monite_entity_id="YOUR_MONITE_ENTITY_ID", token="YOUR_TOKEN", ) + client.e_invoicing_connections.patch_einvoicing_connections_id(einvoicing_connection_id='einvoicing_connection_id', ) + """ + _response = self._raw_client.patch_einvoicing_connections_id( + einvoicing_connection_id, + address=address, + is_receiver=is_receiver, + is_sender=is_sender, + request_options=request_options, + ) + return _response.data + def post_einvoicing_connections_id_network_credentials( self, einvoicing_connection_id: str, @@ -230,6 +289,8 @@ async def post_einvoicing_connections( *, address: EinvoicingAddress, entity_vat_id_id: typing.Optional[str] = OMIT, + is_receiver: typing.Optional[bool] = OMIT, + is_sender: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> EinvoicingConnectionResponse: """ @@ -241,6 +302,12 @@ async def post_einvoicing_connections( entity_vat_id_id : typing.Optional[str] Entity VAT ID identifier for the integration + is_receiver : typing.Optional[bool] + Set to `true` if the entity needs to receive e-invoices. + + is_sender : typing.Optional[bool] + Set to `true` if the entity needs to send e-invoices. Either `is_sender` or `is_receiver` or both must be `true`. + request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -260,7 +327,11 @@ async def main() -> None: asyncio.run(main()) """ _response = await self._raw_client.post_einvoicing_connections( - address=address, entity_vat_id_id=entity_vat_id_id, request_options=request_options + address=address, + entity_vat_id_id=entity_vat_id_id, + is_receiver=is_receiver, + is_sender=is_sender, + request_options=request_options, ) return _response.data @@ -323,6 +394,55 @@ async def main() -> None: ) return _response.data + async def patch_einvoicing_connections_id( + self, + einvoicing_connection_id: str, + *, + address: typing.Optional[UpdateEinvoicingAddress] = OMIT, + is_receiver: typing.Optional[bool] = OMIT, + is_sender: typing.Optional[bool] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> EinvoicingConnectionResponse: + """ + Parameters + ---------- + einvoicing_connection_id : str + + address : typing.Optional[UpdateEinvoicingAddress] + Integration Address + + is_receiver : typing.Optional[bool] + Set to `true` if the entity needs to receive e-invoices. + + is_sender : typing.Optional[bool] + Set to `true` if the entity needs to send e-invoices. Either `is_sender` or `is_receiver` or both must be `true`. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + EinvoicingConnectionResponse + Successful Response + + Examples + -------- + from monite import AsyncMonite + import asyncio + client = AsyncMonite(monite_version="YOUR_MONITE_VERSION", monite_entity_id="YOUR_MONITE_ENTITY_ID", token="YOUR_TOKEN", ) + async def main() -> None: + await client.e_invoicing_connections.patch_einvoicing_connections_id(einvoicing_connection_id='einvoicing_connection_id', ) + asyncio.run(main()) + """ + _response = await self._raw_client.patch_einvoicing_connections_id( + einvoicing_connection_id, + address=address, + is_receiver=is_receiver, + is_sender=is_sender, + request_options=request_options, + ) + return _response.data + async def post_einvoicing_connections_id_network_credentials( self, einvoicing_connection_id: str, diff --git a/src/monite/e_invoicing_connections/raw_client.py b/src/monite/e_invoicing_connections/raw_client.py index 73ead8b..69e7a19 100644 --- a/src/monite/e_invoicing_connections/raw_client.py +++ b/src/monite/e_invoicing_connections/raw_client.py @@ -22,6 +22,7 @@ from ..types.einvoicing_address import EinvoicingAddress from ..types.einvoicing_connection_response import EinvoicingConnectionResponse from ..types.einvoicing_network_credentials_response import EinvoicingNetworkCredentialsResponse +from ..types.update_einvoicing_address import UpdateEinvoicingAddress # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) @@ -125,6 +126,8 @@ def post_einvoicing_connections( *, address: EinvoicingAddress, entity_vat_id_id: typing.Optional[str] = OMIT, + is_receiver: typing.Optional[bool] = OMIT, + is_sender: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[EinvoicingConnectionResponse]: """ @@ -136,6 +139,12 @@ def post_einvoicing_connections( entity_vat_id_id : typing.Optional[str] Entity VAT ID identifier for the integration + is_receiver : typing.Optional[bool] + Set to `true` if the entity needs to receive e-invoices. + + is_sender : typing.Optional[bool] + Set to `true` if the entity needs to send e-invoices. Either `is_sender` or `is_receiver` or both must be `true`. + request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -152,6 +161,8 @@ def post_einvoicing_connections( object_=address, annotation=EinvoicingAddress, direction="write" ), "entity_vat_id_id": entity_vat_id_id, + "is_receiver": is_receiver, + "is_sender": is_sender, }, headers={ "content-type": "application/json", @@ -436,6 +447,145 @@ def delete_einvoicing_connections_id( raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + def patch_einvoicing_connections_id( + self, + einvoicing_connection_id: str, + *, + address: typing.Optional[UpdateEinvoicingAddress] = OMIT, + is_receiver: typing.Optional[bool] = OMIT, + is_sender: typing.Optional[bool] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> HttpResponse[EinvoicingConnectionResponse]: + """ + Parameters + ---------- + einvoicing_connection_id : str + + address : typing.Optional[UpdateEinvoicingAddress] + Integration Address + + is_receiver : typing.Optional[bool] + Set to `true` if the entity needs to receive e-invoices. + + is_sender : typing.Optional[bool] + Set to `true` if the entity needs to send e-invoices. Either `is_sender` or `is_receiver` or both must be `true`. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + HttpResponse[EinvoicingConnectionResponse] + Successful Response + """ + _response = self._client_wrapper.httpx_client.request( + f"einvoicing_connections/{jsonable_encoder(einvoicing_connection_id)}", + method="PATCH", + json={ + "address": convert_and_respect_annotation_metadata( + object_=address, annotation=UpdateEinvoicingAddress, direction="write" + ), + "is_receiver": is_receiver, + "is_sender": is_sender, + }, + headers={ + "content-type": "application/json", + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + EinvoicingConnectionResponse, + parse_obj_as( + type_=EinvoicingConnectionResponse, # type: ignore + object_=_response.json(), + ), + ) + return HttpResponse(response=_response, data=_data) + if _response.status_code == 400: + raise BadRequestError( + headers=dict(_response.headers), + body=typing.cast( + typing.Optional[typing.Any], + parse_obj_as( + type_=typing.Optional[typing.Any], # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + typing.Optional[typing.Any], + parse_obj_as( + type_=typing.Optional[typing.Any], # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + typing.Optional[typing.Any], + parse_obj_as( + type_=typing.Optional[typing.Any], # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 404: + raise NotFoundError( + headers=dict(_response.headers), + body=typing.cast( + typing.Optional[typing.Any], + parse_obj_as( + type_=typing.Optional[typing.Any], # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 409: + raise ConflictError( + headers=dict(_response.headers), + body=typing.cast( + typing.Optional[typing.Any], + parse_obj_as( + type_=typing.Optional[typing.Any], # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 422: + raise UnprocessableEntityError( + headers=dict(_response.headers), + body=typing.cast( + typing.Optional[typing.Any], + parse_obj_as( + type_=typing.Optional[typing.Any], # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 500: + raise InternalServerError( + headers=dict(_response.headers), + body=typing.cast( + typing.Optional[typing.Any], + parse_obj_as( + type_=typing.Optional[typing.Any], # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + def post_einvoicing_connections_id_network_credentials( self, einvoicing_connection_id: str, @@ -667,6 +817,8 @@ async def post_einvoicing_connections( *, address: EinvoicingAddress, entity_vat_id_id: typing.Optional[str] = OMIT, + is_receiver: typing.Optional[bool] = OMIT, + is_sender: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[EinvoicingConnectionResponse]: """ @@ -678,6 +830,12 @@ async def post_einvoicing_connections( entity_vat_id_id : typing.Optional[str] Entity VAT ID identifier for the integration + is_receiver : typing.Optional[bool] + Set to `true` if the entity needs to receive e-invoices. + + is_sender : typing.Optional[bool] + Set to `true` if the entity needs to send e-invoices. Either `is_sender` or `is_receiver` or both must be `true`. + request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -694,6 +852,8 @@ async def post_einvoicing_connections( object_=address, annotation=EinvoicingAddress, direction="write" ), "entity_vat_id_id": entity_vat_id_id, + "is_receiver": is_receiver, + "is_sender": is_sender, }, headers={ "content-type": "application/json", @@ -978,6 +1138,145 @@ async def delete_einvoicing_connections_id( raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + async def patch_einvoicing_connections_id( + self, + einvoicing_connection_id: str, + *, + address: typing.Optional[UpdateEinvoicingAddress] = OMIT, + is_receiver: typing.Optional[bool] = OMIT, + is_sender: typing.Optional[bool] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> AsyncHttpResponse[EinvoicingConnectionResponse]: + """ + Parameters + ---------- + einvoicing_connection_id : str + + address : typing.Optional[UpdateEinvoicingAddress] + Integration Address + + is_receiver : typing.Optional[bool] + Set to `true` if the entity needs to receive e-invoices. + + is_sender : typing.Optional[bool] + Set to `true` if the entity needs to send e-invoices. Either `is_sender` or `is_receiver` or both must be `true`. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncHttpResponse[EinvoicingConnectionResponse] + Successful Response + """ + _response = await self._client_wrapper.httpx_client.request( + f"einvoicing_connections/{jsonable_encoder(einvoicing_connection_id)}", + method="PATCH", + json={ + "address": convert_and_respect_annotation_metadata( + object_=address, annotation=UpdateEinvoicingAddress, direction="write" + ), + "is_receiver": is_receiver, + "is_sender": is_sender, + }, + headers={ + "content-type": "application/json", + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + EinvoicingConnectionResponse, + parse_obj_as( + type_=EinvoicingConnectionResponse, # type: ignore + object_=_response.json(), + ), + ) + return AsyncHttpResponse(response=_response, data=_data) + if _response.status_code == 400: + raise BadRequestError( + headers=dict(_response.headers), + body=typing.cast( + typing.Optional[typing.Any], + parse_obj_as( + type_=typing.Optional[typing.Any], # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + typing.Optional[typing.Any], + parse_obj_as( + type_=typing.Optional[typing.Any], # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + typing.Optional[typing.Any], + parse_obj_as( + type_=typing.Optional[typing.Any], # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 404: + raise NotFoundError( + headers=dict(_response.headers), + body=typing.cast( + typing.Optional[typing.Any], + parse_obj_as( + type_=typing.Optional[typing.Any], # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 409: + raise ConflictError( + headers=dict(_response.headers), + body=typing.cast( + typing.Optional[typing.Any], + parse_obj_as( + type_=typing.Optional[typing.Any], # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 422: + raise UnprocessableEntityError( + headers=dict(_response.headers), + body=typing.cast( + typing.Optional[typing.Any], + parse_obj_as( + type_=typing.Optional[typing.Any], # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 500: + raise InternalServerError( + headers=dict(_response.headers), + body=typing.cast( + typing.Optional[typing.Any], + parse_obj_as( + type_=typing.Optional[typing.Any], # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + async def post_einvoicing_connections_id_network_credentials( self, einvoicing_connection_id: str, diff --git a/src/monite/types/__init__.py b/src/monite/types/__init__.py index 2081e18..74ed2e4 100644 --- a/src/monite/types/__init__.py +++ b/src/monite/types/__init__.py @@ -667,6 +667,7 @@ from .unit_response import UnitResponse from .update_credit_note import UpdateCreditNote from .update_credit_note_payload import UpdateCreditNotePayload +from .update_einvoicing_address import UpdateEinvoicingAddress from .update_entity_address_schema import UpdateEntityAddressSchema from .update_entity_request import UpdateEntityRequest from .update_invoice import UpdateInvoice @@ -1365,6 +1366,7 @@ "UnitResponse", "UpdateCreditNote", "UpdateCreditNotePayload", + "UpdateEinvoicingAddress", "UpdateEntityAddressSchema", "UpdateEntityRequest", "UpdateInvoice", diff --git a/src/monite/types/einvoicing_connection_response.py b/src/monite/types/einvoicing_connection_response.py index cf67b8e..a266ae3 100644 --- a/src/monite/types/einvoicing_connection_response.py +++ b/src/monite/types/einvoicing_connection_response.py @@ -36,6 +36,16 @@ class EinvoicingConnectionResponse(UniversalBaseModel): ID of the entity """ + is_receiver: typing.Optional[bool] = pydantic.Field(default=None) + """ + Set to `true` if the entity needs to receive e-invoices. + """ + + is_sender: typing.Optional[bool] = pydantic.Field(default=None) + """ + Set to `true` if the entity needs to send e-invoices. Either `is_sender` or `is_receiver` or both must be `true`. + """ + legal_name: str = pydantic.Field() """ Legal name of the Entity diff --git a/src/monite/types/update_einvoicing_address.py b/src/monite/types/update_einvoicing_address.py new file mode 100644 index 0000000..8d2b678 --- /dev/null +++ b/src/monite/types/update_einvoicing_address.py @@ -0,0 +1,42 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel + + +class UpdateEinvoicingAddress(UniversalBaseModel): + address_line1: str = pydantic.Field() + """ + Street address line 1 + """ + + address_line2: typing.Optional[str] = pydantic.Field(default=None) + """ + Street address line 2 + """ + + city: str = pydantic.Field() + """ + City name + """ + + postal_code: str = pydantic.Field() + """ + Postal/ZIP code + """ + + state: typing.Optional[str] = pydantic.Field(default=None) + """ + State/Province/County + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow