From 89792ccb6dedc29163fb515d876a83f229cb331d Mon Sep 17 00:00:00 2001 From: lua Date: Mon, 3 Feb 2025 14:33:49 +0100 Subject: [PATCH] generates the new sdk for vouchers, etc --- .../add_apple_app_store_purchase.py | 215 ------------- .../add_google_playstore_purchase.py | 238 -------------- .../plenigo/api/customers/create_customer.py | 223 ------------- .../api/orders/get_order_additional_data.py | 8 +- .../payment_methods/delete_bank_account.py | 216 ------------- .../payment_methods/update_bank_account.py | 232 -------------- ...riptions_chain_chain_id_additional_data.py | 230 -------------- .../api/vouchers/create_voucher_campaign.py | 240 -------------- ...vouchers.py => search_channel_vouchers.py} | 106 ++++++- .../plenigo/api/vouchers/search_vouchers.py | 8 +- plenigo-client/plenigo/models/__init__.py | 84 +---- .../plenigo/models/access_right_item_data.py | 42 ++- ...ccess_right_item_data_access_right_data.py | 36 +-- .../models/access_right_item_data_data.py | 2 +- .../access_right_item_data_item_type.py | 14 + .../plenigo/models/additional_chain_data.py | 2 +- .../models/additional_chain_data_data.py | 29 +- ...nal_chain_data_data_additional_property.py | 67 ---- .../models/additional_customer_data.py | 71 ----- .../models/additional_customer_data_data.py | 60 ---- ..._customer_data_data_additional_property.py | 67 ---- .../plenigo/models/additional_order_data.py | 2 +- .../models/additional_order_data_data.py | 29 +- ...nal_order_data_data_additional_property.py | 67 ---- plenigo-client/plenigo/models/address_base.py | 266 ---------------- .../plenigo/models/address_base_salutation.py | 11 - .../models/address_base_validation_status.py | 12 - .../plenigo/models/address_change.py | 275 ---------------- .../{api_campaign_view.py => api_campaign.py} | 37 ++- .../plenigo/models/api_campaign_base.py | 17 +- .../plenigo/models/api_campaign_page.py | 77 +++-- ...aign_creation_result.py => api_channel.py} | 187 ++++------- .../plenigo/models/api_multi_voucher.py | 224 +++++++++++++ .../models/api_multi_voucher_status.py | 10 + plenigo-client/plenigo/models/api_voucher.py | 19 ++ .../plenigo/models/api_voucher_page.py | 73 ++--- .../plenigo/models/app_store_access_right.py | 81 ----- .../app_store_access_right_additional_data.py | 62 ---- ...ght_additional_data_additional_property.py | 67 ---- .../plenigo/models/app_store_access_rights.py | 74 ----- .../plenigo/models/app_store_purchase.py | 102 ------ .../models/app_store_purchase_detail.py | 141 -------- .../plenigo/models/app_store_purchase_list.py | 74 ----- .../apple_app_store_purchase_addition.py | 70 ---- .../plenigo/models/campaign_creation.py | 170 ---------- .../models/campaign_creation_voucher_type.py | 9 - .../plenigo/models/channel_creation.py | 76 ----- .../plenigo/models/customer_accepted_terms.py | 12 +- ...omer_accepted_terms_additional_property.py | 80 ----- .../models/customer_address_creation.py | 287 ----------------- .../models/customer_address_creation_type.py | 9 - .../plenigo/models/customer_change.py | 233 -------------- .../plenigo/models/customer_creation.py | 300 ------------------ plenigo-client/plenigo/models/error_result.py | 4 +- .../plenigo/models/error_result_base.py | 4 +- .../google_play_store_purchase_addition.py | 84 ----- ...le_play_store_purchase_addition_element.py | 76 ----- plenigo-client/plenigo/models/invoice.py | 14 +- plenigo-client/plenigo/models/offer.py | 35 +- plenigo-client/plenigo/models/offer_base.py | 35 +- .../plenigo/models/offer_product.py | 11 +- .../plenigo/models/offer_product_base.py | 11 +- .../offer_product_base_additional_data.py | 2 +- .../plenigo/models/offer_translation_image.py | 26 +- plenigo-client/plenigo/models/offers.py | 22 ++ plenigo-client/plenigo/models/order_item.py | 26 +- .../plenigo/models/order_item_tax_type.py | 24 -- .../plenigo/models/price_country_segment.py | 19 +- .../models/price_country_segment_creation.py | 19 +- plenigo-client/plenigo/models/product_tag.py | 17 +- .../plenigo/models/product_tag_creation.py | 17 +- .../models/product_tag_creation_category.py | 1 + .../plenigo/models/refund_payment_provider.py | 7 +- ...search_channel_vouchers_voucher_status.py} | 2 +- .../plenigo/models/subscription_item.py | 11 +- .../models/subscription_item_tax_type.py | 24 -- .../plenigo/models/success_status.py | 68 ---- ...r_product_base_tax_type.py => tax_type.py} | 4 +- plenigo-client/plenigo/models/transaction.py | 29 +- .../plenigo/models/validation_error.py | 6 +- 80 files changed, 795 insertions(+), 5146 deletions(-) delete mode 100644 plenigo-client/plenigo/api/app_stores/add_apple_app_store_purchase.py delete mode 100644 plenigo-client/plenigo/api/app_stores/add_google_playstore_purchase.py delete mode 100644 plenigo-client/plenigo/api/customers/create_customer.py delete mode 100644 plenigo-client/plenigo/api/payment_methods/delete_bank_account.py delete mode 100644 plenigo-client/plenigo/api/payment_methods/update_bank_account.py delete mode 100644 plenigo-client/plenigo/api/subscriptions/put_subscriptions_chain_chain_id_additional_data.py delete mode 100644 plenigo-client/plenigo/api/vouchers/create_voucher_campaign.py rename plenigo-client/plenigo/api/vouchers/{get_vouchers_channels_channel_id_vouchers.py => search_channel_vouchers.py} (70%) create mode 100644 plenigo-client/plenigo/models/access_right_item_data_item_type.py delete mode 100644 plenigo-client/plenigo/models/additional_chain_data_data_additional_property.py delete mode 100644 plenigo-client/plenigo/models/additional_customer_data.py delete mode 100644 plenigo-client/plenigo/models/additional_customer_data_data.py delete mode 100644 plenigo-client/plenigo/models/additional_customer_data_data_additional_property.py delete mode 100644 plenigo-client/plenigo/models/additional_order_data_data_additional_property.py delete mode 100644 plenigo-client/plenigo/models/address_base.py delete mode 100644 plenigo-client/plenigo/models/address_base_salutation.py delete mode 100644 plenigo-client/plenigo/models/address_base_validation_status.py delete mode 100644 plenigo-client/plenigo/models/address_change.py rename plenigo-client/plenigo/models/{api_campaign_view.py => api_campaign.py} (93%) rename plenigo-client/plenigo/models/{api_campaign_creation_result.py => api_channel.py} (56%) create mode 100644 plenigo-client/plenigo/models/api_multi_voucher.py create mode 100644 plenigo-client/plenigo/models/api_multi_voucher_status.py delete mode 100644 plenigo-client/plenigo/models/app_store_access_right.py delete mode 100644 plenigo-client/plenigo/models/app_store_access_right_additional_data.py delete mode 100644 plenigo-client/plenigo/models/app_store_access_right_additional_data_additional_property.py delete mode 100644 plenigo-client/plenigo/models/app_store_access_rights.py delete mode 100644 plenigo-client/plenigo/models/app_store_purchase.py delete mode 100644 plenigo-client/plenigo/models/app_store_purchase_detail.py delete mode 100644 plenigo-client/plenigo/models/app_store_purchase_list.py delete mode 100644 plenigo-client/plenigo/models/apple_app_store_purchase_addition.py delete mode 100644 plenigo-client/plenigo/models/campaign_creation.py delete mode 100644 plenigo-client/plenigo/models/campaign_creation_voucher_type.py delete mode 100644 plenigo-client/plenigo/models/channel_creation.py delete mode 100644 plenigo-client/plenigo/models/customer_accepted_terms_additional_property.py delete mode 100644 plenigo-client/plenigo/models/customer_address_creation.py delete mode 100644 plenigo-client/plenigo/models/customer_address_creation_type.py delete mode 100644 plenigo-client/plenigo/models/customer_change.py delete mode 100644 plenigo-client/plenigo/models/customer_creation.py delete mode 100644 plenigo-client/plenigo/models/google_play_store_purchase_addition.py delete mode 100644 plenigo-client/plenigo/models/google_play_store_purchase_addition_element.py delete mode 100644 plenigo-client/plenigo/models/order_item_tax_type.py rename plenigo-client/plenigo/models/{get_vouchers_channels_channel_id_vouchers_voucher_status.py => search_channel_vouchers_voucher_status.py} (73%) delete mode 100644 plenigo-client/plenigo/models/subscription_item_tax_type.py delete mode 100644 plenigo-client/plenigo/models/success_status.py rename plenigo-client/plenigo/models/{offer_product_base_tax_type.py => tax_type.py} (86%) diff --git a/plenigo-client/plenigo/api/app_stores/add_apple_app_store_purchase.py b/plenigo-client/plenigo/api/app_stores/add_apple_app_store_purchase.py deleted file mode 100644 index 58adc0c..0000000 --- a/plenigo-client/plenigo/api/app_stores/add_apple_app_store_purchase.py +++ /dev/null @@ -1,215 +0,0 @@ -import logging -from http import HTTPStatus -from typing import Any, Dict, Optional, Union - -import httpx -from tenacity import retry, retry_if_exception_type, stop_after_attempt, wait_exponential - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.app_store_purchase_list import AppStorePurchaseList -from ...models.apple_app_store_purchase_addition import AppleAppStorePurchaseAddition -from ...models.error_result import ErrorResult -from ...models.error_result_base import ErrorResultBase -from ...types import Response - -log = logging.getLogger(__name__) - - -def _get_kwargs( - *, - body: AppleAppStorePurchaseAddition, -) -> Dict[str, Any]: - headers: Dict[str, Any] = {} - - _kwargs: Dict[str, Any] = { - "method": "post", - "url": "/appStores/appleAppStore", - } - - _body = body.to_dict() - - _kwargs["json"] = _body - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - - log.debug(_kwargs) - - return _kwargs - - -def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[AppStorePurchaseList, ErrorResult, ErrorResultBase]]: - if response.status_code == HTTPStatus.CREATED: - response_201 = AppStorePurchaseList.from_dict(response.json()) - - return response_201 - if response.status_code == HTTPStatus.BAD_REQUEST: - response_400 = ErrorResult.from_dict(response.json()) - - return response_400 - if response.status_code == HTTPStatus.UNAUTHORIZED: - response_401 = ErrorResultBase.from_dict(response.json()) - - return response_401 - if response.status_code == HTTPStatus.TOO_MANY_REQUESTS: - response_429 = ErrorResultBase.from_dict(response.json()) - - return response_429 - if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: - response_500 = ErrorResultBase.from_dict(response.json()) - - return response_500 - if response.status_code == HTTPStatus.BAD_GATEWAY: - response_502 = ErrorResultBase.from_dict(response.json()) - - return response_502 - if response.status_code == HTTPStatus.GATEWAY_TIMEOUT: - response_504 = ErrorResultBase.from_dict(response.json()) - - return response_504 - - if (response.status_code == HTTPStatus.BAD_GATEWAY) or (response.status_code == HTTPStatus.GATEWAY_TIMEOUT): - raise errors.RetryableError - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[AppStorePurchaseList, ErrorResult, ErrorResultBase]]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -@retry( - retry=retry_if_exception_type(errors.RetryableError), - stop=stop_after_attempt(3), - wait=wait_exponential(multiplier=1, min=2, max=30), -) -def sync_detailed( - *, - client: AuthenticatedClient, - body: AppleAppStorePurchaseAddition, -) -> Response[Union[AppStorePurchaseList, ErrorResult, ErrorResultBase]]: - """Add Apple purchase - - Add an Apple app store purchase to the plenigo system and retrieve a token for further processing. - - Args: - body (AppleAppStorePurchaseAddition): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[Union[AppStorePurchaseList, ErrorResult, ErrorResultBase]] - """ - - kwargs = _get_kwargs( - body=body, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient, - body: AppleAppStorePurchaseAddition, -) -> Optional[Union[AppStorePurchaseList, ErrorResult, ErrorResultBase]]: - """Add Apple purchase - - Add an Apple app store purchase to the plenigo system and retrieve a token for further processing. - - Args: - body (AppleAppStorePurchaseAddition): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Union[AppStorePurchaseList, ErrorResult, ErrorResultBase] - """ - - return sync_detailed( - client=client, - body=body, - ).parsed - - -@retry( - retry=retry_if_exception_type(errors.RetryableError), - stop=stop_after_attempt(3), - wait=wait_exponential(multiplier=1, min=2, max=30), -) -async def asyncio_detailed( - *, - client: AuthenticatedClient, - body: AppleAppStorePurchaseAddition, -) -> Response[Union[AppStorePurchaseList, ErrorResult, ErrorResultBase]]: - """Add Apple purchase - - Add an Apple app store purchase to the plenigo system and retrieve a token for further processing. - - Args: - body (AppleAppStorePurchaseAddition): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[Union[AppStorePurchaseList, ErrorResult, ErrorResultBase]] - """ - - kwargs = _get_kwargs( - body=body, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient, - body: AppleAppStorePurchaseAddition, -) -> Optional[Union[AppStorePurchaseList, ErrorResult, ErrorResultBase]]: - """Add Apple purchase - - Add an Apple app store purchase to the plenigo system and retrieve a token for further processing. - - Args: - body (AppleAppStorePurchaseAddition): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Union[AppStorePurchaseList, ErrorResult, ErrorResultBase] - """ - - return ( - await asyncio_detailed( - client=client, - body=body, - ) - ).parsed diff --git a/plenigo-client/plenigo/api/app_stores/add_google_playstore_purchase.py b/plenigo-client/plenigo/api/app_stores/add_google_playstore_purchase.py deleted file mode 100644 index 8b2a3ab..0000000 --- a/plenigo-client/plenigo/api/app_stores/add_google_playstore_purchase.py +++ /dev/null @@ -1,238 +0,0 @@ -import logging -from http import HTTPStatus -from typing import Any, Dict, Optional, Union - -import httpx -from tenacity import retry, retry_if_exception_type, stop_after_attempt, wait_exponential - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.app_store_purchase import AppStorePurchase -from ...models.app_store_purchase_list import AppStorePurchaseList -from ...models.error_result import ErrorResult -from ...models.error_result_base import ErrorResultBase -from ...models.google_play_store_purchase_addition import GooglePlayStorePurchaseAddition -from ...types import Response - -log = logging.getLogger(__name__) - - -def _get_kwargs( - *, - body: GooglePlayStorePurchaseAddition, -) -> Dict[str, Any]: - headers: Dict[str, Any] = {} - - _kwargs: Dict[str, Any] = { - "method": "post", - "url": "/appStores/googlePlayStore", - } - - _body = body.to_dict() - - _kwargs["json"] = _body - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - - log.debug(_kwargs) - - return _kwargs - - -def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorResult, ErrorResultBase, Union["AppStorePurchase", "AppStorePurchaseList"]]]: - if response.status_code == HTTPStatus.CREATED: - - def _parse_response_201(data: object) -> Union["AppStorePurchase", "AppStorePurchaseList"]: - # Try to parse the data as AppStorePurchase - try: - if not isinstance(data, dict): - raise TypeError() - response_201_type_0 = AppStorePurchase.from_dict(data) - - return response_201_type_0 - except: # noqa: E722 - pass - - # In order to parse the one remaining property in the union, - # data must be a dict - if not isinstance(data, dict): - raise TypeError() - - # Finally, parse the data as AppStorePurchaseList - response_201_type_1 = AppStorePurchaseList.from_dict(data) - - return response_201_type_1 - - response_201 = _parse_response_201(response.json()) - - return response_201 - if response.status_code == HTTPStatus.BAD_REQUEST: - response_400 = ErrorResult.from_dict(response.json()) - - return response_400 - if response.status_code == HTTPStatus.UNAUTHORIZED: - response_401 = ErrorResultBase.from_dict(response.json()) - - return response_401 - if response.status_code == HTTPStatus.TOO_MANY_REQUESTS: - response_429 = ErrorResultBase.from_dict(response.json()) - - return response_429 - if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: - response_500 = ErrorResultBase.from_dict(response.json()) - - return response_500 - if response.status_code == HTTPStatus.BAD_GATEWAY: - response_502 = ErrorResultBase.from_dict(response.json()) - - return response_502 - if response.status_code == HTTPStatus.GATEWAY_TIMEOUT: - response_504 = ErrorResultBase.from_dict(response.json()) - - return response_504 - - if (response.status_code == HTTPStatus.BAD_GATEWAY) or (response.status_code == HTTPStatus.GATEWAY_TIMEOUT): - raise errors.RetryableError - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorResult, ErrorResultBase, Union["AppStorePurchase", "AppStorePurchaseList"]]]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -@retry( - retry=retry_if_exception_type(errors.RetryableError), - stop=stop_after_attempt(3), - wait=wait_exponential(multiplier=1, min=2, max=30), -) -def sync_detailed( - *, - client: AuthenticatedClient, - body: GooglePlayStorePurchaseAddition, -) -> Response[Union[ErrorResult, ErrorResultBase, Union["AppStorePurchase", "AppStorePurchaseList"]]]: - """Add Google purchase - - Add a Google Playstore purchase to the plenigo system and retrieve a token for further processing. - - Args: - body (GooglePlayStorePurchaseAddition): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[Union[ErrorResult, ErrorResultBase, Union['AppStorePurchase', 'AppStorePurchaseList']]] - """ - - kwargs = _get_kwargs( - body=body, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient, - body: GooglePlayStorePurchaseAddition, -) -> Optional[Union[ErrorResult, ErrorResultBase, Union["AppStorePurchase", "AppStorePurchaseList"]]]: - """Add Google purchase - - Add a Google Playstore purchase to the plenigo system and retrieve a token for further processing. - - Args: - body (GooglePlayStorePurchaseAddition): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Union[ErrorResult, ErrorResultBase, Union['AppStorePurchase', 'AppStorePurchaseList']] - """ - - return sync_detailed( - client=client, - body=body, - ).parsed - - -@retry( - retry=retry_if_exception_type(errors.RetryableError), - stop=stop_after_attempt(3), - wait=wait_exponential(multiplier=1, min=2, max=30), -) -async def asyncio_detailed( - *, - client: AuthenticatedClient, - body: GooglePlayStorePurchaseAddition, -) -> Response[Union[ErrorResult, ErrorResultBase, Union["AppStorePurchase", "AppStorePurchaseList"]]]: - """Add Google purchase - - Add a Google Playstore purchase to the plenigo system and retrieve a token for further processing. - - Args: - body (GooglePlayStorePurchaseAddition): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[Union[ErrorResult, ErrorResultBase, Union['AppStorePurchase', 'AppStorePurchaseList']]] - """ - - kwargs = _get_kwargs( - body=body, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient, - body: GooglePlayStorePurchaseAddition, -) -> Optional[Union[ErrorResult, ErrorResultBase, Union["AppStorePurchase", "AppStorePurchaseList"]]]: - """Add Google purchase - - Add a Google Playstore purchase to the plenigo system and retrieve a token for further processing. - - Args: - body (GooglePlayStorePurchaseAddition): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Union[ErrorResult, ErrorResultBase, Union['AppStorePurchase', 'AppStorePurchaseList']] - """ - - return ( - await asyncio_detailed( - client=client, - body=body, - ) - ).parsed diff --git a/plenigo-client/plenigo/api/customers/create_customer.py b/plenigo-client/plenigo/api/customers/create_customer.py deleted file mode 100644 index b8291da..0000000 --- a/plenigo-client/plenigo/api/customers/create_customer.py +++ /dev/null @@ -1,223 +0,0 @@ -import logging -from http import HTTPStatus -from typing import Any, Dict, Optional, Union - -import httpx -from tenacity import retry, retry_if_exception_type, stop_after_attempt, wait_exponential - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.customer import Customer -from ...models.customer_creation import CustomerCreation -from ...models.error_result import ErrorResult -from ...models.error_result_base import ErrorResultBase -from ...types import Response - -log = logging.getLogger(__name__) - - -def _get_kwargs( - *, - body: CustomerCreation, -) -> Dict[str, Any]: - headers: Dict[str, Any] = {} - - _kwargs: Dict[str, Any] = { - "method": "post", - "url": "/customers", - } - - _body = body.to_dict() - - _kwargs["json"] = _body - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - - log.debug(_kwargs) - - return _kwargs - - -def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[Customer, ErrorResult, ErrorResultBase]]: - if response.status_code == HTTPStatus.CREATED: - response_201 = Customer.from_dict(response.json()) - - return response_201 - if response.status_code == HTTPStatus.ALREADY_REPORTED: - response_208 = Customer.from_dict(response.json()) - - return response_208 - if response.status_code == HTTPStatus.BAD_REQUEST: - response_400 = ErrorResult.from_dict(response.json()) - - return response_400 - if response.status_code == HTTPStatus.UNAUTHORIZED: - response_401 = ErrorResultBase.from_dict(response.json()) - - return response_401 - if response.status_code == HTTPStatus.NOT_FOUND: - response_404 = ErrorResultBase.from_dict(response.json()) - - return response_404 - if response.status_code == HTTPStatus.TOO_MANY_REQUESTS: - response_429 = ErrorResultBase.from_dict(response.json()) - - return response_429 - if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: - response_500 = ErrorResultBase.from_dict(response.json()) - - return response_500 - if response.status_code == HTTPStatus.BAD_GATEWAY: - response_502 = ErrorResultBase.from_dict(response.json()) - - return response_502 - if response.status_code == HTTPStatus.GATEWAY_TIMEOUT: - response_504 = ErrorResultBase.from_dict(response.json()) - - return response_504 - - if (response.status_code == HTTPStatus.BAD_GATEWAY) or (response.status_code == HTTPStatus.GATEWAY_TIMEOUT): - raise errors.RetryableError - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[Customer, ErrorResult, ErrorResultBase]]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -@retry( - retry=retry_if_exception_type(errors.RetryableError), - stop=stop_after_attempt(3), - wait=wait_exponential(multiplier=1, min=2, max=30), -) -def sync_detailed( - *, - client: AuthenticatedClient, - body: CustomerCreation, -) -> Response[Union[Customer, ErrorResult, ErrorResultBase]]: - """Create customer - - Create a new customer with the data provided. - - Args: - body (CustomerCreation): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[Union[Customer, ErrorResult, ErrorResultBase]] - """ - - kwargs = _get_kwargs( - body=body, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient, - body: CustomerCreation, -) -> Optional[Union[Customer, ErrorResult, ErrorResultBase]]: - """Create customer - - Create a new customer with the data provided. - - Args: - body (CustomerCreation): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Union[Customer, ErrorResult, ErrorResultBase] - """ - - return sync_detailed( - client=client, - body=body, - ).parsed - - -@retry( - retry=retry_if_exception_type(errors.RetryableError), - stop=stop_after_attempt(3), - wait=wait_exponential(multiplier=1, min=2, max=30), -) -async def asyncio_detailed( - *, - client: AuthenticatedClient, - body: CustomerCreation, -) -> Response[Union[Customer, ErrorResult, ErrorResultBase]]: - """Create customer - - Create a new customer with the data provided. - - Args: - body (CustomerCreation): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[Union[Customer, ErrorResult, ErrorResultBase]] - """ - - kwargs = _get_kwargs( - body=body, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient, - body: CustomerCreation, -) -> Optional[Union[Customer, ErrorResult, ErrorResultBase]]: - """Create customer - - Create a new customer with the data provided. - - Args: - body (CustomerCreation): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Union[Customer, ErrorResult, ErrorResultBase] - """ - - return ( - await asyncio_detailed( - client=client, - body=body, - ) - ).parsed diff --git a/plenigo-client/plenigo/api/orders/get_order_additional_data.py b/plenigo-client/plenigo/api/orders/get_order_additional_data.py index 1136764..fbdc0d1 100644 --- a/plenigo-client/plenigo/api/orders/get_order_additional_data.py +++ b/plenigo-client/plenigo/api/orders/get_order_additional_data.py @@ -89,7 +89,7 @@ def sync_detailed( *, client: AuthenticatedClient, ) -> Response[Union[AdditionalOrderData, ErrorResultBase]]: - """Get additional data + """Get additional order data Returns additional data associated with the order associated with the provided order id. @@ -120,7 +120,7 @@ def sync( *, client: AuthenticatedClient, ) -> Optional[Union[AdditionalOrderData, ErrorResultBase]]: - """Get additional data + """Get additional order data Returns additional data associated with the order associated with the provided order id. @@ -151,7 +151,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, ) -> Response[Union[AdditionalOrderData, ErrorResultBase]]: - """Get additional data + """Get additional order data Returns additional data associated with the order associated with the provided order id. @@ -180,7 +180,7 @@ async def asyncio( *, client: AuthenticatedClient, ) -> Optional[Union[AdditionalOrderData, ErrorResultBase]]: - """Get additional data + """Get additional order data Returns additional data associated with the order associated with the provided order id. diff --git a/plenigo-client/plenigo/api/payment_methods/delete_bank_account.py b/plenigo-client/plenigo/api/payment_methods/delete_bank_account.py deleted file mode 100644 index f27d186..0000000 --- a/plenigo-client/plenigo/api/payment_methods/delete_bank_account.py +++ /dev/null @@ -1,216 +0,0 @@ -import logging -from http import HTTPStatus -from typing import Any, Dict, Optional, Union - -import httpx -from tenacity import retry, retry_if_exception_type, stop_after_attempt, wait_exponential - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.error_result import ErrorResult -from ...models.error_result_base import ErrorResultBase -from ...models.success_status import SuccessStatus -from ...types import Response - -log = logging.getLogger(__name__) - - -def _get_kwargs( - bank_account_id: int, -) -> Dict[str, Any]: - _kwargs: Dict[str, Any] = { - "method": "delete", - "url": f"/paymentMethods/bankAccounts/{bank_account_id}", - } - - log.debug(_kwargs) - - return _kwargs - - -def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorResult, ErrorResultBase, SuccessStatus]]: - if response.status_code == HTTPStatus.ACCEPTED: - response_202 = SuccessStatus.from_dict(response.json()) - - return response_202 - if response.status_code == HTTPStatus.BAD_REQUEST: - response_400 = ErrorResult.from_dict(response.json()) - - return response_400 - if response.status_code == HTTPStatus.UNAUTHORIZED: - response_401 = ErrorResultBase.from_dict(response.json()) - - return response_401 - if response.status_code == HTTPStatus.NOT_FOUND: - response_404 = ErrorResultBase.from_dict(response.json()) - - return response_404 - if response.status_code == HTTPStatus.TOO_MANY_REQUESTS: - response_429 = ErrorResultBase.from_dict(response.json()) - - return response_429 - if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: - response_500 = ErrorResultBase.from_dict(response.json()) - - return response_500 - if response.status_code == HTTPStatus.BAD_GATEWAY: - response_502 = ErrorResultBase.from_dict(response.json()) - - return response_502 - if response.status_code == HTTPStatus.GATEWAY_TIMEOUT: - response_504 = ErrorResultBase.from_dict(response.json()) - - return response_504 - - if (response.status_code == HTTPStatus.BAD_GATEWAY) or (response.status_code == HTTPStatus.GATEWAY_TIMEOUT): - raise errors.RetryableError - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorResult, ErrorResultBase, SuccessStatus]]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -@retry( - retry=retry_if_exception_type(errors.RetryableError), - stop=stop_after_attempt(3), - wait=wait_exponential(multiplier=1, min=2, max=30), -) -def sync_detailed( - bank_account_id: int, - *, - client: AuthenticatedClient, -) -> Response[Union[ErrorResult, ErrorResultBase, SuccessStatus]]: - """Delete a bank account - - Delete a bank account. This is only possible if bank account is not associated with a subscription. - Otherwise the subscription association must be - removed first. - - Args: - bank_account_id (int): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[Union[ErrorResult, ErrorResultBase, SuccessStatus]] - """ - - kwargs = _get_kwargs( - bank_account_id=bank_account_id, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - bank_account_id: int, - *, - client: AuthenticatedClient, -) -> Optional[Union[ErrorResult, ErrorResultBase, SuccessStatus]]: - """Delete a bank account - - Delete a bank account. This is only possible if bank account is not associated with a subscription. - Otherwise the subscription association must be - removed first. - - Args: - bank_account_id (int): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Union[ErrorResult, ErrorResultBase, SuccessStatus] - """ - - return sync_detailed( - bank_account_id=bank_account_id, - client=client, - ).parsed - - -@retry( - retry=retry_if_exception_type(errors.RetryableError), - stop=stop_after_attempt(3), - wait=wait_exponential(multiplier=1, min=2, max=30), -) -async def asyncio_detailed( - bank_account_id: int, - *, - client: AuthenticatedClient, -) -> Response[Union[ErrorResult, ErrorResultBase, SuccessStatus]]: - """Delete a bank account - - Delete a bank account. This is only possible if bank account is not associated with a subscription. - Otherwise the subscription association must be - removed first. - - Args: - bank_account_id (int): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[Union[ErrorResult, ErrorResultBase, SuccessStatus]] - """ - - kwargs = _get_kwargs( - bank_account_id=bank_account_id, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - bank_account_id: int, - *, - client: AuthenticatedClient, -) -> Optional[Union[ErrorResult, ErrorResultBase, SuccessStatus]]: - """Delete a bank account - - Delete a bank account. This is only possible if bank account is not associated with a subscription. - Otherwise the subscription association must be - removed first. - - Args: - bank_account_id (int): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Union[ErrorResult, ErrorResultBase, SuccessStatus] - """ - - return ( - await asyncio_detailed( - bank_account_id=bank_account_id, - client=client, - ) - ).parsed diff --git a/plenigo-client/plenigo/api/payment_methods/update_bank_account.py b/plenigo-client/plenigo/api/payment_methods/update_bank_account.py deleted file mode 100644 index 078079e..0000000 --- a/plenigo-client/plenigo/api/payment_methods/update_bank_account.py +++ /dev/null @@ -1,232 +0,0 @@ -import logging -from http import HTTPStatus -from typing import Any, Dict, Optional, Union - -import httpx -from tenacity import retry, retry_if_exception_type, stop_after_attempt, wait_exponential - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.bank_account import BankAccount -from ...models.bank_account_change import BankAccountChange -from ...models.error_result import ErrorResult -from ...models.error_result_base import ErrorResultBase -from ...types import Response - -log = logging.getLogger(__name__) - - -def _get_kwargs( - bank_account_id: int, - *, - body: BankAccountChange, -) -> Dict[str, Any]: - headers: Dict[str, Any] = {} - - _kwargs: Dict[str, Any] = { - "method": "put", - "url": f"/paymentMethods/bankAccounts/{bank_account_id}", - } - - _body = body.to_dict() - - _kwargs["json"] = _body - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - - log.debug(_kwargs) - - return _kwargs - - -def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[BankAccount, ErrorResult, ErrorResultBase]]: - if response.status_code == HTTPStatus.OK: - response_200 = BankAccount.from_dict(response.json()) - - return response_200 - if response.status_code == HTTPStatus.BAD_REQUEST: - response_400 = ErrorResult.from_dict(response.json()) - - return response_400 - if response.status_code == HTTPStatus.UNAUTHORIZED: - response_401 = ErrorResultBase.from_dict(response.json()) - - return response_401 - if response.status_code == HTTPStatus.NOT_FOUND: - response_404 = ErrorResultBase.from_dict(response.json()) - - return response_404 - if response.status_code == HTTPStatus.TOO_MANY_REQUESTS: - response_429 = ErrorResultBase.from_dict(response.json()) - - return response_429 - if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: - response_500 = ErrorResultBase.from_dict(response.json()) - - return response_500 - if response.status_code == HTTPStatus.BAD_GATEWAY: - response_502 = ErrorResultBase.from_dict(response.json()) - - return response_502 - if response.status_code == HTTPStatus.GATEWAY_TIMEOUT: - response_504 = ErrorResultBase.from_dict(response.json()) - - return response_504 - - if (response.status_code == HTTPStatus.BAD_GATEWAY) or (response.status_code == HTTPStatus.GATEWAY_TIMEOUT): - raise errors.RetryableError - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[BankAccount, ErrorResult, ErrorResultBase]]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -@retry( - retry=retry_if_exception_type(errors.RetryableError), - stop=stop_after_attempt(3), - wait=wait_exponential(multiplier=1, min=2, max=30), -) -def sync_detailed( - bank_account_id: int, - *, - client: Union[AuthenticatedClient, Client], - body: BankAccountChange, -) -> Response[Union[BankAccount, ErrorResult, ErrorResultBase]]: - """Update bank account entity - - Update a bank account that is identified by the passed bank account id with the data provided. - - Args: - bank_account_id (int): - body (BankAccountChange): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[Union[BankAccount, ErrorResult, ErrorResultBase]] - """ - - kwargs = _get_kwargs( - bank_account_id=bank_account_id, - body=body, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - bank_account_id: int, - *, - client: Union[AuthenticatedClient, Client], - body: BankAccountChange, -) -> Optional[Union[BankAccount, ErrorResult, ErrorResultBase]]: - """Update bank account entity - - Update a bank account that is identified by the passed bank account id with the data provided. - - Args: - bank_account_id (int): - body (BankAccountChange): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Union[BankAccount, ErrorResult, ErrorResultBase] - """ - - return sync_detailed( - bank_account_id=bank_account_id, - client=client, - body=body, - ).parsed - - -@retry( - retry=retry_if_exception_type(errors.RetryableError), - stop=stop_after_attempt(3), - wait=wait_exponential(multiplier=1, min=2, max=30), -) -async def asyncio_detailed( - bank_account_id: int, - *, - client: Union[AuthenticatedClient, Client], - body: BankAccountChange, -) -> Response[Union[BankAccount, ErrorResult, ErrorResultBase]]: - """Update bank account entity - - Update a bank account that is identified by the passed bank account id with the data provided. - - Args: - bank_account_id (int): - body (BankAccountChange): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[Union[BankAccount, ErrorResult, ErrorResultBase]] - """ - - kwargs = _get_kwargs( - bank_account_id=bank_account_id, - body=body, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - bank_account_id: int, - *, - client: Union[AuthenticatedClient, Client], - body: BankAccountChange, -) -> Optional[Union[BankAccount, ErrorResult, ErrorResultBase]]: - """Update bank account entity - - Update a bank account that is identified by the passed bank account id with the data provided. - - Args: - bank_account_id (int): - body (BankAccountChange): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Union[BankAccount, ErrorResult, ErrorResultBase] - """ - - return ( - await asyncio_detailed( - bank_account_id=bank_account_id, - client=client, - body=body, - ) - ).parsed diff --git a/plenigo-client/plenigo/api/subscriptions/put_subscriptions_chain_chain_id_additional_data.py b/plenigo-client/plenigo/api/subscriptions/put_subscriptions_chain_chain_id_additional_data.py deleted file mode 100644 index c533dc5..0000000 --- a/plenigo-client/plenigo/api/subscriptions/put_subscriptions_chain_chain_id_additional_data.py +++ /dev/null @@ -1,230 +0,0 @@ -import logging -from http import HTTPStatus -from typing import Any, Dict, Optional, Union - -import httpx -from tenacity import retry, retry_if_exception_type, stop_after_attempt, wait_exponential - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.additional_chain_data import AdditionalChainData -from ...models.error_result_base import ErrorResultBase -from ...types import Response - -log = logging.getLogger(__name__) - - -def _get_kwargs( - chain_id: int, - *, - body: AdditionalChainData, -) -> Dict[str, Any]: - headers: Dict[str, Any] = {} - - _kwargs: Dict[str, Any] = { - "method": "put", - "url": f"/subscriptions/chain/{chain_id}/additionalData", - } - - _body = body.to_dict() - - _kwargs["json"] = _body - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - - log.debug(_kwargs) - - return _kwargs - - -def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[AdditionalChainData, ErrorResultBase]]: - if response.status_code == HTTPStatus.OK: - response_200 = AdditionalChainData.from_dict(response.json()) - - return response_200 - if response.status_code == HTTPStatus.UNAUTHORIZED: - response_401 = ErrorResultBase.from_dict(response.json()) - - return response_401 - if response.status_code == HTTPStatus.NOT_FOUND: - response_404 = ErrorResultBase.from_dict(response.json()) - - return response_404 - if response.status_code == HTTPStatus.TOO_MANY_REQUESTS: - response_429 = ErrorResultBase.from_dict(response.json()) - - return response_429 - if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: - response_500 = ErrorResultBase.from_dict(response.json()) - - return response_500 - if response.status_code == HTTPStatus.BAD_GATEWAY: - response_502 = ErrorResultBase.from_dict(response.json()) - - return response_502 - if response.status_code == HTTPStatus.GATEWAY_TIMEOUT: - response_504 = ErrorResultBase.from_dict(response.json()) - - return response_504 - - if (response.status_code == HTTPStatus.BAD_GATEWAY) or (response.status_code == HTTPStatus.GATEWAY_TIMEOUT): - raise errors.RetryableError - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[AdditionalChainData, ErrorResultBase]]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -@retry( - retry=retry_if_exception_type(errors.RetryableError), - stop=stop_after_attempt(3), - wait=wait_exponential(multiplier=1, min=2, max=30), -) -def sync_detailed( - chain_id: int, - *, - client: Union[AuthenticatedClient, Client], - body: AdditionalChainData, -) -> Response[Union[AdditionalChainData, ErrorResultBase]]: - """Replace additional chain data - - Replace additional data of a subscription chain. All data will be replaced with the new data - provided. - - Args: - chain_id (int): - body (AdditionalChainData): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[Union[AdditionalChainData, ErrorResultBase]] - """ - - kwargs = _get_kwargs( - chain_id=chain_id, - body=body, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - chain_id: int, - *, - client: Union[AuthenticatedClient, Client], - body: AdditionalChainData, -) -> Optional[Union[AdditionalChainData, ErrorResultBase]]: - """Replace additional chain data - - Replace additional data of a subscription chain. All data will be replaced with the new data - provided. - - Args: - chain_id (int): - body (AdditionalChainData): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Union[AdditionalChainData, ErrorResultBase] - """ - - return sync_detailed( - chain_id=chain_id, - client=client, - body=body, - ).parsed - - -@retry( - retry=retry_if_exception_type(errors.RetryableError), - stop=stop_after_attempt(3), - wait=wait_exponential(multiplier=1, min=2, max=30), -) -async def asyncio_detailed( - chain_id: int, - *, - client: Union[AuthenticatedClient, Client], - body: AdditionalChainData, -) -> Response[Union[AdditionalChainData, ErrorResultBase]]: - """Replace additional chain data - - Replace additional data of a subscription chain. All data will be replaced with the new data - provided. - - Args: - chain_id (int): - body (AdditionalChainData): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[Union[AdditionalChainData, ErrorResultBase]] - """ - - kwargs = _get_kwargs( - chain_id=chain_id, - body=body, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - chain_id: int, - *, - client: Union[AuthenticatedClient, Client], - body: AdditionalChainData, -) -> Optional[Union[AdditionalChainData, ErrorResultBase]]: - """Replace additional chain data - - Replace additional data of a subscription chain. All data will be replaced with the new data - provided. - - Args: - chain_id (int): - body (AdditionalChainData): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Union[AdditionalChainData, ErrorResultBase] - """ - - return ( - await asyncio_detailed( - chain_id=chain_id, - client=client, - body=body, - ) - ).parsed diff --git a/plenigo-client/plenigo/api/vouchers/create_voucher_campaign.py b/plenigo-client/plenigo/api/vouchers/create_voucher_campaign.py deleted file mode 100644 index 0494486..0000000 --- a/plenigo-client/plenigo/api/vouchers/create_voucher_campaign.py +++ /dev/null @@ -1,240 +0,0 @@ -import logging -from http import HTTPStatus -from typing import Any, Dict, Optional, Union - -import httpx -from tenacity import retry, retry_if_exception_type, stop_after_attempt, wait_exponential - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.api_campaign_creation_result import ApiCampaignCreationResult -from ...models.campaign_creation import CampaignCreation -from ...models.error_result import ErrorResult -from ...models.error_result_base import ErrorResultBase -from ...models.success_status import SuccessStatus -from ...types import UNSET, Response, Unset - -log = logging.getLogger(__name__) - - -def _get_kwargs( - *, - body: CampaignCreation, - callback: Union[Unset, bool] = UNSET, -) -> Dict[str, Any]: - headers: Dict[str, Any] = {} - - params: Dict[str, Any] = {} - - params["callback"] = callback - - params = {k: v for k, v in params.items() if v is not UNSET and v is not None} - - _kwargs: Dict[str, Any] = { - "method": "post", - "url": "/vouchers/campaigns", - "params": params, - } - - _body = body.to_dict() - - _kwargs["json"] = _body - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - - log.debug(_kwargs) - - return _kwargs - - -def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ApiCampaignCreationResult, ErrorResult, ErrorResultBase, SuccessStatus]]: - if response.status_code == HTTPStatus.CREATED: - response_201 = ApiCampaignCreationResult.from_dict(response.json()) - - return response_201 - if response.status_code == HTTPStatus.ACCEPTED: - response_202 = SuccessStatus.from_dict(response.json()) - - return response_202 - if response.status_code == HTTPStatus.BAD_REQUEST: - response_400 = ErrorResult.from_dict(response.json()) - - return response_400 - if response.status_code == HTTPStatus.UNAUTHORIZED: - response_401 = ErrorResultBase.from_dict(response.json()) - - return response_401 - if response.status_code == HTTPStatus.TOO_MANY_REQUESTS: - response_429 = ErrorResultBase.from_dict(response.json()) - - return response_429 - if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: - response_500 = ErrorResultBase.from_dict(response.json()) - - return response_500 - if response.status_code == HTTPStatus.BAD_GATEWAY: - response_502 = ErrorResultBase.from_dict(response.json()) - - return response_502 - if response.status_code == HTTPStatus.GATEWAY_TIMEOUT: - response_504 = ErrorResultBase.from_dict(response.json()) - - return response_504 - - if (response.status_code == HTTPStatus.BAD_GATEWAY) or (response.status_code == HTTPStatus.GATEWAY_TIMEOUT): - raise errors.RetryableError - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ApiCampaignCreationResult, ErrorResult, ErrorResultBase, SuccessStatus]]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -@retry( - retry=retry_if_exception_type(errors.RetryableError), - stop=stop_after_attempt(3), - wait=wait_exponential(multiplier=1, min=2, max=30), -) -def sync_detailed( - *, - client: AuthenticatedClient, - body: CampaignCreation, - callback: Union[Unset, bool] = UNSET, -) -> Response[Union[ApiCampaignCreationResult, ErrorResult, ErrorResultBase, SuccessStatus]]: - """Create voucher campaign - - *ASYNC* Creates a new voucher campaign with the data provided. ATTENTION - this process is async. - - Args: - callback (Union[Unset, bool]): - body (CampaignCreation): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[Union[ApiCampaignCreationResult, ErrorResult, ErrorResultBase, SuccessStatus]] - """ - - kwargs = _get_kwargs( - body=body, - callback=callback, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient, - body: CampaignCreation, - callback: Union[Unset, bool] = UNSET, -) -> Optional[Union[ApiCampaignCreationResult, ErrorResult, ErrorResultBase, SuccessStatus]]: - """Create voucher campaign - - *ASYNC* Creates a new voucher campaign with the data provided. ATTENTION - this process is async. - - Args: - callback (Union[Unset, bool]): - body (CampaignCreation): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Union[ApiCampaignCreationResult, ErrorResult, ErrorResultBase, SuccessStatus] - """ - - return sync_detailed( - client=client, - body=body, - callback=callback, - ).parsed - - -@retry( - retry=retry_if_exception_type(errors.RetryableError), - stop=stop_after_attempt(3), - wait=wait_exponential(multiplier=1, min=2, max=30), -) -async def asyncio_detailed( - *, - client: AuthenticatedClient, - body: CampaignCreation, - callback: Union[Unset, bool] = UNSET, -) -> Response[Union[ApiCampaignCreationResult, ErrorResult, ErrorResultBase, SuccessStatus]]: - """Create voucher campaign - - *ASYNC* Creates a new voucher campaign with the data provided. ATTENTION - this process is async. - - Args: - callback (Union[Unset, bool]): - body (CampaignCreation): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[Union[ApiCampaignCreationResult, ErrorResult, ErrorResultBase, SuccessStatus]] - """ - - kwargs = _get_kwargs( - body=body, - callback=callback, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient, - body: CampaignCreation, - callback: Union[Unset, bool] = UNSET, -) -> Optional[Union[ApiCampaignCreationResult, ErrorResult, ErrorResultBase, SuccessStatus]]: - """Create voucher campaign - - *ASYNC* Creates a new voucher campaign with the data provided. ATTENTION - this process is async. - - Args: - callback (Union[Unset, bool]): - body (CampaignCreation): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Union[ApiCampaignCreationResult, ErrorResult, ErrorResultBase, SuccessStatus] - """ - - return ( - await asyncio_detailed( - client=client, - body=body, - callback=callback, - ) - ).parsed diff --git a/plenigo-client/plenigo/api/vouchers/get_vouchers_channels_channel_id_vouchers.py b/plenigo-client/plenigo/api/vouchers/search_channel_vouchers.py similarity index 70% rename from plenigo-client/plenigo/api/vouchers/get_vouchers_channels_channel_id_vouchers.py rename to plenigo-client/plenigo/api/vouchers/search_channel_vouchers.py index 628583e..7beb94a 100644 --- a/plenigo-client/plenigo/api/vouchers/get_vouchers_channels_channel_id_vouchers.py +++ b/plenigo-client/plenigo/api/vouchers/search_channel_vouchers.py @@ -3,16 +3,14 @@ from typing import Any, Dict, Optional, Union import httpx -from tenacity import retry, retry_if_exception_type, stop_after_attempt, wait_exponential +from tenacity import RetryError, retry, retry_if_exception_type, stop_after_attempt, wait_exponential from ... import errors from ...client import AuthenticatedClient, Client from ...models.api_voucher_page import ApiVoucherPage from ...models.error_result import ErrorResult from ...models.error_result_base import ErrorResultBase -from ...models.get_vouchers_channels_channel_id_vouchers_voucher_status import ( - GetVouchersChannelsChannelIdVouchersVoucherStatus, -) +from ...models.search_channel_vouchers_voucher_status import SearchChannelVouchersVoucherStatus from ...types import UNSET, Response, Unset log = logging.getLogger(__name__) @@ -24,7 +22,7 @@ def _get_kwargs( starting_after: Union[Unset, str] = UNSET, ending_before: Union[Unset, str] = UNSET, size: Union[Unset, int] = UNSET, - voucher_status: Union[Unset, GetVouchersChannelsChannelIdVouchersVoucherStatus] = UNSET, + voucher_status: Union[Unset, SearchChannelVouchersVoucherStatus] = UNSET, ) -> Dict[str, Any]: params: Dict[str, Any] = {} @@ -101,6 +99,46 @@ def _build_response( ) +def sync_all( + channel_id: str, + *, + client: AuthenticatedClient, + starting_after: Union[Unset, str] = UNSET, + ending_before: Union[Unset, str] = UNSET, + size: Union[Unset, int] = UNSET, + voucher_status: Union[Unset, SearchChannelVouchersVoucherStatus] = UNSET, +) -> Optional[Union[ApiVoucherPage, ErrorResult, ErrorResultBase]]: + all_results = ApiVoucherPage(items=[]) + # type: ignore + + while True: + try: + results = sync_detailed( + channel_id=channel_id, + client=client, + starting_after=starting_after, + ending_before=ending_before, + size=size, + voucher_status=voucher_status, + ).parsed + + if results and not isinstance(results, ErrorResultBase) and not isinstance(results.items, Unset): + all_results.items.extend(results.items) # type: ignore + + cursor = results.additional_properties.get("startingAfterId") + + if not cursor: + break + + starting_after = cursor # noqa + else: + break + except RetryError: + break + + return all_results + + @retry( retry=retry_if_exception_type(errors.RetryableError), stop=stop_after_attempt(3), @@ -113,7 +151,7 @@ def sync_detailed( starting_after: Union[Unset, str] = UNSET, ending_before: Union[Unset, str] = UNSET, size: Union[Unset, int] = UNSET, - voucher_status: Union[Unset, GetVouchersChannelsChannelIdVouchersVoucherStatus] = UNSET, + voucher_status: Union[Unset, SearchChannelVouchersVoucherStatus] = UNSET, ) -> Response[Union[ApiVoucherPage, ErrorResult, ErrorResultBase]]: """Returns channel vouchers @@ -124,7 +162,7 @@ def sync_detailed( starting_after (Union[Unset, str]): ending_before (Union[Unset, str]): size (Union[Unset, int]): - voucher_status (Union[Unset, GetVouchersChannelsChannelIdVouchersVoucherStatus]): + voucher_status (Union[Unset, SearchChannelVouchersVoucherStatus]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -156,7 +194,7 @@ def sync( starting_after: Union[Unset, str] = UNSET, ending_before: Union[Unset, str] = UNSET, size: Union[Unset, int] = UNSET, - voucher_status: Union[Unset, GetVouchersChannelsChannelIdVouchersVoucherStatus] = UNSET, + voucher_status: Union[Unset, SearchChannelVouchersVoucherStatus] = UNSET, ) -> Optional[Union[ApiVoucherPage, ErrorResult, ErrorResultBase]]: """Returns channel vouchers @@ -167,7 +205,7 @@ def sync( starting_after (Union[Unset, str]): ending_before (Union[Unset, str]): size (Union[Unset, int]): - voucher_status (Union[Unset, GetVouchersChannelsChannelIdVouchersVoucherStatus]): + voucher_status (Union[Unset, SearchChannelVouchersVoucherStatus]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -199,7 +237,7 @@ async def asyncio_detailed( starting_after: Union[Unset, str] = UNSET, ending_before: Union[Unset, str] = UNSET, size: Union[Unset, int] = UNSET, - voucher_status: Union[Unset, GetVouchersChannelsChannelIdVouchersVoucherStatus] = UNSET, + voucher_status: Union[Unset, SearchChannelVouchersVoucherStatus] = UNSET, ) -> Response[Union[ApiVoucherPage, ErrorResult, ErrorResultBase]]: """Returns channel vouchers @@ -210,7 +248,7 @@ async def asyncio_detailed( starting_after (Union[Unset, str]): ending_before (Union[Unset, str]): size (Union[Unset, int]): - voucher_status (Union[Unset, GetVouchersChannelsChannelIdVouchersVoucherStatus]): + voucher_status (Union[Unset, SearchChannelVouchersVoucherStatus]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -233,6 +271,48 @@ async def asyncio_detailed( return _build_response(client=client, response=response) +async def asyncio_all( + channel_id: str, + *, + client: AuthenticatedClient, + starting_after: Union[Unset, str] = UNSET, + ending_before: Union[Unset, str] = UNSET, + size: Union[Unset, int] = UNSET, + voucher_status: Union[Unset, SearchChannelVouchersVoucherStatus] = UNSET, +) -> Response[Union[ApiVoucherPage, ErrorResult, ErrorResultBase]]: + all_results = ApiVoucherPage(items=[]) + # type: ignore + + while True: + try: + results = ( + await asyncio_detailed( + channel_id=channel_id, + client=client, + starting_after=starting_after, + ending_before=ending_before, + size=size, + voucher_status=voucher_status, + ) + ).parsed + + if results and not isinstance(results, ErrorResultBase) and not isinstance(results.items, Unset): + all_results.items.extend(results.items) # type: ignore + + cursor = results.additional_properties.get("startingAfterId") + + if not cursor: + break + + starting_after = cursor # noqa + else: + break + except RetryError: + break + + return all_results + + async def asyncio( channel_id: str, *, @@ -240,7 +320,7 @@ async def asyncio( starting_after: Union[Unset, str] = UNSET, ending_before: Union[Unset, str] = UNSET, size: Union[Unset, int] = UNSET, - voucher_status: Union[Unset, GetVouchersChannelsChannelIdVouchersVoucherStatus] = UNSET, + voucher_status: Union[Unset, SearchChannelVouchersVoucherStatus] = UNSET, ) -> Optional[Union[ApiVoucherPage, ErrorResult, ErrorResultBase]]: """Returns channel vouchers @@ -251,7 +331,7 @@ async def asyncio( starting_after (Union[Unset, str]): ending_before (Union[Unset, str]): size (Union[Unset, int]): - voucher_status (Union[Unset, GetVouchersChannelsChannelIdVouchersVoucherStatus]): + voucher_status (Union[Unset, SearchChannelVouchersVoucherStatus]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/plenigo-client/plenigo/api/vouchers/search_vouchers.py b/plenigo-client/plenigo/api/vouchers/search_vouchers.py index fc9c512..378da86 100644 --- a/plenigo-client/plenigo/api/vouchers/search_vouchers.py +++ b/plenigo-client/plenigo/api/vouchers/search_vouchers.py @@ -168,7 +168,7 @@ def sync_detailed( size: Union[Unset, int] = UNSET, voucher_status: Union[Unset, SearchVouchersVoucherStatus] = UNSET, ) -> Response[Union[ApiVoucherPage, ErrorResult, ErrorResultBase]]: - """Returns all vouchers + """Search all vouchers Returns all vouchers of the selected channel page, depending on query parameters @@ -214,7 +214,7 @@ def sync( size: Union[Unset, int] = UNSET, voucher_status: Union[Unset, SearchVouchersVoucherStatus] = UNSET, ) -> Optional[Union[ApiVoucherPage, ErrorResult, ErrorResultBase]]: - """Returns all vouchers + """Search all vouchers Returns all vouchers of the selected channel page, depending on query parameters @@ -260,7 +260,7 @@ async def asyncio_detailed( size: Union[Unset, int] = UNSET, voucher_status: Union[Unset, SearchVouchersVoucherStatus] = UNSET, ) -> Response[Union[ApiVoucherPage, ErrorResult, ErrorResultBase]]: - """Returns all vouchers + """Search all vouchers Returns all vouchers of the selected channel page, depending on query parameters @@ -348,7 +348,7 @@ async def asyncio( size: Union[Unset, int] = UNSET, voucher_status: Union[Unset, SearchVouchersVoucherStatus] = UNSET, ) -> Optional[Union[ApiVoucherPage, ErrorResult, ErrorResultBase]]: - """Returns all vouchers + """Search all vouchers Returns all vouchers of the selected channel page, depending on query parameters diff --git a/plenigo-client/plenigo/models/__init__.py b/plenigo-client/plenigo/models/__init__.py index 72c2fb2..83514b3 100644 --- a/plenigo-client/plenigo/models/__init__.py +++ b/plenigo-client/plenigo/models/__init__.py @@ -4,52 +4,36 @@ from .access_right_item_data import AccessRightItemData from .access_right_item_data_access_right_data import AccessRightItemDataAccessRightData from .access_right_item_data_data import AccessRightItemDataData +from .access_right_item_data_item_type import AccessRightItemDataItemType from .access_rights_data import AccessRightsData from .additional_chain_data import AdditionalChainData from .additional_chain_data_data import AdditionalChainDataData -from .additional_chain_data_data_additional_property import AdditionalChainDataDataAdditionalProperty -from .additional_customer_data import AdditionalCustomerData -from .additional_customer_data_data import AdditionalCustomerDataData -from .additional_customer_data_data_additional_property import AdditionalCustomerDataDataAdditionalProperty from .additional_order_data import AdditionalOrderData from .additional_order_data_data import AdditionalOrderDataData -from .additional_order_data_data_additional_property import AdditionalOrderDataDataAdditionalProperty -from .address_base import AddressBase -from .address_base_salutation import AddressBaseSalutation -from .address_base_validation_status import AddressBaseValidationStatus -from .address_change import AddressChange from .api_base import ApiBase from .api_base_date import ApiBaseDate +from .api_campaign import ApiCampaign from .api_campaign_base import ApiCampaignBase from .api_campaign_base_status import ApiCampaignBaseStatus from .api_campaign_base_voucher_type import ApiCampaignBaseVoucherType -from .api_campaign_creation_result import ApiCampaignCreationResult from .api_campaign_page import ApiCampaignPage -from .api_campaign_view import ApiCampaignView +from .api_channel import ApiChannel from .api_channel_base import ApiChannelBase from .api_channel_base_status import ApiChannelBaseStatus +from .api_multi_voucher import ApiMultiVoucher +from .api_multi_voucher_status import ApiMultiVoucherStatus from .api_search_result_base import ApiSearchResultBase from .api_voucher import ApiVoucher from .api_voucher_page import ApiVoucherPage from .api_voucher_status import ApiVoucherStatus -from .app_store_access_right import AppStoreAccessRight -from .app_store_access_right_additional_data import AppStoreAccessRightAdditionalData -from .app_store_access_right_additional_data_additional_property import ( - AppStoreAccessRightAdditionalDataAdditionalProperty, -) -from .app_store_access_rights import AppStoreAccessRights from .app_store_order import AppStoreOrder from .app_store_order_item import AppStoreOrderItem from .app_store_order_store_type import AppStoreOrderStoreType from .app_store_orders import AppStoreOrders -from .app_store_purchase import AppStorePurchase -from .app_store_purchase_detail import AppStorePurchaseDetail -from .app_store_purchase_list import AppStorePurchaseList from .app_store_subscription import AppStoreSubscription from .app_store_subscription_status import AppStoreSubscriptionStatus from .app_store_subscriptions import AppStoreSubscriptions from .apple_app_store_purchase import AppleAppStorePurchase -from .apple_app_store_purchase_addition import AppleAppStorePurchaseAddition from .apple_app_store_purchase_data import AppleAppStorePurchaseData from .apple_app_store_purchases import AppleAppStorePurchases from .apple_app_store_receipt import AppleAppStoreReceipt @@ -60,9 +44,6 @@ from .bank_account import BankAccount from .bank_account_change import BankAccountChange from .bank_account_creation import BankAccountCreation -from .campaign_creation import CampaignCreation -from .campaign_creation_voucher_type import CampaignCreationVoucherType -from .channel_creation import ChannelCreation from .credit_based_product_contract_condition import CreditBasedProductContractCondition from .credit_based_product_contract_condition_accounting_timespan import ( CreditBasedProductContractConditionAccountingTimespan, @@ -77,9 +58,6 @@ from .customer import Customer from .customer_accepted_term import CustomerAcceptedTerm from .customer_accepted_terms import CustomerAcceptedTerms -from .customer_accepted_terms_additional_property import CustomerAcceptedTermsAdditionalProperty -from .customer_address_creation import CustomerAddressCreation -from .customer_address_creation_type import CustomerAddressCreationType from .customer_base import CustomerBase from .customer_base_salutation import CustomerBaseSalutation from .customer_cancellation_reason import CustomerCancellationReason @@ -87,8 +65,6 @@ from .customer_cancellation_reason_translation import CustomerCancellationReasonTranslation from .customer_cancellation_reason_update import CustomerCancellationReasonUpdate from .customer_cancellation_reasons import CustomerCancellationReasons -from .customer_change import CustomerChange -from .customer_creation import CustomerCreation from .customer_customer_marks_item import CustomerCustomerMarksItem from .customer_miscellaneous_data import CustomerMiscellaneousData from .customer_sso_login_providers_item import CustomerSsoLoginProvidersItem @@ -96,12 +72,9 @@ from .customers import Customers from .error_result import ErrorResult from .error_result_base import ErrorResultBase -from .get_vouchers_channels_channel_id_vouchers_voucher_status import GetVouchersChannelsChannelIdVouchersVoucherStatus from .gift_info import GiftInfo from .google_play_product_purchase import GooglePlayProductPurchase from .google_play_store_purchase import GooglePlayStorePurchase -from .google_play_store_purchase_addition import GooglePlayStorePurchaseAddition -from .google_play_store_purchase_addition_element import GooglePlayStorePurchaseAdditionElement from .google_play_store_purchases import GooglePlayStorePurchases from .google_play_subscription_purchase import GooglePlaySubscriptionPurchase from .invoice import Invoice @@ -131,7 +104,6 @@ from .offer_product_base_additional_data import OfferProductBaseAdditionalData from .offer_product_base_data import OfferProductBaseData from .offer_product_base_product_type import OfferProductBaseProductType -from .offer_product_base_tax_type import OfferProductBaseTaxType from .offer_product_base_voucher_validity_timespan import OfferProductBaseVoucherValidityTimespan from .offer_product_group import OfferProductGroup from .offer_product_group_base import OfferProductGroupBase @@ -152,7 +124,6 @@ from .order_address import OrderAddress from .order_address_salutation import OrderAddressSalutation from .order_item import OrderItem -from .order_item_tax_type import OrderItemTaxType from .order_payment_method import OrderPaymentMethod from .order_status import OrderStatus from .order_type import OrderType @@ -185,6 +156,7 @@ from .search_app_store_orders_sort import SearchAppStoreOrdersSort from .search_app_store_subscriptions_sort import SearchAppStoreSubscriptionsSort from .search_apple_app_store_purchases_sort import SearchAppleAppStorePurchasesSort +from .search_channel_vouchers_voucher_status import SearchChannelVouchersVoucherStatus from .search_customers_sort import SearchCustomersSort from .search_google_play_store_purchases_sort import SearchGooglePlayStorePurchasesSort from .search_invoices_invoice_type import SearchInvoicesInvoiceType @@ -204,7 +176,6 @@ from .subscription_duration_period_time_span import SubscriptionDurationPeriodTimeSpan from .subscription_item import SubscriptionItem from .subscription_item_status import SubscriptionItemStatus -from .subscription_item_tax_type import SubscriptionItemTaxType from .subscription_managed_by import SubscriptionManagedBy from .subscription_pause_at import SubscriptionPauseAt from .subscription_pause_at_pause_type import SubscriptionPauseAtPauseType @@ -215,7 +186,7 @@ from .subscription_successor_reason import SubscriptionSuccessorReason from .subscription_term_time_span import SubscriptionTermTimeSpan from .subscriptions import Subscriptions -from .success_status import SuccessStatus +from .tax_type import TaxType from .time_based_product_contract_condition import TimeBasedProductContractCondition from .time_based_product_contract_condition_accounting_timespan import ( TimeBasedProductContractConditionAccountingTimespan, @@ -242,52 +213,38 @@ "AccessRightItemData", "AccessRightItemDataAccessRightData", "AccessRightItemDataData", + "AccessRightItemDataItemType", "AccessRightsData", "AdditionalChainData", "AdditionalChainDataData", - "AdditionalChainDataDataAdditionalProperty", - "AdditionalCustomerData", - "AdditionalCustomerDataData", - "AdditionalCustomerDataDataAdditionalProperty", "AdditionalOrderData", "AdditionalOrderDataData", - "AdditionalOrderDataDataAdditionalProperty", - "AddressBase", - "AddressBaseSalutation", - "AddressBaseValidationStatus", - "AddressChange", "ApiBase", "ApiBaseDate", + "ApiCampaign", "ApiCampaignBase", "ApiCampaignBaseStatus", "ApiCampaignBaseVoucherType", - "ApiCampaignCreationResult", "ApiCampaignPage", - "ApiCampaignView", + "ApiChannel", "ApiChannelBase", "ApiChannelBaseStatus", + "ApiMultiVoucher", + "ApiMultiVoucherStatus", "ApiSearchResultBase", "ApiVoucher", "ApiVoucherPage", "ApiVoucherStatus", "AppleAppStorePurchase", - "AppleAppStorePurchaseAddition", "AppleAppStorePurchaseData", "AppleAppStorePurchases", "AppleAppStoreReceipt", "AppleAppStoreReceiptItem", "AppleAppStoreTransaction", - "AppStoreAccessRight", - "AppStoreAccessRightAdditionalData", - "AppStoreAccessRightAdditionalDataAdditionalProperty", - "AppStoreAccessRights", "AppStoreOrder", "AppStoreOrderItem", "AppStoreOrders", "AppStoreOrderStoreType", - "AppStorePurchase", - "AppStorePurchaseDetail", - "AppStorePurchaseList", "AppStoreSubscription", "AppStoreSubscriptions", "AppStoreSubscriptionStatus", @@ -296,9 +253,6 @@ "BankAccount", "BankAccountChange", "BankAccountCreation", - "CampaignCreation", - "CampaignCreationVoucherType", - "ChannelCreation", "CreditBasedProductContractCondition", "CreditBasedProductContractConditionAccountingTimespan", "CreditBasedProductContractConditionCancellationTimespan", @@ -307,9 +261,6 @@ "Customer", "CustomerAcceptedTerm", "CustomerAcceptedTerms", - "CustomerAcceptedTermsAdditionalProperty", - "CustomerAddressCreation", - "CustomerAddressCreationType", "CustomerBase", "CustomerBaseSalutation", "CustomerCancellationReason", @@ -317,8 +268,6 @@ "CustomerCancellationReasons", "CustomerCancellationReasonTranslation", "CustomerCancellationReasonUpdate", - "CustomerChange", - "CustomerCreation", "CustomerCustomerMarksItem", "CustomerMiscellaneousData", "Customers", @@ -326,12 +275,9 @@ "CustomerStatus", "ErrorResult", "ErrorResultBase", - "GetVouchersChannelsChannelIdVouchersVoucherStatus", "GiftInfo", "GooglePlayProductPurchase", "GooglePlayStorePurchase", - "GooglePlayStorePurchaseAddition", - "GooglePlayStorePurchaseAdditionElement", "GooglePlayStorePurchases", "GooglePlaySubscriptionPurchase", "Invoice", @@ -359,7 +305,6 @@ "OfferProductBaseAdditionalData", "OfferProductBaseData", "OfferProductBaseProductType", - "OfferProductBaseTaxType", "OfferProductBaseVoucherValidityTimespan", "OfferProductGroup", "OfferProductGroupBase", @@ -380,7 +325,6 @@ "OrderAddress", "OrderAddressSalutation", "OrderItem", - "OrderItemTaxType", "OrderPaymentMethod", "Orders", "OrderStatus", @@ -413,6 +357,7 @@ "SearchAppleAppStorePurchasesSort", "SearchAppStoreOrdersSort", "SearchAppStoreSubscriptionsSort", + "SearchChannelVouchersVoucherStatus", "SearchCustomersSort", "SearchGooglePlayStorePurchasesSort", "SearchInvoicesInvoiceType", @@ -432,7 +377,6 @@ "SubscriptionDurationPeriodTimeSpan", "SubscriptionItem", "SubscriptionItemStatus", - "SubscriptionItemTaxType", "SubscriptionManagedBy", "SubscriptionPauseAt", "SubscriptionPauseAtPauseType", @@ -443,7 +387,7 @@ "SubscriptionSubscriptionType", "SubscriptionSuccessorReason", "SubscriptionTermTimeSpan", - "SuccessStatus", + "TaxType", "TimeBasedProductContractCondition", "TimeBasedProductContractConditionAccountingTimespan", "TimeBasedProductContractConditionCancellationTimespan", diff --git a/plenigo-client/plenigo/models/access_right_item_data.py b/plenigo-client/plenigo/models/access_right_item_data.py index 4769aa1..fb51def 100644 --- a/plenigo-client/plenigo/models/access_right_item_data.py +++ b/plenigo-client/plenigo/models/access_right_item_data.py @@ -5,6 +5,7 @@ from attrs import field as _attrs_field from dateutil.parser import isoparse +from ..models.access_right_item_data_item_type import AccessRightItemDataItemType from ..models.user_type import UserType from ..types import UNSET, Unset @@ -20,6 +21,7 @@ class AccessRightItemData: """ Attributes: + access_right_unique_id (str): unique id of the access right this access right grants access to created_date (Union[None, Unset, datetime.datetime]): time the object was created with time notation as defined by RFC 3339, section 5.6, for example, 17:32:28 @@ -45,7 +47,7 @@ class AccessRightItemData: max_cache_date (Union[None, Unset, datetime.datetime]): max cache date with date-time notation as defined by RFC 3339, section 5.6, for example, 2017-07-21T17:32:28Z - data (Union[Unset, AccessRightItemDataData]): + data (Union[Unset, AccessRightItemDataData]): Key must be a string with a maximum length of 20 characters. blocked (Union[Unset, bool]): flag indicating if access is blocked product_id (Union[Unset, str]): id of the product bought plenigo_offer_id (Union[Unset, str]): if the product is based on a plenigo offer the plenigo offer id is @@ -54,12 +56,13 @@ class AccessRightItemData: provided here - can be identically to the productId plenigo_step_id (Union[Unset, str]): if the product is based on a plenigo offer the plenigo step id is provided here - access_right_unique_id (Union[Unset, str]): unique id of the access right this access right grants access to - item_type (Union[Unset, str]): type of this access right item + item_type (Union[Unset, AccessRightItemDataItemType]): type of this access right item item_id (Union[Unset, str]): the id this access right belongs to - access_right_data (Union[Unset, AccessRightItemDataAccessRightData]): + access_right_data (Union[Unset, AccessRightItemDataAccessRightData]): Key must be a string with a maximum length + of 30 characters. """ + access_right_unique_id: str created_date: Union[None, Unset, datetime.datetime] = UNSET changed_date: Union[None, Unset, datetime.datetime] = UNSET created_by: Union[Unset, str] = UNSET @@ -77,13 +80,14 @@ class AccessRightItemData: plenigo_offer_id: Union[Unset, str] = UNSET plenigo_product_id: Union[Unset, str] = UNSET plenigo_step_id: Union[Unset, str] = UNSET - access_right_unique_id: Union[Unset, str] = UNSET - item_type: Union[Unset, str] = UNSET + item_type: Union[Unset, AccessRightItemDataItemType] = UNSET item_id: Union[Unset, str] = UNSET access_right_data: Union[Unset, "AccessRightItemDataAccessRightData"] = UNSET additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> Dict[str, Any]: + access_right_unique_id = self.access_right_unique_id + created_date: Union[None, Unset, str] if isinstance(self.created_date, Unset) or self.created_date is None: created_date = UNSET @@ -166,9 +170,9 @@ def to_dict(self) -> Dict[str, Any]: plenigo_step_id = self.plenigo_step_id - access_right_unique_id = self.access_right_unique_id - - item_type = self.item_type + item_type: Union[Unset, str] = UNSET + if not isinstance(self.item_type, Unset): + item_type = self.item_type.value item_id = self.item_id @@ -178,7 +182,11 @@ def to_dict(self) -> Dict[str, Any]: field_dict: Dict[str, Any] = {} field_dict.update(self.additional_properties) - field_dict.update({}) + field_dict.update( + { + "accessRightUniqueId": access_right_unique_id, + } + ) if created_date is not UNSET: field_dict["createdDate"] = created_date if changed_date is not UNSET: @@ -213,8 +221,6 @@ def to_dict(self) -> Dict[str, Any]: field_dict["plenigoProductId"] = plenigo_product_id if plenigo_step_id is not UNSET: field_dict["plenigoStepId"] = plenigo_step_id - if access_right_unique_id is not UNSET: - field_dict["accessRightUniqueId"] = access_right_unique_id if item_type is not UNSET: field_dict["itemType"] = item_type if item_id is not UNSET: @@ -230,6 +236,7 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: from ..models.access_right_item_data_data import AccessRightItemDataData d = src_dict.copy() + access_right_unique_id = d.pop("accessRightUniqueId") def _parse_created_date(data: object) -> Union[None, Unset, datetime.datetime]: if data is None: @@ -434,9 +441,12 @@ def _parse_max_cache_date(data: object) -> Union[None, Unset, datetime.datetime] plenigo_step_id = d.pop("plenigoStepId", UNSET) - access_right_unique_id = d.pop("accessRightUniqueId", UNSET) - - item_type = d.pop("itemType", UNSET) + _item_type = d.pop("itemType", UNSET) + item_type: Union[Unset, AccessRightItemDataItemType] + if isinstance(_item_type, Unset) or not _item_type: + item_type = UNSET + else: + item_type = AccessRightItemDataItemType(_item_type) item_id = d.pop("itemId", UNSET) @@ -448,6 +458,7 @@ def _parse_max_cache_date(data: object) -> Union[None, Unset, datetime.datetime] access_right_data = AccessRightItemDataAccessRightData.from_dict(_access_right_data) access_right_item_data = cls( + access_right_unique_id=access_right_unique_id, created_date=created_date, changed_date=changed_date, created_by=created_by, @@ -465,7 +476,6 @@ def _parse_max_cache_date(data: object) -> Union[None, Unset, datetime.datetime] plenigo_offer_id=plenigo_offer_id, plenigo_product_id=plenigo_product_id, plenigo_step_id=plenigo_step_id, - access_right_unique_id=access_right_unique_id, item_type=item_type, item_id=item_id, access_right_data=access_right_data, diff --git a/plenigo-client/plenigo/models/access_right_item_data_access_right_data.py b/plenigo-client/plenigo/models/access_right_item_data_access_right_data.py index 551b38a..4be7433 100644 --- a/plenigo-client/plenigo/models/access_right_item_data_access_right_data.py +++ b/plenigo-client/plenigo/models/access_right_item_data_access_right_data.py @@ -1,51 +1,27 @@ -from typing import Any, Dict, List, Type, TypeVar, Union +from typing import Any, Dict, List, Type, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset - T = TypeVar("T", bound="AccessRightItemDataAccessRightData") @_attrs_define class AccessRightItemDataAccessRightData: - """ - Attributes: - key (Union[Unset, str]): - value (Union[Unset, str]): - """ + """Key must be a string with a maximum length of 30 characters.""" - key: Union[Unset, str] = UNSET - value: Union[Unset, str] = UNSET - additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) + additional_properties: Dict[str, str] = _attrs_field(init=False, factory=dict) def to_dict(self) -> Dict[str, Any]: - key = self.key - - value = self.value - field_dict: Dict[str, Any] = {} field_dict.update(self.additional_properties) - field_dict.update({}) - if key is not UNSET: - field_dict["key"] = key - if value is not UNSET: - field_dict["value"] = value return field_dict @classmethod def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: d = src_dict.copy() - key = d.pop("key", UNSET) - - value = d.pop("value", UNSET) - - access_right_item_data_access_right_data = cls( - key=key, - value=value, - ) + access_right_item_data_access_right_data = cls() access_right_item_data_access_right_data.additional_properties = d return access_right_item_data_access_right_data @@ -54,10 +30,10 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: def additional_keys(self) -> List[str]: return list(self.additional_properties.keys()) - def __getitem__(self, key: str) -> Any: + def __getitem__(self, key: str) -> str: return self.additional_properties[key] - def __setitem__(self, key: str, value: Any) -> None: + def __setitem__(self, key: str, value: str) -> None: self.additional_properties[key] = value def __delitem__(self, key: str) -> None: diff --git a/plenigo-client/plenigo/models/access_right_item_data_data.py b/plenigo-client/plenigo/models/access_right_item_data_data.py index c150f49..6948d9c 100644 --- a/plenigo-client/plenigo/models/access_right_item_data_data.py +++ b/plenigo-client/plenigo/models/access_right_item_data_data.py @@ -8,7 +8,7 @@ @_attrs_define class AccessRightItemDataData: - """ """ + """Key must be a string with a maximum length of 20 characters.""" additional_properties: Dict[str, str] = _attrs_field(init=False, factory=dict) diff --git a/plenigo-client/plenigo/models/access_right_item_data_item_type.py b/plenigo-client/plenigo/models/access_right_item_data_item_type.py new file mode 100644 index 0000000..8133833 --- /dev/null +++ b/plenigo-client/plenigo/models/access_right_item_data_item_type.py @@ -0,0 +1,14 @@ +from enum import Enum + + +class AccessRightItemDataItemType(str, Enum): + APP_STORE_PRODUCT = "APP_STORE_PRODUCT" + APP_STORE_SUBSCRIPTION = "APP_STORE_SUBSCRIPTION" + CORPORATE_ACCOUNT = "CORPORATE_ACCOUNT" + EXTERNAL = "EXTERNAL" + SINGLE_PRODUCT = "SINGLE_PRODUCT" + SUBSCRIPTION = "SUBSCRIPTION" + SUBSCRIPTION_ITEM = "SUBSCRIPTION_ITEM" + + def __str__(self) -> str: + return str(self.value) diff --git a/plenigo-client/plenigo/models/additional_chain_data.py b/plenigo-client/plenigo/models/additional_chain_data.py index a022439..5d828b3 100644 --- a/plenigo-client/plenigo/models/additional_chain_data.py +++ b/plenigo-client/plenigo/models/additional_chain_data.py @@ -16,7 +16,7 @@ class AdditionalChainData: """ Attributes: - data (Union[Unset, AdditionalChainDataData]): + data (Union[Unset, AdditionalChainDataData]): Key must be a string with a maximum length of 30 characters. """ data: Union[Unset, "AdditionalChainDataData"] = UNSET diff --git a/plenigo-client/plenigo/models/additional_chain_data_data.py b/plenigo-client/plenigo/models/additional_chain_data_data.py index 279b5c6..287d590 100644 --- a/plenigo-client/plenigo/models/additional_chain_data_data.py +++ b/plenigo-client/plenigo/models/additional_chain_data_data.py @@ -1,54 +1,39 @@ -from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar +from typing import Any, Dict, List, Type, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field -if TYPE_CHECKING: - from ..models.additional_chain_data_data_additional_property import AdditionalChainDataDataAdditionalProperty - - T = TypeVar("T", bound="AdditionalChainDataData") @_attrs_define class AdditionalChainDataData: - """ """ + """Key must be a string with a maximum length of 30 characters.""" - additional_properties: Dict[str, "AdditionalChainDataDataAdditionalProperty"] = _attrs_field( - init=False, factory=dict - ) + additional_properties: Dict[str, str] = _attrs_field(init=False, factory=dict) def to_dict(self) -> Dict[str, Any]: field_dict: Dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - field_dict[prop_name] = prop.to_dict() + field_dict.update(self.additional_properties) return field_dict @classmethod def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: - from ..models.additional_chain_data_data_additional_property import AdditionalChainDataDataAdditionalProperty - d = src_dict.copy() additional_chain_data_data = cls() - additional_properties = {} - for prop_name, prop_dict in d.items(): - additional_property = AdditionalChainDataDataAdditionalProperty.from_dict(prop_dict) - - additional_properties[prop_name] = additional_property - - additional_chain_data_data.additional_properties = additional_properties + additional_chain_data_data.additional_properties = d return additional_chain_data_data @property def additional_keys(self) -> List[str]: return list(self.additional_properties.keys()) - def __getitem__(self, key: str) -> "AdditionalChainDataDataAdditionalProperty": + def __getitem__(self, key: str) -> str: return self.additional_properties[key] - def __setitem__(self, key: str, value: "AdditionalChainDataDataAdditionalProperty") -> None: + def __setitem__(self, key: str, value: str) -> None: self.additional_properties[key] = value def __delitem__(self, key: str) -> None: diff --git a/plenigo-client/plenigo/models/additional_chain_data_data_additional_property.py b/plenigo-client/plenigo/models/additional_chain_data_data_additional_property.py deleted file mode 100644 index 94a91fd..0000000 --- a/plenigo-client/plenigo/models/additional_chain_data_data_additional_property.py +++ /dev/null @@ -1,67 +0,0 @@ -from typing import Any, Dict, List, Type, TypeVar, Union - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from ..types import UNSET, Unset - -T = TypeVar("T", bound="AdditionalChainDataDataAdditionalProperty") - - -@_attrs_define -class AdditionalChainDataDataAdditionalProperty: - """ - Attributes: - key (Union[Unset, str]): - value (Union[Unset, str]): - """ - - key: Union[Unset, str] = UNSET - value: Union[Unset, str] = UNSET - additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> Dict[str, Any]: - key = self.key - - value = self.value - - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if key is not UNSET: - field_dict["key"] = key - if value is not UNSET: - field_dict["value"] = value - - return field_dict - - @classmethod - def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: - d = src_dict.copy() - key = d.pop("key", UNSET) - - value = d.pop("value", UNSET) - - additional_chain_data_data_additional_property = cls( - key=key, - value=value, - ) - - additional_chain_data_data_additional_property.additional_properties = d - return additional_chain_data_data_additional_property - - @property - def additional_keys(self) -> List[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/plenigo-client/plenigo/models/additional_customer_data.py b/plenigo-client/plenigo/models/additional_customer_data.py deleted file mode 100644 index 89c73e7..0000000 --- a/plenigo-client/plenigo/models/additional_customer_data.py +++ /dev/null @@ -1,71 +0,0 @@ -from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.additional_customer_data_data import AdditionalCustomerDataData - - -T = TypeVar("T", bound="AdditionalCustomerData") - - -@_attrs_define -class AdditionalCustomerData: - """ - Attributes: - data (Union[Unset, AdditionalCustomerDataData]): - """ - - data: Union[Unset, "AdditionalCustomerDataData"] = UNSET - additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> Dict[str, Any]: - data: Union[Unset, Dict[str, Any]] = UNSET - if not isinstance(self.data, Unset): - data = self.data.to_dict() - - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if data is not UNSET: - field_dict["data"] = data - - return field_dict - - @classmethod - def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: - from ..models.additional_customer_data_data import AdditionalCustomerDataData - - d = src_dict.copy() - _data = d.pop("data", UNSET) - data: Union[Unset, AdditionalCustomerDataData] - if isinstance(_data, Unset) or not _data: - data = UNSET - else: - data = AdditionalCustomerDataData.from_dict(_data) - - additional_customer_data = cls( - data=data, - ) - - additional_customer_data.additional_properties = d - return additional_customer_data - - @property - def additional_keys(self) -> List[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/plenigo-client/plenigo/models/additional_customer_data_data.py b/plenigo-client/plenigo/models/additional_customer_data_data.py deleted file mode 100644 index f4640f2..0000000 --- a/plenigo-client/plenigo/models/additional_customer_data_data.py +++ /dev/null @@ -1,60 +0,0 @@ -from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -if TYPE_CHECKING: - from ..models.additional_customer_data_data_additional_property import AdditionalCustomerDataDataAdditionalProperty - - -T = TypeVar("T", bound="AdditionalCustomerDataData") - - -@_attrs_define -class AdditionalCustomerDataData: - """ """ - - additional_properties: Dict[str, "AdditionalCustomerDataDataAdditionalProperty"] = _attrs_field( - init=False, factory=dict - ) - - def to_dict(self) -> Dict[str, Any]: - field_dict: Dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - field_dict[prop_name] = prop.to_dict() - - return field_dict - - @classmethod - def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: - from ..models.additional_customer_data_data_additional_property import ( - AdditionalCustomerDataDataAdditionalProperty, - ) - - d = src_dict.copy() - additional_customer_data_data = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - additional_property = AdditionalCustomerDataDataAdditionalProperty.from_dict(prop_dict) - - additional_properties[prop_name] = additional_property - - additional_customer_data_data.additional_properties = additional_properties - return additional_customer_data_data - - @property - def additional_keys(self) -> List[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> "AdditionalCustomerDataDataAdditionalProperty": - return self.additional_properties[key] - - def __setitem__(self, key: str, value: "AdditionalCustomerDataDataAdditionalProperty") -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/plenigo-client/plenigo/models/additional_customer_data_data_additional_property.py b/plenigo-client/plenigo/models/additional_customer_data_data_additional_property.py deleted file mode 100644 index d34e76a..0000000 --- a/plenigo-client/plenigo/models/additional_customer_data_data_additional_property.py +++ /dev/null @@ -1,67 +0,0 @@ -from typing import Any, Dict, List, Type, TypeVar, Union - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from ..types import UNSET, Unset - -T = TypeVar("T", bound="AdditionalCustomerDataDataAdditionalProperty") - - -@_attrs_define -class AdditionalCustomerDataDataAdditionalProperty: - """ - Attributes: - key (Union[Unset, str]): - value (Union[Unset, str]): - """ - - key: Union[Unset, str] = UNSET - value: Union[Unset, str] = UNSET - additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> Dict[str, Any]: - key = self.key - - value = self.value - - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if key is not UNSET: - field_dict["key"] = key - if value is not UNSET: - field_dict["value"] = value - - return field_dict - - @classmethod - def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: - d = src_dict.copy() - key = d.pop("key", UNSET) - - value = d.pop("value", UNSET) - - additional_customer_data_data_additional_property = cls( - key=key, - value=value, - ) - - additional_customer_data_data_additional_property.additional_properties = d - return additional_customer_data_data_additional_property - - @property - def additional_keys(self) -> List[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/plenigo-client/plenigo/models/additional_order_data.py b/plenigo-client/plenigo/models/additional_order_data.py index 2734874..202bd04 100644 --- a/plenigo-client/plenigo/models/additional_order_data.py +++ b/plenigo-client/plenigo/models/additional_order_data.py @@ -29,7 +29,7 @@ class AdditionalOrderData: partner_id (Union[Unset, str]): id of the partner source_id (Union[Unset, str]): id (e.g. URI) to identify source utm (Union[Unset, Utm]): - data (Union[Unset, AdditionalOrderDataData]): + data (Union[Unset, AdditionalOrderDataData]): Key must be a string with a maximum length of 30 characters. """ created_date: Union[None, Unset, datetime.datetime] = UNSET diff --git a/plenigo-client/plenigo/models/additional_order_data_data.py b/plenigo-client/plenigo/models/additional_order_data_data.py index 31c7777..00709fa 100644 --- a/plenigo-client/plenigo/models/additional_order_data_data.py +++ b/plenigo-client/plenigo/models/additional_order_data_data.py @@ -1,54 +1,39 @@ -from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar +from typing import Any, Dict, List, Type, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field -if TYPE_CHECKING: - from ..models.additional_order_data_data_additional_property import AdditionalOrderDataDataAdditionalProperty - - T = TypeVar("T", bound="AdditionalOrderDataData") @_attrs_define class AdditionalOrderDataData: - """ """ + """Key must be a string with a maximum length of 30 characters.""" - additional_properties: Dict[str, "AdditionalOrderDataDataAdditionalProperty"] = _attrs_field( - init=False, factory=dict - ) + additional_properties: Dict[str, str] = _attrs_field(init=False, factory=dict) def to_dict(self) -> Dict[str, Any]: field_dict: Dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - field_dict[prop_name] = prop.to_dict() + field_dict.update(self.additional_properties) return field_dict @classmethod def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: - from ..models.additional_order_data_data_additional_property import AdditionalOrderDataDataAdditionalProperty - d = src_dict.copy() additional_order_data_data = cls() - additional_properties = {} - for prop_name, prop_dict in d.items(): - additional_property = AdditionalOrderDataDataAdditionalProperty.from_dict(prop_dict) - - additional_properties[prop_name] = additional_property - - additional_order_data_data.additional_properties = additional_properties + additional_order_data_data.additional_properties = d return additional_order_data_data @property def additional_keys(self) -> List[str]: return list(self.additional_properties.keys()) - def __getitem__(self, key: str) -> "AdditionalOrderDataDataAdditionalProperty": + def __getitem__(self, key: str) -> str: return self.additional_properties[key] - def __setitem__(self, key: str, value: "AdditionalOrderDataDataAdditionalProperty") -> None: + def __setitem__(self, key: str, value: str) -> None: self.additional_properties[key] = value def __delitem__(self, key: str) -> None: diff --git a/plenigo-client/plenigo/models/additional_order_data_data_additional_property.py b/plenigo-client/plenigo/models/additional_order_data_data_additional_property.py deleted file mode 100644 index fb9a69e..0000000 --- a/plenigo-client/plenigo/models/additional_order_data_data_additional_property.py +++ /dev/null @@ -1,67 +0,0 @@ -from typing import Any, Dict, List, Type, TypeVar, Union - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from ..types import UNSET, Unset - -T = TypeVar("T", bound="AdditionalOrderDataDataAdditionalProperty") - - -@_attrs_define -class AdditionalOrderDataDataAdditionalProperty: - """ - Attributes: - key (Union[Unset, str]): - value (Union[Unset, str]): - """ - - key: Union[Unset, str] = UNSET - value: Union[Unset, str] = UNSET - additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> Dict[str, Any]: - key = self.key - - value = self.value - - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if key is not UNSET: - field_dict["key"] = key - if value is not UNSET: - field_dict["value"] = value - - return field_dict - - @classmethod - def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: - d = src_dict.copy() - key = d.pop("key", UNSET) - - value = d.pop("value", UNSET) - - additional_order_data_data_additional_property = cls( - key=key, - value=value, - ) - - additional_order_data_data_additional_property.additional_properties = d - return additional_order_data_data_additional_property - - @property - def additional_keys(self) -> List[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/plenigo-client/plenigo/models/address_base.py b/plenigo-client/plenigo/models/address_base.py deleted file mode 100644 index 2980410..0000000 --- a/plenigo-client/plenigo/models/address_base.py +++ /dev/null @@ -1,266 +0,0 @@ -from typing import Any, Dict, List, Type, TypeVar, Union - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from ..models.address_base_salutation import AddressBaseSalutation -from ..models.address_base_validation_status import AddressBaseValidationStatus -from ..types import UNSET, Unset - -T = TypeVar("T", bound="AddressBase") - - -@_attrs_define -class AddressBase: - """ - Attributes: - business_address (Union[Unset, bool]): flag indicating if address represents a private or a business address - salutation (Union[Unset, AddressBaseSalutation]): salutation to identify the correct designation of a customer - title (Union[Unset, str]): title of the customer - first_name (Union[Unset, str]): first name of the customer - first name and last name or company name are - required - last_name (Union[Unset, str]): last name of the customer - first name and last name or company name are required - company_name (Union[Unset, str]): company name - first name and last name or company name are required - additional_company_info (Union[Unset, str]): additional information belonging to the company - street (Union[Unset, str]): street name - street_number (Union[Unset, str]): street number - additional_street_info (Union[Unset, str]): additional information describing address - postbox (Union[Unset, str]): postbox id - postcode (Union[Unset, str]): postcode - city (Union[Unset, str]): city - state (Union[Unset, str]): state - country (Union[Unset, str]): country code formatted as ISO 3166-1 alpha-2 - vat_number (Union[Unset, str]): VAT number of a member country of the European Union - phone_number (Union[Unset, str]): phone number of the customer formatted as E.164 - delivery_information (Union[Unset, str]): delivery information - academic_title (Union[Unset, str]): academic title - job_position (Union[Unset, str]): job position - validation_status (Union[Unset, AddressBaseValidationStatus]): validation status of the address - validation_hash (Union[Unset, str]): validation hash of a valid address - """ - - business_address: Union[Unset, bool] = UNSET - salutation: Union[Unset, AddressBaseSalutation] = UNSET - title: Union[Unset, str] = UNSET - first_name: Union[Unset, str] = UNSET - last_name: Union[Unset, str] = UNSET - company_name: Union[Unset, str] = UNSET - additional_company_info: Union[Unset, str] = UNSET - street: Union[Unset, str] = UNSET - street_number: Union[Unset, str] = UNSET - additional_street_info: Union[Unset, str] = UNSET - postbox: Union[Unset, str] = UNSET - postcode: Union[Unset, str] = UNSET - city: Union[Unset, str] = UNSET - state: Union[Unset, str] = UNSET - country: Union[Unset, str] = UNSET - vat_number: Union[Unset, str] = UNSET - phone_number: Union[Unset, str] = UNSET - delivery_information: Union[Unset, str] = UNSET - academic_title: Union[Unset, str] = UNSET - job_position: Union[Unset, str] = UNSET - validation_status: Union[Unset, AddressBaseValidationStatus] = UNSET - validation_hash: Union[Unset, str] = UNSET - additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> Dict[str, Any]: - business_address = self.business_address - - salutation: Union[Unset, str] = UNSET - if not isinstance(self.salutation, Unset): - salutation = self.salutation.value - - title = self.title - - first_name = self.first_name - - last_name = self.last_name - - company_name = self.company_name - - additional_company_info = self.additional_company_info - - street = self.street - - street_number = self.street_number - - additional_street_info = self.additional_street_info - - postbox = self.postbox - - postcode = self.postcode - - city = self.city - - state = self.state - - country = self.country - - vat_number = self.vat_number - - phone_number = self.phone_number - - delivery_information = self.delivery_information - - academic_title = self.academic_title - - job_position = self.job_position - - validation_status: Union[Unset, str] = UNSET - if not isinstance(self.validation_status, Unset): - validation_status = self.validation_status.value - - validation_hash = self.validation_hash - - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if business_address is not UNSET: - field_dict["businessAddress"] = business_address - if salutation is not UNSET: - field_dict["salutation"] = salutation - if title is not UNSET: - field_dict["title"] = title - if first_name is not UNSET: - field_dict["firstName"] = first_name - if last_name is not UNSET: - field_dict["lastName"] = last_name - if company_name is not UNSET: - field_dict["companyName"] = company_name - if additional_company_info is not UNSET: - field_dict["additionalCompanyInfo"] = additional_company_info - if street is not UNSET: - field_dict["street"] = street - if street_number is not UNSET: - field_dict["streetNumber"] = street_number - if additional_street_info is not UNSET: - field_dict["additionalStreetInfo"] = additional_street_info - if postbox is not UNSET: - field_dict["postbox"] = postbox - if postcode is not UNSET: - field_dict["postcode"] = postcode - if city is not UNSET: - field_dict["city"] = city - if state is not UNSET: - field_dict["state"] = state - if country is not UNSET: - field_dict["country"] = country - if vat_number is not UNSET: - field_dict["vatNumber"] = vat_number - if phone_number is not UNSET: - field_dict["phoneNumber"] = phone_number - if delivery_information is not UNSET: - field_dict["deliveryInformation"] = delivery_information - if academic_title is not UNSET: - field_dict["academicTitle"] = academic_title - if job_position is not UNSET: - field_dict["jobPosition"] = job_position - if validation_status is not UNSET: - field_dict["validationStatus"] = validation_status - if validation_hash is not UNSET: - field_dict["validationHash"] = validation_hash - - return field_dict - - @classmethod - def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: - d = src_dict.copy() - business_address = d.pop("businessAddress", UNSET) - - _salutation = d.pop("salutation", UNSET) - salutation: Union[Unset, AddressBaseSalutation] - if isinstance(_salutation, Unset) or not _salutation: - salutation = UNSET - else: - salutation = AddressBaseSalutation(_salutation) - - title = d.pop("title", UNSET) - - first_name = d.pop("firstName", UNSET) - - last_name = d.pop("lastName", UNSET) - - company_name = d.pop("companyName", UNSET) - - additional_company_info = d.pop("additionalCompanyInfo", UNSET) - - street = d.pop("street", UNSET) - - street_number = d.pop("streetNumber", UNSET) - - additional_street_info = d.pop("additionalStreetInfo", UNSET) - - postbox = d.pop("postbox", UNSET) - - postcode = d.pop("postcode", UNSET) - - city = d.pop("city", UNSET) - - state = d.pop("state", UNSET) - - country = d.pop("country", UNSET) - - vat_number = d.pop("vatNumber", UNSET) - - phone_number = d.pop("phoneNumber", UNSET) - - delivery_information = d.pop("deliveryInformation", UNSET) - - academic_title = d.pop("academicTitle", UNSET) - - job_position = d.pop("jobPosition", UNSET) - - _validation_status = d.pop("validationStatus", UNSET) - validation_status: Union[Unset, AddressBaseValidationStatus] - if isinstance(_validation_status, Unset) or not _validation_status: - validation_status = UNSET - else: - validation_status = AddressBaseValidationStatus(_validation_status) - - validation_hash = d.pop("validationHash", UNSET) - - address_base = cls( - business_address=business_address, - salutation=salutation, - title=title, - first_name=first_name, - last_name=last_name, - company_name=company_name, - additional_company_info=additional_company_info, - street=street, - street_number=street_number, - additional_street_info=additional_street_info, - postbox=postbox, - postcode=postcode, - city=city, - state=state, - country=country, - vat_number=vat_number, - phone_number=phone_number, - delivery_information=delivery_information, - academic_title=academic_title, - job_position=job_position, - validation_status=validation_status, - validation_hash=validation_hash, - ) - - address_base.additional_properties = d - return address_base - - @property - def additional_keys(self) -> List[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/plenigo-client/plenigo/models/address_base_salutation.py b/plenigo-client/plenigo/models/address_base_salutation.py deleted file mode 100644 index 22144b8..0000000 --- a/plenigo-client/plenigo/models/address_base_salutation.py +++ /dev/null @@ -1,11 +0,0 @@ -from enum import Enum - - -class AddressBaseSalutation(str, Enum): - DIVERSE = "DIVERSE" - MR = "MR" - MRS = "MRS" - NONE = "NONE" - - def __str__(self) -> str: - return str(self.value) diff --git a/plenigo-client/plenigo/models/address_base_validation_status.py b/plenigo-client/plenigo/models/address_base_validation_status.py deleted file mode 100644 index 4c6db63..0000000 --- a/plenigo-client/plenigo/models/address_base_validation_status.py +++ /dev/null @@ -1,12 +0,0 @@ -from enum import Enum - - -class AddressBaseValidationStatus(str, Enum): - INVALID = "INVALID" - NONE = "NONE" - OVERRIDDEN = "OVERRIDDEN" - SUSPECT = "SUSPECT" - VALID = "VALID" - - def __str__(self) -> str: - return str(self.value) diff --git a/plenigo-client/plenigo/models/address_change.py b/plenigo-client/plenigo/models/address_change.py deleted file mode 100644 index 35f0897..0000000 --- a/plenigo-client/plenigo/models/address_change.py +++ /dev/null @@ -1,275 +0,0 @@ -from typing import Any, Dict, List, Type, TypeVar, Union - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from ..models.address_base_salutation import AddressBaseSalutation -from ..models.address_base_validation_status import AddressBaseValidationStatus -from ..types import UNSET, Unset - -T = TypeVar("T", bound="AddressChange") - - -@_attrs_define -class AddressChange: - """ - Attributes: - business_address (Union[Unset, bool]): flag indicating if address represents a private or a business address - salutation (Union[Unset, AddressBaseSalutation]): salutation to identify the correct designation of a customer - title (Union[Unset, str]): title of the customer - first_name (Union[Unset, str]): first name of the customer - first name and last name or company name are - required - last_name (Union[Unset, str]): last name of the customer - first name and last name or company name are required - company_name (Union[Unset, str]): company name - first name and last name or company name are required - additional_company_info (Union[Unset, str]): additional information belonging to the company - street (Union[Unset, str]): street name - street_number (Union[Unset, str]): street number - additional_street_info (Union[Unset, str]): additional information describing address - postbox (Union[Unset, str]): postbox id - postcode (Union[Unset, str]): postcode - city (Union[Unset, str]): city - state (Union[Unset, str]): state - country (Union[Unset, str]): country code formatted as ISO 3166-1 alpha-2 - vat_number (Union[Unset, str]): VAT number of a member country of the European Union - phone_number (Union[Unset, str]): phone number of the customer formatted as E.164 - delivery_information (Union[Unset, str]): delivery information - academic_title (Union[Unset, str]): academic title - job_position (Union[Unset, str]): job position - validation_status (Union[Unset, AddressBaseValidationStatus]): validation status of the address - validation_hash (Union[Unset, str]): validation hash of a valid address - preferred (Union[Unset, bool]): flag indicating if address is default selection for address type - """ - - business_address: Union[Unset, bool] = UNSET - salutation: Union[Unset, AddressBaseSalutation] = UNSET - title: Union[Unset, str] = UNSET - first_name: Union[Unset, str] = UNSET - last_name: Union[Unset, str] = UNSET - company_name: Union[Unset, str] = UNSET - additional_company_info: Union[Unset, str] = UNSET - street: Union[Unset, str] = UNSET - street_number: Union[Unset, str] = UNSET - additional_street_info: Union[Unset, str] = UNSET - postbox: Union[Unset, str] = UNSET - postcode: Union[Unset, str] = UNSET - city: Union[Unset, str] = UNSET - state: Union[Unset, str] = UNSET - country: Union[Unset, str] = UNSET - vat_number: Union[Unset, str] = UNSET - phone_number: Union[Unset, str] = UNSET - delivery_information: Union[Unset, str] = UNSET - academic_title: Union[Unset, str] = UNSET - job_position: Union[Unset, str] = UNSET - validation_status: Union[Unset, AddressBaseValidationStatus] = UNSET - validation_hash: Union[Unset, str] = UNSET - preferred: Union[Unset, bool] = UNSET - additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> Dict[str, Any]: - business_address = self.business_address - - salutation: Union[Unset, str] = UNSET - if not isinstance(self.salutation, Unset): - salutation = self.salutation.value - - title = self.title - - first_name = self.first_name - - last_name = self.last_name - - company_name = self.company_name - - additional_company_info = self.additional_company_info - - street = self.street - - street_number = self.street_number - - additional_street_info = self.additional_street_info - - postbox = self.postbox - - postcode = self.postcode - - city = self.city - - state = self.state - - country = self.country - - vat_number = self.vat_number - - phone_number = self.phone_number - - delivery_information = self.delivery_information - - academic_title = self.academic_title - - job_position = self.job_position - - validation_status: Union[Unset, str] = UNSET - if not isinstance(self.validation_status, Unset): - validation_status = self.validation_status.value - - validation_hash = self.validation_hash - - preferred = self.preferred - - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if business_address is not UNSET: - field_dict["businessAddress"] = business_address - if salutation is not UNSET: - field_dict["salutation"] = salutation - if title is not UNSET: - field_dict["title"] = title - if first_name is not UNSET: - field_dict["firstName"] = first_name - if last_name is not UNSET: - field_dict["lastName"] = last_name - if company_name is not UNSET: - field_dict["companyName"] = company_name - if additional_company_info is not UNSET: - field_dict["additionalCompanyInfo"] = additional_company_info - if street is not UNSET: - field_dict["street"] = street - if street_number is not UNSET: - field_dict["streetNumber"] = street_number - if additional_street_info is not UNSET: - field_dict["additionalStreetInfo"] = additional_street_info - if postbox is not UNSET: - field_dict["postbox"] = postbox - if postcode is not UNSET: - field_dict["postcode"] = postcode - if city is not UNSET: - field_dict["city"] = city - if state is not UNSET: - field_dict["state"] = state - if country is not UNSET: - field_dict["country"] = country - if vat_number is not UNSET: - field_dict["vatNumber"] = vat_number - if phone_number is not UNSET: - field_dict["phoneNumber"] = phone_number - if delivery_information is not UNSET: - field_dict["deliveryInformation"] = delivery_information - if academic_title is not UNSET: - field_dict["academicTitle"] = academic_title - if job_position is not UNSET: - field_dict["jobPosition"] = job_position - if validation_status is not UNSET: - field_dict["validationStatus"] = validation_status - if validation_hash is not UNSET: - field_dict["validationHash"] = validation_hash - if preferred is not UNSET: - field_dict["preferred"] = preferred - - return field_dict - - @classmethod - def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: - d = src_dict.copy() - business_address = d.pop("businessAddress", UNSET) - - _salutation = d.pop("salutation", UNSET) - salutation: Union[Unset, AddressBaseSalutation] - if isinstance(_salutation, Unset) or not _salutation: - salutation = UNSET - else: - salutation = AddressBaseSalutation(_salutation) - - title = d.pop("title", UNSET) - - first_name = d.pop("firstName", UNSET) - - last_name = d.pop("lastName", UNSET) - - company_name = d.pop("companyName", UNSET) - - additional_company_info = d.pop("additionalCompanyInfo", UNSET) - - street = d.pop("street", UNSET) - - street_number = d.pop("streetNumber", UNSET) - - additional_street_info = d.pop("additionalStreetInfo", UNSET) - - postbox = d.pop("postbox", UNSET) - - postcode = d.pop("postcode", UNSET) - - city = d.pop("city", UNSET) - - state = d.pop("state", UNSET) - - country = d.pop("country", UNSET) - - vat_number = d.pop("vatNumber", UNSET) - - phone_number = d.pop("phoneNumber", UNSET) - - delivery_information = d.pop("deliveryInformation", UNSET) - - academic_title = d.pop("academicTitle", UNSET) - - job_position = d.pop("jobPosition", UNSET) - - _validation_status = d.pop("validationStatus", UNSET) - validation_status: Union[Unset, AddressBaseValidationStatus] - if isinstance(_validation_status, Unset) or not _validation_status: - validation_status = UNSET - else: - validation_status = AddressBaseValidationStatus(_validation_status) - - validation_hash = d.pop("validationHash", UNSET) - - preferred = d.pop("preferred", UNSET) - - address_change = cls( - business_address=business_address, - salutation=salutation, - title=title, - first_name=first_name, - last_name=last_name, - company_name=company_name, - additional_company_info=additional_company_info, - street=street, - street_number=street_number, - additional_street_info=additional_street_info, - postbox=postbox, - postcode=postcode, - city=city, - state=state, - country=country, - vat_number=vat_number, - phone_number=phone_number, - delivery_information=delivery_information, - academic_title=academic_title, - job_position=job_position, - validation_status=validation_status, - validation_hash=validation_hash, - preferred=preferred, - ) - - address_change.additional_properties = d - return address_change - - @property - def additional_keys(self) -> List[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/plenigo-client/plenigo/models/api_campaign_view.py b/plenigo-client/plenigo/models/api_campaign.py similarity index 93% rename from plenigo-client/plenigo/models/api_campaign_view.py rename to plenigo-client/plenigo/models/api_campaign.py index bdf27fe..32662a6 100644 --- a/plenigo-client/plenigo/models/api_campaign_view.py +++ b/plenigo-client/plenigo/models/api_campaign.py @@ -11,24 +11,25 @@ from ..types import UNSET, Unset if TYPE_CHECKING: - from ..models.api_channel_base import ApiChannelBase + from ..models.api_channel import ApiChannel -T = TypeVar("T", bound="ApiCampaignView") +T = TypeVar("T", bound="ApiCampaign") @_attrs_define -class ApiCampaignView: +class ApiCampaign: """ Attributes: campaign_id (str): unique id of the campaign in the context of a company campaign_name (str): name of the campaign voucher_type (ApiCampaignBaseVoucherType): represents the type of the vouchers of this campaign + plenigo_offer_id (str): offer id the vouchers are for status (ApiCampaignBaseStatus): status of the campaign start_date (Union[None, datetime.date]): start date of the campaign with full-date notation as defined by RFC 3339, section 5.6, for example, 2017-07-21 - channels (List['ApiChannelBase']): + channels (List['ApiChannel']): created_date (Union[None, Unset, datetime.datetime]): time the object was created with time notation as defined by RFC 3339, section 5.6, for example, 17:32:28 @@ -39,7 +40,6 @@ class ApiCampaignView: created_by_type (Union[Unset, UserType]): type of user who performs the action changed_by (Union[Unset, str]): id who changed the object changed_by_type (Union[Unset, UserType]): type of user who performs the action - plenigo_offer_id (Union[Unset, str]): offer id the vouchers are for end_date (Union[None, Unset, datetime.date]): end date of the campaign with full-date notation as defined by RFC 3339, section 5.6, for example, 2017-07-21 @@ -48,16 +48,16 @@ class ApiCampaignView: campaign_id: str campaign_name: str voucher_type: ApiCampaignBaseVoucherType + plenigo_offer_id: str status: ApiCampaignBaseStatus start_date: Union[None, datetime.date] - channels: List["ApiChannelBase"] + channels: List["ApiChannel"] created_date: Union[None, Unset, datetime.datetime] = UNSET changed_date: Union[None, Unset, datetime.datetime] = UNSET created_by: Union[Unset, str] = UNSET created_by_type: Union[Unset, UserType] = UNSET changed_by: Union[Unset, str] = UNSET changed_by_type: Union[Unset, UserType] = UNSET - plenigo_offer_id: Union[Unset, str] = UNSET end_date: Union[None, Unset, datetime.date] = UNSET additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -68,6 +68,8 @@ def to_dict(self) -> Dict[str, Any]: voucher_type = self.voucher_type.value + plenigo_offer_id = self.plenigo_offer_id + status = self.status.value start_date: Union[None, str] @@ -109,8 +111,6 @@ def to_dict(self) -> Dict[str, Any]: if not isinstance(self.changed_by_type, Unset): changed_by_type = self.changed_by_type.value - plenigo_offer_id = self.plenigo_offer_id - end_date: Union[None, Unset, str] if isinstance(self.end_date, Unset) or self.end_date is None: end_date = UNSET @@ -126,6 +126,7 @@ def to_dict(self) -> Dict[str, Any]: "campaignId": campaign_id, "campaignName": campaign_name, "voucherType": voucher_type, + "plenigoOfferId": plenigo_offer_id, "status": status, "startDate": start_date, "channels": channels, @@ -143,8 +144,6 @@ def to_dict(self) -> Dict[str, Any]: field_dict["changedBy"] = changed_by if changed_by_type is not UNSET: field_dict["changedByType"] = changed_by_type - if plenigo_offer_id is not UNSET: - field_dict["plenigoOfferId"] = plenigo_offer_id if end_date is not UNSET: field_dict["endDate"] = end_date @@ -152,7 +151,7 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: - from ..models.api_channel_base import ApiChannelBase + from ..models.api_channel import ApiChannel d = src_dict.copy() campaign_id = d.pop("campaignId") @@ -161,6 +160,8 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: voucher_type = ApiCampaignBaseVoucherType(d.pop("voucherType")) + plenigo_offer_id = d.pop("plenigoOfferId") + status = ApiCampaignBaseStatus(d.pop("status")) def _parse_start_date(data: object) -> Union[None, datetime.date]: @@ -184,7 +185,7 @@ def _parse_start_date(data: object) -> Union[None, datetime.date]: channels = [] _channels = d.pop("channels") for channels_item_data in _channels: - channels_item = ApiChannelBase.from_dict(channels_item_data) + channels_item = ApiChannel.from_dict(channels_item_data) channels.append(channels_item) @@ -254,8 +255,6 @@ def _parse_changed_date(data: object) -> Union[None, Unset, datetime.datetime]: else: changed_by_type = UserType(_changed_by_type) - plenigo_offer_id = d.pop("plenigoOfferId", UNSET) - def _parse_end_date(data: object) -> Union[None, Unset, datetime.date]: if data is None: return data @@ -280,10 +279,11 @@ def _parse_end_date(data: object) -> Union[None, Unset, datetime.date]: end_date = _parse_end_date(d.pop("endDate", UNSET)) - api_campaign_view = cls( + api_campaign = cls( campaign_id=campaign_id, campaign_name=campaign_name, voucher_type=voucher_type, + plenigo_offer_id=plenigo_offer_id, status=status, start_date=start_date, channels=channels, @@ -293,12 +293,11 @@ def _parse_end_date(data: object) -> Union[None, Unset, datetime.date]: created_by_type=created_by_type, changed_by=changed_by, changed_by_type=changed_by_type, - plenigo_offer_id=plenigo_offer_id, end_date=end_date, ) - api_campaign_view.additional_properties = d - return api_campaign_view + api_campaign.additional_properties = d + return api_campaign @property def additional_keys(self) -> List[str]: diff --git a/plenigo-client/plenigo/models/api_campaign_base.py b/plenigo-client/plenigo/models/api_campaign_base.py index 69130b2..cfe06ff 100644 --- a/plenigo-client/plenigo/models/api_campaign_base.py +++ b/plenigo-client/plenigo/models/api_campaign_base.py @@ -20,6 +20,7 @@ class ApiCampaignBase: campaign_id (str): unique id of the campaign in the context of a company campaign_name (str): name of the campaign voucher_type (ApiCampaignBaseVoucherType): represents the type of the vouchers of this campaign + plenigo_offer_id (str): offer id the vouchers are for status (ApiCampaignBaseStatus): status of the campaign start_date (Union[None, datetime.date]): start date of the campaign with full-date notation as defined by RFC 3339, section 5.6, for example, @@ -34,7 +35,6 @@ class ApiCampaignBase: created_by_type (Union[Unset, UserType]): type of user who performs the action changed_by (Union[Unset, str]): id who changed the object changed_by_type (Union[Unset, UserType]): type of user who performs the action - plenigo_offer_id (Union[Unset, str]): offer id the vouchers are for end_date (Union[None, Unset, datetime.date]): end date of the campaign with full-date notation as defined by RFC 3339, section 5.6, for example, 2017-07-21 @@ -43,6 +43,7 @@ class ApiCampaignBase: campaign_id: str campaign_name: str voucher_type: ApiCampaignBaseVoucherType + plenigo_offer_id: str status: ApiCampaignBaseStatus start_date: Union[None, datetime.date] created_date: Union[None, Unset, datetime.datetime] = UNSET @@ -51,7 +52,6 @@ class ApiCampaignBase: created_by_type: Union[Unset, UserType] = UNSET changed_by: Union[Unset, str] = UNSET changed_by_type: Union[Unset, UserType] = UNSET - plenigo_offer_id: Union[Unset, str] = UNSET end_date: Union[None, Unset, datetime.date] = UNSET additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -62,6 +62,8 @@ def to_dict(self) -> Dict[str, Any]: voucher_type = self.voucher_type.value + plenigo_offer_id = self.plenigo_offer_id + status = self.status.value start_date: Union[None, str] @@ -98,8 +100,6 @@ def to_dict(self) -> Dict[str, Any]: if not isinstance(self.changed_by_type, Unset): changed_by_type = self.changed_by_type.value - plenigo_offer_id = self.plenigo_offer_id - end_date: Union[None, Unset, str] if isinstance(self.end_date, Unset) or self.end_date is None: end_date = UNSET @@ -115,6 +115,7 @@ def to_dict(self) -> Dict[str, Any]: "campaignId": campaign_id, "campaignName": campaign_name, "voucherType": voucher_type, + "plenigoOfferId": plenigo_offer_id, "status": status, "startDate": start_date, } @@ -131,8 +132,6 @@ def to_dict(self) -> Dict[str, Any]: field_dict["changedBy"] = changed_by if changed_by_type is not UNSET: field_dict["changedByType"] = changed_by_type - if plenigo_offer_id is not UNSET: - field_dict["plenigoOfferId"] = plenigo_offer_id if end_date is not UNSET: field_dict["endDate"] = end_date @@ -147,6 +146,8 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: voucher_type = ApiCampaignBaseVoucherType(d.pop("voucherType")) + plenigo_offer_id = d.pop("plenigoOfferId") + status = ApiCampaignBaseStatus(d.pop("status")) def _parse_start_date(data: object) -> Union[None, datetime.date]: @@ -233,8 +234,6 @@ def _parse_changed_date(data: object) -> Union[None, Unset, datetime.datetime]: else: changed_by_type = UserType(_changed_by_type) - plenigo_offer_id = d.pop("plenigoOfferId", UNSET) - def _parse_end_date(data: object) -> Union[None, Unset, datetime.date]: if data is None: return data @@ -263,6 +262,7 @@ def _parse_end_date(data: object) -> Union[None, Unset, datetime.date]: campaign_id=campaign_id, campaign_name=campaign_name, voucher_type=voucher_type, + plenigo_offer_id=plenigo_offer_id, status=status, start_date=start_date, created_date=created_date, @@ -271,7 +271,6 @@ def _parse_end_date(data: object) -> Union[None, Unset, datetime.date]: created_by_type=created_by_type, changed_by=changed_by, changed_by_type=changed_by_type, - plenigo_offer_id=plenigo_offer_id, end_date=end_date, ) diff --git a/plenigo-client/plenigo/models/api_campaign_page.py b/plenigo-client/plenigo/models/api_campaign_page.py index 36d97bc..4413d3a 100644 --- a/plenigo-client/plenigo/models/api_campaign_page.py +++ b/plenigo-client/plenigo/models/api_campaign_page.py @@ -6,7 +6,7 @@ from ..types import UNSET, Unset if TYPE_CHECKING: - from ..models.api_campaign_view import ApiCampaignView + from ..models.api_campaign import ApiCampaign T = TypeVar("T", bound="ApiCampaignPage") @@ -16,69 +16,64 @@ class ApiCampaignPage: """ Attributes: - starting_after (Union[Unset, int]): starting after element id - size (Union[Unset, int]): size of elements of the page - total_size (Union[Unset, int]): total of elements - campaigns (Union[Unset, List['ApiCampaignView']]): + ending_before_id (Union[Unset, str]): A cursor for use in pagination. endingBefore is an object ID that defines + your place in the list. For instance, if you make a list request and receive 100 objects, starting with obj_bar, + your subsequent call can include endingBefore=obj_bar in order to fetch the previous page of the list. + starting_after_id (Union[Unset, str]): A cursor for use in pagination. startingAfter is an object ID that + defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with + obj_foo, your subsequent call can include startingAfter=obj_foo in order to fetch the next result set. + items (Union[Unset, List['ApiCampaign']]): """ - starting_after: Union[Unset, int] = UNSET - size: Union[Unset, int] = UNSET - total_size: Union[Unset, int] = UNSET - campaigns: Union[Unset, List["ApiCampaignView"]] = UNSET + ending_before_id: Union[Unset, str] = UNSET + starting_after_id: Union[Unset, str] = UNSET + items: Union[Unset, List["ApiCampaign"]] = UNSET additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> Dict[str, Any]: - starting_after = self.starting_after + ending_before_id = self.ending_before_id - size = self.size + starting_after_id = self.starting_after_id - total_size = self.total_size - - campaigns: Union[Unset, List[Dict[str, Any]]] = UNSET - if not isinstance(self.campaigns, Unset): - campaigns = [] - for campaigns_item_data in self.campaigns: - campaigns_item = campaigns_item_data.to_dict() - campaigns.append(campaigns_item) + items: Union[Unset, List[Dict[str, Any]]] = UNSET + if not isinstance(self.items, Unset): + items = [] + for items_item_data in self.items: + items_item = items_item_data.to_dict() + items.append(items_item) field_dict: Dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update({}) - if starting_after is not UNSET: - field_dict["startingAfter"] = starting_after - if size is not UNSET: - field_dict["size"] = size - if total_size is not UNSET: - field_dict["totalSize"] = total_size - if campaigns is not UNSET: - field_dict["campaigns"] = campaigns + if ending_before_id is not UNSET: + field_dict["endingBeforeId"] = ending_before_id + if starting_after_id is not UNSET: + field_dict["startingAfterId"] = starting_after_id + if items is not UNSET: + field_dict["items"] = items return field_dict @classmethod def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: - from ..models.api_campaign_view import ApiCampaignView + from ..models.api_campaign import ApiCampaign d = src_dict.copy() - starting_after = d.pop("startingAfter", UNSET) - - size = d.pop("size", UNSET) + ending_before_id = d.pop("endingBeforeId", UNSET) - total_size = d.pop("totalSize", UNSET) + starting_after_id = d.pop("startingAfterId", UNSET) - campaigns = [] - _campaigns = d.pop("campaigns", UNSET) - for campaigns_item_data in _campaigns or []: - campaigns_item = ApiCampaignView.from_dict(campaigns_item_data) + items = [] + _items = d.pop("items", UNSET) + for items_item_data in _items or []: + items_item = ApiCampaign.from_dict(items_item_data) - campaigns.append(campaigns_item) + items.append(items_item) api_campaign_page = cls( - starting_after=starting_after, - size=size, - total_size=total_size, - campaigns=campaigns, + ending_before_id=ending_before_id, + starting_after_id=starting_after_id, + items=items, ) api_campaign_page.additional_properties = d diff --git a/plenigo-client/plenigo/models/api_campaign_creation_result.py b/plenigo-client/plenigo/models/api_channel.py similarity index 56% rename from plenigo-client/plenigo/models/api_campaign_creation_result.py rename to plenigo-client/plenigo/models/api_channel.py index 8b93849..00e28b3 100644 --- a/plenigo-client/plenigo/models/api_campaign_creation_result.py +++ b/plenigo-client/plenigo/models/api_channel.py @@ -5,30 +5,26 @@ from attrs import field as _attrs_field from dateutil.parser import isoparse -from ..models.api_campaign_base_status import ApiCampaignBaseStatus -from ..models.api_campaign_base_voucher_type import ApiCampaignBaseVoucherType +from ..models.api_channel_base_status import ApiChannelBaseStatus from ..models.user_type import UserType from ..types import UNSET, Unset if TYPE_CHECKING: - from ..models.api_channel_base import ApiChannelBase + from ..models.api_multi_voucher import ApiMultiVoucher + from ..models.api_voucher import ApiVoucher -T = TypeVar("T", bound="ApiCampaignCreationResult") +T = TypeVar("T", bound="ApiChannel") @_attrs_define -class ApiCampaignCreationResult: +class ApiChannel: """ Attributes: - campaign_id (str): unique id of the campaign in the context of a company - campaign_name (str): name of the campaign - voucher_type (ApiCampaignBaseVoucherType): represents the type of the vouchers of this campaign - status (ApiCampaignBaseStatus): status of the campaign - start_date (Union[None, datetime.date]): start date of the campaign with full-date notation as defined by RFC 3339, section 5.6, for example, - 2017-07-21 - channels (List['ApiChannelBase']): + channel_id (int): unique id of the channel in the context of a company + channel_name (str): name of the channel + voucher_amount (int): represents the amount of vouchers for this channel + status (ApiChannelBaseStatus): status of the campaign created_date (Union[None, Unset, datetime.datetime]): time the object was created with time notation as defined by RFC 3339, section 5.6, for example, 17:32:28 @@ -39,48 +35,35 @@ class ApiCampaignCreationResult: created_by_type (Union[Unset, UserType]): type of user who performs the action changed_by (Union[Unset, str]): id who changed the object changed_by_type (Union[Unset, UserType]): type of user who performs the action - plenigo_offer_id (Union[Unset, str]): offer id the vouchers are for - end_date (Union[None, Unset, datetime.date]): end date of the campaign with full-date notation as defined by RFC 3339, section 5.6, for example, - 2017-07-21 + custom_data (Union[Unset, str]): free text field + vouchers (Union[Unset, List['ApiVoucher']]): + multi_voucher (Union[Unset, ApiMultiVoucher]): """ - campaign_id: str - campaign_name: str - voucher_type: ApiCampaignBaseVoucherType - status: ApiCampaignBaseStatus - start_date: Union[None, datetime.date] - channels: List["ApiChannelBase"] + channel_id: int + channel_name: str + voucher_amount: int + status: ApiChannelBaseStatus created_date: Union[None, Unset, datetime.datetime] = UNSET changed_date: Union[None, Unset, datetime.datetime] = UNSET created_by: Union[Unset, str] = UNSET created_by_type: Union[Unset, UserType] = UNSET changed_by: Union[Unset, str] = UNSET changed_by_type: Union[Unset, UserType] = UNSET - plenigo_offer_id: Union[Unset, str] = UNSET - end_date: Union[None, Unset, datetime.date] = UNSET + custom_data: Union[Unset, str] = UNSET + vouchers: Union[Unset, List["ApiVoucher"]] = UNSET + multi_voucher: Union[Unset, "ApiMultiVoucher"] = UNSET additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> Dict[str, Any]: - campaign_id = self.campaign_id + channel_id = self.channel_id - campaign_name = self.campaign_name + channel_name = self.channel_name - voucher_type = self.voucher_type.value + voucher_amount = self.voucher_amount status = self.status.value - start_date: Union[None, str] - if isinstance(self.start_date, datetime.date): - start_date = self.start_date.isoformat() - else: - start_date = self.start_date - - channels = [] - for channels_item_data in self.channels: - channels_item = channels_item_data.to_dict() - channels.append(channels_item) - created_date: Union[None, Unset, str] if isinstance(self.created_date, Unset) or self.created_date is None: created_date = UNSET @@ -109,26 +92,27 @@ def to_dict(self) -> Dict[str, Any]: if not isinstance(self.changed_by_type, Unset): changed_by_type = self.changed_by_type.value - plenigo_offer_id = self.plenigo_offer_id + custom_data = self.custom_data - end_date: Union[None, Unset, str] - if isinstance(self.end_date, Unset) or self.end_date is None: - end_date = UNSET - elif isinstance(self.end_date, datetime.date): - end_date = self.end_date.isoformat() - else: - end_date = self.end_date + vouchers: Union[Unset, List[Dict[str, Any]]] = UNSET + if not isinstance(self.vouchers, Unset): + vouchers = [] + for vouchers_item_data in self.vouchers: + vouchers_item = vouchers_item_data.to_dict() + vouchers.append(vouchers_item) + + multi_voucher: Union[Unset, Dict[str, Any]] = UNSET + if not isinstance(self.multi_voucher, Unset): + multi_voucher = self.multi_voucher.to_dict() field_dict: Dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update( { - "campaignId": campaign_id, - "campaignName": campaign_name, - "voucherType": voucher_type, + "channelId": channel_id, + "channelName": channel_name, + "voucherAmount": voucher_amount, "status": status, - "startDate": start_date, - "channels": channels, } ) if created_date is not UNSET: @@ -143,50 +127,28 @@ def to_dict(self) -> Dict[str, Any]: field_dict["changedBy"] = changed_by if changed_by_type is not UNSET: field_dict["changedByType"] = changed_by_type - if plenigo_offer_id is not UNSET: - field_dict["plenigoOfferId"] = plenigo_offer_id - if end_date is not UNSET: - field_dict["endDate"] = end_date + if custom_data is not UNSET: + field_dict["customData"] = custom_data + if vouchers is not UNSET: + field_dict["vouchers"] = vouchers + if multi_voucher is not UNSET: + field_dict["multiVoucher"] = multi_voucher return field_dict @classmethod def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: - from ..models.api_channel_base import ApiChannelBase + from ..models.api_multi_voucher import ApiMultiVoucher + from ..models.api_voucher import ApiVoucher d = src_dict.copy() - campaign_id = d.pop("campaignId") - - campaign_name = d.pop("campaignName") - - voucher_type = ApiCampaignBaseVoucherType(d.pop("voucherType")) - - status = ApiCampaignBaseStatus(d.pop("status")) - - def _parse_start_date(data: object) -> Union[None, datetime.date]: - if data is None: - return data - - # Try to parse the data as datetime.date - try: - if not isinstance(data, str): - raise TypeError() - start_date_type_1 = isoparse(data).date() - - return start_date_type_1 - except: # noqa: E722 - pass + channel_id = d.pop("channelId") - return cast(Union[None, datetime.date], data) + channel_name = d.pop("channelName") - start_date = _parse_start_date(d.pop("startDate")) + voucher_amount = d.pop("voucherAmount") - channels = [] - _channels = d.pop("channels") - for channels_item_data in _channels: - channels_item = ApiChannelBase.from_dict(channels_item_data) - - channels.append(channels_item) + status = ApiChannelBaseStatus(d.pop("status")) def _parse_created_date(data: object) -> Union[None, Unset, datetime.datetime]: if data is None: @@ -254,51 +216,40 @@ def _parse_changed_date(data: object) -> Union[None, Unset, datetime.datetime]: else: changed_by_type = UserType(_changed_by_type) - plenigo_offer_id = d.pop("plenigoOfferId", UNSET) + custom_data = d.pop("customData", UNSET) - def _parse_end_date(data: object) -> Union[None, Unset, datetime.date]: - if data is None: - return data + vouchers = [] + _vouchers = d.pop("vouchers", UNSET) + for vouchers_item_data in _vouchers or []: + vouchers_item = ApiVoucher.from_dict(vouchers_item_data) - if data is None: - return data + vouchers.append(vouchers_item) - if isinstance(data, Unset): - return data - - # Try to parse the data as datetime.date - try: - if not isinstance(data, str): - raise TypeError() - end_date_type_1 = isoparse(data).date() - - return end_date_type_1 - except: # noqa: E722 - pass - - return cast(Union[None, Unset, datetime.date], data) - - end_date = _parse_end_date(d.pop("endDate", UNSET)) + _multi_voucher = d.pop("multiVoucher", UNSET) + multi_voucher: Union[Unset, ApiMultiVoucher] + if isinstance(_multi_voucher, Unset) or not _multi_voucher: + multi_voucher = UNSET + else: + multi_voucher = ApiMultiVoucher.from_dict(_multi_voucher) - api_campaign_creation_result = cls( - campaign_id=campaign_id, - campaign_name=campaign_name, - voucher_type=voucher_type, + api_channel = cls( + channel_id=channel_id, + channel_name=channel_name, + voucher_amount=voucher_amount, status=status, - start_date=start_date, - channels=channels, created_date=created_date, changed_date=changed_date, created_by=created_by, created_by_type=created_by_type, changed_by=changed_by, changed_by_type=changed_by_type, - plenigo_offer_id=plenigo_offer_id, - end_date=end_date, + custom_data=custom_data, + vouchers=vouchers, + multi_voucher=multi_voucher, ) - api_campaign_creation_result.additional_properties = d - return api_campaign_creation_result + api_channel.additional_properties = d + return api_channel @property def additional_keys(self) -> List[str]: diff --git a/plenigo-client/plenigo/models/api_multi_voucher.py b/plenigo-client/plenigo/models/api_multi_voucher.py new file mode 100644 index 0000000..a3584db --- /dev/null +++ b/plenigo-client/plenigo/models/api_multi_voucher.py @@ -0,0 +1,224 @@ +import datetime +from typing import Any, Dict, List, Type, TypeVar, Union, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field +from dateutil.parser import isoparse + +from ..models.api_multi_voucher_status import ApiMultiVoucherStatus +from ..models.user_type import UserType +from ..types import UNSET, Unset + +T = TypeVar("T", bound="ApiMultiVoucher") + + +@_attrs_define +class ApiMultiVoucher: + """ + Attributes: + id (int): unique id of the multi voucher in the context of a company + voucher_code (str): voucher code + status (ApiMultiVoucherStatus): status of the multi voucher + voucher_amount (int): amount how often the voucher code can be used + voucher_used (int): amount of how often the voucher code is already used + created_date (Union[None, Unset, datetime.datetime]): time the object was created with time notation as defined + by RFC 3339, section 5.6, for + example, 17:32:28 + changed_date (Union[None, Unset, datetime.datetime]): time the object was changed with time notation as defined + by RFC 3339, section 5.6, for + example, 17:32:28 + created_by (Union[Unset, str]): id who created the object + created_by_type (Union[Unset, UserType]): type of user who performs the action + changed_by (Union[Unset, str]): id who changed the object + changed_by_type (Union[Unset, UserType]): type of user who performs the action + """ + + id: int + voucher_code: str + status: ApiMultiVoucherStatus + voucher_amount: int + voucher_used: int + created_date: Union[None, Unset, datetime.datetime] = UNSET + changed_date: Union[None, Unset, datetime.datetime] = UNSET + created_by: Union[Unset, str] = UNSET + created_by_type: Union[Unset, UserType] = UNSET + changed_by: Union[Unset, str] = UNSET + changed_by_type: Union[Unset, UserType] = UNSET + additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + id = self.id + + voucher_code = self.voucher_code + + status = self.status.value + + voucher_amount = self.voucher_amount + + voucher_used = self.voucher_used + + created_date: Union[None, Unset, str] + if isinstance(self.created_date, Unset) or self.created_date is None: + created_date = UNSET + elif isinstance(self.created_date, datetime.datetime): + created_date = self.created_date.isoformat() + else: + created_date = self.created_date + + changed_date: Union[None, Unset, str] + if isinstance(self.changed_date, Unset) or self.changed_date is None: + changed_date = UNSET + elif isinstance(self.changed_date, datetime.datetime): + changed_date = self.changed_date.isoformat() + else: + changed_date = self.changed_date + + created_by = self.created_by + + created_by_type: Union[Unset, str] = UNSET + if not isinstance(self.created_by_type, Unset): + created_by_type = self.created_by_type.value + + changed_by = self.changed_by + + changed_by_type: Union[Unset, str] = UNSET + if not isinstance(self.changed_by_type, Unset): + changed_by_type = self.changed_by_type.value + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + "voucherCode": voucher_code, + "status": status, + "voucherAmount": voucher_amount, + "voucherUsed": voucher_used, + } + ) + if created_date is not UNSET: + field_dict["createdDate"] = created_date + if changed_date is not UNSET: + field_dict["changedDate"] = changed_date + if created_by is not UNSET: + field_dict["createdBy"] = created_by + if created_by_type is not UNSET: + field_dict["createdByType"] = created_by_type + if changed_by is not UNSET: + field_dict["changedBy"] = changed_by + if changed_by_type is not UNSET: + field_dict["changedByType"] = changed_by_type + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + id = d.pop("id") + + voucher_code = d.pop("voucherCode") + + status = ApiMultiVoucherStatus(d.pop("status")) + + voucher_amount = d.pop("voucherAmount") + + voucher_used = d.pop("voucherUsed") + + def _parse_created_date(data: object) -> Union[None, Unset, datetime.datetime]: + if data is None: + return data + + if data is None: + return data + + if isinstance(data, Unset): + return data + + # Try to parse the data as datetime.datetime + try: + if not isinstance(data, str): + raise TypeError() + created_date_type_0 = isoparse(data) + + return created_date_type_0 + except: # noqa: E722 + pass + + return cast(Union[None, Unset, datetime.datetime], data) + + created_date = _parse_created_date(d.pop("createdDate", UNSET)) + + def _parse_changed_date(data: object) -> Union[None, Unset, datetime.datetime]: + if data is None: + return data + + if data is None: + return data + + if isinstance(data, Unset): + return data + + # Try to parse the data as datetime.datetime + try: + if not isinstance(data, str): + raise TypeError() + changed_date_type_0 = isoparse(data) + + return changed_date_type_0 + except: # noqa: E722 + pass + + return cast(Union[None, Unset, datetime.datetime], data) + + changed_date = _parse_changed_date(d.pop("changedDate", UNSET)) + + created_by = d.pop("createdBy", UNSET) + + _created_by_type = d.pop("createdByType", UNSET) + created_by_type: Union[Unset, UserType] + if isinstance(_created_by_type, Unset) or not _created_by_type: + created_by_type = UNSET + else: + created_by_type = UserType(_created_by_type) + + changed_by = d.pop("changedBy", UNSET) + + _changed_by_type = d.pop("changedByType", UNSET) + changed_by_type: Union[Unset, UserType] + if isinstance(_changed_by_type, Unset) or not _changed_by_type: + changed_by_type = UNSET + else: + changed_by_type = UserType(_changed_by_type) + + api_multi_voucher = cls( + id=id, + voucher_code=voucher_code, + status=status, + voucher_amount=voucher_amount, + voucher_used=voucher_used, + created_date=created_date, + changed_date=changed_date, + created_by=created_by, + created_by_type=created_by_type, + changed_by=changed_by, + changed_by_type=changed_by_type, + ) + + api_multi_voucher.additional_properties = d + return api_multi_voucher + + @property + def additional_keys(self) -> List[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/plenigo-client/plenigo/models/api_multi_voucher_status.py b/plenigo-client/plenigo/models/api_multi_voucher_status.py new file mode 100644 index 0000000..db37274 --- /dev/null +++ b/plenigo-client/plenigo/models/api_multi_voucher_status.py @@ -0,0 +1,10 @@ +from enum import Enum + + +class ApiMultiVoucherStatus(str, Enum): + ACTIVE = "ACTIVE" + DELETED = "DELETED" + INACTIVE = "INACTIVE" + + def __str__(self) -> str: + return str(self.value) diff --git a/plenigo-client/plenigo/models/api_voucher.py b/plenigo-client/plenigo/models/api_voucher.py index cf6fb6d..6fd60a9 100644 --- a/plenigo-client/plenigo/models/api_voucher.py +++ b/plenigo-client/plenigo/models/api_voucher.py @@ -29,6 +29,9 @@ class ApiVoucher: created_by_type (Union[Unset, UserType]): type of user who performs the action changed_by (Union[Unset, str]): id who changed the object changed_by_type (Union[Unset, UserType]): type of user who performs the action + purchase_order_id (Union[Unset, int]): id of the order voucher was purchased with + purchase_order_item_position (Union[Unset, int]): position of the order item inside the order voucher was + purchased with custom_data (Union[Unset, str]): free text field order_id (Union[Unset, int]): order id this voucher was used """ @@ -42,6 +45,8 @@ class ApiVoucher: created_by_type: Union[Unset, UserType] = UNSET changed_by: Union[Unset, str] = UNSET changed_by_type: Union[Unset, UserType] = UNSET + purchase_order_id: Union[Unset, int] = UNSET + purchase_order_item_position: Union[Unset, int] = UNSET custom_data: Union[Unset, str] = UNSET order_id: Union[Unset, int] = UNSET additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -81,6 +86,10 @@ def to_dict(self) -> Dict[str, Any]: if not isinstance(self.changed_by_type, Unset): changed_by_type = self.changed_by_type.value + purchase_order_id = self.purchase_order_id + + purchase_order_item_position = self.purchase_order_item_position + custom_data = self.custom_data order_id = self.order_id @@ -106,6 +115,10 @@ def to_dict(self) -> Dict[str, Any]: field_dict["changedBy"] = changed_by if changed_by_type is not UNSET: field_dict["changedByType"] = changed_by_type + if purchase_order_id is not UNSET: + field_dict["purchaseOrderId"] = purchase_order_id + if purchase_order_item_position is not UNSET: + field_dict["purchaseOrderItemPosition"] = purchase_order_item_position if custom_data is not UNSET: field_dict["customData"] = custom_data if order_id is not UNSET: @@ -188,6 +201,10 @@ def _parse_changed_date(data: object) -> Union[None, Unset, datetime.datetime]: else: changed_by_type = UserType(_changed_by_type) + purchase_order_id = d.pop("purchaseOrderId", UNSET) + + purchase_order_item_position = d.pop("purchaseOrderItemPosition", UNSET) + custom_data = d.pop("customData", UNSET) order_id = d.pop("orderId", UNSET) @@ -202,6 +219,8 @@ def _parse_changed_date(data: object) -> Union[None, Unset, datetime.datetime]: created_by_type=created_by_type, changed_by=changed_by, changed_by_type=changed_by_type, + purchase_order_id=purchase_order_id, + purchase_order_item_position=purchase_order_item_position, custom_data=custom_data, order_id=order_id, ) diff --git a/plenigo-client/plenigo/models/api_voucher_page.py b/plenigo-client/plenigo/models/api_voucher_page.py index fa83883..7b49bb8 100644 --- a/plenigo-client/plenigo/models/api_voucher_page.py +++ b/plenigo-client/plenigo/models/api_voucher_page.py @@ -16,43 +16,41 @@ class ApiVoucherPage: """ Attributes: - starting_after (Union[Unset, int]): starting after element id - size (Union[Unset, int]): size of elements of the page - total_size (Union[Unset, int]): total of elements - campaigns (Union[Unset, List['ApiVoucher']]): + ending_before_id (Union[Unset, str]): A cursor for use in pagination. endingBefore is an object ID that defines + your place in the list. For instance, if you make a list request and receive 100 objects, starting with obj_bar, + your subsequent call can include endingBefore=obj_bar in order to fetch the previous page of the list. + starting_after_id (Union[Unset, str]): A cursor for use in pagination. startingAfter is an object ID that + defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with + obj_foo, your subsequent call can include startingAfter=obj_foo in order to fetch the next result set. + items (Union[Unset, List['ApiVoucher']]): """ - starting_after: Union[Unset, int] = UNSET - size: Union[Unset, int] = UNSET - total_size: Union[Unset, int] = UNSET - campaigns: Union[Unset, List["ApiVoucher"]] = UNSET + ending_before_id: Union[Unset, str] = UNSET + starting_after_id: Union[Unset, str] = UNSET + items: Union[Unset, List["ApiVoucher"]] = UNSET additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> Dict[str, Any]: - starting_after = self.starting_after + ending_before_id = self.ending_before_id - size = self.size + starting_after_id = self.starting_after_id - total_size = self.total_size - - campaigns: Union[Unset, List[Dict[str, Any]]] = UNSET - if not isinstance(self.campaigns, Unset): - campaigns = [] - for campaigns_item_data in self.campaigns: - campaigns_item = campaigns_item_data.to_dict() - campaigns.append(campaigns_item) + items: Union[Unset, List[Dict[str, Any]]] = UNSET + if not isinstance(self.items, Unset): + items = [] + for items_item_data in self.items: + items_item = items_item_data.to_dict() + items.append(items_item) field_dict: Dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update({}) - if starting_after is not UNSET: - field_dict["startingAfter"] = starting_after - if size is not UNSET: - field_dict["size"] = size - if total_size is not UNSET: - field_dict["totalSize"] = total_size - if campaigns is not UNSET: - field_dict["campaigns"] = campaigns + if ending_before_id is not UNSET: + field_dict["endingBeforeId"] = ending_before_id + if starting_after_id is not UNSET: + field_dict["startingAfterId"] = starting_after_id + if items is not UNSET: + field_dict["items"] = items return field_dict @@ -61,24 +59,21 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: from ..models.api_voucher import ApiVoucher d = src_dict.copy() - starting_after = d.pop("startingAfter", UNSET) - - size = d.pop("size", UNSET) + ending_before_id = d.pop("endingBeforeId", UNSET) - total_size = d.pop("totalSize", UNSET) + starting_after_id = d.pop("startingAfterId", UNSET) - campaigns = [] - _campaigns = d.pop("campaigns", UNSET) - for campaigns_item_data in _campaigns or []: - campaigns_item = ApiVoucher.from_dict(campaigns_item_data) + items = [] + _items = d.pop("items", UNSET) + for items_item_data in _items or []: + items_item = ApiVoucher.from_dict(items_item_data) - campaigns.append(campaigns_item) + items.append(items_item) api_voucher_page = cls( - starting_after=starting_after, - size=size, - total_size=total_size, - campaigns=campaigns, + ending_before_id=ending_before_id, + starting_after_id=starting_after_id, + items=items, ) api_voucher_page.additional_properties = d diff --git a/plenigo-client/plenigo/models/app_store_access_right.py b/plenigo-client/plenigo/models/app_store_access_right.py deleted file mode 100644 index d8290ba..0000000 --- a/plenigo-client/plenigo/models/app_store_access_right.py +++ /dev/null @@ -1,81 +0,0 @@ -from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.app_store_access_right_additional_data import AppStoreAccessRightAdditionalData - - -T = TypeVar("T", bound="AppStoreAccessRight") - - -@_attrs_define -class AppStoreAccessRight: - """ - Attributes: - unique_id (Union[Unset, str]): access right unique id that will be associated with this app store purchase after - association - additional_data (Union[Unset, AppStoreAccessRightAdditionalData]): - """ - - unique_id: Union[Unset, str] = UNSET - additional_data: Union[Unset, "AppStoreAccessRightAdditionalData"] = UNSET - additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> Dict[str, Any]: - unique_id = self.unique_id - - additional_data: Union[Unset, Dict[str, Any]] = UNSET - if not isinstance(self.additional_data, Unset): - additional_data = self.additional_data.to_dict() - - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if unique_id is not UNSET: - field_dict["uniqueId"] = unique_id - if additional_data is not UNSET: - field_dict["additionalData"] = additional_data - - return field_dict - - @classmethod - def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: - from ..models.app_store_access_right_additional_data import AppStoreAccessRightAdditionalData - - d = src_dict.copy() - unique_id = d.pop("uniqueId", UNSET) - - _additional_data = d.pop("additionalData", UNSET) - additional_data: Union[Unset, AppStoreAccessRightAdditionalData] - if isinstance(_additional_data, Unset) or not _additional_data: - additional_data = UNSET - else: - additional_data = AppStoreAccessRightAdditionalData.from_dict(_additional_data) - - app_store_access_right = cls( - unique_id=unique_id, - additional_data=additional_data, - ) - - app_store_access_right.additional_properties = d - return app_store_access_right - - @property - def additional_keys(self) -> List[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/plenigo-client/plenigo/models/app_store_access_right_additional_data.py b/plenigo-client/plenigo/models/app_store_access_right_additional_data.py deleted file mode 100644 index 603ed90..0000000 --- a/plenigo-client/plenigo/models/app_store_access_right_additional_data.py +++ /dev/null @@ -1,62 +0,0 @@ -from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -if TYPE_CHECKING: - from ..models.app_store_access_right_additional_data_additional_property import ( - AppStoreAccessRightAdditionalDataAdditionalProperty, - ) - - -T = TypeVar("T", bound="AppStoreAccessRightAdditionalData") - - -@_attrs_define -class AppStoreAccessRightAdditionalData: - """ """ - - additional_properties: Dict[str, "AppStoreAccessRightAdditionalDataAdditionalProperty"] = _attrs_field( - init=False, factory=dict - ) - - def to_dict(self) -> Dict[str, Any]: - field_dict: Dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - field_dict[prop_name] = prop.to_dict() - - return field_dict - - @classmethod - def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: - from ..models.app_store_access_right_additional_data_additional_property import ( - AppStoreAccessRightAdditionalDataAdditionalProperty, - ) - - d = src_dict.copy() - app_store_access_right_additional_data = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - additional_property = AppStoreAccessRightAdditionalDataAdditionalProperty.from_dict(prop_dict) - - additional_properties[prop_name] = additional_property - - app_store_access_right_additional_data.additional_properties = additional_properties - return app_store_access_right_additional_data - - @property - def additional_keys(self) -> List[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> "AppStoreAccessRightAdditionalDataAdditionalProperty": - return self.additional_properties[key] - - def __setitem__(self, key: str, value: "AppStoreAccessRightAdditionalDataAdditionalProperty") -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/plenigo-client/plenigo/models/app_store_access_right_additional_data_additional_property.py b/plenigo-client/plenigo/models/app_store_access_right_additional_data_additional_property.py deleted file mode 100644 index a15641f..0000000 --- a/plenigo-client/plenigo/models/app_store_access_right_additional_data_additional_property.py +++ /dev/null @@ -1,67 +0,0 @@ -from typing import Any, Dict, List, Type, TypeVar, Union - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from ..types import UNSET, Unset - -T = TypeVar("T", bound="AppStoreAccessRightAdditionalDataAdditionalProperty") - - -@_attrs_define -class AppStoreAccessRightAdditionalDataAdditionalProperty: - """ - Attributes: - key (Union[Unset, str]): - value (Union[Unset, str]): - """ - - key: Union[Unset, str] = UNSET - value: Union[Unset, str] = UNSET - additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> Dict[str, Any]: - key = self.key - - value = self.value - - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if key is not UNSET: - field_dict["key"] = key - if value is not UNSET: - field_dict["value"] = value - - return field_dict - - @classmethod - def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: - d = src_dict.copy() - key = d.pop("key", UNSET) - - value = d.pop("value", UNSET) - - app_store_access_right_additional_data_additional_property = cls( - key=key, - value=value, - ) - - app_store_access_right_additional_data_additional_property.additional_properties = d - return app_store_access_right_additional_data_additional_property - - @property - def additional_keys(self) -> List[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/plenigo-client/plenigo/models/app_store_access_rights.py b/plenigo-client/plenigo/models/app_store_access_rights.py deleted file mode 100644 index 0e1fcd3..0000000 --- a/plenigo-client/plenigo/models/app_store_access_rights.py +++ /dev/null @@ -1,74 +0,0 @@ -from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.app_store_access_right import AppStoreAccessRight - - -T = TypeVar("T", bound="AppStoreAccessRights") - - -@_attrs_define -class AppStoreAccessRights: - """ - Attributes: - items (Union[Unset, List['AppStoreAccessRight']]): - """ - - items: Union[Unset, List["AppStoreAccessRight"]] = UNSET - additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> Dict[str, Any]: - items: Union[Unset, List[Dict[str, Any]]] = UNSET - if not isinstance(self.items, Unset): - items = [] - for items_item_data in self.items: - items_item = items_item_data.to_dict() - items.append(items_item) - - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if items is not UNSET: - field_dict["items"] = items - - return field_dict - - @classmethod - def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: - from ..models.app_store_access_right import AppStoreAccessRight - - d = src_dict.copy() - items = [] - _items = d.pop("items", UNSET) - for items_item_data in _items or []: - items_item = AppStoreAccessRight.from_dict(items_item_data) - - items.append(items_item) - - app_store_access_rights = cls( - items=items, - ) - - app_store_access_rights.additional_properties = d - return app_store_access_rights - - @property - def additional_keys(self) -> List[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/plenigo-client/plenigo/models/app_store_purchase.py b/plenigo-client/plenigo/models/app_store_purchase.py deleted file mode 100644 index d149cad..0000000 --- a/plenigo-client/plenigo/models/app_store_purchase.py +++ /dev/null @@ -1,102 +0,0 @@ -from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.app_store_purchase_detail import AppStorePurchaseDetail - - -T = TypeVar("T", bound="AppStorePurchase") - - -@_attrs_define -class AppStorePurchase: - """ - Attributes: - customer_id (Union[Unset, str]): id of the customer purchase is associated with - only set if purchase is - already associated - token (Union[Unset, str]): token that uniquely identifies this purchase and is used for further API requests - has_orders (Union[Unset, bool]): flag indicating if purchase has orders - orders (Union[Unset, List['AppStorePurchaseDetail']]): - """ - - customer_id: Union[Unset, str] = UNSET - token: Union[Unset, str] = UNSET - has_orders: Union[Unset, bool] = UNSET - orders: Union[Unset, List["AppStorePurchaseDetail"]] = UNSET - additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> Dict[str, Any]: - customer_id = self.customer_id - - token = self.token - - has_orders = self.has_orders - - orders: Union[Unset, List[Dict[str, Any]]] = UNSET - if not isinstance(self.orders, Unset): - orders = [] - for orders_item_data in self.orders: - orders_item = orders_item_data.to_dict() - orders.append(orders_item) - - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if customer_id is not UNSET: - field_dict["customerId"] = customer_id - if token is not UNSET: - field_dict["token"] = token - if has_orders is not UNSET: - field_dict["hasOrders"] = has_orders - if orders is not UNSET: - field_dict["orders"] = orders - - return field_dict - - @classmethod - def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: - from ..models.app_store_purchase_detail import AppStorePurchaseDetail - - d = src_dict.copy() - customer_id = d.pop("customerId", UNSET) - - token = d.pop("token", UNSET) - - has_orders = d.pop("hasOrders", UNSET) - - orders = [] - _orders = d.pop("orders", UNSET) - for orders_item_data in _orders or []: - orders_item = AppStorePurchaseDetail.from_dict(orders_item_data) - - orders.append(orders_item) - - app_store_purchase = cls( - customer_id=customer_id, - token=token, - has_orders=has_orders, - orders=orders, - ) - - app_store_purchase.additional_properties = d - return app_store_purchase - - @property - def additional_keys(self) -> List[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/plenigo-client/plenigo/models/app_store_purchase_detail.py b/plenigo-client/plenigo/models/app_store_purchase_detail.py deleted file mode 100644 index b8bfa43..0000000 --- a/plenigo-client/plenigo/models/app_store_purchase_detail.py +++ /dev/null @@ -1,141 +0,0 @@ -import datetime -from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union, cast - -from attrs import define as _attrs_define -from attrs import field as _attrs_field -from dateutil.parser import isoparse - -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.app_store_access_rights import AppStoreAccessRights - - -T = TypeVar("T", bound="AppStorePurchaseDetail") - - -@_attrs_define -class AppStorePurchaseDetail: - """ - Attributes: - purchase_date (Union[None, Unset, datetime.datetime]): date the product was purchased with date-time notation as - defined by RFC 3339, section 5.6, - for example, 2017-07-21T17:32:28Z - valid (Union[Unset, bool]): flag indicating purchase is still valid - access_right_unique_id (Union[Unset, str]): access right unique id that will be associated with this app store - purchase after association - app_store_product_id (Union[Unset, str]): id of the product as set in the app store - access_rights (Union[Unset, AppStoreAccessRights]): - """ - - purchase_date: Union[None, Unset, datetime.datetime] = UNSET - valid: Union[Unset, bool] = UNSET - access_right_unique_id: Union[Unset, str] = UNSET - app_store_product_id: Union[Unset, str] = UNSET - access_rights: Union[Unset, "AppStoreAccessRights"] = UNSET - additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> Dict[str, Any]: - purchase_date: Union[None, Unset, str] - if isinstance(self.purchase_date, Unset) or self.purchase_date is None: - purchase_date = UNSET - elif isinstance(self.purchase_date, datetime.datetime): - purchase_date = self.purchase_date.isoformat() - else: - purchase_date = self.purchase_date - - valid = self.valid - - access_right_unique_id = self.access_right_unique_id - - app_store_product_id = self.app_store_product_id - - access_rights: Union[Unset, Dict[str, Any]] = UNSET - if not isinstance(self.access_rights, Unset): - access_rights = self.access_rights.to_dict() - - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if purchase_date is not UNSET: - field_dict["purchaseDate"] = purchase_date - if valid is not UNSET: - field_dict["valid"] = valid - if access_right_unique_id is not UNSET: - field_dict["accessRightUniqueId"] = access_right_unique_id - if app_store_product_id is not UNSET: - field_dict["appStoreProductId"] = app_store_product_id - if access_rights is not UNSET: - field_dict["accessRights"] = access_rights - - return field_dict - - @classmethod - def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: - from ..models.app_store_access_rights import AppStoreAccessRights - - d = src_dict.copy() - - def _parse_purchase_date(data: object) -> Union[None, Unset, datetime.datetime]: - if data is None: - return data - - if data is None: - return data - - if isinstance(data, Unset): - return data - - # Try to parse the data as datetime.datetime - try: - if not isinstance(data, str): - raise TypeError() - purchase_date_type_0 = isoparse(data) - - return purchase_date_type_0 - except: # noqa: E722 - pass - - return cast(Union[None, Unset, datetime.datetime], data) - - purchase_date = _parse_purchase_date(d.pop("purchaseDate", UNSET)) - - valid = d.pop("valid", UNSET) - - access_right_unique_id = d.pop("accessRightUniqueId", UNSET) - - app_store_product_id = d.pop("appStoreProductId", UNSET) - - _access_rights = d.pop("accessRights", UNSET) - access_rights: Union[Unset, AppStoreAccessRights] - if isinstance(_access_rights, Unset) or not _access_rights: - access_rights = UNSET - else: - access_rights = AppStoreAccessRights.from_dict(_access_rights) - - app_store_purchase_detail = cls( - purchase_date=purchase_date, - valid=valid, - access_right_unique_id=access_right_unique_id, - app_store_product_id=app_store_product_id, - access_rights=access_rights, - ) - - app_store_purchase_detail.additional_properties = d - return app_store_purchase_detail - - @property - def additional_keys(self) -> List[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/plenigo-client/plenigo/models/app_store_purchase_list.py b/plenigo-client/plenigo/models/app_store_purchase_list.py deleted file mode 100644 index ed95497..0000000 --- a/plenigo-client/plenigo/models/app_store_purchase_list.py +++ /dev/null @@ -1,74 +0,0 @@ -from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.app_store_purchase import AppStorePurchase - - -T = TypeVar("T", bound="AppStorePurchaseList") - - -@_attrs_define -class AppStorePurchaseList: - """ - Attributes: - purchases (Union[Unset, List['AppStorePurchase']]): - """ - - purchases: Union[Unset, List["AppStorePurchase"]] = UNSET - additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> Dict[str, Any]: - purchases: Union[Unset, List[Dict[str, Any]]] = UNSET - if not isinstance(self.purchases, Unset): - purchases = [] - for purchases_item_data in self.purchases: - purchases_item = purchases_item_data.to_dict() - purchases.append(purchases_item) - - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if purchases is not UNSET: - field_dict["purchases"] = purchases - - return field_dict - - @classmethod - def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: - from ..models.app_store_purchase import AppStorePurchase - - d = src_dict.copy() - purchases = [] - _purchases = d.pop("purchases", UNSET) - for purchases_item_data in _purchases or []: - purchases_item = AppStorePurchase.from_dict(purchases_item_data) - - purchases.append(purchases_item) - - app_store_purchase_list = cls( - purchases=purchases, - ) - - app_store_purchase_list.additional_properties = d - return app_store_purchase_list - - @property - def additional_keys(self) -> List[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/plenigo-client/plenigo/models/apple_app_store_purchase_addition.py b/plenigo-client/plenigo/models/apple_app_store_purchase_addition.py deleted file mode 100644 index bc9a17a..0000000 --- a/plenigo-client/plenigo/models/apple_app_store_purchase_addition.py +++ /dev/null @@ -1,70 +0,0 @@ -from typing import Any, Dict, List, Type, TypeVar, Union, cast - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from ..types import UNSET, Unset - -T = TypeVar("T", bound="AppleAppStorePurchaseAddition") - - -@_attrs_define -class AppleAppStorePurchaseAddition: - """ - Attributes: - app_identifier (Union[Unset, str]): identifier of the application as defined in the plenigo backend to retrieve - the according secret - receipt_data (Union[Unset, List[str]]): - """ - - app_identifier: Union[Unset, str] = UNSET - receipt_data: Union[Unset, List[str]] = UNSET - additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> Dict[str, Any]: - app_identifier = self.app_identifier - - receipt_data: Union[Unset, List[str]] = UNSET - if not isinstance(self.receipt_data, Unset): - receipt_data = self.receipt_data - - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if app_identifier is not UNSET: - field_dict["appIdentifier"] = app_identifier - if receipt_data is not UNSET: - field_dict["receiptData"] = receipt_data - - return field_dict - - @classmethod - def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: - d = src_dict.copy() - app_identifier = d.pop("appIdentifier", UNSET) - - receipt_data = cast(List[str], d.pop("receiptData", UNSET)) - - apple_app_store_purchase_addition = cls( - app_identifier=app_identifier, - receipt_data=receipt_data, - ) - - apple_app_store_purchase_addition.additional_properties = d - return apple_app_store_purchase_addition - - @property - def additional_keys(self) -> List[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/plenigo-client/plenigo/models/campaign_creation.py b/plenigo-client/plenigo/models/campaign_creation.py deleted file mode 100644 index d30fe84..0000000 --- a/plenigo-client/plenigo/models/campaign_creation.py +++ /dev/null @@ -1,170 +0,0 @@ -import datetime -from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union, cast - -from attrs import define as _attrs_define -from attrs import field as _attrs_field -from dateutil.parser import isoparse - -from ..models.campaign_creation_voucher_type import CampaignCreationVoucherType -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.channel_creation import ChannelCreation - - -T = TypeVar("T", bound="CampaignCreation") - - -@_attrs_define -class CampaignCreation: - """ - Attributes: - campaign_name (str): name of the campaign - voucher_type (CampaignCreationVoucherType): represents the type of the vouchers of this campaign - plenigo_offer_id (str): plenigo offer id the vouchers are for - start_date (Union[None, datetime.date]): start date of the campaign with full-date notation as defined by RFC 3339, section 5.6, for example, - 2017-07-21 - channels (List['ChannelCreation']): - end_date (Union[None, Unset, datetime.date]): end date of the campaign with full-date notation as defined by RFC 3339, section 5.6, for example, - 2017-07-21 - """ - - campaign_name: str - voucher_type: CampaignCreationVoucherType - plenigo_offer_id: str - start_date: Union[None, datetime.date] - channels: List["ChannelCreation"] - end_date: Union[None, Unset, datetime.date] = UNSET - additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> Dict[str, Any]: - campaign_name = self.campaign_name - - voucher_type = self.voucher_type.value - - plenigo_offer_id = self.plenigo_offer_id - - start_date: Union[None, str] - if isinstance(self.start_date, datetime.date): - start_date = self.start_date.isoformat() - else: - start_date = self.start_date - - channels = [] - for channels_item_data in self.channels: - channels_item = channels_item_data.to_dict() - channels.append(channels_item) - - end_date: Union[None, Unset, str] - if isinstance(self.end_date, Unset) or self.end_date is None: - end_date = UNSET - elif isinstance(self.end_date, datetime.date): - end_date = self.end_date.isoformat() - else: - end_date = self.end_date - - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "campaignName": campaign_name, - "voucherType": voucher_type, - "plenigoOfferId": plenigo_offer_id, - "startDate": start_date, - "channels": channels, - } - ) - if end_date is not UNSET: - field_dict["endDate"] = end_date - - return field_dict - - @classmethod - def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: - from ..models.channel_creation import ChannelCreation - - d = src_dict.copy() - campaign_name = d.pop("campaignName") - - voucher_type = CampaignCreationVoucherType(d.pop("voucherType")) - - plenigo_offer_id = d.pop("plenigoOfferId") - - def _parse_start_date(data: object) -> Union[None, datetime.date]: - if data is None: - return data - - # Try to parse the data as datetime.date - try: - if not isinstance(data, str): - raise TypeError() - start_date_type_1 = isoparse(data).date() - - return start_date_type_1 - except: # noqa: E722 - pass - - return cast(Union[None, datetime.date], data) - - start_date = _parse_start_date(d.pop("startDate")) - - channels = [] - _channels = d.pop("channels") - for channels_item_data in _channels: - channels_item = ChannelCreation.from_dict(channels_item_data) - - channels.append(channels_item) - - def _parse_end_date(data: object) -> Union[None, Unset, datetime.date]: - if data is None: - return data - - if data is None: - return data - - if isinstance(data, Unset): - return data - - # Try to parse the data as datetime.date - try: - if not isinstance(data, str): - raise TypeError() - end_date_type_1 = isoparse(data).date() - - return end_date_type_1 - except: # noqa: E722 - pass - - return cast(Union[None, Unset, datetime.date], data) - - end_date = _parse_end_date(d.pop("endDate", UNSET)) - - campaign_creation = cls( - campaign_name=campaign_name, - voucher_type=voucher_type, - plenigo_offer_id=plenigo_offer_id, - start_date=start_date, - channels=channels, - end_date=end_date, - ) - - campaign_creation.additional_properties = d - return campaign_creation - - @property - def additional_keys(self) -> List[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/plenigo-client/plenigo/models/campaign_creation_voucher_type.py b/plenigo-client/plenigo/models/campaign_creation_voucher_type.py deleted file mode 100644 index 2f59854..0000000 --- a/plenigo-client/plenigo/models/campaign_creation_voucher_type.py +++ /dev/null @@ -1,9 +0,0 @@ -from enum import Enum - - -class CampaignCreationVoucherType(str, Enum): - MULTI = "MULTI" - SINGLE = "SINGLE" - - def __str__(self) -> str: - return str(self.value) diff --git a/plenigo-client/plenigo/models/channel_creation.py b/plenigo-client/plenigo/models/channel_creation.py deleted file mode 100644 index f7b7f7e..0000000 --- a/plenigo-client/plenigo/models/channel_creation.py +++ /dev/null @@ -1,76 +0,0 @@ -from typing import Any, Dict, List, Type, TypeVar, Union - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from ..types import UNSET, Unset - -T = TypeVar("T", bound="ChannelCreation") - - -@_attrs_define -class ChannelCreation: - """ - Attributes: - channel_name (Union[Unset, str]): name of the channel - custom_data (Union[Unset, str]): free text field - voucher_amount (Union[Unset, int]): represents the amount of vouchers to create for this channel - """ - - channel_name: Union[Unset, str] = UNSET - custom_data: Union[Unset, str] = UNSET - voucher_amount: Union[Unset, int] = UNSET - additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> Dict[str, Any]: - channel_name = self.channel_name - - custom_data = self.custom_data - - voucher_amount = self.voucher_amount - - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if channel_name is not UNSET: - field_dict["channelName"] = channel_name - if custom_data is not UNSET: - field_dict["customData"] = custom_data - if voucher_amount is not UNSET: - field_dict["voucherAmount"] = voucher_amount - - return field_dict - - @classmethod - def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: - d = src_dict.copy() - channel_name = d.pop("channelName", UNSET) - - custom_data = d.pop("customData", UNSET) - - voucher_amount = d.pop("voucherAmount", UNSET) - - channel_creation = cls( - channel_name=channel_name, - custom_data=custom_data, - voucher_amount=voucher_amount, - ) - - channel_creation.additional_properties = d - return channel_creation - - @property - def additional_keys(self) -> List[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/plenigo-client/plenigo/models/customer_accepted_terms.py b/plenigo-client/plenigo/models/customer_accepted_terms.py index 6a570a0..0dd2ce3 100644 --- a/plenigo-client/plenigo/models/customer_accepted_terms.py +++ b/plenigo-client/plenigo/models/customer_accepted_terms.py @@ -4,7 +4,7 @@ from attrs import field as _attrs_field if TYPE_CHECKING: - from ..models.customer_accepted_terms_additional_property import CustomerAcceptedTermsAdditionalProperty + from ..models.customer_accepted_term import CustomerAcceptedTerm T = TypeVar("T", bound="CustomerAcceptedTerms") @@ -14,7 +14,7 @@ class CustomerAcceptedTerms: """ """ - additional_properties: Dict[str, "CustomerAcceptedTermsAdditionalProperty"] = _attrs_field(init=False, factory=dict) + additional_properties: Dict[str, "CustomerAcceptedTerm"] = _attrs_field(init=False, factory=dict) def to_dict(self) -> Dict[str, Any]: field_dict: Dict[str, Any] = {} @@ -25,14 +25,14 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: - from ..models.customer_accepted_terms_additional_property import CustomerAcceptedTermsAdditionalProperty + from ..models.customer_accepted_term import CustomerAcceptedTerm d = src_dict.copy() customer_accepted_terms = cls() additional_properties = {} for prop_name, prop_dict in d.items(): - additional_property = CustomerAcceptedTermsAdditionalProperty.from_dict(prop_dict) + additional_property = CustomerAcceptedTerm.from_dict(prop_dict) additional_properties[prop_name] = additional_property @@ -43,10 +43,10 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: def additional_keys(self) -> List[str]: return list(self.additional_properties.keys()) - def __getitem__(self, key: str) -> "CustomerAcceptedTermsAdditionalProperty": + def __getitem__(self, key: str) -> "CustomerAcceptedTerm": return self.additional_properties[key] - def __setitem__(self, key: str, value: "CustomerAcceptedTermsAdditionalProperty") -> None: + def __setitem__(self, key: str, value: "CustomerAcceptedTerm") -> None: self.additional_properties[key] = value def __delitem__(self, key: str) -> None: diff --git a/plenigo-client/plenigo/models/customer_accepted_terms_additional_property.py b/plenigo-client/plenigo/models/customer_accepted_terms_additional_property.py deleted file mode 100644 index 53d9584..0000000 --- a/plenigo-client/plenigo/models/customer_accepted_terms_additional_property.py +++ /dev/null @@ -1,80 +0,0 @@ -from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.customer_accepted_term import CustomerAcceptedTerm - - -T = TypeVar("T", bound="CustomerAcceptedTermsAdditionalProperty") - - -@_attrs_define -class CustomerAcceptedTermsAdditionalProperty: - """ - Attributes: - key (Union[Unset, str]): id of the company opt in was accepted for - value (Union[Unset, CustomerAcceptedTerm]): - """ - - key: Union[Unset, str] = UNSET - value: Union[Unset, "CustomerAcceptedTerm"] = UNSET - additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> Dict[str, Any]: - key = self.key - - value: Union[Unset, Dict[str, Any]] = UNSET - if not isinstance(self.value, Unset): - value = self.value.to_dict() - - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if key is not UNSET: - field_dict["key"] = key - if value is not UNSET: - field_dict["value"] = value - - return field_dict - - @classmethod - def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: - from ..models.customer_accepted_term import CustomerAcceptedTerm - - d = src_dict.copy() - key = d.pop("key", UNSET) - - _value = d.pop("value", UNSET) - value: Union[Unset, CustomerAcceptedTerm] - if isinstance(_value, Unset) or not _value: - value = UNSET - else: - value = CustomerAcceptedTerm.from_dict(_value) - - customer_accepted_terms_additional_property = cls( - key=key, - value=value, - ) - - customer_accepted_terms_additional_property.additional_properties = d - return customer_accepted_terms_additional_property - - @property - def additional_keys(self) -> List[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/plenigo-client/plenigo/models/customer_address_creation.py b/plenigo-client/plenigo/models/customer_address_creation.py deleted file mode 100644 index 5606ac7..0000000 --- a/plenigo-client/plenigo/models/customer_address_creation.py +++ /dev/null @@ -1,287 +0,0 @@ -from typing import Any, Dict, List, Type, TypeVar, Union - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from ..models.address_base_salutation import AddressBaseSalutation -from ..models.address_base_validation_status import AddressBaseValidationStatus -from ..models.customer_address_creation_type import CustomerAddressCreationType -from ..types import UNSET, Unset - -T = TypeVar("T", bound="CustomerAddressCreation") - - -@_attrs_define -class CustomerAddressCreation: - """ - Attributes: - type (CustomerAddressCreationType): address type - business_address (Union[Unset, bool]): flag indicating if address represents a private or a business address - salutation (Union[Unset, AddressBaseSalutation]): salutation to identify the correct designation of a customer - title (Union[Unset, str]): title of the customer - first_name (Union[Unset, str]): first name of the customer - first name and last name or company name are - required - last_name (Union[Unset, str]): last name of the customer - first name and last name or company name are required - company_name (Union[Unset, str]): company name - first name and last name or company name are required - additional_company_info (Union[Unset, str]): additional information belonging to the company - street (Union[Unset, str]): street name - street_number (Union[Unset, str]): street number - additional_street_info (Union[Unset, str]): additional information describing address - postbox (Union[Unset, str]): postbox id - postcode (Union[Unset, str]): postcode - city (Union[Unset, str]): city - state (Union[Unset, str]): state - country (Union[Unset, str]): country code formatted as ISO 3166-1 alpha-2 - vat_number (Union[Unset, str]): VAT number of a member country of the European Union - phone_number (Union[Unset, str]): phone number of the customer formatted as E.164 - delivery_information (Union[Unset, str]): delivery information - academic_title (Union[Unset, str]): academic title - job_position (Union[Unset, str]): job position - validation_status (Union[Unset, AddressBaseValidationStatus]): validation status of the address - validation_hash (Union[Unset, str]): validation hash of a valid address - preferred (Union[Unset, bool]): flag indicating if address is default selection for address type - """ - - type: CustomerAddressCreationType - business_address: Union[Unset, bool] = UNSET - salutation: Union[Unset, AddressBaseSalutation] = UNSET - title: Union[Unset, str] = UNSET - first_name: Union[Unset, str] = UNSET - last_name: Union[Unset, str] = UNSET - company_name: Union[Unset, str] = UNSET - additional_company_info: Union[Unset, str] = UNSET - street: Union[Unset, str] = UNSET - street_number: Union[Unset, str] = UNSET - additional_street_info: Union[Unset, str] = UNSET - postbox: Union[Unset, str] = UNSET - postcode: Union[Unset, str] = UNSET - city: Union[Unset, str] = UNSET - state: Union[Unset, str] = UNSET - country: Union[Unset, str] = UNSET - vat_number: Union[Unset, str] = UNSET - phone_number: Union[Unset, str] = UNSET - delivery_information: Union[Unset, str] = UNSET - academic_title: Union[Unset, str] = UNSET - job_position: Union[Unset, str] = UNSET - validation_status: Union[Unset, AddressBaseValidationStatus] = UNSET - validation_hash: Union[Unset, str] = UNSET - preferred: Union[Unset, bool] = UNSET - additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> Dict[str, Any]: - type = self.type.value - - business_address = self.business_address - - salutation: Union[Unset, str] = UNSET - if not isinstance(self.salutation, Unset): - salutation = self.salutation.value - - title = self.title - - first_name = self.first_name - - last_name = self.last_name - - company_name = self.company_name - - additional_company_info = self.additional_company_info - - street = self.street - - street_number = self.street_number - - additional_street_info = self.additional_street_info - - postbox = self.postbox - - postcode = self.postcode - - city = self.city - - state = self.state - - country = self.country - - vat_number = self.vat_number - - phone_number = self.phone_number - - delivery_information = self.delivery_information - - academic_title = self.academic_title - - job_position = self.job_position - - validation_status: Union[Unset, str] = UNSET - if not isinstance(self.validation_status, Unset): - validation_status = self.validation_status.value - - validation_hash = self.validation_hash - - preferred = self.preferred - - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "type": type, - } - ) - if business_address is not UNSET: - field_dict["businessAddress"] = business_address - if salutation is not UNSET: - field_dict["salutation"] = salutation - if title is not UNSET: - field_dict["title"] = title - if first_name is not UNSET: - field_dict["firstName"] = first_name - if last_name is not UNSET: - field_dict["lastName"] = last_name - if company_name is not UNSET: - field_dict["companyName"] = company_name - if additional_company_info is not UNSET: - field_dict["additionalCompanyInfo"] = additional_company_info - if street is not UNSET: - field_dict["street"] = street - if street_number is not UNSET: - field_dict["streetNumber"] = street_number - if additional_street_info is not UNSET: - field_dict["additionalStreetInfo"] = additional_street_info - if postbox is not UNSET: - field_dict["postbox"] = postbox - if postcode is not UNSET: - field_dict["postcode"] = postcode - if city is not UNSET: - field_dict["city"] = city - if state is not UNSET: - field_dict["state"] = state - if country is not UNSET: - field_dict["country"] = country - if vat_number is not UNSET: - field_dict["vatNumber"] = vat_number - if phone_number is not UNSET: - field_dict["phoneNumber"] = phone_number - if delivery_information is not UNSET: - field_dict["deliveryInformation"] = delivery_information - if academic_title is not UNSET: - field_dict["academicTitle"] = academic_title - if job_position is not UNSET: - field_dict["jobPosition"] = job_position - if validation_status is not UNSET: - field_dict["validationStatus"] = validation_status - if validation_hash is not UNSET: - field_dict["validationHash"] = validation_hash - if preferred is not UNSET: - field_dict["preferred"] = preferred - - return field_dict - - @classmethod - def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: - d = src_dict.copy() - type = CustomerAddressCreationType(d.pop("type")) - - business_address = d.pop("businessAddress", UNSET) - - _salutation = d.pop("salutation", UNSET) - salutation: Union[Unset, AddressBaseSalutation] - if isinstance(_salutation, Unset) or not _salutation: - salutation = UNSET - else: - salutation = AddressBaseSalutation(_salutation) - - title = d.pop("title", UNSET) - - first_name = d.pop("firstName", UNSET) - - last_name = d.pop("lastName", UNSET) - - company_name = d.pop("companyName", UNSET) - - additional_company_info = d.pop("additionalCompanyInfo", UNSET) - - street = d.pop("street", UNSET) - - street_number = d.pop("streetNumber", UNSET) - - additional_street_info = d.pop("additionalStreetInfo", UNSET) - - postbox = d.pop("postbox", UNSET) - - postcode = d.pop("postcode", UNSET) - - city = d.pop("city", UNSET) - - state = d.pop("state", UNSET) - - country = d.pop("country", UNSET) - - vat_number = d.pop("vatNumber", UNSET) - - phone_number = d.pop("phoneNumber", UNSET) - - delivery_information = d.pop("deliveryInformation", UNSET) - - academic_title = d.pop("academicTitle", UNSET) - - job_position = d.pop("jobPosition", UNSET) - - _validation_status = d.pop("validationStatus", UNSET) - validation_status: Union[Unset, AddressBaseValidationStatus] - if isinstance(_validation_status, Unset) or not _validation_status: - validation_status = UNSET - else: - validation_status = AddressBaseValidationStatus(_validation_status) - - validation_hash = d.pop("validationHash", UNSET) - - preferred = d.pop("preferred", UNSET) - - customer_address_creation = cls( - type=type, - business_address=business_address, - salutation=salutation, - title=title, - first_name=first_name, - last_name=last_name, - company_name=company_name, - additional_company_info=additional_company_info, - street=street, - street_number=street_number, - additional_street_info=additional_street_info, - postbox=postbox, - postcode=postcode, - city=city, - state=state, - country=country, - vat_number=vat_number, - phone_number=phone_number, - delivery_information=delivery_information, - academic_title=academic_title, - job_position=job_position, - validation_status=validation_status, - validation_hash=validation_hash, - preferred=preferred, - ) - - customer_address_creation.additional_properties = d - return customer_address_creation - - @property - def additional_keys(self) -> List[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/plenigo-client/plenigo/models/customer_address_creation_type.py b/plenigo-client/plenigo/models/customer_address_creation_type.py deleted file mode 100644 index 4cfeb11..0000000 --- a/plenigo-client/plenigo/models/customer_address_creation_type.py +++ /dev/null @@ -1,9 +0,0 @@ -from enum import Enum - - -class CustomerAddressCreationType(str, Enum): - DELIVERY = "DELIVERY" - INVOICE = "INVOICE" - - def __str__(self) -> str: - return str(self.value) diff --git a/plenigo-client/plenigo/models/customer_change.py b/plenigo-client/plenigo/models/customer_change.py deleted file mode 100644 index ced380e..0000000 --- a/plenigo-client/plenigo/models/customer_change.py +++ /dev/null @@ -1,233 +0,0 @@ -import datetime -from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union, cast - -from attrs import define as _attrs_define -from attrs import field as _attrs_field -from dateutil.parser import isoparse - -from ..models.customer_base_salutation import CustomerBaseSalutation -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.customer_miscellaneous_data import CustomerMiscellaneousData - - -T = TypeVar("T", bound="CustomerChange") - - -@_attrs_define -class CustomerChange: - """ - Attributes: - username (Union[Unset, str]): selected username of the customer that is unique for all users - email (Union[Unset, str]): email address of the customer that is unique for all users - external_system_id (Union[Unset, str]): external system id - can only be set if not set yet - salutation (Union[Unset, CustomerBaseSalutation]): salutation to identify the correct designation of a customer - first_name (Union[Unset, str]): first name of the customer - first name and last name or company name are - required - last_name (Union[Unset, str]): last name of the customer - first name and last name or company name are required - invoice_email (Union[Unset, str]): email address of the customer where invoices should be sent to - language (Union[Unset, str]): language of the customer - two letter language code according to ISO 639-1 - mobile_number (Union[Unset, str]): mobile number of the customer formatted as E.164 - birthday (Union[None, Unset, datetime.date]): birthday of the customer with full-date notation as defined by RFC 3339, section 5.6, for example, - 2017-07-01 - miscellaneous_data (Union[Unset, CustomerMiscellaneousData]): - pseudo_email (Union[Unset, bool]): flag indicating that email should be a pseudo email - password (Union[Unset, str]): new password of the user - if left empty the old password will be kept - processing_blocked (Union[Unset, bool]): Flag to indicate to third party systems that the customer is blocked - for further processing and should not be used for advertisement, etc. Can be used in combination with the - pseudoEmail flag to handle data protection requests without deletion of a customer. - """ - - username: Union[Unset, str] = UNSET - email: Union[Unset, str] = UNSET - external_system_id: Union[Unset, str] = UNSET - salutation: Union[Unset, CustomerBaseSalutation] = UNSET - first_name: Union[Unset, str] = UNSET - last_name: Union[Unset, str] = UNSET - invoice_email: Union[Unset, str] = UNSET - language: Union[Unset, str] = UNSET - mobile_number: Union[Unset, str] = UNSET - birthday: Union[None, Unset, datetime.date] = UNSET - miscellaneous_data: Union[Unset, "CustomerMiscellaneousData"] = UNSET - pseudo_email: Union[Unset, bool] = UNSET - password: Union[Unset, str] = UNSET - processing_blocked: Union[Unset, bool] = UNSET - additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> Dict[str, Any]: - username = self.username - - email = self.email - - external_system_id = self.external_system_id - - salutation: Union[Unset, str] = UNSET - if not isinstance(self.salutation, Unset): - salutation = self.salutation.value - - first_name = self.first_name - - last_name = self.last_name - - invoice_email = self.invoice_email - - language = self.language - - mobile_number = self.mobile_number - - birthday: Union[None, Unset, str] - if isinstance(self.birthday, Unset) or self.birthday is None: - birthday = UNSET - elif isinstance(self.birthday, datetime.date): - birthday = self.birthday.isoformat() - else: - birthday = self.birthday - - miscellaneous_data: Union[Unset, Dict[str, Any]] = UNSET - if not isinstance(self.miscellaneous_data, Unset): - miscellaneous_data = self.miscellaneous_data.to_dict() - - pseudo_email = self.pseudo_email - - password = self.password - - processing_blocked = self.processing_blocked - - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if username is not UNSET: - field_dict["username"] = username - if email is not UNSET: - field_dict["email"] = email - if external_system_id is not UNSET: - field_dict["externalSystemId"] = external_system_id - if salutation is not UNSET: - field_dict["salutation"] = salutation - if first_name is not UNSET: - field_dict["firstName"] = first_name - if last_name is not UNSET: - field_dict["lastName"] = last_name - if invoice_email is not UNSET: - field_dict["invoiceEmail"] = invoice_email - if language is not UNSET: - field_dict["language"] = language - if mobile_number is not UNSET: - field_dict["mobileNumber"] = mobile_number - if birthday is not UNSET: - field_dict["birthday"] = birthday - if miscellaneous_data is not UNSET: - field_dict["miscellaneousData"] = miscellaneous_data - if pseudo_email is not UNSET: - field_dict["pseudoEmail"] = pseudo_email - if password is not UNSET: - field_dict["password"] = password - if processing_blocked is not UNSET: - field_dict["processingBlocked"] = processing_blocked - - return field_dict - - @classmethod - def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: - from ..models.customer_miscellaneous_data import CustomerMiscellaneousData - - d = src_dict.copy() - username = d.pop("username", UNSET) - - email = d.pop("email", UNSET) - - external_system_id = d.pop("externalSystemId", UNSET) - - _salutation = d.pop("salutation", UNSET) - salutation: Union[Unset, CustomerBaseSalutation] - if isinstance(_salutation, Unset) or not _salutation: - salutation = UNSET - else: - salutation = CustomerBaseSalutation(_salutation) - - first_name = d.pop("firstName", UNSET) - - last_name = d.pop("lastName", UNSET) - - invoice_email = d.pop("invoiceEmail", UNSET) - - language = d.pop("language", UNSET) - - mobile_number = d.pop("mobileNumber", UNSET) - - def _parse_birthday(data: object) -> Union[None, Unset, datetime.date]: - if data is None: - return data - - if data is None: - return data - - if isinstance(data, Unset): - return data - - # Try to parse the data as datetime.date - try: - if not isinstance(data, str): - raise TypeError() - birthday_type_0 = isoparse(data).date() - - return birthday_type_0 - except: # noqa: E722 - pass - - return cast(Union[None, Unset, datetime.date], data) - - birthday = _parse_birthday(d.pop("birthday", UNSET)) - - _miscellaneous_data = d.pop("miscellaneousData", UNSET) - miscellaneous_data: Union[Unset, CustomerMiscellaneousData] - if isinstance(_miscellaneous_data, Unset) or not _miscellaneous_data: - miscellaneous_data = UNSET - else: - miscellaneous_data = CustomerMiscellaneousData.from_dict(_miscellaneous_data) - - pseudo_email = d.pop("pseudoEmail", UNSET) - - password = d.pop("password", UNSET) - - processing_blocked = d.pop("processingBlocked", UNSET) - - customer_change = cls( - username=username, - email=email, - external_system_id=external_system_id, - salutation=salutation, - first_name=first_name, - last_name=last_name, - invoice_email=invoice_email, - language=language, - mobile_number=mobile_number, - birthday=birthday, - miscellaneous_data=miscellaneous_data, - pseudo_email=pseudo_email, - password=password, - processing_blocked=processing_blocked, - ) - - customer_change.additional_properties = d - return customer_change - - @property - def additional_keys(self) -> List[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/plenigo-client/plenigo/models/customer_creation.py b/plenigo-client/plenigo/models/customer_creation.py deleted file mode 100644 index 09d38d6..0000000 --- a/plenigo-client/plenigo/models/customer_creation.py +++ /dev/null @@ -1,300 +0,0 @@ -import datetime -from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union, cast - -from attrs import define as _attrs_define -from attrs import field as _attrs_field -from dateutil.parser import isoparse - -from ..models.customer_base_salutation import CustomerBaseSalutation -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.additional_customer_data import AdditionalCustomerData - from ..models.customer_address_creation import CustomerAddressCreation - from ..models.customer_miscellaneous_data import CustomerMiscellaneousData - - -T = TypeVar("T", bound="CustomerCreation") - - -@_attrs_define -class CustomerCreation: - """ - Attributes: - username (Union[Unset, str]): selected username of the customer that is unique for all users - email (Union[Unset, str]): email address of the customer that is unique for all users - external_system_id (Union[Unset, str]): external system id - can only be set if not set yet - salutation (Union[Unset, CustomerBaseSalutation]): salutation to identify the correct designation of a customer - first_name (Union[Unset, str]): first name of the customer - first name and last name or company name are - required - last_name (Union[Unset, str]): last name of the customer - first name and last name or company name are required - invoice_email (Union[Unset, str]): email address of the customer where invoices should be sent to - language (Union[Unset, str]): language of the customer - two letter language code according to ISO 639-1 - mobile_number (Union[Unset, str]): mobile number of the customer formatted as E.164 - birthday (Union[None, Unset, datetime.date]): birthday of the customer with full-date notation as defined by RFC 3339, section 5.6, for example, - 2017-07-01 - miscellaneous_data (Union[Unset, CustomerMiscellaneousData]): - pseudo_email (Union[Unset, bool]): flag indicating that email should be a pseudo email - password (Union[Unset, str]): password the new customer should get - processing_blocked (Union[Unset, bool]): Flag to indicate to third party systems that the customer is blocked - for further processing and should not be used for advertisement, etc. Can be used in combination with the - pseudoEmail flag to handle data protection requests without deletion of a customer. - customer_id (Union[Unset, str]): unique id of the customer - registration_source (Union[Unset, str]): domain, website, app or other source of the customer registration - send_welcome_mail (Union[Unset, bool]): flag indicating if welcome mail for customer should be sent - addresses (Union[Unset, List['CustomerAddressCreation']]): addresses that should be directly associated with the - customer - data (Union[Unset, AdditionalCustomerData]): - """ - - username: Union[Unset, str] = UNSET - email: Union[Unset, str] = UNSET - external_system_id: Union[Unset, str] = UNSET - salutation: Union[Unset, CustomerBaseSalutation] = UNSET - first_name: Union[Unset, str] = UNSET - last_name: Union[Unset, str] = UNSET - invoice_email: Union[Unset, str] = UNSET - language: Union[Unset, str] = UNSET - mobile_number: Union[Unset, str] = UNSET - birthday: Union[None, Unset, datetime.date] = UNSET - miscellaneous_data: Union[Unset, "CustomerMiscellaneousData"] = UNSET - pseudo_email: Union[Unset, bool] = UNSET - password: Union[Unset, str] = UNSET - processing_blocked: Union[Unset, bool] = UNSET - customer_id: Union[Unset, str] = UNSET - registration_source: Union[Unset, str] = UNSET - send_welcome_mail: Union[Unset, bool] = UNSET - addresses: Union[Unset, List["CustomerAddressCreation"]] = UNSET - data: Union[Unset, "AdditionalCustomerData"] = UNSET - additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> Dict[str, Any]: - username = self.username - - email = self.email - - external_system_id = self.external_system_id - - salutation: Union[Unset, str] = UNSET - if not isinstance(self.salutation, Unset): - salutation = self.salutation.value - - first_name = self.first_name - - last_name = self.last_name - - invoice_email = self.invoice_email - - language = self.language - - mobile_number = self.mobile_number - - birthday: Union[None, Unset, str] - if isinstance(self.birthday, Unset) or self.birthday is None: - birthday = UNSET - elif isinstance(self.birthday, datetime.date): - birthday = self.birthday.isoformat() - else: - birthday = self.birthday - - miscellaneous_data: Union[Unset, Dict[str, Any]] = UNSET - if not isinstance(self.miscellaneous_data, Unset): - miscellaneous_data = self.miscellaneous_data.to_dict() - - pseudo_email = self.pseudo_email - - password = self.password - - processing_blocked = self.processing_blocked - - customer_id = self.customer_id - - registration_source = self.registration_source - - send_welcome_mail = self.send_welcome_mail - - addresses: Union[Unset, List[Dict[str, Any]]] = UNSET - if not isinstance(self.addresses, Unset): - addresses = [] - for addresses_item_data in self.addresses: - addresses_item = addresses_item_data.to_dict() - addresses.append(addresses_item) - - data: Union[Unset, Dict[str, Any]] = UNSET - if not isinstance(self.data, Unset): - data = self.data.to_dict() - - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if username is not UNSET: - field_dict["username"] = username - if email is not UNSET: - field_dict["email"] = email - if external_system_id is not UNSET: - field_dict["externalSystemId"] = external_system_id - if salutation is not UNSET: - field_dict["salutation"] = salutation - if first_name is not UNSET: - field_dict["firstName"] = first_name - if last_name is not UNSET: - field_dict["lastName"] = last_name - if invoice_email is not UNSET: - field_dict["invoiceEmail"] = invoice_email - if language is not UNSET: - field_dict["language"] = language - if mobile_number is not UNSET: - field_dict["mobileNumber"] = mobile_number - if birthday is not UNSET: - field_dict["birthday"] = birthday - if miscellaneous_data is not UNSET: - field_dict["miscellaneousData"] = miscellaneous_data - if pseudo_email is not UNSET: - field_dict["pseudoEmail"] = pseudo_email - if password is not UNSET: - field_dict["password"] = password - if processing_blocked is not UNSET: - field_dict["processingBlocked"] = processing_blocked - if customer_id is not UNSET: - field_dict["customerId"] = customer_id - if registration_source is not UNSET: - field_dict["registrationSource"] = registration_source - if send_welcome_mail is not UNSET: - field_dict["sendWelcomeMail"] = send_welcome_mail - if addresses is not UNSET: - field_dict["addresses"] = addresses - if data is not UNSET: - field_dict["data"] = data - - return field_dict - - @classmethod - def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: - from ..models.additional_customer_data import AdditionalCustomerData - from ..models.customer_address_creation import CustomerAddressCreation - from ..models.customer_miscellaneous_data import CustomerMiscellaneousData - - d = src_dict.copy() - username = d.pop("username", UNSET) - - email = d.pop("email", UNSET) - - external_system_id = d.pop("externalSystemId", UNSET) - - _salutation = d.pop("salutation", UNSET) - salutation: Union[Unset, CustomerBaseSalutation] - if isinstance(_salutation, Unset) or not _salutation: - salutation = UNSET - else: - salutation = CustomerBaseSalutation(_salutation) - - first_name = d.pop("firstName", UNSET) - - last_name = d.pop("lastName", UNSET) - - invoice_email = d.pop("invoiceEmail", UNSET) - - language = d.pop("language", UNSET) - - mobile_number = d.pop("mobileNumber", UNSET) - - def _parse_birthday(data: object) -> Union[None, Unset, datetime.date]: - if data is None: - return data - - if data is None: - return data - - if isinstance(data, Unset): - return data - - # Try to parse the data as datetime.date - try: - if not isinstance(data, str): - raise TypeError() - birthday_type_0 = isoparse(data).date() - - return birthday_type_0 - except: # noqa: E722 - pass - - return cast(Union[None, Unset, datetime.date], data) - - birthday = _parse_birthday(d.pop("birthday", UNSET)) - - _miscellaneous_data = d.pop("miscellaneousData", UNSET) - miscellaneous_data: Union[Unset, CustomerMiscellaneousData] - if isinstance(_miscellaneous_data, Unset) or not _miscellaneous_data: - miscellaneous_data = UNSET - else: - miscellaneous_data = CustomerMiscellaneousData.from_dict(_miscellaneous_data) - - pseudo_email = d.pop("pseudoEmail", UNSET) - - password = d.pop("password", UNSET) - - processing_blocked = d.pop("processingBlocked", UNSET) - - customer_id = d.pop("customerId", UNSET) - - registration_source = d.pop("registrationSource", UNSET) - - send_welcome_mail = d.pop("sendWelcomeMail", UNSET) - - addresses = [] - _addresses = d.pop("addresses", UNSET) - for addresses_item_data in _addresses or []: - addresses_item = CustomerAddressCreation.from_dict(addresses_item_data) - - addresses.append(addresses_item) - - _data = d.pop("data", UNSET) - data: Union[Unset, AdditionalCustomerData] - if isinstance(_data, Unset) or not _data: - data = UNSET - else: - data = AdditionalCustomerData.from_dict(_data) - - customer_creation = cls( - username=username, - email=email, - external_system_id=external_system_id, - salutation=salutation, - first_name=first_name, - last_name=last_name, - invoice_email=invoice_email, - language=language, - mobile_number=mobile_number, - birthday=birthday, - miscellaneous_data=miscellaneous_data, - pseudo_email=pseudo_email, - password=password, - processing_blocked=processing_blocked, - customer_id=customer_id, - registration_source=registration_source, - send_welcome_mail=send_welcome_mail, - addresses=addresses, - data=data, - ) - - customer_creation.additional_properties = d - return customer_creation - - @property - def additional_keys(self) -> List[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/plenigo-client/plenigo/models/error_result.py b/plenigo-client/plenigo/models/error_result.py index 0d615d1..5476426 100644 --- a/plenigo-client/plenigo/models/error_result.py +++ b/plenigo-client/plenigo/models/error_result.py @@ -16,8 +16,8 @@ class ErrorResult: """ Attributes: - error_code (int): plenigo error code - error_message (str): plenigo error description + error_code (int): plenigo error code Example: 99400. + error_message (str): plenigo error description Example: Provided data cannot be processed.. validation_errors (Union[Unset, List['ValidationError']]): """ diff --git a/plenigo-client/plenigo/models/error_result_base.py b/plenigo-client/plenigo/models/error_result_base.py index 7baf47a..ef5be81 100644 --- a/plenigo-client/plenigo/models/error_result_base.py +++ b/plenigo-client/plenigo/models/error_result_base.py @@ -10,8 +10,8 @@ class ErrorResultBase: """ Attributes: - error_code (int): plenigo error code - error_message (str): plenigo error description + error_code (int): plenigo error code Example: 99400. + error_message (str): plenigo error description Example: Provided data cannot be processed.. """ error_code: int diff --git a/plenigo-client/plenigo/models/google_play_store_purchase_addition.py b/plenigo-client/plenigo/models/google_play_store_purchase_addition.py deleted file mode 100644 index 4982c41..0000000 --- a/plenigo-client/plenigo/models/google_play_store_purchase_addition.py +++ /dev/null @@ -1,84 +0,0 @@ -from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.google_play_store_purchase_addition_element import GooglePlayStorePurchaseAdditionElement - - -T = TypeVar("T", bound="GooglePlayStorePurchaseAddition") - - -@_attrs_define -class GooglePlayStorePurchaseAddition: - """ - Attributes: - package_name (Union[Unset, str]): package name of the application this purchase was done for (for example, - 'com.some.thing'). - receipt_data (Union[Unset, List['GooglePlayStorePurchaseAdditionElement']]): - """ - - package_name: Union[Unset, str] = UNSET - receipt_data: Union[Unset, List["GooglePlayStorePurchaseAdditionElement"]] = UNSET - additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> Dict[str, Any]: - package_name = self.package_name - - receipt_data: Union[Unset, List[Dict[str, Any]]] = UNSET - if not isinstance(self.receipt_data, Unset): - receipt_data = [] - for receipt_data_item_data in self.receipt_data: - receipt_data_item = receipt_data_item_data.to_dict() - receipt_data.append(receipt_data_item) - - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if package_name is not UNSET: - field_dict["packageName"] = package_name - if receipt_data is not UNSET: - field_dict["receiptData"] = receipt_data - - return field_dict - - @classmethod - def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: - from ..models.google_play_store_purchase_addition_element import GooglePlayStorePurchaseAdditionElement - - d = src_dict.copy() - package_name = d.pop("packageName", UNSET) - - receipt_data = [] - _receipt_data = d.pop("receiptData", UNSET) - for receipt_data_item_data in _receipt_data or []: - receipt_data_item = GooglePlayStorePurchaseAdditionElement.from_dict(receipt_data_item_data) - - receipt_data.append(receipt_data_item) - - google_play_store_purchase_addition = cls( - package_name=package_name, - receipt_data=receipt_data, - ) - - google_play_store_purchase_addition.additional_properties = d - return google_play_store_purchase_addition - - @property - def additional_keys(self) -> List[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/plenigo-client/plenigo/models/google_play_store_purchase_addition_element.py b/plenigo-client/plenigo/models/google_play_store_purchase_addition_element.py deleted file mode 100644 index 8a1d0e6..0000000 --- a/plenigo-client/plenigo/models/google_play_store_purchase_addition_element.py +++ /dev/null @@ -1,76 +0,0 @@ -from typing import Any, Dict, List, Type, TypeVar, Union - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from ..types import UNSET, Unset - -T = TypeVar("T", bound="GooglePlayStorePurchaseAdditionElement") - - -@_attrs_define -class GooglePlayStorePurchaseAdditionElement: - """ - Attributes: - product_id (Union[Unset, str]): the purchased ID (for example, 'monthly001'). - subscription (Union[Unset, bool]): flag indicating if purchase is a subscription or a single product purchase - purchase_token (Union[Unset, str]): token provided to the customer's device when the purchase was done - """ - - product_id: Union[Unset, str] = UNSET - subscription: Union[Unset, bool] = UNSET - purchase_token: Union[Unset, str] = UNSET - additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> Dict[str, Any]: - product_id = self.product_id - - subscription = self.subscription - - purchase_token = self.purchase_token - - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if product_id is not UNSET: - field_dict["productId"] = product_id - if subscription is not UNSET: - field_dict["subscription"] = subscription - if purchase_token is not UNSET: - field_dict["purchaseToken"] = purchase_token - - return field_dict - - @classmethod - def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: - d = src_dict.copy() - product_id = d.pop("productId", UNSET) - - subscription = d.pop("subscription", UNSET) - - purchase_token = d.pop("purchaseToken", UNSET) - - google_play_store_purchase_addition_element = cls( - product_id=product_id, - subscription=subscription, - purchase_token=purchase_token, - ) - - google_play_store_purchase_addition_element.additional_properties = d - return google_play_store_purchase_addition_element - - @property - def additional_keys(self) -> List[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/plenigo-client/plenigo/models/invoice.py b/plenigo-client/plenigo/models/invoice.py index 0e451ec..5aa3914 100644 --- a/plenigo-client/plenigo/models/invoice.py +++ b/plenigo-client/plenigo/models/invoice.py @@ -54,7 +54,7 @@ class Invoice: payment process precursor_id (Union[Unset, int]): invoice id which was corrected or cancelled successor_id (Union[Unset, int]): invoice id of the corrected invoice - invoice_cancellation_id (Union[Unset, int]): invoice id of the cancellation invoice + cancellation_invoice_id (Union[Unset, int]): invoice id of the cancellation invoice """ invoice_id: int @@ -80,7 +80,7 @@ class Invoice: payment_changed_to_billing: Union[Unset, bool] = UNSET precursor_id: Union[Unset, int] = UNSET successor_id: Union[Unset, int] = UNSET - invoice_cancellation_id: Union[Unset, int] = UNSET + cancellation_invoice_id: Union[Unset, int] = UNSET additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> Dict[str, Any]: @@ -159,7 +159,7 @@ def to_dict(self) -> Dict[str, Any]: successor_id = self.successor_id - invoice_cancellation_id = self.invoice_cancellation_id + cancellation_invoice_id = self.cancellation_invoice_id field_dict: Dict[str, Any] = {} field_dict.update(self.additional_properties) @@ -206,8 +206,8 @@ def to_dict(self) -> Dict[str, Any]: field_dict["precursorId"] = precursor_id if successor_id is not UNSET: field_dict["successorId"] = successor_id - if invoice_cancellation_id is not UNSET: - field_dict["invoiceCancellationId"] = invoice_cancellation_id + if cancellation_invoice_id is not UNSET: + field_dict["cancellationInvoiceId"] = cancellation_invoice_id return field_dict @@ -353,7 +353,7 @@ def _parse_changed_date(data: object) -> Union[None, Unset, datetime.datetime]: successor_id = d.pop("successorId", UNSET) - invoice_cancellation_id = d.pop("invoiceCancellationId", UNSET) + cancellation_invoice_id = d.pop("cancellationInvoiceId", UNSET) invoice = cls( invoice_id=invoice_id, @@ -379,7 +379,7 @@ def _parse_changed_date(data: object) -> Union[None, Unset, datetime.datetime]: payment_changed_to_billing=payment_changed_to_billing, precursor_id=precursor_id, successor_id=successor_id, - invoice_cancellation_id=invoice_cancellation_id, + cancellation_invoice_id=cancellation_invoice_id, ) invoice.additional_properties = d diff --git a/plenigo-client/plenigo/models/offer.py b/plenigo-client/plenigo/models/offer.py index 7676c14..a073d65 100644 --- a/plenigo-client/plenigo/models/offer.py +++ b/plenigo-client/plenigo/models/offer.py @@ -29,7 +29,6 @@ class Offer: """ Attributes: internal_title (str): internal title of the product group - translations (List['OfferTranslation']): translations associated with this product plenigo_offer_id (str): unique id of the offer within a company pause_able (Union[Unset, bool]): flag indicating if subscription is pause able invoice_address_mandatory (Union[Unset, bool]): flag indicating if invoice address must be provided by the @@ -59,6 +58,7 @@ class Offer: bonus_id (Union[Unset, int]): id of the bonus associated with this offer self_service_hint_tm_id (Union[Unset, int]): id of the text module used as self service hint managed_by (Union[Unset, OfferBaseManagedBy]): managed by of the given offer. + translations (Union[Unset, List['OfferTranslation']]): translations associated with this product pdf_template_usage (Union[Unset, OfferBasePdfTemplateUsage]): contains the pdf template to use with this offer partner_settings (Union[Unset, OfferPartnerSettings]): created_date (Union[None, Unset, datetime.datetime]): time the object was created with time notation as defined @@ -78,7 +78,6 @@ class Offer: """ internal_title: str - translations: List["OfferTranslation"] plenigo_offer_id: str pause_able: Union[Unset, bool] = UNSET invoice_address_mandatory: Union[Unset, bool] = UNSET @@ -100,6 +99,7 @@ class Offer: bonus_id: Union[Unset, int] = UNSET self_service_hint_tm_id: Union[Unset, int] = UNSET managed_by: Union[Unset, OfferBaseManagedBy] = UNSET + translations: Union[Unset, List["OfferTranslation"]] = UNSET pdf_template_usage: Union[Unset, OfferBasePdfTemplateUsage] = UNSET partner_settings: Union[Unset, "OfferPartnerSettings"] = UNSET created_date: Union[None, Unset, datetime.datetime] = UNSET @@ -117,11 +117,6 @@ class Offer: def to_dict(self) -> Dict[str, Any]: internal_title = self.internal_title - translations = [] - for translations_item_data in self.translations: - translations_item = translations_item_data.to_dict() - translations.append(translations_item) - plenigo_offer_id = self.plenigo_offer_id pause_able = self.pause_able @@ -181,6 +176,13 @@ def to_dict(self) -> Dict[str, Any]: if not isinstance(self.managed_by, Unset): managed_by = self.managed_by.value + translations: Union[Unset, List[Dict[str, Any]]] = UNSET + if not isinstance(self.translations, Unset): + translations = [] + for translations_item_data in self.translations: + translations_item = translations_item_data.to_dict() + translations.append(translations_item) + pdf_template_usage: Union[Unset, str] = UNSET if not isinstance(self.pdf_template_usage, Unset): pdf_template_usage = self.pdf_template_usage.value @@ -245,7 +247,6 @@ def to_dict(self) -> Dict[str, Any]: field_dict.update( { "internalTitle": internal_title, - "translations": translations, "plenigoOfferId": plenigo_offer_id, } ) @@ -289,6 +290,8 @@ def to_dict(self) -> Dict[str, Any]: field_dict["selfServiceHintTmId"] = self_service_hint_tm_id if managed_by is not UNSET: field_dict["managedBy"] = managed_by + if translations is not UNSET: + field_dict["translations"] = translations if pdf_template_usage is not UNSET: field_dict["pdfTemplateUsage"] = pdf_template_usage if partner_settings is not UNSET: @@ -329,13 +332,6 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: d = src_dict.copy() internal_title = d.pop("internalTitle") - translations = [] - _translations = d.pop("translations") - for translations_item_data in _translations: - translations_item = OfferTranslation.from_dict(translations_item_data) - - translations.append(translations_item) - plenigo_offer_id = d.pop("plenigoOfferId") pause_able = d.pop("pauseAble", UNSET) @@ -420,6 +416,13 @@ def _parse_fixed_start_date(data: object) -> Union[None, Unset, datetime.date]: else: managed_by = OfferBaseManagedBy(_managed_by) + translations = [] + _translations = d.pop("translations", UNSET) + for translations_item_data in _translations or []: + translations_item = OfferTranslation.from_dict(translations_item_data) + + translations.append(translations_item) + _pdf_template_usage = d.pop("pdfTemplateUsage", UNSET) pdf_template_usage: Union[Unset, OfferBasePdfTemplateUsage] if isinstance(_pdf_template_usage, Unset) or not _pdf_template_usage: @@ -525,7 +528,6 @@ def _parse_changed_date(data: object) -> Union[None, Unset, datetime.datetime]: offer = cls( internal_title=internal_title, - translations=translations, plenigo_offer_id=plenigo_offer_id, pause_able=pause_able, invoice_address_mandatory=invoice_address_mandatory, @@ -547,6 +549,7 @@ def _parse_changed_date(data: object) -> Union[None, Unset, datetime.datetime]: bonus_id=bonus_id, self_service_hint_tm_id=self_service_hint_tm_id, managed_by=managed_by, + translations=translations, pdf_template_usage=pdf_template_usage, partner_settings=partner_settings, created_date=created_date, diff --git a/plenigo-client/plenigo/models/offer_base.py b/plenigo-client/plenigo/models/offer_base.py index cfff432..18a0e5f 100644 --- a/plenigo-client/plenigo/models/offer_base.py +++ b/plenigo-client/plenigo/models/offer_base.py @@ -25,7 +25,6 @@ class OfferBase: """ Attributes: internal_title (str): internal title of the product group - translations (List['OfferTranslation']): translations associated with this product pause_able (Union[Unset, bool]): flag indicating if subscription is pause able invoice_address_mandatory (Union[Unset, bool]): flag indicating if invoice address must be provided by the customer @@ -54,12 +53,12 @@ class OfferBase: bonus_id (Union[Unset, int]): id of the bonus associated with this offer self_service_hint_tm_id (Union[Unset, int]): id of the text module used as self service hint managed_by (Union[Unset, OfferBaseManagedBy]): managed by of the given offer. + translations (Union[Unset, List['OfferTranslation']]): translations associated with this product pdf_template_usage (Union[Unset, OfferBasePdfTemplateUsage]): contains the pdf template to use with this offer partner_settings (Union[Unset, OfferPartnerSettings]): """ internal_title: str - translations: List["OfferTranslation"] pause_able: Union[Unset, bool] = UNSET invoice_address_mandatory: Union[Unset, bool] = UNSET delivery_address_mandatory: Union[Unset, bool] = UNSET @@ -80,6 +79,7 @@ class OfferBase: bonus_id: Union[Unset, int] = UNSET self_service_hint_tm_id: Union[Unset, int] = UNSET managed_by: Union[Unset, OfferBaseManagedBy] = UNSET + translations: Union[Unset, List["OfferTranslation"]] = UNSET pdf_template_usage: Union[Unset, OfferBasePdfTemplateUsage] = UNSET partner_settings: Union[Unset, "OfferPartnerSettings"] = UNSET additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -87,11 +87,6 @@ class OfferBase: def to_dict(self) -> Dict[str, Any]: internal_title = self.internal_title - translations = [] - for translations_item_data in self.translations: - translations_item = translations_item_data.to_dict() - translations.append(translations_item) - pause_able = self.pause_able invoice_address_mandatory = self.invoice_address_mandatory @@ -149,6 +144,13 @@ def to_dict(self) -> Dict[str, Any]: if not isinstance(self.managed_by, Unset): managed_by = self.managed_by.value + translations: Union[Unset, List[Dict[str, Any]]] = UNSET + if not isinstance(self.translations, Unset): + translations = [] + for translations_item_data in self.translations: + translations_item = translations_item_data.to_dict() + translations.append(translations_item) + pdf_template_usage: Union[Unset, str] = UNSET if not isinstance(self.pdf_template_usage, Unset): pdf_template_usage = self.pdf_template_usage.value @@ -162,7 +164,6 @@ def to_dict(self) -> Dict[str, Any]: field_dict.update( { "internalTitle": internal_title, - "translations": translations, } ) if pause_able is not UNSET: @@ -205,6 +206,8 @@ def to_dict(self) -> Dict[str, Any]: field_dict["selfServiceHintTmId"] = self_service_hint_tm_id if managed_by is not UNSET: field_dict["managedBy"] = managed_by + if translations is not UNSET: + field_dict["translations"] = translations if pdf_template_usage is not UNSET: field_dict["pdfTemplateUsage"] = pdf_template_usage if partner_settings is not UNSET: @@ -222,13 +225,6 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: d = src_dict.copy() internal_title = d.pop("internalTitle") - translations = [] - _translations = d.pop("translations") - for translations_item_data in _translations: - translations_item = OfferTranslation.from_dict(translations_item_data) - - translations.append(translations_item) - pause_able = d.pop("pauseAble", UNSET) invoice_address_mandatory = d.pop("invoiceAddressMandatory", UNSET) @@ -311,6 +307,13 @@ def _parse_fixed_start_date(data: object) -> Union[None, Unset, datetime.date]: else: managed_by = OfferBaseManagedBy(_managed_by) + translations = [] + _translations = d.pop("translations", UNSET) + for translations_item_data in _translations or []: + translations_item = OfferTranslation.from_dict(translations_item_data) + + translations.append(translations_item) + _pdf_template_usage = d.pop("pdfTemplateUsage", UNSET) pdf_template_usage: Union[Unset, OfferBasePdfTemplateUsage] if isinstance(_pdf_template_usage, Unset) or not _pdf_template_usage: @@ -327,7 +330,6 @@ def _parse_fixed_start_date(data: object) -> Union[None, Unset, datetime.date]: offer_base = cls( internal_title=internal_title, - translations=translations, pause_able=pause_able, invoice_address_mandatory=invoice_address_mandatory, delivery_address_mandatory=delivery_address_mandatory, @@ -348,6 +350,7 @@ def _parse_fixed_start_date(data: object) -> Union[None, Unset, datetime.date]: bonus_id=bonus_id, self_service_hint_tm_id=self_service_hint_tm_id, managed_by=managed_by, + translations=translations, pdf_template_usage=pdf_template_usage, partner_settings=partner_settings, ) diff --git a/plenigo-client/plenigo/models/offer_product.py b/plenigo-client/plenigo/models/offer_product.py index e18c271..b0cd1da 100644 --- a/plenigo-client/plenigo/models/offer_product.py +++ b/plenigo-client/plenigo/models/offer_product.py @@ -6,8 +6,8 @@ from dateutil.parser import isoparse from ..models.offer_product_base_product_type import OfferProductBaseProductType -from ..models.offer_product_base_tax_type import OfferProductBaseTaxType from ..models.offer_product_base_voucher_validity_timespan import OfferProductBaseVoucherValidityTimespan +from ..models.tax_type import TaxType from ..types import UNSET, Unset if TYPE_CHECKING: @@ -26,7 +26,7 @@ class OfferProduct: """ Attributes: position (int): order position within the offer - must start with one and be in order - tax_type (OfferProductBaseTaxType): tax type product is associated with + tax_type (TaxType): unique identification of the tax type the product represents product_type (OfferProductBaseProductType): defines the type of product amount (int): amount of goods represented by this product access_right_id (int): id of the access right associated with this product @@ -46,7 +46,8 @@ class OfferProduct: voucher_validity_time (Union[Unset, int]): validity time of the voucher based on timespan voucher_validity_timespan (Union[Unset, OfferProductBaseVoucherValidityTimespan]): date the this product validity will be end - additional_data (Union[Unset, OfferProductBaseAdditionalData]): + additional_data (Union[Unset, OfferProductBaseAdditionalData]): Key must be a string with a maximum length of 30 + characters. data (Union[Unset, OfferProductBaseData]): additional data field price_issue_id (Union[Unset, int]): id of the price issue associated with this product shipping_cost_price_issue_id (Union[Unset, int]): id of the shipping cost price issue associated with this @@ -68,7 +69,7 @@ class OfferProduct: """ position: int - tax_type: OfferProductBaseTaxType + tax_type: TaxType product_type: OfferProductBaseProductType amount: int access_right_id: int @@ -273,7 +274,7 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: d = src_dict.copy() position = d.pop("position") - tax_type = OfferProductBaseTaxType(d.pop("taxType")) + tax_type = TaxType(d.pop("taxType")) product_type = OfferProductBaseProductType(d.pop("productType")) diff --git a/plenigo-client/plenigo/models/offer_product_base.py b/plenigo-client/plenigo/models/offer_product_base.py index 907b085..ffb1a08 100644 --- a/plenigo-client/plenigo/models/offer_product_base.py +++ b/plenigo-client/plenigo/models/offer_product_base.py @@ -6,8 +6,8 @@ from dateutil.parser import isoparse from ..models.offer_product_base_product_type import OfferProductBaseProductType -from ..models.offer_product_base_tax_type import OfferProductBaseTaxType from ..models.offer_product_base_voucher_validity_timespan import OfferProductBaseVoucherValidityTimespan +from ..models.tax_type import TaxType from ..types import UNSET, Unset if TYPE_CHECKING: @@ -24,7 +24,7 @@ class OfferProductBase: """ Attributes: position (int): order position within the offer - must start with one and be in order - tax_type (OfferProductBaseTaxType): tax type product is associated with + tax_type (TaxType): unique identification of the tax type the product represents product_type (OfferProductBaseProductType): defines the type of product amount (int): amount of goods represented by this product access_right_id (int): id of the access right associated with this product @@ -43,7 +43,8 @@ class OfferProductBase: voucher_validity_time (Union[Unset, int]): validity time of the voucher based on timespan voucher_validity_timespan (Union[Unset, OfferProductBaseVoucherValidityTimespan]): date the this product validity will be end - additional_data (Union[Unset, OfferProductBaseAdditionalData]): + additional_data (Union[Unset, OfferProductBaseAdditionalData]): Key must be a string with a maximum length of 30 + characters. data (Union[Unset, OfferProductBaseData]): additional data field price_issue_id (Union[Unset, int]): id of the price issue associated with this product shipping_cost_price_issue_id (Union[Unset, int]): id of the shipping cost price issue associated with this @@ -56,7 +57,7 @@ class OfferProductBase: """ position: int - tax_type: OfferProductBaseTaxType + tax_type: TaxType product_type: OfferProductBaseProductType amount: int access_right_id: int @@ -213,7 +214,7 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: d = src_dict.copy() position = d.pop("position") - tax_type = OfferProductBaseTaxType(d.pop("taxType")) + tax_type = TaxType(d.pop("taxType")) product_type = OfferProductBaseProductType(d.pop("productType")) diff --git a/plenigo-client/plenigo/models/offer_product_base_additional_data.py b/plenigo-client/plenigo/models/offer_product_base_additional_data.py index e3b0952..1b5ac27 100644 --- a/plenigo-client/plenigo/models/offer_product_base_additional_data.py +++ b/plenigo-client/plenigo/models/offer_product_base_additional_data.py @@ -8,7 +8,7 @@ @_attrs_define class OfferProductBaseAdditionalData: - """ """ + """Key must be a string with a maximum length of 30 characters.""" additional_properties: Dict[str, str] = _attrs_field(init=False, factory=dict) diff --git a/plenigo-client/plenigo/models/offer_translation_image.py b/plenigo-client/plenigo/models/offer_translation_image.py index 70b0069..e65e781 100644 --- a/plenigo-client/plenigo/models/offer_translation_image.py +++ b/plenigo-client/plenigo/models/offer_translation_image.py @@ -18,22 +18,24 @@ class OfferTranslationImage: image_type (OfferTranslationImageImageType): type of the image - there can only be one image of each type per translation name (str): name of the image - url (str): url to get image from created_date (Union[None, Unset, datetime.datetime]): time the object was created with time notation as defined by RFC 3339, section 5.6, for example, 17:32:28 changed_date (Union[None, Unset, datetime.datetime]): time the object was changed with time notation as defined by RFC 3339, section 5.6, for example, 17:32:28 + url (Union[Unset, str]): url to get image from alt_text (Union[Unset, str]): image alt text + image (Union[Unset, str]): """ image_type: OfferTranslationImageImageType name: str - url: str created_date: Union[None, Unset, datetime.datetime] = UNSET changed_date: Union[None, Unset, datetime.datetime] = UNSET + url: Union[Unset, str] = UNSET alt_text: Union[Unset, str] = UNSET + image: Union[Unset, str] = UNSET additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> Dict[str, Any]: @@ -41,8 +43,6 @@ def to_dict(self) -> Dict[str, Any]: name = self.name - url = self.url - created_date: Union[None, Unset, str] if isinstance(self.created_date, Unset) or self.created_date is None: created_date = UNSET @@ -59,23 +59,30 @@ def to_dict(self) -> Dict[str, Any]: else: changed_date = self.changed_date + url = self.url + alt_text = self.alt_text + image = self.image + field_dict: Dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update( { "imageType": image_type, "name": name, - "url": url, } ) if created_date is not UNSET: field_dict["createdDate"] = created_date if changed_date is not UNSET: field_dict["changedDate"] = changed_date + if url is not UNSET: + field_dict["url"] = url if alt_text is not UNSET: field_dict["altText"] = alt_text + if image is not UNSET: + field_dict["image"] = image return field_dict @@ -86,8 +93,6 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: name = d.pop("name") - url = d.pop("url") - def _parse_created_date(data: object) -> Union[None, Unset, datetime.datetime]: if data is None: return data @@ -136,15 +141,20 @@ def _parse_changed_date(data: object) -> Union[None, Unset, datetime.datetime]: changed_date = _parse_changed_date(d.pop("changedDate", UNSET)) + url = d.pop("url", UNSET) + alt_text = d.pop("altText", UNSET) + image = d.pop("image", UNSET) + offer_translation_image = cls( image_type=image_type, name=name, - url=url, created_date=created_date, changed_date=changed_date, + url=url, alt_text=alt_text, + image=image, ) offer_translation_image.additional_properties = d diff --git a/plenigo-client/plenigo/models/offers.py b/plenigo-client/plenigo/models/offers.py index 0e11a29..560bc7b 100644 --- a/plenigo-client/plenigo/models/offers.py +++ b/plenigo-client/plenigo/models/offers.py @@ -16,13 +16,25 @@ class Offers: """ Attributes: + ending_before_id (Union[Unset, str]): A cursor for use in pagination. endingBefore is an object ID that defines + your place in the list. For instance, if you make a list request and receive 100 objects, starting with obj_bar, + your subsequent call can include endingBefore=obj_bar in order to fetch the previous page of the list. + starting_after_id (Union[Unset, str]): A cursor for use in pagination. startingAfter is an object ID that + defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with + obj_foo, your subsequent call can include startingAfter=obj_foo in order to fetch the next result set. items (Union[Unset, List['Offer']]): offers """ + ending_before_id: Union[Unset, str] = UNSET + starting_after_id: Union[Unset, str] = UNSET items: Union[Unset, List["Offer"]] = UNSET additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> Dict[str, Any]: + ending_before_id = self.ending_before_id + + starting_after_id = self.starting_after_id + items: Union[Unset, List[Dict[str, Any]]] = UNSET if not isinstance(self.items, Unset): items = [] @@ -33,6 +45,10 @@ def to_dict(self) -> Dict[str, Any]: field_dict: Dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update({}) + if ending_before_id is not UNSET: + field_dict["endingBeforeId"] = ending_before_id + if starting_after_id is not UNSET: + field_dict["startingAfterId"] = starting_after_id if items is not UNSET: field_dict["items"] = items @@ -43,6 +59,10 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: from ..models.offer import Offer d = src_dict.copy() + ending_before_id = d.pop("endingBeforeId", UNSET) + + starting_after_id = d.pop("startingAfterId", UNSET) + items = [] _items = d.pop("items", UNSET) for items_item_data in _items or []: @@ -51,6 +71,8 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: items.append(items_item) offers = cls( + ending_before_id=ending_before_id, + starting_after_id=starting_after_id, items=items, ) diff --git a/plenigo-client/plenigo/models/order_item.py b/plenigo-client/plenigo/models/order_item.py index eb023fb..c96e8ea 100644 --- a/plenigo-client/plenigo/models/order_item.py +++ b/plenigo-client/plenigo/models/order_item.py @@ -5,7 +5,7 @@ from attrs import field as _attrs_field from dateutil.parser import isoparse -from ..models.order_item_tax_type import OrderItemTaxType +from ..models.tax_type import TaxType from ..types import UNSET, Unset if TYPE_CHECKING: @@ -25,14 +25,12 @@ class OrderItem: the orderId product_id (str): id of the product bought title (str): product title presented to the customer - tax_type (OrderItemTaxType): unique identification of the tax type the product represents - important for tax - handling purposes + tax_type (TaxType): unique identification of the tax type the product represents price (float): price of the order item tax (float): tax percentage operated on this order item tax_country (str): country tax is based on formatted as ISO 3166-1 alpha-2 quantity (int): purchase quantity - discount_percentage (int): discount offered to the order item delivery_customer_id (str): id of the customer the delivery belongs to (also includes digital products) created_date (Union[None, Unset, datetime.datetime]): time the object was created with time notation as defined by RFC 3339, section 5.6, for @@ -49,6 +47,7 @@ class OrderItem: access_right_unique_id (Union[Unset, str]): unique id of the access right this order item grants access to internal_title (Union[Unset, str]): if the product is based on a plenigo offer the product title for internal usage is provided here + discount_percentage (Union[Unset, int]): discount offered to the order item cost_center (Union[Unset, str]): cost center associated with this product at the time of order creation purchase_number (Union[Unset, str]): purchase number associated with this subscription item voucher_code (Union[Unset, str]): voucher code to purchase this order item @@ -68,12 +67,11 @@ class OrderItem: position: int product_id: str title: str - tax_type: OrderItemTaxType + tax_type: TaxType price: float tax: float tax_country: str quantity: int - discount_percentage: int delivery_customer_id: str created_date: Union[None, Unset, datetime.datetime] = UNSET changed_date: Union[None, Unset, datetime.datetime] = UNSET @@ -82,6 +80,7 @@ class OrderItem: plenigo_step_id: Union[Unset, str] = UNSET access_right_unique_id: Union[Unset, str] = UNSET internal_title: Union[Unset, str] = UNSET + discount_percentage: Union[Unset, int] = UNSET cost_center: Union[Unset, str] = UNSET purchase_number: Union[Unset, str] = UNSET voucher_code: Union[Unset, str] = UNSET @@ -112,8 +111,6 @@ def to_dict(self) -> Dict[str, Any]: quantity = self.quantity - discount_percentage = self.discount_percentage - delivery_customer_id = self.delivery_customer_id created_date: Union[None, Unset, str] @@ -142,6 +139,8 @@ def to_dict(self) -> Dict[str, Any]: internal_title = self.internal_title + discount_percentage = self.discount_percentage + cost_center = self.cost_center purchase_number = self.purchase_number @@ -188,7 +187,6 @@ def to_dict(self) -> Dict[str, Any]: "tax": tax, "taxCountry": tax_country, "quantity": quantity, - "discountPercentage": discount_percentage, "deliveryCustomerId": delivery_customer_id, } ) @@ -206,6 +204,8 @@ def to_dict(self) -> Dict[str, Any]: field_dict["accessRightUniqueId"] = access_right_unique_id if internal_title is not UNSET: field_dict["internalTitle"] = internal_title + if discount_percentage is not UNSET: + field_dict["discountPercentage"] = discount_percentage if cost_center is not UNSET: field_dict["costCenter"] = cost_center if purchase_number is not UNSET: @@ -244,7 +244,7 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: title = d.pop("title") - tax_type = OrderItemTaxType(d.pop("taxType")) + tax_type = TaxType(d.pop("taxType")) price = d.pop("price") @@ -254,8 +254,6 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: quantity = d.pop("quantity") - discount_percentage = d.pop("discountPercentage") - delivery_customer_id = d.pop("deliveryCustomerId") def _parse_created_date(data: object) -> Union[None, Unset, datetime.datetime]: @@ -316,6 +314,8 @@ def _parse_changed_date(data: object) -> Union[None, Unset, datetime.datetime]: internal_title = d.pop("internalTitle", UNSET) + discount_percentage = d.pop("discountPercentage", UNSET) + cost_center = d.pop("costCenter", UNSET) purchase_number = d.pop("purchaseNumber", UNSET) @@ -384,7 +384,6 @@ def _parse_validity_end_date(data: object) -> Union[None, Unset, datetime.dateti tax=tax, tax_country=tax_country, quantity=quantity, - discount_percentage=discount_percentage, delivery_customer_id=delivery_customer_id, created_date=created_date, changed_date=changed_date, @@ -393,6 +392,7 @@ def _parse_validity_end_date(data: object) -> Union[None, Unset, datetime.dateti plenigo_step_id=plenigo_step_id, access_right_unique_id=access_right_unique_id, internal_title=internal_title, + discount_percentage=discount_percentage, cost_center=cost_center, purchase_number=purchase_number, voucher_code=voucher_code, diff --git a/plenigo-client/plenigo/models/order_item_tax_type.py b/plenigo-client/plenigo/models/order_item_tax_type.py deleted file mode 100644 index baf044f..0000000 --- a/plenigo-client/plenigo/models/order_item_tax_type.py +++ /dev/null @@ -1,24 +0,0 @@ -from enum import Enum - - -class OrderItemTaxType(str, Enum): - ADVERTISEMENT = "ADVERTISEMENT" - BOOK = "BOOK" - DIGITALNEWSPAPER = "DIGITALNEWSPAPER" - DIGITALOFFER = "DIGITALOFFER" - DIGITALPRODUCT = "DIGITALPRODUCT" - DONATION = "DONATION" - DOWNLOAD = "DOWNLOAD" - EBOOK = "EBOOK" - EVENT = "EVENT" - FEE = "FEE" - MAGAZINE = "MAGAZINE" - MEMBERSHIP = "MEMBERSHIP" - MUSIC = "MUSIC" - NEWSPAPER = "NEWSPAPER" - PHYSICALPRODUCT = "PHYSICALPRODUCT" - VIDEO = "VIDEO" - VOUCHER = "VOUCHER" - - def __str__(self) -> str: - return str(self.value) diff --git a/plenigo-client/plenigo/models/price_country_segment.py b/plenigo-client/plenigo/models/price_country_segment.py index ee60391..be9d881 100644 --- a/plenigo-client/plenigo/models/price_country_segment.py +++ b/plenigo-client/plenigo/models/price_country_segment.py @@ -16,11 +16,11 @@ class PriceCountrySegment: """ Attributes: title (str): title of the price country segment + priority (int): priority of the price country segment - the lower the priority the higher the rank of the price + segment countries (List[str]): array of country codes formatted as ISO 3166-1 alpha-2 price_country_segment_id (int): unique id of the price country segment within a contract company - priority (Union[Unset, int]): priority of the price country segment - the lower the priority the higher the rank - of the price segment description (Union[Unset, str]): internal description of the price country segment created_date (Union[None, Unset, datetime.datetime]): time the object was created with time notation as defined by RFC 3339, section 5.6, for @@ -35,9 +35,9 @@ class PriceCountrySegment: """ title: str + priority: int countries: List[str] price_country_segment_id: int - priority: Union[Unset, int] = UNSET description: Union[Unset, str] = UNSET created_date: Union[None, Unset, datetime.datetime] = UNSET changed_date: Union[None, Unset, datetime.datetime] = UNSET @@ -50,12 +50,12 @@ class PriceCountrySegment: def to_dict(self) -> Dict[str, Any]: title = self.title + priority = self.priority + countries = self.countries price_country_segment_id = self.price_country_segment_id - priority = self.priority - description = self.description created_date: Union[None, Unset, str] @@ -91,12 +91,11 @@ def to_dict(self) -> Dict[str, Any]: field_dict.update( { "title": title, + "priority": priority, "countries": countries, "priceCountrySegmentId": price_country_segment_id, } ) - if priority is not UNSET: - field_dict["priority"] = priority if description is not UNSET: field_dict["description"] = description if created_date is not UNSET: @@ -119,12 +118,12 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: d = src_dict.copy() title = d.pop("title") + priority = d.pop("priority") + countries = cast(List[str], d.pop("countries")) price_country_segment_id = d.pop("priceCountrySegmentId") - priority = d.pop("priority", UNSET) - description = d.pop("description", UNSET) def _parse_created_date(data: object) -> Union[None, Unset, datetime.datetime]: @@ -195,9 +194,9 @@ def _parse_changed_date(data: object) -> Union[None, Unset, datetime.datetime]: price_country_segment = cls( title=title, + priority=priority, countries=countries, price_country_segment_id=price_country_segment_id, - priority=priority, description=description, created_date=created_date, changed_date=changed_date, diff --git a/plenigo-client/plenigo/models/price_country_segment_creation.py b/plenigo-client/plenigo/models/price_country_segment_creation.py index 0c878e1..77cf62b 100644 --- a/plenigo-client/plenigo/models/price_country_segment_creation.py +++ b/plenigo-client/plenigo/models/price_country_segment_creation.py @@ -13,26 +13,26 @@ class PriceCountrySegmentCreation: """ Attributes: title (str): title of the price country segment + priority (int): priority of the price country segment - the lower the priority the higher the rank of the price + segment countries (List[str]): array of country codes formatted as ISO 3166-1 alpha-2 - priority (Union[Unset, int]): priority of the price country segment - the lower the priority the higher the rank - of the price segment description (Union[Unset, str]): internal description of the price country segment """ title: str + priority: int countries: List[str] - priority: Union[Unset, int] = UNSET description: Union[Unset, str] = UNSET additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> Dict[str, Any]: title = self.title - countries = self.countries - priority = self.priority + countries = self.countries + description = self.description field_dict: Dict[str, Any] = {} @@ -40,11 +40,10 @@ def to_dict(self) -> Dict[str, Any]: field_dict.update( { "title": title, + "priority": priority, "countries": countries, } ) - if priority is not UNSET: - field_dict["priority"] = priority if description is not UNSET: field_dict["description"] = description @@ -55,16 +54,16 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: d = src_dict.copy() title = d.pop("title") - countries = cast(List[str], d.pop("countries")) + priority = d.pop("priority") - priority = d.pop("priority", UNSET) + countries = cast(List[str], d.pop("countries")) description = d.pop("description", UNSET) price_country_segment_creation = cls( title=title, - countries=countries, priority=priority, + countries=countries, description=description, ) diff --git a/plenigo-client/plenigo/models/product_tag.py b/plenigo-client/plenigo/models/product_tag.py index c8098ae..cc20f06 100644 --- a/plenigo-client/plenigo/models/product_tag.py +++ b/plenigo-client/plenigo/models/product_tag.py @@ -16,9 +16,9 @@ class ProductTag: """ Attributes: + name (str): a name that is unique in combination with a category category (ProductTagCreationCategory): category that reflects the usage of the tag product_tag_id (int): unique id of the product tag within a contract company - name (Union[Unset, str]): a name that is unique in combination with a category description (Union[Unset, str]): internal description of the product tag created_date (Union[None, Unset, datetime.datetime]): time the object was created with time notation as defined by RFC 3339, section 5.6, for @@ -32,9 +32,9 @@ class ProductTag: changed_by_type (Union[Unset, UserType]): type of user who performs the action """ + name: str category: ProductTagCreationCategory product_tag_id: int - name: Union[Unset, str] = UNSET description: Union[Unset, str] = UNSET created_date: Union[None, Unset, datetime.datetime] = UNSET changed_date: Union[None, Unset, datetime.datetime] = UNSET @@ -45,12 +45,12 @@ class ProductTag: additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> Dict[str, Any]: + name = self.name + category = self.category.value product_tag_id = self.product_tag_id - name = self.name - description = self.description created_date: Union[None, Unset, str] @@ -85,12 +85,11 @@ def to_dict(self) -> Dict[str, Any]: field_dict.update(self.additional_properties) field_dict.update( { + "name": name, "category": category, "productTagId": product_tag_id, } ) - if name is not UNSET: - field_dict["name"] = name if description is not UNSET: field_dict["description"] = description if created_date is not UNSET: @@ -111,12 +110,12 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: d = src_dict.copy() + name = d.pop("name") + category = ProductTagCreationCategory(d.pop("category")) product_tag_id = d.pop("productTagId") - name = d.pop("name", UNSET) - description = d.pop("description", UNSET) def _parse_created_date(data: object) -> Union[None, Unset, datetime.datetime]: @@ -186,9 +185,9 @@ def _parse_changed_date(data: object) -> Union[None, Unset, datetime.datetime]: changed_by_type = UserType(_changed_by_type) product_tag = cls( + name=name, category=category, product_tag_id=product_tag_id, - name=name, description=description, created_date=created_date, changed_date=changed_date, diff --git a/plenigo-client/plenigo/models/product_tag_creation.py b/plenigo-client/plenigo/models/product_tag_creation.py index 55682c6..feaf75a 100644 --- a/plenigo-client/plenigo/models/product_tag_creation.py +++ b/plenigo-client/plenigo/models/product_tag_creation.py @@ -13,32 +13,31 @@ class ProductTagCreation: """ Attributes: + name (str): a name that is unique in combination with a category category (ProductTagCreationCategory): category that reflects the usage of the tag - name (Union[Unset, str]): a name that is unique in combination with a category description (Union[Unset, str]): internal description of the product tag """ + name: str category: ProductTagCreationCategory - name: Union[Unset, str] = UNSET description: Union[Unset, str] = UNSET additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> Dict[str, Any]: - category = self.category.value - name = self.name + category = self.category.value + description = self.description field_dict: Dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update( { + "name": name, "category": category, } ) - if name is not UNSET: - field_dict["name"] = name if description is not UNSET: field_dict["description"] = description @@ -47,15 +46,15 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: d = src_dict.copy() - category = ProductTagCreationCategory(d.pop("category")) + name = d.pop("name") - name = d.pop("name", UNSET) + category = ProductTagCreationCategory(d.pop("category")) description = d.pop("description", UNSET) product_tag_creation = cls( - category=category, name=name, + category=category, description=description, ) diff --git a/plenigo-client/plenigo/models/product_tag_creation_category.py b/plenigo-client/plenigo/models/product_tag_creation_category.py index 5c08923..dda2002 100644 --- a/plenigo-client/plenigo/models/product_tag_creation_category.py +++ b/plenigo-client/plenigo/models/product_tag_creation_category.py @@ -5,6 +5,7 @@ class ProductTagCreationCategory(str, Enum): ANALYTICS = "ANALYTICS" CUSTOM = "CUSTOM" FLOW = "FLOW" + PAYWALL = "PAYWALL" RULE = "RULE" def __str__(self) -> str: diff --git a/plenigo-client/plenigo/models/refund_payment_provider.py b/plenigo-client/plenigo/models/refund_payment_provider.py index 8f67556..219b852 100644 --- a/plenigo-client/plenigo/models/refund_payment_provider.py +++ b/plenigo-client/plenigo/models/refund_payment_provider.py @@ -3,13 +3,14 @@ class RefundPaymentProvider(str, Enum): AMAZON = "AMAZON" - APPLE = "APPLE" DATATRANS = "DATATRANS" - GOOGLE = "GOOGLE" PAYONE = "PAYONE" PAYPAL = "PAYPAL" + SIX = "SIX" + SOFORT = "SOFORT" STRIPE = "STRIPE" - WIRECARD_LEGACY = "WIRECARD_LEGACY" + UNZER = "UNZER" + WORLDPAY = "WORLDPAY" def __str__(self) -> str: return str(self.value) diff --git a/plenigo-client/plenigo/models/get_vouchers_channels_channel_id_vouchers_voucher_status.py b/plenigo-client/plenigo/models/search_channel_vouchers_voucher_status.py similarity index 73% rename from plenigo-client/plenigo/models/get_vouchers_channels_channel_id_vouchers_voucher_status.py rename to plenigo-client/plenigo/models/search_channel_vouchers_voucher_status.py index f063260..f94b6fa 100644 --- a/plenigo-client/plenigo/models/get_vouchers_channels_channel_id_vouchers_voucher_status.py +++ b/plenigo-client/plenigo/models/search_channel_vouchers_voucher_status.py @@ -1,7 +1,7 @@ from enum import Enum -class GetVouchersChannelsChannelIdVouchersVoucherStatus(str, Enum): +class SearchChannelVouchersVoucherStatus(str, Enum): ACTIVE = "ACTIVE" CANCELLED = "CANCELLED" DELETED = "DELETED" diff --git a/plenigo-client/plenigo/models/subscription_item.py b/plenigo-client/plenigo/models/subscription_item.py index eb85e90..62b5894 100644 --- a/plenigo-client/plenigo/models/subscription_item.py +++ b/plenigo-client/plenigo/models/subscription_item.py @@ -6,7 +6,7 @@ from dateutil.parser import isoparse from ..models.subscription_item_status import SubscriptionItemStatus -from ..models.subscription_item_tax_type import SubscriptionItemTaxType +from ..models.tax_type import TaxType from ..models.user_type import UserType from ..types import UNSET, Unset @@ -41,8 +41,7 @@ class SubscriptionItem: to internal_title (Union[Unset, str]): if the product is based on a plenigo offer the product title for internal usage is provided here - tax_type (Union[Unset, SubscriptionItemTaxType]): unique identification of tax type the product represents - - important for tax handling purposes + tax_type (Union[Unset, TaxType]): unique identification of the tax type the product represents package_title (Union[Unset, str]): if subscription item is correlated to another subscription item in a way that both items are presented as one (bundle) this field contains the correlation title package_id (Union[Unset, str]): if subscription item is correlated to another subscription item in a way that @@ -74,7 +73,7 @@ class SubscriptionItem: plenigo_step_id: Union[Unset, str] = UNSET access_right_unique_id: Union[Unset, str] = UNSET internal_title: Union[Unset, str] = UNSET - tax_type: Union[Unset, SubscriptionItemTaxType] = UNSET + tax_type: Union[Unset, TaxType] = UNSET package_title: Union[Unset, str] = UNSET package_id: Union[Unset, str] = UNSET package_cancellation_locked: Union[Unset, bool] = UNSET @@ -304,11 +303,11 @@ def _parse_changed_date(data: object) -> Union[None, Unset, datetime.datetime]: internal_title = d.pop("internalTitle", UNSET) _tax_type = d.pop("taxType", UNSET) - tax_type: Union[Unset, SubscriptionItemTaxType] + tax_type: Union[Unset, TaxType] if isinstance(_tax_type, Unset) or not _tax_type: tax_type = UNSET else: - tax_type = SubscriptionItemTaxType(_tax_type) + tax_type = TaxType(_tax_type) package_title = d.pop("packageTitle", UNSET) diff --git a/plenigo-client/plenigo/models/subscription_item_tax_type.py b/plenigo-client/plenigo/models/subscription_item_tax_type.py deleted file mode 100644 index a8217cd..0000000 --- a/plenigo-client/plenigo/models/subscription_item_tax_type.py +++ /dev/null @@ -1,24 +0,0 @@ -from enum import Enum - - -class SubscriptionItemTaxType(str, Enum): - ADVERTISEMENT = "ADVERTISEMENT" - BOOK = "BOOK" - DIGITALNEWSPAPER = "DIGITALNEWSPAPER" - DIGITALOFFER = "DIGITALOFFER" - DIGITALPRODUCT = "DIGITALPRODUCT" - DONATION = "DONATION" - DOWNLOAD = "DOWNLOAD" - EBOOK = "EBOOK" - EVENT = "EVENT" - FEE = "FEE" - MAGAZINE = "MAGAZINE" - MEMBERSHIP = "MEMBERSHIP" - MUSIC = "MUSIC" - NEWSPAPER = "NEWSPAPER" - PHYSICALPRODUCT = "PHYSICALPRODUCT" - VIDEO = "VIDEO" - VOUCHER = "VOUCHER" - - def __str__(self) -> str: - return str(self.value) diff --git a/plenigo-client/plenigo/models/success_status.py b/plenigo-client/plenigo/models/success_status.py deleted file mode 100644 index 98d5b2c..0000000 --- a/plenigo-client/plenigo/models/success_status.py +++ /dev/null @@ -1,68 +0,0 @@ -from typing import Any, Dict, List, Type, TypeVar, Union - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from ..types import UNSET, Unset - -T = TypeVar("T", bound="SuccessStatus") - - -@_attrs_define -class SuccessStatus: - """ - Attributes: - success (Union[Unset, bool]): success status - promise_id (Union[Unset, str]): in case of long running calls it contains the id that identifies the - corresponding callback that contains the result - """ - - success: Union[Unset, bool] = UNSET - promise_id: Union[Unset, str] = UNSET - additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> Dict[str, Any]: - success = self.success - - promise_id = self.promise_id - - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if success is not UNSET: - field_dict["success"] = success - if promise_id is not UNSET: - field_dict["promiseId"] = promise_id - - return field_dict - - @classmethod - def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: - d = src_dict.copy() - success = d.pop("success", UNSET) - - promise_id = d.pop("promiseId", UNSET) - - success_status = cls( - success=success, - promise_id=promise_id, - ) - - success_status.additional_properties = d - return success_status - - @property - def additional_keys(self) -> List[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/plenigo-client/plenigo/models/offer_product_base_tax_type.py b/plenigo-client/plenigo/models/tax_type.py similarity index 86% rename from plenigo-client/plenigo/models/offer_product_base_tax_type.py rename to plenigo-client/plenigo/models/tax_type.py index 8992d08..8a973f3 100644 --- a/plenigo-client/plenigo/models/offer_product_base_tax_type.py +++ b/plenigo-client/plenigo/models/tax_type.py @@ -1,9 +1,10 @@ from enum import Enum -class OfferProductBaseTaxType(str, Enum): +class TaxType(str, Enum): ADVERTISEMENT = "ADVERTISEMENT" BOOK = "BOOK" + BUNDLE = "BUNDLE" DIGITALNEWSPAPER = "DIGITALNEWSPAPER" DIGITALOFFER = "DIGITALOFFER" DIGITALPRODUCT = "DIGITALPRODUCT" @@ -17,6 +18,7 @@ class OfferProductBaseTaxType(str, Enum): MUSIC = "MUSIC" NEWSPAPER = "NEWSPAPER" PHYSICALPRODUCT = "PHYSICALPRODUCT" + SHIPPINGCOSTS = "SHIPPINGCOSTS" VIDEO = "VIDEO" VOUCHER = "VOUCHER" diff --git a/plenigo-client/plenigo/models/transaction.py b/plenigo-client/plenigo/models/transaction.py index b33bc9f..dfbfd25 100644 --- a/plenigo-client/plenigo/models/transaction.py +++ b/plenigo-client/plenigo/models/transaction.py @@ -18,7 +18,7 @@ class Transaction: """ Attributes: - transaction_id (int): unique id of the transaction also used for pagination + transaction_id (str): unique id of the transaction also used for pagination plenigo_transaction_id (str): unique plenigo transaction id used to communicate with payment provider amount (float): amount of the transaction currency (str): currency of the transaction formatted as RFC 3339, section 5.6, for example, 2017-07-21T17:32:28Z + sort_key (Union[None, Unset, int]): key to sort the results psp_transaction_id (Union[Unset, str]): id of the payment service provider if one was provided description (Union[Unset, str]): description describing the transaction reason error_code (Union[Unset, str]): error code for transaction failure error_message (Union[Unset, str]): description of the error """ - transaction_id: int + transaction_id: str plenigo_transaction_id: str amount: float currency: str @@ -59,6 +60,7 @@ class Transaction: changed_date: Union[None, Unset, datetime.datetime] = UNSET transaction_date: Union[None, Unset, datetime.datetime] = UNSET fulfillment_date: Union[None, Unset, datetime.datetime] = UNSET + sort_key: Union[None, Unset, int] = UNSET psp_transaction_id: Union[Unset, str] = UNSET description: Union[Unset, str] = UNSET error_code: Union[Unset, str] = UNSET @@ -116,6 +118,12 @@ def to_dict(self) -> Dict[str, Any]: else: fulfillment_date = self.fulfillment_date + sort_key: Union[None, Unset, int] + if isinstance(self.sort_key, Unset) or self.sort_key is None: + sort_key = UNSET + else: + sort_key = self.sort_key + psp_transaction_id = self.psp_transaction_id description = self.description @@ -147,6 +155,8 @@ def to_dict(self) -> Dict[str, Any]: field_dict["transactionDate"] = transaction_date if fulfillment_date is not UNSET: field_dict["fulfillmentDate"] = fulfillment_date + if sort_key is not UNSET: + field_dict["sortKey"] = sort_key if psp_transaction_id is not UNSET: field_dict["pspTransactionId"] = psp_transaction_id if description is not UNSET: @@ -275,6 +285,20 @@ def _parse_fulfillment_date(data: object) -> Union[None, Unset, datetime.datetim fulfillment_date = _parse_fulfillment_date(d.pop("fulfillmentDate", UNSET)) + def _parse_sort_key(data: object) -> Union[None, Unset, int]: + if data is None: + return data + + if data is None: + return data + + if isinstance(data, Unset): + return data + + return cast(Union[None, Unset, int], data) + + sort_key = _parse_sort_key(d.pop("sortKey", UNSET)) + psp_transaction_id = d.pop("pspTransactionId", UNSET) description = d.pop("description", UNSET) @@ -297,6 +321,7 @@ def _parse_fulfillment_date(data: object) -> Union[None, Unset, datetime.datetim changed_date=changed_date, transaction_date=transaction_date, fulfillment_date=fulfillment_date, + sort_key=sort_key, psp_transaction_id=psp_transaction_id, description=description, error_code=error_code, diff --git a/plenigo-client/plenigo/models/validation_error.py b/plenigo-client/plenigo/models/validation_error.py index 2c567a2..4884068 100644 --- a/plenigo-client/plenigo/models/validation_error.py +++ b/plenigo-client/plenigo/models/validation_error.py @@ -10,9 +10,9 @@ class ValidationError: """ Attributes: - field (str): field name with the error - error (str): error description - value (str): value of the field + field (str): field name with the error Example: customerId. + error (str): error description Example: numeric. + value (str): value of the field Example: C1454646. """ field: str