diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index 1dea1f1..a84c6df 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -13,7 +13,9 @@ Monei/api/prices_api.py Monei/api/products_api.py Monei/api/subscriptions_api.py Monei/api/tax_rates_api.py +Monei/api/ucp_api.py Monei/api/verification_of_payee_api.py +Monei/api/webhooks_api.py Monei/api_client.py Monei/apis/__init__.py Monei/configuration.py @@ -54,9 +56,13 @@ Monei/model/create_price_request.py Monei/model/create_product_request.py Monei/model/create_subscription_request.py Monei/model/create_tax_rate_request.py +Monei/model/create_webhook_request.py +Monei/model/created_webhook.py +Monei/model/created_webhook_all_of.py Monei/model/customer.py Monei/model/customer_payment_method.py Monei/model/deleted_resource.py +Monei/model/deleted_webhook.py Monei/model/internal_server_error.py Monei/model/internal_server_error_all_of.py Monei/model/not_found_error.py @@ -160,6 +166,13 @@ Monei/model/tax_rate.py Monei/model/tax_rate_display_name.py Monei/model/tax_rate_list.py Monei/model/tax_rate_percentage.py +Monei/model/tokenize_ucp_request.py +Monei/model/tokenize_ucp_request_binding.py +Monei/model/tokenize_ucp_request_credential.py +Monei/model/tokenize_ucp_request_identity.py +Monei/model/tokenize_ucp_request_signals.py +Monei/model/tokenize_ucp_request_usage_limits.py +Monei/model/ucp_tokenize200_response.py Monei/model/unauthorized_error.py Monei/model/unauthorized_error_all_of.py Monei/model/unprocessable_entity_error.py @@ -170,10 +183,31 @@ Monei/model/update_price_request.py Monei/model/update_product_request.py Monei/model/update_subscription_request.py Monei/model/update_tax_rate_request.py +Monei/model/update_webhook_request.py Monei/model/validate_bizum_phone_request.py Monei/model/verify_cardholder_request.py Monei/model/verify_payee_request.py +Monei/model/webhook.py +Monei/model/webhook_event_types.py +Monei/model/webhook_list.py Monei/model_utils.py Monei/models/__init__.py Monei/rest.py test/__init__.py +test/test_create_webhook_request.py +test/test_created_webhook.py +test/test_created_webhook_all_of.py +test/test_deleted_webhook.py +test/test_tokenize_ucp_request.py +test/test_tokenize_ucp_request_binding.py +test/test_tokenize_ucp_request_credential.py +test/test_tokenize_ucp_request_identity.py +test/test_tokenize_ucp_request_signals.py +test/test_tokenize_ucp_request_usage_limits.py +test/test_ucp_api.py +test/test_ucp_tokenize200_response.py +test/test_update_webhook_request.py +test/test_webhook.py +test/test_webhook_event_types.py +test/test_webhook_list.py +test/test_webhooks_api.py diff --git a/Monei/api/payments_api.py b/Monei/api/payments_api.py index d9ea485..b1636d7 100644 --- a/Monei/api/payments_api.py +++ b/Monei/api/payments_api.py @@ -668,7 +668,7 @@ def confirm(self, id, **kwargs): def create(self, create_payment_request, **kwargs): """Create Payment # noqa: E501 - Creates a new payment with the specified parameters. You can create a payment in two ways: 1. **Immediate processing**: Provide a `paymentToken` or `paymentMethod` - The payment will be processed instantly 2. **Deferred processing**: Create without payment details - The payment remains in `PENDING` status until you confirm it later using the [confirm endpoint](https://docs.monei.com/apis/rest/payments-confirm/) When creating a payment without payment details, you can redirect customers to the hosted payment page where they can select their preferred payment method and complete the transaction. For immediate processing, use one of these token options: - A temporary `paymentToken` generated on the frontend using [monei.js Components](https://docs.monei.com/monei-js/overview/) - A permanent `paymentToken` from a previous successful payment (when `generatePaymentToken: true` was included) Permanent tokens enable one-click checkout experiences for returning customers by allowing you to securely store and reuse payment details without requiring customers to re-enter their information. # noqa: E501 + Creates a new payment with the specified parameters. You can create a payment in two ways: 1. **Immediate processing**: Provide a `paymentToken` or `paymentMethod` - The payment will be processed instantly 2. **Deferred processing**: Create without payment details - The payment remains in `PENDING` status until you confirm it later using the [confirm endpoint](https://docs.monei.com/apis/rest/payments-confirm/) When creating a payment without payment details, you can redirect customers to the hosted payment page where they can select their preferred payment method and complete the transaction. For immediate processing, use one of these token options: - A temporary `paymentToken` generated on the frontend using [monei.js Components](https://docs.monei.com/monei-js/overview/) - A permanent `paymentToken` from a previous successful payment (when `generatePaymentToken: true` was included) - A single-use UCP agent `paymentToken` bound to the checkout's derived `sessionId`. Omit `generatePaymentToken` and `sequence` for this token. [Tokenize a UCP card](https://docs.monei.com/apis/rest/ucp-tokenize/) Permanent tokens enable one-click checkout experiences for returning customers by allowing you to securely store and reuse payment details without requiring customers to re-enter their information. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True diff --git a/Monei/api/ucp_api.py b/Monei/api/ucp_api.py new file mode 100644 index 0000000..20c6048 --- /dev/null +++ b/Monei/api/ucp_api.py @@ -0,0 +1,139 @@ +""" +MONEI API v1 + +The MONEI API is organized around REST principles. Our API is designed to be intuitive and developer-friendly. ### Base URL All API requests should be made to: ``` https://api.monei.com/v1 ``` ### Environment MONEI provides two environments: - **Test Environment**: For development and testing without processing real payments - **Live Environment**: For processing real transactions in production ### Client Libraries We provide official SDKs to simplify integration: - [PHP SDK](https://github.com/MONEI/monei-php-sdk) - [Python SDK](https://github.com/MONEI/monei-python-sdk) - [Node.js SDK](https://github.com/MONEI/monei-node-sdk) - [Postman Collection](https://postman.monei.com/) Our SDKs handle authentication, error handling, and request formatting automatically. You can download the OpenAPI specification from the https://js.monei.com/api/v1/openapi.json and generate your own client library using the [OpenAPI Generator](https://openapi-generator.tech/). ### Important Requirements - All API requests must be made over HTTPS - If you are not using our official SDKs, you **must provide a valid `User-Agent` header** with each request - Requests without proper authentication will return a `401 Unauthorized` error ### Error Handling The API returns consistent error codes and messages to help you troubleshoot issues. Each response includes a `statusCode` attribute indicating the outcome of your request. ### Rate Limits The API implements rate limiting to ensure stability. If you exceed the limits, requests will return a `429 Too Many Requests` status code. # noqa: E501 + +The version of the OpenAPI document: 1.13.0 +Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import sys # noqa: F401 + +from Monei.api_client import ApiClient, Endpoint as _Endpoint +from Monei.model_utils import ( # noqa: F401 + check_allowed_values, + check_validations, + date, + datetime, + file_type, + none_type, + validate_and_convert_types, +) +from Monei.model.bad_request_error import BadRequestError +from Monei.model.tokenize_ucp_request import TokenizeUcpRequest +from Monei.model.ucp_tokenize200_response import UcpTokenize200Response + + +class UCPApi(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + self.tokenize_endpoint = _Endpoint( + settings={ + "response_type": (UcpTokenize200Response,), + "auth": ["UCPPlatformKey"], + "endpoint_path": "/ucp/tokenize", + "operation_id": "tokenize", + "http_method": "POST", + "servers": None, + }, + params_map={ + "all": [ + "tokenize_ucp_request", + ], + "required": [ + "tokenize_ucp_request", + ], + "nullable": [], + "enum": [], + "validation": [], + }, + root_map={ + "validations": {}, + "allowed_values": {}, + "openapi_types": { + "tokenize_ucp_request": (TokenizeUcpRequest,), + }, + "attribute_map": {}, + "location_map": { + "tokenize_ucp_request": "body", + }, + "collection_format_map": {}, + }, + headers_map={ + "accept": ["application/json"], + "content_type": ["application/json"], + }, + api_client=api_client, + ) + + def tokenize(self, tokenize_ucp_request, **kwargs): + """Tokenize a UCP Card # noqa: E501 + + Exchanges a UCP card credential for a single-use token valid for 15 minutes. Only MONEI-approved AI agent platform accounts can call this endpoint. The agent platform sends its scoped API key in `Authorization` and the merchant's MONEI account ID in `identity.access_token`. The token is bound to the merchant, the checkout, and the currency in `usage_limits`. The merchant can charge up to `usage_limits.max_amount`. ## Charge the token Send the returned `token` as `paymentToken` to Create Payment with `amount`, `currency`, `orderId`, `sessionId`, and `callbackUrl`. To derive `sessionId`, join `binding.type` and `binding.id` with `|`, hash the UTF-8 bytes with SHA-256, encode the digest as unpadded base64url, and prefix the first 36 characters with `ucp_`. [Create Payment](https://docs.monei.com/apis/rest/payments-create/) Use one stable `orderId` per checkout and a checkout lock to run at most one Complete request at a time for card or Bizum. Omit `generatePaymentToken` and `sequence` for agent tokens. For Bizum payments, omit `sessionId`. While the checkout is `complete_in_progress`, also poll `GET /v1/payments/{id}`. The final `EXPIRED` status sends no webhook. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.tokenize(tokenize_ucp_request, async_req=True) + >>> result = thread.get() + + Args: + tokenize_ucp_request (TokenizeUcpRequest): + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + _request_auths (list): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None + async_req (bool): execute request asynchronously + + Returns: + UcpTokenize200Response + If the method is called asynchronously, returns the request + thread. + """ + kwargs["async_req"] = kwargs.get("async_req", False) + kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True) + kwargs["_preload_content"] = kwargs.get("_preload_content", True) + kwargs["_request_timeout"] = kwargs.get("_request_timeout", None) + kwargs["_check_input_type"] = kwargs.get("_check_input_type", True) + kwargs["_check_return_type"] = kwargs.get("_check_return_type", True) + kwargs["_spec_property_naming"] = kwargs.get("_spec_property_naming", False) + kwargs["_content_type"] = kwargs.get("_content_type") + kwargs["_host_index"] = kwargs.get("_host_index") + kwargs["_request_auths"] = kwargs.get("_request_auths", None) + kwargs["tokenize_ucp_request"] = tokenize_ucp_request + return self.tokenize_endpoint.call_with_http_info(**kwargs) diff --git a/Monei/api/webhooks_api.py b/Monei/api/webhooks_api.py new file mode 100644 index 0000000..232cd37 --- /dev/null +++ b/Monei/api/webhooks_api.py @@ -0,0 +1,450 @@ +""" +MONEI API v1 + +The MONEI API is organized around REST principles. Our API is designed to be intuitive and developer-friendly. ### Base URL All API requests should be made to: ``` https://api.monei.com/v1 ``` ### Environment MONEI provides two environments: - **Test Environment**: For development and testing without processing real payments - **Live Environment**: For processing real transactions in production ### Client Libraries We provide official SDKs to simplify integration: - [PHP SDK](https://github.com/MONEI/monei-php-sdk) - [Python SDK](https://github.com/MONEI/monei-python-sdk) - [Node.js SDK](https://github.com/MONEI/monei-node-sdk) - [Postman Collection](https://postman.monei.com/) Our SDKs handle authentication, error handling, and request formatting automatically. You can download the OpenAPI specification from the https://js.monei.com/api/v1/openapi.json and generate your own client library using the [OpenAPI Generator](https://openapi-generator.tech/). ### Important Requirements - All API requests must be made over HTTPS - If you are not using our official SDKs, you **must provide a valid `User-Agent` header** with each request - Requests without proper authentication will return a `401 Unauthorized` error ### Error Handling The API returns consistent error codes and messages to help you troubleshoot issues. Each response includes a `statusCode` attribute indicating the outcome of your request. ### Rate Limits The API implements rate limiting to ensure stability. If you exceed the limits, requests will return a `429 Too Many Requests` status code. # noqa: E501 + +The version of the OpenAPI document: 1.13.0 +Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import sys # noqa: F401 + +from Monei.api_client import ApiClient, Endpoint as _Endpoint +from Monei.model_utils import ( # noqa: F401 + check_allowed_values, + check_validations, + date, + datetime, + file_type, + none_type, + validate_and_convert_types, +) +from Monei.model.bad_request_error import BadRequestError +from Monei.model.create_webhook_request import CreateWebhookRequest +from Monei.model.created_webhook import CreatedWebhook +from Monei.model.deleted_webhook import DeletedWebhook +from Monei.model.internal_server_error import InternalServerError +from Monei.model.not_found_error import NotFoundError +from Monei.model.service_unavailable_error import ServiceUnavailableError +from Monei.model.unauthorized_error import UnauthorizedError +from Monei.model.unprocessable_entity_error import UnprocessableEntityError +from Monei.model.update_webhook_request import UpdateWebhookRequest +from Monei.model.webhook import Webhook +from Monei.model.webhook_list import WebhookList + + +class WebhooksApi(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + self.create_endpoint = _Endpoint( + settings={ + "response_type": (CreatedWebhook,), + "auth": ["APIKey"], + "endpoint_path": "/webhooks", + "operation_id": "create", + "http_method": "POST", + "servers": None, + }, + params_map={ + "all": [ + "create_webhook_request", + ], + "required": [ + "create_webhook_request", + ], + "nullable": [], + "enum": [], + "validation": [], + }, + root_map={ + "validations": {}, + "allowed_values": {}, + "openapi_types": { + "create_webhook_request": (CreateWebhookRequest,), + }, + "attribute_map": {}, + "location_map": { + "create_webhook_request": "body", + }, + "collection_format_map": {}, + }, + headers_map={ + "accept": ["application/json"], + "content_type": ["application/json"], + }, + api_client=api_client, + ) + self.delete_endpoint = _Endpoint( + settings={ + "response_type": (DeletedWebhook,), + "auth": ["APIKey"], + "endpoint_path": "/webhooks/{id}", + "operation_id": "delete", + "http_method": "DELETE", + "servers": None, + }, + params_map={ + "all": [ + "id", + ], + "required": [ + "id", + ], + "nullable": [], + "enum": [], + "validation": [], + }, + root_map={ + "validations": {}, + "allowed_values": {}, + "openapi_types": { + "id": (str,), + }, + "attribute_map": { + "id": "id", + }, + "location_map": { + "id": "path", + }, + "collection_format_map": {}, + }, + headers_map={ + "accept": ["application/json"], + "content_type": [], + }, + api_client=api_client, + ) + self.list_endpoint = _Endpoint( + settings={ + "response_type": (WebhookList,), + "auth": ["APIKey"], + "endpoint_path": "/webhooks", + "operation_id": "list", + "http_method": "GET", + "servers": None, + }, + params_map={ + "all": [], + "required": [], + "nullable": [], + "enum": [], + "validation": [], + }, + root_map={ + "validations": {}, + "allowed_values": {}, + "openapi_types": {}, + "attribute_map": {}, + "location_map": {}, + "collection_format_map": {}, + }, + headers_map={ + "accept": ["application/json"], + "content_type": [], + }, + api_client=api_client, + ) + self.update_endpoint = _Endpoint( + settings={ + "response_type": (Webhook,), + "auth": ["APIKey"], + "endpoint_path": "/webhooks/{id}", + "operation_id": "update", + "http_method": "PUT", + "servers": None, + }, + params_map={ + "all": [ + "id", + "update_webhook_request", + ], + "required": [ + "id", + "update_webhook_request", + ], + "nullable": [], + "enum": [], + "validation": [], + }, + root_map={ + "validations": {}, + "allowed_values": {}, + "openapi_types": { + "id": (str,), + "update_webhook_request": (UpdateWebhookRequest,), + }, + "attribute_map": { + "id": "id", + }, + "location_map": { + "id": "path", + "update_webhook_request": "body", + }, + "collection_format_map": {}, + }, + headers_map={ + "accept": ["application/json"], + "content_type": ["application/json"], + }, + api_client=api_client, + ) + + def create(self, create_webhook_request, **kwargs): + """Create Webhook # noqa: E501 + + Creates a webhook. MONEI first sends a signed `{\"type\":\"webhook.test\"}` request to `url`, unless `enabled` is `false`. The URL must answer with a 2xx status. The response holds the `signingSecret` of the webhook. No other response returns it: store it now. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create(create_webhook_request, async_req=True) + >>> result = thread.get() + + Args: + create_webhook_request (CreateWebhookRequest): + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + _request_auths (list): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None + async_req (bool): execute request asynchronously + + Returns: + CreatedWebhook + If the method is called asynchronously, returns the request + thread. + """ + kwargs["async_req"] = kwargs.get("async_req", False) + kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True) + kwargs["_preload_content"] = kwargs.get("_preload_content", True) + kwargs["_request_timeout"] = kwargs.get("_request_timeout", None) + kwargs["_check_input_type"] = kwargs.get("_check_input_type", True) + kwargs["_check_return_type"] = kwargs.get("_check_return_type", True) + kwargs["_spec_property_naming"] = kwargs.get("_spec_property_naming", False) + kwargs["_content_type"] = kwargs.get("_content_type") + kwargs["_host_index"] = kwargs.get("_host_index") + kwargs["_request_auths"] = kwargs.get("_request_auths", None) + kwargs["create_webhook_request"] = create_webhook_request + return self.create_endpoint.call_with_http_info(**kwargs) + + def delete(self, id, **kwargs): + """Delete Webhook # noqa: E501 + + Deletes a webhook. MONEI stops sending events to it at once. To get a new signing secret, delete the webhook and create a new one. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete(id, async_req=True) + >>> result = thread.get() + + Args: + id (str): The webhook ID + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + _request_auths (list): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None + async_req (bool): execute request asynchronously + + Returns: + DeletedWebhook + If the method is called asynchronously, returns the request + thread. + """ + kwargs["async_req"] = kwargs.get("async_req", False) + kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True) + kwargs["_preload_content"] = kwargs.get("_preload_content", True) + kwargs["_request_timeout"] = kwargs.get("_request_timeout", None) + kwargs["_check_input_type"] = kwargs.get("_check_input_type", True) + kwargs["_check_return_type"] = kwargs.get("_check_return_type", True) + kwargs["_spec_property_naming"] = kwargs.get("_spec_property_naming", False) + kwargs["_content_type"] = kwargs.get("_content_type") + kwargs["_host_index"] = kwargs.get("_host_index") + kwargs["_request_auths"] = kwargs.get("_request_auths", None) + kwargs["id"] = id + return self.delete_endpoint.call_with_http_info(**kwargs) + + def list(self, **kwargs): + """List Webhooks # noqa: E501 + + Lists the webhooks you can manage with this API key. An API key made for a shop plugin lists only the webhooks on its shop's host. The response never holds a signing secret. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list(async_req=True) + >>> result = thread.get() + + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + _request_auths (list): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None + async_req (bool): execute request asynchronously + + Returns: + WebhookList + If the method is called asynchronously, returns the request + thread. + """ + kwargs["async_req"] = kwargs.get("async_req", False) + kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True) + kwargs["_preload_content"] = kwargs.get("_preload_content", True) + kwargs["_request_timeout"] = kwargs.get("_request_timeout", None) + kwargs["_check_input_type"] = kwargs.get("_check_input_type", True) + kwargs["_check_return_type"] = kwargs.get("_check_return_type", True) + kwargs["_spec_property_naming"] = kwargs.get("_spec_property_naming", False) + kwargs["_content_type"] = kwargs.get("_content_type") + kwargs["_host_index"] = kwargs.get("_host_index") + kwargs["_request_auths"] = kwargs.get("_request_auths", None) + return self.list_endpoint.call_with_http_info(**kwargs) + + def update(self, id, update_webhook_request, **kwargs): + """Update Webhook # noqa: E501 + + Replaces the `url`, `eventTypes` and `enabled` of a webhook. When `enabled` is `true`, MONEI first sends a signed `{\"type\":\"webhook.test\"}` request to `url`. The URL must answer with a 2xx status. Enabling a webhook that was disabled after failed deliveries starts its deliveries again. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.update(id, update_webhook_request, async_req=True) + >>> result = thread.get() + + Args: + id (str): The webhook ID + update_webhook_request (UpdateWebhookRequest): + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + _request_auths (list): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None + async_req (bool): execute request asynchronously + + Returns: + Webhook + If the method is called asynchronously, returns the request + thread. + """ + kwargs["async_req"] = kwargs.get("async_req", False) + kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True) + kwargs["_preload_content"] = kwargs.get("_preload_content", True) + kwargs["_request_timeout"] = kwargs.get("_request_timeout", None) + kwargs["_check_input_type"] = kwargs.get("_check_input_type", True) + kwargs["_check_return_type"] = kwargs.get("_check_return_type", True) + kwargs["_spec_property_naming"] = kwargs.get("_spec_property_naming", False) + kwargs["_content_type"] = kwargs.get("_content_type") + kwargs["_host_index"] = kwargs.get("_host_index") + kwargs["_request_auths"] = kwargs.get("_request_auths", None) + kwargs["id"] = id + kwargs["update_webhook_request"] = update_webhook_request + return self.update_endpoint.call_with_http_info(**kwargs) diff --git a/Monei/apis/__init__.py b/Monei/apis/__init__.py index 610f06f..482aa5a 100644 --- a/Monei/apis/__init__.py +++ b/Monei/apis/__init__.py @@ -26,4 +26,6 @@ from Monei.api.products_api import ProductsApi from Monei.api.subscriptions_api import SubscriptionsApi from Monei.api.tax_rates_api import TaxRatesApi +from Monei.api.ucp_api import UCPApi from Monei.api.verification_of_payee_api import VerificationOfPayeeApi +from Monei.api.webhooks_api import WebhooksApi diff --git a/Monei/configuration.py b/Monei/configuration.py index a7c7879..50f4b7a 100644 --- a/Monei/configuration.py +++ b/Monei/configuration.py @@ -420,6 +420,15 @@ def auth_settings(self): "AccountId", ), } + if "UCPPlatformKey" in self.api_key: + auth["UCPPlatformKey"] = { + "type": "api_key", + "in": "header", + "key": "Authorization", + "value": self.get_api_key_with_prefix( + "UCPPlatformKey", + ), + } return auth def to_debug_report(self): diff --git a/Monei/model/activate_subscription_request.py b/Monei/model/activate_subscription_request.py index 4018bf1..4bc623d 100644 --- a/Monei/model/activate_subscription_request.py +++ b/Monei/model/activate_subscription_request.py @@ -185,7 +185,7 @@ def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 through its discriminator because we passed in _visited_composed_classes = (Animal,) payment_token (bool, date, datetime, dict, float, int, list, str, none_type): A payment token generated by monei.js [Components](https://docs.monei.com/monei-js/overview/) or a paymentToken [saved after a previous successful payment](https://docs.monei.com/guides/save-payment-method/). In case of the first one, you will also need to send the `sessionId` used to generate the token in the first place. . [optional] # noqa: E501 - session_id (str): A unique identifier within your system that adds security to the payment process. You need to pass the same session ID as the one used on the frontend to initialize MONEI Component (if you needed to). This is required if a payment token (not permanent) was already generated in the frontend. . [optional] # noqa: E501 + session_id (str): A unique identifier within your system that adds security to the payment process. You need to pass the same session ID as the one used on the frontend to initialize MONEI Component (if you needed to). This is required if a payment token (not permanent) was already generated in the frontend. Values starting with `ucp_` (case-insensitive) are reserved for UCP agent payments. `POST /v1/tokens` rejects these values with HTTP 400. A payment with a reserved session ID requires a UCP agent token bound to that session. . [optional] # noqa: E501 add_amount (bool, date, datetime, dict, float, int, list, str, none_type): The amount to be added to the subscription's initial payment. A positive integer representing how much to charge in the smallest currency unit (e.g., 100 cents to charge 1.00 USD). . [optional] # noqa: E501 allowed_payment_methods (SubscriptionPaymentMethods): [optional] # noqa: E501 sequence_id (str): A permanent identifier that refers to the initial payment of a sequence of payments. This value needs to be sent in the path for `RECURRING` payments. . [optional] # noqa: E501 @@ -284,7 +284,7 @@ def __init__(self, *args, **kwargs): # noqa: E501 through its discriminator because we passed in _visited_composed_classes = (Animal,) payment_token (bool, date, datetime, dict, float, int, list, str, none_type): A payment token generated by monei.js [Components](https://docs.monei.com/monei-js/overview/) or a paymentToken [saved after a previous successful payment](https://docs.monei.com/guides/save-payment-method/). In case of the first one, you will also need to send the `sessionId` used to generate the token in the first place. . [optional] # noqa: E501 - session_id (str): A unique identifier within your system that adds security to the payment process. You need to pass the same session ID as the one used on the frontend to initialize MONEI Component (if you needed to). This is required if a payment token (not permanent) was already generated in the frontend. . [optional] # noqa: E501 + session_id (str): A unique identifier within your system that adds security to the payment process. You need to pass the same session ID as the one used on the frontend to initialize MONEI Component (if you needed to). This is required if a payment token (not permanent) was already generated in the frontend. Values starting with `ucp_` (case-insensitive) are reserved for UCP agent payments. `POST /v1/tokens` rejects these values with HTTP 400. A payment with a reserved session ID requires a UCP agent token bound to that session. . [optional] # noqa: E501 add_amount (bool, date, datetime, dict, float, int, list, str, none_type): The amount to be added to the subscription's initial payment. A positive integer representing how much to charge in the smallest currency unit (e.g., 100 cents to charge 1.00 USD). . [optional] # noqa: E501 allowed_payment_methods (SubscriptionPaymentMethods): [optional] # noqa: E501 sequence_id (str): A permanent identifier that refers to the initial payment of a sequence of payments. This value needs to be sent in the path for `RECURRING` payments. . [optional] # noqa: E501 diff --git a/Monei/model/confirm_payment_request.py b/Monei/model/confirm_payment_request.py index 415218f..2ee2e0a 100644 --- a/Monei/model/confirm_payment_request.py +++ b/Monei/model/confirm_payment_request.py @@ -186,7 +186,7 @@ def _from_openapi_data(cls, payment_token, *args, **kwargs): # noqa: E501 through its discriminator because we passed in _visited_composed_classes = (Animal,) payment_method (ConfirmPaymentRequestPaymentMethod): [optional] # noqa: E501 - generate_payment_token (bool): If set to true a permanent token that represents a payment method used in the payment will be generated. . [optional] if omitted the server will use the default value of False # noqa: E501 + generate_payment_token (bool): If set to true a permanent token that represents a payment method used in the payment will be generated. Omit this field for UCP agent tokens. Setting it to `true` causes error `E232`. . [optional] if omitted the server will use the default value of False # noqa: E501 customer (PaymentCustomer): [optional] # noqa: E501 billing_details (PaymentBillingDetails): [optional] # noqa: E501 shipping_details (PaymentShippingDetails): [optional] # noqa: E501 @@ -287,7 +287,7 @@ def __init__(self, payment_token, *args, **kwargs): # noqa: E501 through its discriminator because we passed in _visited_composed_classes = (Animal,) payment_method (ConfirmPaymentRequestPaymentMethod): [optional] # noqa: E501 - generate_payment_token (bool): If set to true a permanent token that represents a payment method used in the payment will be generated. . [optional] if omitted the server will use the default value of False # noqa: E501 + generate_payment_token (bool): If set to true a permanent token that represents a payment method used in the payment will be generated. Omit this field for UCP agent tokens. Setting it to `true` causes error `E232`. . [optional] if omitted the server will use the default value of False # noqa: E501 customer (PaymentCustomer): [optional] # noqa: E501 billing_details (PaymentBillingDetails): [optional] # noqa: E501 shipping_details (PaymentShippingDetails): [optional] # noqa: E501 diff --git a/Monei/model/create_payment_request.py b/Monei/model/create_payment_request.py index bf9a382..d1aaff9 100644 --- a/Monei/model/create_payment_request.py +++ b/Monei/model/create_payment_request.py @@ -235,9 +235,9 @@ def _from_openapi_data( complete_url (str): The URL the customer will be directed to after transaction completed (successful or failed - except if `failUrl` is provided). . [optional] # noqa: E501 fail_url (str): The URL the customer will be directed to after transaction has failed, instead of `completeUrl` (used in hosted payment page). This allows to provide two different URLs for successful and failed payments. . [optional] # noqa: E501 cancel_url (str): The URL the customer will be directed to if they decide to cancel payment and return to your website (used in hosted payment page). . [optional] # noqa: E501 - payment_token (bool, date, datetime, dict, float, int, list, str, none_type): A payment token generated by monei.js [Components](https://docs.monei.com/monei-js/overview/) or a paymentToken [saved after a previous successful payment](https://docs.monei.com/guides/save-payment-method/). In case of the first one, you will also need to send the `sessionId` used to generate the token in the first place. . [optional] # noqa: E501 - session_id (str): A unique identifier within your system that adds security to the payment process. You need to pass the same session ID as the one used on the frontend to initialize MONEI Component (if you needed to). This is required if a payment token (not permanent) was already generated in the frontend. . [optional] # noqa: E501 - generate_payment_token (bool): If set to true a permanent token that represents a payment method used in the payment will be generated. . [optional] if omitted the server will use the default value of False # noqa: E501 + payment_token (bool, date, datetime, dict, float, int, list, str, none_type): A payment token generated by monei.js [Components](https://docs.monei.com/monei-js/overview/) or a paymentToken [saved after a previous successful payment](https://docs.monei.com/guides/save-payment-method/). In case of the first one, you will also need to send the `sessionId` used to generate the token in the first place. For a UCP agent token, pass the `sessionId` derived from the checkout binding. . [optional] # noqa: E501 + session_id (str): A unique identifier within your system that adds security to the payment process. You need to pass the same session ID as the one used on the frontend to initialize MONEI Component (if you needed to). This is required if a payment token (not permanent) was already generated in the frontend. Values starting with `ucp_` (case-insensitive) are reserved for UCP agent payments. `POST /v1/tokens` rejects these values with HTTP 400. A payment with a reserved session ID requires a UCP agent token bound to that session. . [optional] # noqa: E501 + generate_payment_token (bool): If set to true a permanent token that represents a payment method used in the payment will be generated. Omit this field for UCP agent tokens. Setting it to `true` causes error `E232`. . [optional] if omitted the server will use the default value of False # noqa: E501 payment_method (PaymentPaymentMethodInput): [optional] # noqa: E501 allowed_payment_methods (PaymentPaymentMethods): [optional] # noqa: E501 transaction_type (PaymentTransactionType): [optional] # noqa: E501 @@ -357,9 +357,9 @@ def __init__(self, amount, currency, order_id, *args, **kwargs): # noqa: E501 complete_url (str): The URL the customer will be directed to after transaction completed (successful or failed - except if `failUrl` is provided). . [optional] # noqa: E501 fail_url (str): The URL the customer will be directed to after transaction has failed, instead of `completeUrl` (used in hosted payment page). This allows to provide two different URLs for successful and failed payments. . [optional] # noqa: E501 cancel_url (str): The URL the customer will be directed to if they decide to cancel payment and return to your website (used in hosted payment page). . [optional] # noqa: E501 - payment_token (bool, date, datetime, dict, float, int, list, str, none_type): A payment token generated by monei.js [Components](https://docs.monei.com/monei-js/overview/) or a paymentToken [saved after a previous successful payment](https://docs.monei.com/guides/save-payment-method/). In case of the first one, you will also need to send the `sessionId` used to generate the token in the first place. . [optional] # noqa: E501 - session_id (str): A unique identifier within your system that adds security to the payment process. You need to pass the same session ID as the one used on the frontend to initialize MONEI Component (if you needed to). This is required if a payment token (not permanent) was already generated in the frontend. . [optional] # noqa: E501 - generate_payment_token (bool): If set to true a permanent token that represents a payment method used in the payment will be generated. . [optional] if omitted the server will use the default value of False # noqa: E501 + payment_token (bool, date, datetime, dict, float, int, list, str, none_type): A payment token generated by monei.js [Components](https://docs.monei.com/monei-js/overview/) or a paymentToken [saved after a previous successful payment](https://docs.monei.com/guides/save-payment-method/). In case of the first one, you will also need to send the `sessionId` used to generate the token in the first place. For a UCP agent token, pass the `sessionId` derived from the checkout binding. . [optional] # noqa: E501 + session_id (str): A unique identifier within your system that adds security to the payment process. You need to pass the same session ID as the one used on the frontend to initialize MONEI Component (if you needed to). This is required if a payment token (not permanent) was already generated in the frontend. Values starting with `ucp_` (case-insensitive) are reserved for UCP agent payments. `POST /v1/tokens` rejects these values with HTTP 400. A payment with a reserved session ID requires a UCP agent token bound to that session. . [optional] # noqa: E501 + generate_payment_token (bool): If set to true a permanent token that represents a payment method used in the payment will be generated. Omit this field for UCP agent tokens. Setting it to `true` causes error `E232`. . [optional] if omitted the server will use the default value of False # noqa: E501 payment_method (PaymentPaymentMethodInput): [optional] # noqa: E501 allowed_payment_methods (PaymentPaymentMethods): [optional] # noqa: E501 transaction_type (PaymentTransactionType): [optional] # noqa: E501 diff --git a/Monei/model/create_webhook_request.py b/Monei/model/create_webhook_request.py new file mode 100644 index 0000000..cb10df7 --- /dev/null +++ b/Monei/model/create_webhook_request.py @@ -0,0 +1,301 @@ +""" +MONEI API v1 + +The MONEI API is organized around REST principles. Our API is designed to be intuitive and developer-friendly. ### Base URL All API requests should be made to: ``` https://api.monei.com/v1 ``` ### Environment MONEI provides two environments: - **Test Environment**: For development and testing without processing real payments - **Live Environment**: For processing real transactions in production ### Client Libraries We provide official SDKs to simplify integration: - [PHP SDK](https://github.com/MONEI/monei-php-sdk) - [Python SDK](https://github.com/MONEI/monei-python-sdk) - [Node.js SDK](https://github.com/MONEI/monei-node-sdk) - [Postman Collection](https://postman.monei.com/) Our SDKs handle authentication, error handling, and request formatting automatically. You can download the OpenAPI specification from the https://js.monei.com/api/v1/openapi.json and generate your own client library using the [OpenAPI Generator](https://openapi-generator.tech/). ### Important Requirements - All API requests must be made over HTTPS - If you are not using our official SDKs, you **must provide a valid `User-Agent` header** with each request - Requests without proper authentication will return a `401 Unauthorized` error ### Error Handling The API returns consistent error codes and messages to help you troubleshoot issues. Each response includes a `statusCode` attribute indicating the outcome of your request. ### Rate Limits The API implements rate limiting to ensure stability. If you exceed the limits, requests will return a `429 Too Many Requests` status code. # noqa: E501 + +The version of the OpenAPI document: 1.13.0 +Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import sys # noqa: F401 + +from Monei.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel, +) +from Monei.exceptions import ApiAttributeError + + +def lazy_import(): + from Monei.model.webhook_event_types import WebhookEventTypes + + globals()["WebhookEventTypes"] = WebhookEventTypes + + +class CreateWebhookRequest(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = {} + + validations = {} + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + "url": (str,), # noqa: E501 + "event_types": (WebhookEventTypes,), # noqa: E501 + "enabled": (bool,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + attribute_map = { + "url": "url", # noqa: E501 + "event_types": "eventTypes", # noqa: E501 + "enabled": "enabled", # noqa: E501 + } + + read_only_vars = {} + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, url, event_types, *args, **kwargs): # noqa: E501 + """CreateWebhookRequest - a model defined in OpenAPI + + Args: + url (str): The URL MONEI sends the events to. An API key made for a shop plugin accepts only an `https` URL on the shop's host. + event_types (WebhookEventTypes): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + enabled (bool): Whether MONEI sends events to the webhook.. [optional] if omitted the server will use the default value of True # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", True) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.url = url + self.event_types = event_types + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set( + [ + "_data_store", + "_check_type", + "_spec_property_naming", + "_path_to_item", + "_configuration", + "_visited_composed_classes", + ] + ) + + @convert_js_args_to_python_args + def __init__(self, url, event_types, *args, **kwargs): # noqa: E501 + """CreateWebhookRequest - a model defined in OpenAPI + + Args: + url (str): The URL MONEI sends the events to. An API key made for a shop plugin accepts only an `https` URL on the shop's host. + event_types (WebhookEventTypes): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + enabled (bool): Whether MONEI sends events to the webhook.. [optional] if omitted the server will use the default value of True # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.url = url + self.event_types = event_types + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/Monei/model/created_webhook.py b/Monei/model/created_webhook.py new file mode 100644 index 0000000..e45df0c --- /dev/null +++ b/Monei/model/created_webhook.py @@ -0,0 +1,364 @@ +""" +MONEI API v1 + +The MONEI API is organized around REST principles. Our API is designed to be intuitive and developer-friendly. ### Base URL All API requests should be made to: ``` https://api.monei.com/v1 ``` ### Environment MONEI provides two environments: - **Test Environment**: For development and testing without processing real payments - **Live Environment**: For processing real transactions in production ### Client Libraries We provide official SDKs to simplify integration: - [PHP SDK](https://github.com/MONEI/monei-php-sdk) - [Python SDK](https://github.com/MONEI/monei-python-sdk) - [Node.js SDK](https://github.com/MONEI/monei-node-sdk) - [Postman Collection](https://postman.monei.com/) Our SDKs handle authentication, error handling, and request formatting automatically. You can download the OpenAPI specification from the https://js.monei.com/api/v1/openapi.json and generate your own client library using the [OpenAPI Generator](https://openapi-generator.tech/). ### Important Requirements - All API requests must be made over HTTPS - If you are not using our official SDKs, you **must provide a valid `User-Agent` header** with each request - Requests without proper authentication will return a `401 Unauthorized` error ### Error Handling The API returns consistent error codes and messages to help you troubleshoot issues. Each response includes a `statusCode` attribute indicating the outcome of your request. ### Rate Limits The API implements rate limiting to ensure stability. If you exceed the limits, requests will return a `429 Too Many Requests` status code. # noqa: E501 + +The version of the OpenAPI document: 1.13.0 +Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import sys # noqa: F401 + +from Monei.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel, +) +from Monei.exceptions import ApiAttributeError + + +def lazy_import(): + from Monei.model.created_webhook_all_of import CreatedWebhookAllOf + from Monei.model.webhook import Webhook + from Monei.model.webhook_event_types import WebhookEventTypes + + globals()["CreatedWebhookAllOf"] = CreatedWebhookAllOf + globals()["Webhook"] = Webhook + globals()["WebhookEventTypes"] = WebhookEventTypes + + +class CreatedWebhook(ModelComposed): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = {} + + validations = {} + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + "id": (str,), # noqa: E501 + "url": (str,), # noqa: E501 + "event_types": (WebhookEventTypes,), # noqa: E501 + "enabled": (bool,), # noqa: E501 + "created_at": (int,), # noqa: E501 + "signing_secret": (str,), # noqa: E501 + "failing_since": (int,), # noqa: E501 + "updated_at": (int,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + attribute_map = { + "id": "id", # noqa: E501 + "url": "url", # noqa: E501 + "event_types": "eventTypes", # noqa: E501 + "enabled": "enabled", # noqa: E501 + "created_at": "createdAt", # noqa: E501 + "signing_secret": "signingSecret", # noqa: E501 + "failing_since": "failingSince", # noqa: E501 + "updated_at": "updatedAt", # noqa: E501 + } + + read_only_vars = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """CreatedWebhook - a model defined in OpenAPI + + Keyword Args: + id (str): Unique identifier for the webhook. + url (str): The URL MONEI sends the events to. An API key made for a shop plugin accepts only an `https` URL on the shop's host. + event_types (WebhookEventTypes): + enabled (bool): Whether MONEI sends events to the webhook. + created_at (int): Time at which the resource was created. Measured in seconds since the Unix epoch. + signing_secret (str): The secret of the `v2` part of the `MONEI-Signature` header of each delivery. Store it now: no other response returns it. + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + failing_since (int): Start of the current run of failed deliveries, in seconds since the Unix epoch. Absent while deliveries succeed. A webhook that keeps failing is disabled. . [optional] # noqa: E501 + updated_at (int): Time at which the resource updated last time. Measured in seconds since the Unix epoch.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + constant_args = { + "_check_type": _check_type, + "_path_to_item": _path_to_item, + "_spec_property_naming": _spec_property_naming, + "_configuration": _configuration, + "_visited_composed_classes": self._visited_composed_classes, + } + composed_info = validate_get_composed_info(constant_args, kwargs, self) + self._composed_instances = composed_info[0] + self._var_name_to_model_instances = composed_info[1] + self._additional_properties_model_instances = composed_info[2] + discarded_args = composed_info[3] + + for var_name, var_value in kwargs.items(): + if ( + var_name in discarded_args + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self._additional_properties_model_instances + ): + # discard variable. + continue + setattr(self, var_name, var_value) + + return self + + required_properties = set( + [ + "_data_store", + "_check_type", + "_spec_property_naming", + "_path_to_item", + "_configuration", + "_visited_composed_classes", + "_composed_instances", + "_var_name_to_model_instances", + "_additional_properties_model_instances", + ] + ) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """CreatedWebhook - a model defined in OpenAPI + + Keyword Args: + id (str): Unique identifier for the webhook. + url (str): The URL MONEI sends the events to. An API key made for a shop plugin accepts only an `https` URL on the shop's host. + event_types (WebhookEventTypes): + enabled (bool): Whether MONEI sends events to the webhook. + created_at (int): Time at which the resource was created. Measured in seconds since the Unix epoch. + signing_secret (str): The secret of the `v2` part of the `MONEI-Signature` header of each delivery. Store it now: no other response returns it. + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + failing_since (int): Start of the current run of failed deliveries, in seconds since the Unix epoch. Absent while deliveries succeed. A webhook that keeps failing is disabled. . [optional] # noqa: E501 + updated_at (int): Time at which the resource updated last time. Measured in seconds since the Unix epoch.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + constant_args = { + "_check_type": _check_type, + "_path_to_item": _path_to_item, + "_spec_property_naming": _spec_property_naming, + "_configuration": _configuration, + "_visited_composed_classes": self._visited_composed_classes, + } + composed_info = validate_get_composed_info(constant_args, kwargs, self) + self._composed_instances = composed_info[0] + self._var_name_to_model_instances = composed_info[1] + self._additional_properties_model_instances = composed_info[2] + discarded_args = composed_info[3] + + for var_name, var_value in kwargs.items(): + if ( + var_name in discarded_args + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self._additional_properties_model_instances + ): + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) + + @cached_property + def _composed_schemas(): + # we need this here to make our import statements work + # we must store _composed_schemas in here so the code is only run + # when we invoke this method. If we kept this at the class + # level we would get an error because the class level + # code would be run when this module is imported, and these composed + # classes don't exist yet because their module has not finished + # loading + lazy_import() + return { + "anyOf": [], + "allOf": [ + CreatedWebhookAllOf, + Webhook, + ], + "oneOf": [], + } diff --git a/Monei/model/created_webhook_all_of.py b/Monei/model/created_webhook_all_of.py new file mode 100644 index 0000000..16e8e22 --- /dev/null +++ b/Monei/model/created_webhook_all_of.py @@ -0,0 +1,283 @@ +""" +MONEI API v1 + +The MONEI API is organized around REST principles. Our API is designed to be intuitive and developer-friendly. ### Base URL All API requests should be made to: ``` https://api.monei.com/v1 ``` ### Environment MONEI provides two environments: - **Test Environment**: For development and testing without processing real payments - **Live Environment**: For processing real transactions in production ### Client Libraries We provide official SDKs to simplify integration: - [PHP SDK](https://github.com/MONEI/monei-php-sdk) - [Python SDK](https://github.com/MONEI/monei-python-sdk) - [Node.js SDK](https://github.com/MONEI/monei-node-sdk) - [Postman Collection](https://postman.monei.com/) Our SDKs handle authentication, error handling, and request formatting automatically. You can download the OpenAPI specification from the https://js.monei.com/api/v1/openapi.json and generate your own client library using the [OpenAPI Generator](https://openapi-generator.tech/). ### Important Requirements - All API requests must be made over HTTPS - If you are not using our official SDKs, you **must provide a valid `User-Agent` header** with each request - Requests without proper authentication will return a `401 Unauthorized` error ### Error Handling The API returns consistent error codes and messages to help you troubleshoot issues. Each response includes a `statusCode` attribute indicating the outcome of your request. ### Rate Limits The API implements rate limiting to ensure stability. If you exceed the limits, requests will return a `429 Too Many Requests` status code. # noqa: E501 + +The version of the OpenAPI document: 1.13.0 +Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import sys # noqa: F401 + +from Monei.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel, +) +from Monei.exceptions import ApiAttributeError + + +class CreatedWebhookAllOf(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = {} + + validations = {} + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + "signing_secret": (str,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + attribute_map = { + "signing_secret": "signingSecret", # noqa: E501 + } + + read_only_vars = {} + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, signing_secret, *args, **kwargs): # noqa: E501 + """CreatedWebhookAllOf - a model defined in OpenAPI + + Args: + signing_secret (str): The secret of the `v2` part of the `MONEI-Signature` header of each delivery. Store it now: no other response returns it. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", True) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.signing_secret = signing_secret + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set( + [ + "_data_store", + "_check_type", + "_spec_property_naming", + "_path_to_item", + "_configuration", + "_visited_composed_classes", + ] + ) + + @convert_js_args_to_python_args + def __init__(self, signing_secret, *args, **kwargs): # noqa: E501 + """CreatedWebhookAllOf - a model defined in OpenAPI + + Args: + signing_secret (str): The secret of the `v2` part of the `MONEI-Signature` header of each delivery. Store it now: no other response returns it. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.signing_secret = signing_secret + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/Monei/model/deleted_webhook.py b/Monei/model/deleted_webhook.py new file mode 100644 index 0000000..4c62810 --- /dev/null +++ b/Monei/model/deleted_webhook.py @@ -0,0 +1,283 @@ +""" +MONEI API v1 + +The MONEI API is organized around REST principles. Our API is designed to be intuitive and developer-friendly. ### Base URL All API requests should be made to: ``` https://api.monei.com/v1 ``` ### Environment MONEI provides two environments: - **Test Environment**: For development and testing without processing real payments - **Live Environment**: For processing real transactions in production ### Client Libraries We provide official SDKs to simplify integration: - [PHP SDK](https://github.com/MONEI/monei-php-sdk) - [Python SDK](https://github.com/MONEI/monei-python-sdk) - [Node.js SDK](https://github.com/MONEI/monei-node-sdk) - [Postman Collection](https://postman.monei.com/) Our SDKs handle authentication, error handling, and request formatting automatically. You can download the OpenAPI specification from the https://js.monei.com/api/v1/openapi.json and generate your own client library using the [OpenAPI Generator](https://openapi-generator.tech/). ### Important Requirements - All API requests must be made over HTTPS - If you are not using our official SDKs, you **must provide a valid `User-Agent` header** with each request - Requests without proper authentication will return a `401 Unauthorized` error ### Error Handling The API returns consistent error codes and messages to help you troubleshoot issues. Each response includes a `statusCode` attribute indicating the outcome of your request. ### Rate Limits The API implements rate limiting to ensure stability. If you exceed the limits, requests will return a `429 Too Many Requests` status code. # noqa: E501 + +The version of the OpenAPI document: 1.13.0 +Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import sys # noqa: F401 + +from Monei.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel, +) +from Monei.exceptions import ApiAttributeError + + +class DeletedWebhook(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = {} + + validations = {} + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + "success": (bool,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + attribute_map = { + "success": "success", # noqa: E501 + } + + read_only_vars = {} + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, success, *args, **kwargs): # noqa: E501 + """DeletedWebhook - a model defined in OpenAPI + + Args: + success (bool): Always `true`. The request failed otherwise. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", True) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.success = success + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set( + [ + "_data_store", + "_check_type", + "_spec_property_naming", + "_path_to_item", + "_configuration", + "_visited_composed_classes", + ] + ) + + @convert_js_args_to_python_args + def __init__(self, success, *args, **kwargs): # noqa: E501 + """DeletedWebhook - a model defined in OpenAPI + + Args: + success (bool): Always `true`. The request failed otherwise. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.success = success + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/Monei/model/tokenize_ucp_request.py b/Monei/model/tokenize_ucp_request.py new file mode 100644 index 0000000..9702529 --- /dev/null +++ b/Monei/model/tokenize_ucp_request.py @@ -0,0 +1,327 @@ +""" +MONEI API v1 + +The MONEI API is organized around REST principles. Our API is designed to be intuitive and developer-friendly. ### Base URL All API requests should be made to: ``` https://api.monei.com/v1 ``` ### Environment MONEI provides two environments: - **Test Environment**: For development and testing without processing real payments - **Live Environment**: For processing real transactions in production ### Client Libraries We provide official SDKs to simplify integration: - [PHP SDK](https://github.com/MONEI/monei-php-sdk) - [Python SDK](https://github.com/MONEI/monei-python-sdk) - [Node.js SDK](https://github.com/MONEI/monei-node-sdk) - [Postman Collection](https://postman.monei.com/) Our SDKs handle authentication, error handling, and request formatting automatically. You can download the OpenAPI specification from the https://js.monei.com/api/v1/openapi.json and generate your own client library using the [OpenAPI Generator](https://openapi-generator.tech/). ### Important Requirements - All API requests must be made over HTTPS - If you are not using our official SDKs, you **must provide a valid `User-Agent` header** with each request - Requests without proper authentication will return a `401 Unauthorized` error ### Error Handling The API returns consistent error codes and messages to help you troubleshoot issues. Each response includes a `statusCode` attribute indicating the outcome of your request. ### Rate Limits The API implements rate limiting to ensure stability. If you exceed the limits, requests will return a `429 Too Many Requests` status code. # noqa: E501 + +The version of the OpenAPI document: 1.13.0 +Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import sys # noqa: F401 + +from Monei.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel, +) +from Monei.exceptions import ApiAttributeError + + +def lazy_import(): + from Monei.model.tokenize_ucp_request_binding import TokenizeUcpRequestBinding + from Monei.model.tokenize_ucp_request_credential import TokenizeUcpRequestCredential + from Monei.model.tokenize_ucp_request_identity import TokenizeUcpRequestIdentity + from Monei.model.tokenize_ucp_request_signals import TokenizeUcpRequestSignals + from Monei.model.tokenize_ucp_request_usage_limits import ( + TokenizeUcpRequestUsageLimits, + ) + + globals()["TokenizeUcpRequestBinding"] = TokenizeUcpRequestBinding + globals()["TokenizeUcpRequestCredential"] = TokenizeUcpRequestCredential + globals()["TokenizeUcpRequestIdentity"] = TokenizeUcpRequestIdentity + globals()["TokenizeUcpRequestSignals"] = TokenizeUcpRequestSignals + globals()["TokenizeUcpRequestUsageLimits"] = TokenizeUcpRequestUsageLimits + + +class TokenizeUcpRequest(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = {} + + validations = {} + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + "credential": (TokenizeUcpRequestCredential,), # noqa: E501 + "binding": (TokenizeUcpRequestBinding,), # noqa: E501 + "identity": (TokenizeUcpRequestIdentity,), # noqa: E501 + "usage_limits": (TokenizeUcpRequestUsageLimits,), # noqa: E501 + "signals": (TokenizeUcpRequestSignals,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + attribute_map = { + "credential": "credential", # noqa: E501 + "binding": "binding", # noqa: E501 + "identity": "identity", # noqa: E501 + "usage_limits": "usage_limits", # noqa: E501 + "signals": "signals", # noqa: E501 + } + + read_only_vars = {} + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data( + cls, credential, binding, identity, usage_limits, *args, **kwargs + ): # noqa: E501 + """TokenizeUcpRequest - a model defined in OpenAPI + + Args: + credential (TokenizeUcpRequestCredential): + binding (TokenizeUcpRequestBinding): + identity (TokenizeUcpRequestIdentity): + usage_limits (TokenizeUcpRequestUsageLimits): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + signals (TokenizeUcpRequestSignals): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", True) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.credential = credential + self.binding = binding + self.identity = identity + self.usage_limits = usage_limits + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set( + [ + "_data_store", + "_check_type", + "_spec_property_naming", + "_path_to_item", + "_configuration", + "_visited_composed_classes", + ] + ) + + @convert_js_args_to_python_args + def __init__( + self, credential, binding, identity, usage_limits, *args, **kwargs + ): # noqa: E501 + """TokenizeUcpRequest - a model defined in OpenAPI + + Args: + credential (TokenizeUcpRequestCredential): + binding (TokenizeUcpRequestBinding): + identity (TokenizeUcpRequestIdentity): + usage_limits (TokenizeUcpRequestUsageLimits): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + signals (TokenizeUcpRequestSignals): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.credential = credential + self.binding = binding + self.identity = identity + self.usage_limits = usage_limits + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/Monei/model/tokenize_ucp_request_binding.py b/Monei/model/tokenize_ucp_request_binding.py new file mode 100644 index 0000000..15e37f7 --- /dev/null +++ b/Monei/model/tokenize_ucp_request_binding.py @@ -0,0 +1,299 @@ +""" +MONEI API v1 + +The MONEI API is organized around REST principles. Our API is designed to be intuitive and developer-friendly. ### Base URL All API requests should be made to: ``` https://api.monei.com/v1 ``` ### Environment MONEI provides two environments: - **Test Environment**: For development and testing without processing real payments - **Live Environment**: For processing real transactions in production ### Client Libraries We provide official SDKs to simplify integration: - [PHP SDK](https://github.com/MONEI/monei-php-sdk) - [Python SDK](https://github.com/MONEI/monei-python-sdk) - [Node.js SDK](https://github.com/MONEI/monei-node-sdk) - [Postman Collection](https://postman.monei.com/) Our SDKs handle authentication, error handling, and request formatting automatically. You can download the OpenAPI specification from the https://js.monei.com/api/v1/openapi.json and generate your own client library using the [OpenAPI Generator](https://openapi-generator.tech/). ### Important Requirements - All API requests must be made over HTTPS - If you are not using our official SDKs, you **must provide a valid `User-Agent` header** with each request - Requests without proper authentication will return a `401 Unauthorized` error ### Error Handling The API returns consistent error codes and messages to help you troubleshoot issues. Each response includes a `statusCode` attribute indicating the outcome of your request. ### Rate Limits The API implements rate limiting to ensure stability. If you exceed the limits, requests will return a `429 Too Many Requests` status code. # noqa: E501 + +The version of the OpenAPI document: 1.13.0 +Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import sys # noqa: F401 + +from Monei.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel, +) +from Monei.exceptions import ApiAttributeError + + +class TokenizeUcpRequestBinding(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = {} + + validations = { + ("type",): { + "regex": { + "pattern": r"^[a-z](?:[a-z0-9-]*[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9_-]*[a-z0-9_])?)+$", # noqa: E501 + }, + }, + ("id",): { + "max_length": 255, + "min_length": 1, + }, + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + "type": (str,), # noqa: E501 + "id": (str,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + attribute_map = { + "type": "type", # noqa: E501 + "id": "id", # noqa: E501 + } + + read_only_vars = {} + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, type, id, *args, **kwargs): # noqa: E501 + """TokenizeUcpRequestBinding - a model defined in OpenAPI + + Args: + type (str): A reverse-DNS binding type. Unknown types that match this format are accepted. + id (str): The opaque checkout identifier. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", True) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.type = type + self.id = id + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set( + [ + "_data_store", + "_check_type", + "_spec_property_naming", + "_path_to_item", + "_configuration", + "_visited_composed_classes", + ] + ) + + @convert_js_args_to_python_args + def __init__(self, type, id, *args, **kwargs): # noqa: E501 + """TokenizeUcpRequestBinding - a model defined in OpenAPI + + Args: + type (str): A reverse-DNS binding type. Unknown types that match this format are accepted. + id (str): The opaque checkout identifier. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.type = type + self.id = id + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/Monei/model/tokenize_ucp_request_credential.py b/Monei/model/tokenize_ucp_request_credential.py new file mode 100644 index 0000000..5eae175 --- /dev/null +++ b/Monei/model/tokenize_ucp_request_credential.py @@ -0,0 +1,340 @@ +""" +MONEI API v1 + +The MONEI API is organized around REST principles. Our API is designed to be intuitive and developer-friendly. ### Base URL All API requests should be made to: ``` https://api.monei.com/v1 ``` ### Environment MONEI provides two environments: - **Test Environment**: For development and testing without processing real payments - **Live Environment**: For processing real transactions in production ### Client Libraries We provide official SDKs to simplify integration: - [PHP SDK](https://github.com/MONEI/monei-php-sdk) - [Python SDK](https://github.com/MONEI/monei-python-sdk) - [Node.js SDK](https://github.com/MONEI/monei-node-sdk) - [Postman Collection](https://postman.monei.com/) Our SDKs handle authentication, error handling, and request formatting automatically. You can download the OpenAPI specification from the https://js.monei.com/api/v1/openapi.json and generate your own client library using the [OpenAPI Generator](https://openapi-generator.tech/). ### Important Requirements - All API requests must be made over HTTPS - If you are not using our official SDKs, you **must provide a valid `User-Agent` header** with each request - Requests without proper authentication will return a `401 Unauthorized` error ### Error Handling The API returns consistent error codes and messages to help you troubleshoot issues. Each response includes a `statusCode` attribute indicating the outcome of your request. ### Rate Limits The API implements rate limiting to ensure stability. If you exceed the limits, requests will return a `429 Too Many Requests` status code. # noqa: E501 + +The version of the OpenAPI document: 1.13.0 +Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import sys # noqa: F401 + +from Monei.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel, +) +from Monei.exceptions import ApiAttributeError + + +class TokenizeUcpRequestCredential(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ("type",): { + "PAN": "pan", + }, + } + + validations = { + ("number",): { + "regex": { + "pattern": r"^[0-9]{13,19}$", # noqa: E501 + }, + }, + ("expiry_month",): { + "inclusive_maximum": 12, + "inclusive_minimum": 1, + }, + ("expiry_year",): { + "inclusive_maximum": 2099, + "inclusive_minimum": 2000, + }, + ("cvc",): { + "regex": { + "pattern": r"^[0-9]{3,5}$", # noqa: E501 + }, + }, + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + "type": (str,), # noqa: E501 + "number": (str,), # noqa: E501 + "expiry_month": (int,), # noqa: E501 + "expiry_year": (int,), # noqa: E501 + "cvc": (str,), # noqa: E501 + "name": (str,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + attribute_map = { + "type": "type", # noqa: E501 + "number": "number", # noqa: E501 + "expiry_month": "expiry_month", # noqa: E501 + "expiry_year": "expiry_year", # noqa: E501 + "cvc": "cvc", # noqa: E501 + "name": "name", # noqa: E501 + } + + read_only_vars = {} + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data( + cls, number, expiry_month, expiry_year, cvc, *args, **kwargs + ): # noqa: E501 + """TokenizeUcpRequestCredential - a model defined in OpenAPI + + Args: + number (str): The card number. It must pass the Luhn check. + expiry_month (int): + expiry_year (int): + cvc (str): The card security code. + + Keyword Args: + type (str): defaults to "pan", must be one of ["pan", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + name (str): The cardholder's name, as stated in the credit card.. [optional] # noqa: E501 + """ + + type = kwargs.get("type", "pan") + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", True) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.type = type + self.number = number + self.expiry_month = expiry_month + self.expiry_year = expiry_year + self.cvc = cvc + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set( + [ + "_data_store", + "_check_type", + "_spec_property_naming", + "_path_to_item", + "_configuration", + "_visited_composed_classes", + ] + ) + + @convert_js_args_to_python_args + def __init__( + self, number, expiry_month, expiry_year, cvc, *args, **kwargs + ): # noqa: E501 + """TokenizeUcpRequestCredential - a model defined in OpenAPI + + Args: + number (str): The card number. It must pass the Luhn check. + expiry_month (int): + expiry_year (int): + cvc (str): The card security code. + + Keyword Args: + type (str): defaults to "pan", must be one of ["pan", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + name (str): The cardholder's name, as stated in the credit card.. [optional] # noqa: E501 + """ + + type = kwargs.get("type", "pan") + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.type = type + self.number = number + self.expiry_month = expiry_month + self.expiry_year = expiry_year + self.cvc = cvc + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/Monei/model/tokenize_ucp_request_identity.py b/Monei/model/tokenize_ucp_request_identity.py new file mode 100644 index 0000000..16a52a7 --- /dev/null +++ b/Monei/model/tokenize_ucp_request_identity.py @@ -0,0 +1,293 @@ +""" +MONEI API v1 + +The MONEI API is organized around REST principles. Our API is designed to be intuitive and developer-friendly. ### Base URL All API requests should be made to: ``` https://api.monei.com/v1 ``` ### Environment MONEI provides two environments: - **Test Environment**: For development and testing without processing real payments - **Live Environment**: For processing real transactions in production ### Client Libraries We provide official SDKs to simplify integration: - [PHP SDK](https://github.com/MONEI/monei-php-sdk) - [Python SDK](https://github.com/MONEI/monei-python-sdk) - [Node.js SDK](https://github.com/MONEI/monei-node-sdk) - [Postman Collection](https://postman.monei.com/) Our SDKs handle authentication, error handling, and request formatting automatically. You can download the OpenAPI specification from the https://js.monei.com/api/v1/openapi.json and generate your own client library using the [OpenAPI Generator](https://openapi-generator.tech/). ### Important Requirements - All API requests must be made over HTTPS - If you are not using our official SDKs, you **must provide a valid `User-Agent` header** with each request - Requests without proper authentication will return a `401 Unauthorized` error ### Error Handling The API returns consistent error codes and messages to help you troubleshoot issues. Each response includes a `statusCode` attribute indicating the outcome of your request. ### Rate Limits The API implements rate limiting to ensure stability. If you exceed the limits, requests will return a `429 Too Many Requests` status code. # noqa: E501 + +The version of the OpenAPI document: 1.13.0 +Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import sys # noqa: F401 + +from Monei.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel, +) +from Monei.exceptions import ApiAttributeError + + +class TokenizeUcpRequestIdentity(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = {} + + validations = {} + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + "access_token": ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + attribute_map = { + "access_token": "access_token", # noqa: E501 + } + + read_only_vars = {} + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, access_token, *args, **kwargs): # noqa: E501 + """TokenizeUcpRequestIdentity - a model defined in OpenAPI + + Args: + access_token (bool, date, datetime, dict, float, int, list, str, none_type): The merchant's MONEI account ID. The merchant must be in the same mode as the caller. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", True) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.access_token = access_token + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set( + [ + "_data_store", + "_check_type", + "_spec_property_naming", + "_path_to_item", + "_configuration", + "_visited_composed_classes", + ] + ) + + @convert_js_args_to_python_args + def __init__(self, access_token, *args, **kwargs): # noqa: E501 + """TokenizeUcpRequestIdentity - a model defined in OpenAPI + + Args: + access_token (bool, date, datetime, dict, float, int, list, str, none_type): The merchant's MONEI account ID. The merchant must be in the same mode as the caller. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.access_token = access_token + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/Monei/model/tokenize_ucp_request_signals.py b/Monei/model/tokenize_ucp_request_signals.py new file mode 100644 index 0000000..256f452 --- /dev/null +++ b/Monei/model/tokenize_ucp_request_signals.py @@ -0,0 +1,281 @@ +""" +MONEI API v1 + +The MONEI API is organized around REST principles. Our API is designed to be intuitive and developer-friendly. ### Base URL All API requests should be made to: ``` https://api.monei.com/v1 ``` ### Environment MONEI provides two environments: - **Test Environment**: For development and testing without processing real payments - **Live Environment**: For processing real transactions in production ### Client Libraries We provide official SDKs to simplify integration: - [PHP SDK](https://github.com/MONEI/monei-php-sdk) - [Python SDK](https://github.com/MONEI/monei-python-sdk) - [Node.js SDK](https://github.com/MONEI/monei-node-sdk) - [Postman Collection](https://postman.monei.com/) Our SDKs handle authentication, error handling, and request formatting automatically. You can download the OpenAPI specification from the https://js.monei.com/api/v1/openapi.json and generate your own client library using the [OpenAPI Generator](https://openapi-generator.tech/). ### Important Requirements - All API requests must be made over HTTPS - If you are not using our official SDKs, you **must provide a valid `User-Agent` header** with each request - Requests without proper authentication will return a `401 Unauthorized` error ### Error Handling The API returns consistent error codes and messages to help you troubleshoot issues. Each response includes a `statusCode` attribute indicating the outcome of your request. ### Rate Limits The API implements rate limiting to ensure stability. If you exceed the limits, requests will return a `429 Too Many Requests` status code. # noqa: E501 + +The version of the OpenAPI document: 1.13.0 +Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import sys # noqa: F401 + +from Monei.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel, +) +from Monei.exceptions import ApiAttributeError + + +class TokenizeUcpRequestSignals(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = {} + + validations = {} + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + "dev_ucp_buyer_ip": (str,), # noqa: E501 + "dev_ucp_user_agent": (str,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + attribute_map = { + "dev_ucp_buyer_ip": "dev.ucp.buyer_ip", # noqa: E501 + "dev_ucp_user_agent": "dev.ucp.user_agent", # noqa: E501 + } + + read_only_vars = {} + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """TokenizeUcpRequestSignals - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + dev_ucp_buyer_ip (str): The buyer's IP address.. [optional] # noqa: E501 + dev_ucp_user_agent (str): Full user agent string of the browser session.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", True) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set( + [ + "_data_store", + "_check_type", + "_spec_property_naming", + "_path_to_item", + "_configuration", + "_visited_composed_classes", + ] + ) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """TokenizeUcpRequestSignals - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + dev_ucp_buyer_ip (str): The buyer's IP address.. [optional] # noqa: E501 + dev_ucp_user_agent (str): Full user agent string of the browser session.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/Monei/model/tokenize_ucp_request_usage_limits.py b/Monei/model/tokenize_ucp_request_usage_limits.py new file mode 100644 index 0000000..b8a3ccf --- /dev/null +++ b/Monei/model/tokenize_ucp_request_usage_limits.py @@ -0,0 +1,303 @@ +""" +MONEI API v1 + +The MONEI API is organized around REST principles. Our API is designed to be intuitive and developer-friendly. ### Base URL All API requests should be made to: ``` https://api.monei.com/v1 ``` ### Environment MONEI provides two environments: - **Test Environment**: For development and testing without processing real payments - **Live Environment**: For processing real transactions in production ### Client Libraries We provide official SDKs to simplify integration: - [PHP SDK](https://github.com/MONEI/monei-php-sdk) - [Python SDK](https://github.com/MONEI/monei-python-sdk) - [Node.js SDK](https://github.com/MONEI/monei-node-sdk) - [Postman Collection](https://postman.monei.com/) Our SDKs handle authentication, error handling, and request formatting automatically. You can download the OpenAPI specification from the https://js.monei.com/api/v1/openapi.json and generate your own client library using the [OpenAPI Generator](https://openapi-generator.tech/). ### Important Requirements - All API requests must be made over HTTPS - If you are not using our official SDKs, you **must provide a valid `User-Agent` header** with each request - Requests without proper authentication will return a `401 Unauthorized` error ### Error Handling The API returns consistent error codes and messages to help you troubleshoot issues. Each response includes a `statusCode` attribute indicating the outcome of your request. ### Rate Limits The API implements rate limiting to ensure stability. If you exceed the limits, requests will return a `429 Too Many Requests` status code. # noqa: E501 + +The version of the OpenAPI document: 1.13.0 +Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import sys # noqa: F401 + +from Monei.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel, +) +from Monei.exceptions import ApiAttributeError + + +class TokenizeUcpRequestUsageLimits(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = {} + + validations = { + ("max_amount",): { + "inclusive_minimum": 1, + }, + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + "max_amount": (int,), # noqa: E501 + "currency": ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + attribute_map = { + "max_amount": "max_amount", # noqa: E501 + "currency": "currency", # noqa: E501 + } + + read_only_vars = {} + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, max_amount, currency, *args, **kwargs): # noqa: E501 + """TokenizeUcpRequestUsageLimits - a model defined in OpenAPI + + Args: + max_amount (int): The maximum amount the merchant can charge, in the smallest currency unit. + currency (bool, date, datetime, dict, float, int, list, str, none_type): The currency the merchant must use to charge this token. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", True) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.max_amount = max_amount + self.currency = currency + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set( + [ + "_data_store", + "_check_type", + "_spec_property_naming", + "_path_to_item", + "_configuration", + "_visited_composed_classes", + ] + ) + + @convert_js_args_to_python_args + def __init__(self, max_amount, currency, *args, **kwargs): # noqa: E501 + """TokenizeUcpRequestUsageLimits - a model defined in OpenAPI + + Args: + max_amount (int): The maximum amount the merchant can charge, in the smallest currency unit. + currency (bool, date, datetime, dict, float, int, list, str, none_type): The currency the merchant must use to charge this token. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.max_amount = max_amount + self.currency = currency + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/Monei/model/ucp_tokenize200_response.py b/Monei/model/ucp_tokenize200_response.py new file mode 100644 index 0000000..a54e900 --- /dev/null +++ b/Monei/model/ucp_tokenize200_response.py @@ -0,0 +1,295 @@ +""" +MONEI API v1 + +The MONEI API is organized around REST principles. Our API is designed to be intuitive and developer-friendly. ### Base URL All API requests should be made to: ``` https://api.monei.com/v1 ``` ### Environment MONEI provides two environments: - **Test Environment**: For development and testing without processing real payments - **Live Environment**: For processing real transactions in production ### Client Libraries We provide official SDKs to simplify integration: - [PHP SDK](https://github.com/MONEI/monei-php-sdk) - [Python SDK](https://github.com/MONEI/monei-python-sdk) - [Node.js SDK](https://github.com/MONEI/monei-node-sdk) - [Postman Collection](https://postman.monei.com/) Our SDKs handle authentication, error handling, and request formatting automatically. You can download the OpenAPI specification from the https://js.monei.com/api/v1/openapi.json and generate your own client library using the [OpenAPI Generator](https://openapi-generator.tech/). ### Important Requirements - All API requests must be made over HTTPS - If you are not using our official SDKs, you **must provide a valid `User-Agent` header** with each request - Requests without proper authentication will return a `401 Unauthorized` error ### Error Handling The API returns consistent error codes and messages to help you troubleshoot issues. Each response includes a `statusCode` attribute indicating the outcome of your request. ### Rate Limits The API implements rate limiting to ensure stability. If you exceed the limits, requests will return a `429 Too Many Requests` status code. # noqa: E501 + +The version of the OpenAPI document: 1.13.0 +Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import sys # noqa: F401 + +from Monei.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel, +) +from Monei.exceptions import ApiAttributeError + + +class UcpTokenize200Response(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = {} + + validations = { + ("token",): { + "regex": { + "pattern": r"^[0-9a-f]{40}$", # noqa: E501 + }, + }, + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + "token": (str,), # noqa: E501 + "expiry": (datetime,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + attribute_map = { + "token": "token", # noqa: E501 + "expiry": "expiry", # noqa: E501 + } + + read_only_vars = {} + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, token, expiry, *args, **kwargs): # noqa: E501 + """UcpTokenize200Response - a model defined in OpenAPI + + Args: + token (str): A 40-character hexadecimal value for a UCP `monei_payment_token` credential. + expiry (datetime): The token expires 15 minutes after issuance. Platforms must tokenize again before this time. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", True) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.token = token + self.expiry = expiry + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set( + [ + "_data_store", + "_check_type", + "_spec_property_naming", + "_path_to_item", + "_configuration", + "_visited_composed_classes", + ] + ) + + @convert_js_args_to_python_args + def __init__(self, token, expiry, *args, **kwargs): # noqa: E501 + """UcpTokenize200Response - a model defined in OpenAPI + + Args: + token (str): A 40-character hexadecimal value for a UCP `monei_payment_token` credential. + expiry (datetime): The token expires 15 minutes after issuance. Platforms must tokenize again before this time. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.token = token + self.expiry = expiry + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/Monei/model/update_webhook_request.py b/Monei/model/update_webhook_request.py new file mode 100644 index 0000000..bc0ca28 --- /dev/null +++ b/Monei/model/update_webhook_request.py @@ -0,0 +1,305 @@ +""" +MONEI API v1 + +The MONEI API is organized around REST principles. Our API is designed to be intuitive and developer-friendly. ### Base URL All API requests should be made to: ``` https://api.monei.com/v1 ``` ### Environment MONEI provides two environments: - **Test Environment**: For development and testing without processing real payments - **Live Environment**: For processing real transactions in production ### Client Libraries We provide official SDKs to simplify integration: - [PHP SDK](https://github.com/MONEI/monei-php-sdk) - [Python SDK](https://github.com/MONEI/monei-python-sdk) - [Node.js SDK](https://github.com/MONEI/monei-node-sdk) - [Postman Collection](https://postman.monei.com/) Our SDKs handle authentication, error handling, and request formatting automatically. You can download the OpenAPI specification from the https://js.monei.com/api/v1/openapi.json and generate your own client library using the [OpenAPI Generator](https://openapi-generator.tech/). ### Important Requirements - All API requests must be made over HTTPS - If you are not using our official SDKs, you **must provide a valid `User-Agent` header** with each request - Requests without proper authentication will return a `401 Unauthorized` error ### Error Handling The API returns consistent error codes and messages to help you troubleshoot issues. Each response includes a `statusCode` attribute indicating the outcome of your request. ### Rate Limits The API implements rate limiting to ensure stability. If you exceed the limits, requests will return a `429 Too Many Requests` status code. # noqa: E501 + +The version of the OpenAPI document: 1.13.0 +Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import sys # noqa: F401 + +from Monei.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel, +) +from Monei.exceptions import ApiAttributeError + + +def lazy_import(): + from Monei.model.webhook_event_types import WebhookEventTypes + + globals()["WebhookEventTypes"] = WebhookEventTypes + + +class UpdateWebhookRequest(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = {} + + validations = {} + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + "url": (str,), # noqa: E501 + "event_types": (WebhookEventTypes,), # noqa: E501 + "enabled": (bool,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + attribute_map = { + "url": "url", # noqa: E501 + "event_types": "eventTypes", # noqa: E501 + "enabled": "enabled", # noqa: E501 + } + + read_only_vars = {} + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data( + cls, url, event_types, enabled, *args, **kwargs + ): # noqa: E501 + """UpdateWebhookRequest - a model defined in OpenAPI + + Args: + url (str): The URL MONEI sends the events to. An API key made for a shop plugin accepts only an `https` URL on the shop's host. + event_types (WebhookEventTypes): + enabled (bool): Whether MONEI sends events to the webhook. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", True) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.url = url + self.event_types = event_types + self.enabled = enabled + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set( + [ + "_data_store", + "_check_type", + "_spec_property_naming", + "_path_to_item", + "_configuration", + "_visited_composed_classes", + ] + ) + + @convert_js_args_to_python_args + def __init__(self, url, event_types, enabled, *args, **kwargs): # noqa: E501 + """UpdateWebhookRequest - a model defined in OpenAPI + + Args: + url (str): The URL MONEI sends the events to. An API key made for a shop plugin accepts only an `https` URL on the shop's host. + event_types (WebhookEventTypes): + enabled (bool): Whether MONEI sends events to the webhook. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.url = url + self.event_types = event_types + self.enabled = enabled + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/Monei/model/webhook.py b/Monei/model/webhook.py new file mode 100644 index 0000000..edf8dc0 --- /dev/null +++ b/Monei/model/webhook.py @@ -0,0 +1,327 @@ +""" +MONEI API v1 + +The MONEI API is organized around REST principles. Our API is designed to be intuitive and developer-friendly. ### Base URL All API requests should be made to: ``` https://api.monei.com/v1 ``` ### Environment MONEI provides two environments: - **Test Environment**: For development and testing without processing real payments - **Live Environment**: For processing real transactions in production ### Client Libraries We provide official SDKs to simplify integration: - [PHP SDK](https://github.com/MONEI/monei-php-sdk) - [Python SDK](https://github.com/MONEI/monei-python-sdk) - [Node.js SDK](https://github.com/MONEI/monei-node-sdk) - [Postman Collection](https://postman.monei.com/) Our SDKs handle authentication, error handling, and request formatting automatically. You can download the OpenAPI specification from the https://js.monei.com/api/v1/openapi.json and generate your own client library using the [OpenAPI Generator](https://openapi-generator.tech/). ### Important Requirements - All API requests must be made over HTTPS - If you are not using our official SDKs, you **must provide a valid `User-Agent` header** with each request - Requests without proper authentication will return a `401 Unauthorized` error ### Error Handling The API returns consistent error codes and messages to help you troubleshoot issues. Each response includes a `statusCode` attribute indicating the outcome of your request. ### Rate Limits The API implements rate limiting to ensure stability. If you exceed the limits, requests will return a `429 Too Many Requests` status code. # noqa: E501 + +The version of the OpenAPI document: 1.13.0 +Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import sys # noqa: F401 + +from Monei.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel, +) +from Monei.exceptions import ApiAttributeError + + +def lazy_import(): + from Monei.model.webhook_event_types import WebhookEventTypes + + globals()["WebhookEventTypes"] = WebhookEventTypes + + +class Webhook(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = {} + + validations = {} + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + "id": (str,), # noqa: E501 + "url": (str,), # noqa: E501 + "event_types": (WebhookEventTypes,), # noqa: E501 + "enabled": (bool,), # noqa: E501 + "created_at": (int,), # noqa: E501 + "failing_since": (int,), # noqa: E501 + "updated_at": (int,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + attribute_map = { + "id": "id", # noqa: E501 + "url": "url", # noqa: E501 + "event_types": "eventTypes", # noqa: E501 + "enabled": "enabled", # noqa: E501 + "created_at": "createdAt", # noqa: E501 + "failing_since": "failingSince", # noqa: E501 + "updated_at": "updatedAt", # noqa: E501 + } + + read_only_vars = {} + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data( + cls, id, url, event_types, enabled, created_at, *args, **kwargs + ): # noqa: E501 + """Webhook - a model defined in OpenAPI + + Args: + id (str): Unique identifier for the webhook. + url (str): The URL MONEI sends the events to. An API key made for a shop plugin accepts only an `https` URL on the shop's host. + event_types (WebhookEventTypes): + enabled (bool): Whether MONEI sends events to the webhook. + created_at (int): Time at which the resource was created. Measured in seconds since the Unix epoch. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + failing_since (int): Start of the current run of failed deliveries, in seconds since the Unix epoch. Absent while deliveries succeed. A webhook that keeps failing is disabled. . [optional] # noqa: E501 + updated_at (int): Time at which the resource updated last time. Measured in seconds since the Unix epoch.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", True) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.id = id + self.url = url + self.event_types = event_types + self.enabled = enabled + self.created_at = created_at + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set( + [ + "_data_store", + "_check_type", + "_spec_property_naming", + "_path_to_item", + "_configuration", + "_visited_composed_classes", + ] + ) + + @convert_js_args_to_python_args + def __init__( + self, id, url, event_types, enabled, created_at, *args, **kwargs + ): # noqa: E501 + """Webhook - a model defined in OpenAPI + + Args: + id (str): Unique identifier for the webhook. + url (str): The URL MONEI sends the events to. An API key made for a shop plugin accepts only an `https` URL on the shop's host. + event_types (WebhookEventTypes): + enabled (bool): Whether MONEI sends events to the webhook. + created_at (int): Time at which the resource was created. Measured in seconds since the Unix epoch. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + failing_since (int): Start of the current run of failed deliveries, in seconds since the Unix epoch. Absent while deliveries succeed. A webhook that keeps failing is disabled. . [optional] # noqa: E501 + updated_at (int): Time at which the resource updated last time. Measured in seconds since the Unix epoch.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.id = id + self.url = url + self.event_types = event_types + self.enabled = enabled + self.created_at = created_at + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/Monei/model/webhook_event_types.py b/Monei/model/webhook_event_types.py new file mode 100644 index 0000000..021660d --- /dev/null +++ b/Monei/model/webhook_event_types.py @@ -0,0 +1,291 @@ +""" +MONEI API v1 + +The MONEI API is organized around REST principles. Our API is designed to be intuitive and developer-friendly. ### Base URL All API requests should be made to: ``` https://api.monei.com/v1 ``` ### Environment MONEI provides two environments: - **Test Environment**: For development and testing without processing real payments - **Live Environment**: For processing real transactions in production ### Client Libraries We provide official SDKs to simplify integration: - [PHP SDK](https://github.com/MONEI/monei-php-sdk) - [Python SDK](https://github.com/MONEI/monei-python-sdk) - [Node.js SDK](https://github.com/MONEI/monei-node-sdk) - [Postman Collection](https://postman.monei.com/) Our SDKs handle authentication, error handling, and request formatting automatically. You can download the OpenAPI specification from the https://js.monei.com/api/v1/openapi.json and generate your own client library using the [OpenAPI Generator](https://openapi-generator.tech/). ### Important Requirements - All API requests must be made over HTTPS - If you are not using our official SDKs, you **must provide a valid `User-Agent` header** with each request - Requests without proper authentication will return a `401 Unauthorized` error ### Error Handling The API returns consistent error codes and messages to help you troubleshoot issues. Each response includes a `statusCode` attribute indicating the outcome of your request. ### Rate Limits The API implements rate limiting to ensure stability. If you exceed the limits, requests will return a `429 Too Many Requests` status code. # noqa: E501 + +The version of the OpenAPI document: 1.13.0 +Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import sys # noqa: F401 + +from Monei.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel, +) +from Monei.exceptions import ApiAttributeError + + +class WebhookEventTypes(ModelSimple): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = {} + + validations = { + ("value",): { + "min_items": 1, + }, + } + + additional_properties_type = None + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + "value": ([str],), + } + + @cached_property + def discriminator(): + return None + + attribute_map = {} + + read_only_vars = set() + + _composed_schemas = None + + required_properties = set( + [ + "_data_store", + "_check_type", + "_spec_property_naming", + "_path_to_item", + "_configuration", + "_visited_composed_classes", + ] + ) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): + """WebhookEventTypes - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] ([str]): The event types to send, for example `CHARGE_SUCCEEDED` or `SUBSCRIPTION_ACTIVATED`. An API key made for a shop plugin accepts only the events of what it can read: charge events (`CHARGE_*`, except `CHARGE_CHARGEBACK`, which needs read access to chargebacks) and subscription events (`SUBSCRIPTION_*`). . # noqa: E501 + + Keyword Args: + value ([str]): The event types to send, for example `CHARGE_SUCCEEDED` or `SUBSCRIPTION_ACTIVATED`. An API key made for a shop plugin accepts only the events of what it can read: charge events (`CHARGE_*`, except `CHARGE_CHARGEBACK`, which needs read access to chargebacks) and subscription events (`SUBSCRIPTION_*`). . # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """WebhookEventTypes - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] ([str]): The event types to send, for example `CHARGE_SUCCEEDED` or `SUBSCRIPTION_ACTIVATED`. An API key made for a shop plugin accepts only the events of what it can read: charge events (`CHARGE_*`, except `CHARGE_CHARGEBACK`, which needs read access to chargebacks) and subscription events (`SUBSCRIPTION_*`). . # noqa: E501 + + Keyword Args: + value ([str]): The event types to send, for example `CHARGE_SUCCEEDED` or `SUBSCRIPTION_ACTIVATED`. An API key made for a shop plugin accepts only the events of what it can read: charge events (`CHARGE_*`, except `CHARGE_CHARGEBACK`, which needs read access to chargebacks) and subscription events (`SUBSCRIPTION_*`). . # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/Monei/model/webhook_list.py b/Monei/model/webhook_list.py new file mode 100644 index 0000000..176d4c1 --- /dev/null +++ b/Monei/model/webhook_list.py @@ -0,0 +1,291 @@ +""" +MONEI API v1 + +The MONEI API is organized around REST principles. Our API is designed to be intuitive and developer-friendly. ### Base URL All API requests should be made to: ``` https://api.monei.com/v1 ``` ### Environment MONEI provides two environments: - **Test Environment**: For development and testing without processing real payments - **Live Environment**: For processing real transactions in production ### Client Libraries We provide official SDKs to simplify integration: - [PHP SDK](https://github.com/MONEI/monei-php-sdk) - [Python SDK](https://github.com/MONEI/monei-python-sdk) - [Node.js SDK](https://github.com/MONEI/monei-node-sdk) - [Postman Collection](https://postman.monei.com/) Our SDKs handle authentication, error handling, and request formatting automatically. You can download the OpenAPI specification from the https://js.monei.com/api/v1/openapi.json and generate your own client library using the [OpenAPI Generator](https://openapi-generator.tech/). ### Important Requirements - All API requests must be made over HTTPS - If you are not using our official SDKs, you **must provide a valid `User-Agent` header** with each request - Requests without proper authentication will return a `401 Unauthorized` error ### Error Handling The API returns consistent error codes and messages to help you troubleshoot issues. Each response includes a `statusCode` attribute indicating the outcome of your request. ### Rate Limits The API implements rate limiting to ensure stability. If you exceed the limits, requests will return a `429 Too Many Requests` status code. # noqa: E501 + +The version of the OpenAPI document: 1.13.0 +Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import sys # noqa: F401 + +from Monei.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel, +) +from Monei.exceptions import ApiAttributeError + + +def lazy_import(): + from Monei.model.webhook import Webhook + + globals()["Webhook"] = Webhook + + +class WebhookList(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = {} + + validations = {} + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + "items": ([Webhook],), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + attribute_map = { + "items": "items", # noqa: E501 + } + + read_only_vars = {} + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, items, *args, **kwargs): # noqa: E501 + """WebhookList - a model defined in OpenAPI + + Args: + items ([Webhook]): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", True) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.items = items + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set( + [ + "_data_store", + "_check_type", + "_spec_property_naming", + "_path_to_item", + "_configuration", + "_visited_composed_classes", + ] + ) + + @convert_js_args_to_python_args + def __init__(self, items, *args, **kwargs): # noqa: E501 + """WebhookList - a model defined in OpenAPI + + Args: + items ([Webhook]): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.items = items + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/Monei/models/__init__.py b/Monei/models/__init__.py index 69eb578..9e48abe 100644 --- a/Monei/models/__init__.py +++ b/Monei/models/__init__.py @@ -58,9 +58,13 @@ from Monei.model.create_product_request import CreateProductRequest from Monei.model.create_subscription_request import CreateSubscriptionRequest from Monei.model.create_tax_rate_request import CreateTaxRateRequest +from Monei.model.create_webhook_request import CreateWebhookRequest +from Monei.model.created_webhook import CreatedWebhook +from Monei.model.created_webhook_all_of import CreatedWebhookAllOf from Monei.model.customer import Customer from Monei.model.customer_payment_method import CustomerPaymentMethod from Monei.model.deleted_resource import DeletedResource +from Monei.model.deleted_webhook import DeletedWebhook from Monei.model.internal_server_error import InternalServerError from Monei.model.internal_server_error_all_of import InternalServerErrorAllOf from Monei.model.not_found_error import NotFoundError @@ -182,6 +186,13 @@ from Monei.model.tax_rate_display_name import TaxRateDisplayName from Monei.model.tax_rate_list import TaxRateList from Monei.model.tax_rate_percentage import TaxRatePercentage +from Monei.model.tokenize_ucp_request import TokenizeUcpRequest +from Monei.model.tokenize_ucp_request_binding import TokenizeUcpRequestBinding +from Monei.model.tokenize_ucp_request_credential import TokenizeUcpRequestCredential +from Monei.model.tokenize_ucp_request_identity import TokenizeUcpRequestIdentity +from Monei.model.tokenize_ucp_request_signals import TokenizeUcpRequestSignals +from Monei.model.tokenize_ucp_request_usage_limits import TokenizeUcpRequestUsageLimits +from Monei.model.ucp_tokenize200_response import UcpTokenize200Response from Monei.model.unauthorized_error import UnauthorizedError from Monei.model.unauthorized_error_all_of import UnauthorizedErrorAllOf from Monei.model.unprocessable_entity_error import UnprocessableEntityError @@ -194,6 +205,10 @@ from Monei.model.update_product_request import UpdateProductRequest from Monei.model.update_subscription_request import UpdateSubscriptionRequest from Monei.model.update_tax_rate_request import UpdateTaxRateRequest +from Monei.model.update_webhook_request import UpdateWebhookRequest from Monei.model.validate_bizum_phone_request import ValidateBizumPhoneRequest from Monei.model.verify_cardholder_request import VerifyCardholderRequest from Monei.model.verify_payee_request import VerifyPayeeRequest +from Monei.model.webhook import Webhook +from Monei.model.webhook_event_types import WebhookEventTypes +from Monei.model.webhook_list import WebhookList diff --git a/Monei/monei_client.py b/Monei/monei_client.py index 9173cab..71693f3 100644 --- a/Monei/monei_client.py +++ b/Monei/monei_client.py @@ -14,6 +14,7 @@ PricesApi, TaxRatesApi, CheckoutSessionsApi, + WebhooksApi, ApplePayDomainApi, ApplePayCertificateApi, BizumApi, @@ -96,6 +97,7 @@ def call_api_with_validation(*args, **kwargs): self.Prices = PricesApi(api_client) self.TaxRates = TaxRatesApi(api_client) self.CheckoutSessions = CheckoutSessionsApi(api_client) + self.Webhooks = WebhooksApi(api_client) self.ApplePayDomain = ApplePayDomainApi(api_client) self.Bizum = BizumApi(api_client) self.ApplePayCertificate = ApplePayCertificateApi(api_client) @@ -112,6 +114,7 @@ def call_api_with_validation(*args, **kwargs): self.prices = self.Prices self.tax_rates = self.TaxRates self.checkout_sessions = self.CheckoutSessions + self.webhooks = self.Webhooks self.apple_pay_domain = self.ApplePayDomain self.apple_pay_certificate = self.ApplePayCertificate self.bizum = self.Bizum diff --git a/README.md b/README.md index fbb29a7..e5c3b4c 100644 --- a/README.md +++ b/README.md @@ -42,6 +42,7 @@ For collecting customer and payment information in the browser, use [monei.js](h - [Features](#features) - [Integration Flow](#integration-flow) - [Webhooks](#webhooks) + - [Managing Webhook Endpoints](#managing-webhook-endpoints) - [Signature Verification](#signature-verification) - [Signing Secrets](#signing-secrets) - [Handling Payment Callbacks](#handling-payment-callbacks) @@ -425,6 +426,31 @@ For more information about the hosted payment page, visit the [MONEI Hosted Paym Webhooks can be configured in the [MONEI Dashboard → Settings → Webhooks](https://dashboard.monei.com/settings/webhooks). +### Managing Webhook Endpoints + +Use `monei.webhooks` to create, list, update, and delete webhook endpoints. New endpoints are enabled by default. Store `signing_secret` from the create response securely and use it to verify deliveries. + +```python +from Monei import CreateWebhookRequest, UpdateWebhookRequest, WebhookEventTypes + +url = 'https://example.com/webhooks/monei' +event_types = WebhookEventTypes(['CHARGE_SUCCEEDED', 'CHARGE_REFUNDED']) + +webhook = monei.webhooks.create( + CreateWebhookRequest(url=url, event_types=event_types) +) +signing_secret = webhook.signing_secret +webhooks = monei.webhooks.list().items + +monei.webhooks.update( + webhook.id, + UpdateWebhookRequest(url=url, event_types=event_types, enabled=False), +) + +# Delete the endpoint when you no longer need it. +monei.webhooks.delete(webhook.id) +``` + ### Signature Verification When receiving webhooks from MONEI, you should verify the signature to ensure the request is authentic: diff --git a/test/test_create_webhook_request.py b/test/test_create_webhook_request.py new file mode 100644 index 0000000..067eacc --- /dev/null +++ b/test/test_create_webhook_request.py @@ -0,0 +1,37 @@ +""" +MONEI API v1 + +The MONEI API is organized around REST principles. Our API is designed to be intuitive and developer-friendly. ### Base URL All API requests should be made to: ``` https://api.monei.com/v1 ``` ### Environment MONEI provides two environments: - **Test Environment**: For development and testing without processing real payments - **Live Environment**: For processing real transactions in production ### Client Libraries We provide official SDKs to simplify integration: - [PHP SDK](https://github.com/MONEI/monei-php-sdk) - [Python SDK](https://github.com/MONEI/monei-python-sdk) - [Node.js SDK](https://github.com/MONEI/monei-node-sdk) - [Postman Collection](https://postman.monei.com/) Our SDKs handle authentication, error handling, and request formatting automatically. You can download the OpenAPI specification from the https://js.monei.com/api/v1/openapi.json and generate your own client library using the [OpenAPI Generator](https://openapi-generator.tech/). ### Important Requirements - All API requests must be made over HTTPS - If you are not using our official SDKs, you **must provide a valid `User-Agent` header** with each request - Requests without proper authentication will return a `401 Unauthorized` error ### Error Handling The API returns consistent error codes and messages to help you troubleshoot issues. Each response includes a `statusCode` attribute indicating the outcome of your request. ### Rate Limits The API implements rate limiting to ensure stability. If you exceed the limits, requests will return a `429 Too Many Requests` status code. # noqa: E501 + +The version of the OpenAPI document: 1.13.0 +Generated by: https://openapi-generator.tech +""" + +import sys +import unittest + +import Monei +from Monei.model.webhook_event_types import WebhookEventTypes + +globals()["WebhookEventTypes"] = WebhookEventTypes +from Monei.model.create_webhook_request import CreateWebhookRequest + + +class TestCreateWebhookRequest(unittest.TestCase): + """CreateWebhookRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testCreateWebhookRequest(self): + """Test CreateWebhookRequest""" + # FIXME: construct object with mandatory attributes with example values + # model = CreateWebhookRequest() # noqa: E501 + pass + + +if __name__ == "__main__": + unittest.main() diff --git a/test/test_created_webhook.py b/test/test_created_webhook.py new file mode 100644 index 0000000..ddf8512 --- /dev/null +++ b/test/test_created_webhook.py @@ -0,0 +1,41 @@ +""" +MONEI API v1 + +The MONEI API is organized around REST principles. Our API is designed to be intuitive and developer-friendly. ### Base URL All API requests should be made to: ``` https://api.monei.com/v1 ``` ### Environment MONEI provides two environments: - **Test Environment**: For development and testing without processing real payments - **Live Environment**: For processing real transactions in production ### Client Libraries We provide official SDKs to simplify integration: - [PHP SDK](https://github.com/MONEI/monei-php-sdk) - [Python SDK](https://github.com/MONEI/monei-python-sdk) - [Node.js SDK](https://github.com/MONEI/monei-node-sdk) - [Postman Collection](https://postman.monei.com/) Our SDKs handle authentication, error handling, and request formatting automatically. You can download the OpenAPI specification from the https://js.monei.com/api/v1/openapi.json and generate your own client library using the [OpenAPI Generator](https://openapi-generator.tech/). ### Important Requirements - All API requests must be made over HTTPS - If you are not using our official SDKs, you **must provide a valid `User-Agent` header** with each request - Requests without proper authentication will return a `401 Unauthorized` error ### Error Handling The API returns consistent error codes and messages to help you troubleshoot issues. Each response includes a `statusCode` attribute indicating the outcome of your request. ### Rate Limits The API implements rate limiting to ensure stability. If you exceed the limits, requests will return a `429 Too Many Requests` status code. # noqa: E501 + +The version of the OpenAPI document: 1.13.0 +Generated by: https://openapi-generator.tech +""" + +import sys +import unittest + +import Monei +from Monei.model.created_webhook_all_of import CreatedWebhookAllOf +from Monei.model.webhook import Webhook +from Monei.model.webhook_event_types import WebhookEventTypes + +globals()["CreatedWebhookAllOf"] = CreatedWebhookAllOf +globals()["Webhook"] = Webhook +globals()["WebhookEventTypes"] = WebhookEventTypes +from Monei.model.created_webhook import CreatedWebhook + + +class TestCreatedWebhook(unittest.TestCase): + """CreatedWebhook unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testCreatedWebhook(self): + """Test CreatedWebhook""" + # FIXME: construct object with mandatory attributes with example values + # model = CreatedWebhook() # noqa: E501 + pass + + +if __name__ == "__main__": + unittest.main() diff --git a/test/test_created_webhook_all_of.py b/test/test_created_webhook_all_of.py new file mode 100644 index 0000000..f6667f9 --- /dev/null +++ b/test/test_created_webhook_all_of.py @@ -0,0 +1,34 @@ +""" +MONEI API v1 + +The MONEI API is organized around REST principles. Our API is designed to be intuitive and developer-friendly. ### Base URL All API requests should be made to: ``` https://api.monei.com/v1 ``` ### Environment MONEI provides two environments: - **Test Environment**: For development and testing without processing real payments - **Live Environment**: For processing real transactions in production ### Client Libraries We provide official SDKs to simplify integration: - [PHP SDK](https://github.com/MONEI/monei-php-sdk) - [Python SDK](https://github.com/MONEI/monei-python-sdk) - [Node.js SDK](https://github.com/MONEI/monei-node-sdk) - [Postman Collection](https://postman.monei.com/) Our SDKs handle authentication, error handling, and request formatting automatically. You can download the OpenAPI specification from the https://js.monei.com/api/v1/openapi.json and generate your own client library using the [OpenAPI Generator](https://openapi-generator.tech/). ### Important Requirements - All API requests must be made over HTTPS - If you are not using our official SDKs, you **must provide a valid `User-Agent` header** with each request - Requests without proper authentication will return a `401 Unauthorized` error ### Error Handling The API returns consistent error codes and messages to help you troubleshoot issues. Each response includes a `statusCode` attribute indicating the outcome of your request. ### Rate Limits The API implements rate limiting to ensure stability. If you exceed the limits, requests will return a `429 Too Many Requests` status code. # noqa: E501 + +The version of the OpenAPI document: 1.13.0 +Generated by: https://openapi-generator.tech +""" + +import sys +import unittest + +import Monei +from Monei.model.created_webhook_all_of import CreatedWebhookAllOf + + +class TestCreatedWebhookAllOf(unittest.TestCase): + """CreatedWebhookAllOf unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testCreatedWebhookAllOf(self): + """Test CreatedWebhookAllOf""" + # FIXME: construct object with mandatory attributes with example values + # model = CreatedWebhookAllOf() # noqa: E501 + pass + + +if __name__ == "__main__": + unittest.main() diff --git a/test/test_deleted_webhook.py b/test/test_deleted_webhook.py new file mode 100644 index 0000000..827b293 --- /dev/null +++ b/test/test_deleted_webhook.py @@ -0,0 +1,34 @@ +""" +MONEI API v1 + +The MONEI API is organized around REST principles. Our API is designed to be intuitive and developer-friendly. ### Base URL All API requests should be made to: ``` https://api.monei.com/v1 ``` ### Environment MONEI provides two environments: - **Test Environment**: For development and testing without processing real payments - **Live Environment**: For processing real transactions in production ### Client Libraries We provide official SDKs to simplify integration: - [PHP SDK](https://github.com/MONEI/monei-php-sdk) - [Python SDK](https://github.com/MONEI/monei-python-sdk) - [Node.js SDK](https://github.com/MONEI/monei-node-sdk) - [Postman Collection](https://postman.monei.com/) Our SDKs handle authentication, error handling, and request formatting automatically. You can download the OpenAPI specification from the https://js.monei.com/api/v1/openapi.json and generate your own client library using the [OpenAPI Generator](https://openapi-generator.tech/). ### Important Requirements - All API requests must be made over HTTPS - If you are not using our official SDKs, you **must provide a valid `User-Agent` header** with each request - Requests without proper authentication will return a `401 Unauthorized` error ### Error Handling The API returns consistent error codes and messages to help you troubleshoot issues. Each response includes a `statusCode` attribute indicating the outcome of your request. ### Rate Limits The API implements rate limiting to ensure stability. If you exceed the limits, requests will return a `429 Too Many Requests` status code. # noqa: E501 + +The version of the OpenAPI document: 1.13.0 +Generated by: https://openapi-generator.tech +""" + +import sys +import unittest + +import Monei +from Monei.model.deleted_webhook import DeletedWebhook + + +class TestDeletedWebhook(unittest.TestCase): + """DeletedWebhook unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testDeletedWebhook(self): + """Test DeletedWebhook""" + # FIXME: construct object with mandatory attributes with example values + # model = DeletedWebhook() # noqa: E501 + pass + + +if __name__ == "__main__": + unittest.main() diff --git a/test/test_tokenize_ucp_request.py b/test/test_tokenize_ucp_request.py new file mode 100644 index 0000000..ff84277 --- /dev/null +++ b/test/test_tokenize_ucp_request.py @@ -0,0 +1,45 @@ +""" +MONEI API v1 + +The MONEI API is organized around REST principles. Our API is designed to be intuitive and developer-friendly. ### Base URL All API requests should be made to: ``` https://api.monei.com/v1 ``` ### Environment MONEI provides two environments: - **Test Environment**: For development and testing without processing real payments - **Live Environment**: For processing real transactions in production ### Client Libraries We provide official SDKs to simplify integration: - [PHP SDK](https://github.com/MONEI/monei-php-sdk) - [Python SDK](https://github.com/MONEI/monei-python-sdk) - [Node.js SDK](https://github.com/MONEI/monei-node-sdk) - [Postman Collection](https://postman.monei.com/) Our SDKs handle authentication, error handling, and request formatting automatically. You can download the OpenAPI specification from the https://js.monei.com/api/v1/openapi.json and generate your own client library using the [OpenAPI Generator](https://openapi-generator.tech/). ### Important Requirements - All API requests must be made over HTTPS - If you are not using our official SDKs, you **must provide a valid `User-Agent` header** with each request - Requests without proper authentication will return a `401 Unauthorized` error ### Error Handling The API returns consistent error codes and messages to help you troubleshoot issues. Each response includes a `statusCode` attribute indicating the outcome of your request. ### Rate Limits The API implements rate limiting to ensure stability. If you exceed the limits, requests will return a `429 Too Many Requests` status code. # noqa: E501 + +The version of the OpenAPI document: 1.13.0 +Generated by: https://openapi-generator.tech +""" + +import sys +import unittest + +import Monei +from Monei.model.tokenize_ucp_request_binding import TokenizeUcpRequestBinding +from Monei.model.tokenize_ucp_request_credential import TokenizeUcpRequestCredential +from Monei.model.tokenize_ucp_request_identity import TokenizeUcpRequestIdentity +from Monei.model.tokenize_ucp_request_signals import TokenizeUcpRequestSignals +from Monei.model.tokenize_ucp_request_usage_limits import TokenizeUcpRequestUsageLimits + +globals()["TokenizeUcpRequestBinding"] = TokenizeUcpRequestBinding +globals()["TokenizeUcpRequestCredential"] = TokenizeUcpRequestCredential +globals()["TokenizeUcpRequestIdentity"] = TokenizeUcpRequestIdentity +globals()["TokenizeUcpRequestSignals"] = TokenizeUcpRequestSignals +globals()["TokenizeUcpRequestUsageLimits"] = TokenizeUcpRequestUsageLimits +from Monei.model.tokenize_ucp_request import TokenizeUcpRequest + + +class TestTokenizeUcpRequest(unittest.TestCase): + """TokenizeUcpRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testTokenizeUcpRequest(self): + """Test TokenizeUcpRequest""" + # FIXME: construct object with mandatory attributes with example values + # model = TokenizeUcpRequest() # noqa: E501 + pass + + +if __name__ == "__main__": + unittest.main() diff --git a/test/test_tokenize_ucp_request_binding.py b/test/test_tokenize_ucp_request_binding.py new file mode 100644 index 0000000..33973bb --- /dev/null +++ b/test/test_tokenize_ucp_request_binding.py @@ -0,0 +1,34 @@ +""" +MONEI API v1 + +The MONEI API is organized around REST principles. Our API is designed to be intuitive and developer-friendly. ### Base URL All API requests should be made to: ``` https://api.monei.com/v1 ``` ### Environment MONEI provides two environments: - **Test Environment**: For development and testing without processing real payments - **Live Environment**: For processing real transactions in production ### Client Libraries We provide official SDKs to simplify integration: - [PHP SDK](https://github.com/MONEI/monei-php-sdk) - [Python SDK](https://github.com/MONEI/monei-python-sdk) - [Node.js SDK](https://github.com/MONEI/monei-node-sdk) - [Postman Collection](https://postman.monei.com/) Our SDKs handle authentication, error handling, and request formatting automatically. You can download the OpenAPI specification from the https://js.monei.com/api/v1/openapi.json and generate your own client library using the [OpenAPI Generator](https://openapi-generator.tech/). ### Important Requirements - All API requests must be made over HTTPS - If you are not using our official SDKs, you **must provide a valid `User-Agent` header** with each request - Requests without proper authentication will return a `401 Unauthorized` error ### Error Handling The API returns consistent error codes and messages to help you troubleshoot issues. Each response includes a `statusCode` attribute indicating the outcome of your request. ### Rate Limits The API implements rate limiting to ensure stability. If you exceed the limits, requests will return a `429 Too Many Requests` status code. # noqa: E501 + +The version of the OpenAPI document: 1.13.0 +Generated by: https://openapi-generator.tech +""" + +import sys +import unittest + +import Monei +from Monei.model.tokenize_ucp_request_binding import TokenizeUcpRequestBinding + + +class TestTokenizeUcpRequestBinding(unittest.TestCase): + """TokenizeUcpRequestBinding unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testTokenizeUcpRequestBinding(self): + """Test TokenizeUcpRequestBinding""" + # FIXME: construct object with mandatory attributes with example values + # model = TokenizeUcpRequestBinding() # noqa: E501 + pass + + +if __name__ == "__main__": + unittest.main() diff --git a/test/test_tokenize_ucp_request_credential.py b/test/test_tokenize_ucp_request_credential.py new file mode 100644 index 0000000..eb2085d --- /dev/null +++ b/test/test_tokenize_ucp_request_credential.py @@ -0,0 +1,34 @@ +""" +MONEI API v1 + +The MONEI API is organized around REST principles. Our API is designed to be intuitive and developer-friendly. ### Base URL All API requests should be made to: ``` https://api.monei.com/v1 ``` ### Environment MONEI provides two environments: - **Test Environment**: For development and testing without processing real payments - **Live Environment**: For processing real transactions in production ### Client Libraries We provide official SDKs to simplify integration: - [PHP SDK](https://github.com/MONEI/monei-php-sdk) - [Python SDK](https://github.com/MONEI/monei-python-sdk) - [Node.js SDK](https://github.com/MONEI/monei-node-sdk) - [Postman Collection](https://postman.monei.com/) Our SDKs handle authentication, error handling, and request formatting automatically. You can download the OpenAPI specification from the https://js.monei.com/api/v1/openapi.json and generate your own client library using the [OpenAPI Generator](https://openapi-generator.tech/). ### Important Requirements - All API requests must be made over HTTPS - If you are not using our official SDKs, you **must provide a valid `User-Agent` header** with each request - Requests without proper authentication will return a `401 Unauthorized` error ### Error Handling The API returns consistent error codes and messages to help you troubleshoot issues. Each response includes a `statusCode` attribute indicating the outcome of your request. ### Rate Limits The API implements rate limiting to ensure stability. If you exceed the limits, requests will return a `429 Too Many Requests` status code. # noqa: E501 + +The version of the OpenAPI document: 1.13.0 +Generated by: https://openapi-generator.tech +""" + +import sys +import unittest + +import Monei +from Monei.model.tokenize_ucp_request_credential import TokenizeUcpRequestCredential + + +class TestTokenizeUcpRequestCredential(unittest.TestCase): + """TokenizeUcpRequestCredential unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testTokenizeUcpRequestCredential(self): + """Test TokenizeUcpRequestCredential""" + # FIXME: construct object with mandatory attributes with example values + # model = TokenizeUcpRequestCredential() # noqa: E501 + pass + + +if __name__ == "__main__": + unittest.main() diff --git a/test/test_tokenize_ucp_request_identity.py b/test/test_tokenize_ucp_request_identity.py new file mode 100644 index 0000000..ea72a26 --- /dev/null +++ b/test/test_tokenize_ucp_request_identity.py @@ -0,0 +1,34 @@ +""" +MONEI API v1 + +The MONEI API is organized around REST principles. Our API is designed to be intuitive and developer-friendly. ### Base URL All API requests should be made to: ``` https://api.monei.com/v1 ``` ### Environment MONEI provides two environments: - **Test Environment**: For development and testing without processing real payments - **Live Environment**: For processing real transactions in production ### Client Libraries We provide official SDKs to simplify integration: - [PHP SDK](https://github.com/MONEI/monei-php-sdk) - [Python SDK](https://github.com/MONEI/monei-python-sdk) - [Node.js SDK](https://github.com/MONEI/monei-node-sdk) - [Postman Collection](https://postman.monei.com/) Our SDKs handle authentication, error handling, and request formatting automatically. You can download the OpenAPI specification from the https://js.monei.com/api/v1/openapi.json and generate your own client library using the [OpenAPI Generator](https://openapi-generator.tech/). ### Important Requirements - All API requests must be made over HTTPS - If you are not using our official SDKs, you **must provide a valid `User-Agent` header** with each request - Requests without proper authentication will return a `401 Unauthorized` error ### Error Handling The API returns consistent error codes and messages to help you troubleshoot issues. Each response includes a `statusCode` attribute indicating the outcome of your request. ### Rate Limits The API implements rate limiting to ensure stability. If you exceed the limits, requests will return a `429 Too Many Requests` status code. # noqa: E501 + +The version of the OpenAPI document: 1.13.0 +Generated by: https://openapi-generator.tech +""" + +import sys +import unittest + +import Monei +from Monei.model.tokenize_ucp_request_identity import TokenizeUcpRequestIdentity + + +class TestTokenizeUcpRequestIdentity(unittest.TestCase): + """TokenizeUcpRequestIdentity unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testTokenizeUcpRequestIdentity(self): + """Test TokenizeUcpRequestIdentity""" + # FIXME: construct object with mandatory attributes with example values + # model = TokenizeUcpRequestIdentity() # noqa: E501 + pass + + +if __name__ == "__main__": + unittest.main() diff --git a/test/test_tokenize_ucp_request_signals.py b/test/test_tokenize_ucp_request_signals.py new file mode 100644 index 0000000..5cff3e2 --- /dev/null +++ b/test/test_tokenize_ucp_request_signals.py @@ -0,0 +1,34 @@ +""" +MONEI API v1 + +The MONEI API is organized around REST principles. Our API is designed to be intuitive and developer-friendly. ### Base URL All API requests should be made to: ``` https://api.monei.com/v1 ``` ### Environment MONEI provides two environments: - **Test Environment**: For development and testing without processing real payments - **Live Environment**: For processing real transactions in production ### Client Libraries We provide official SDKs to simplify integration: - [PHP SDK](https://github.com/MONEI/monei-php-sdk) - [Python SDK](https://github.com/MONEI/monei-python-sdk) - [Node.js SDK](https://github.com/MONEI/monei-node-sdk) - [Postman Collection](https://postman.monei.com/) Our SDKs handle authentication, error handling, and request formatting automatically. You can download the OpenAPI specification from the https://js.monei.com/api/v1/openapi.json and generate your own client library using the [OpenAPI Generator](https://openapi-generator.tech/). ### Important Requirements - All API requests must be made over HTTPS - If you are not using our official SDKs, you **must provide a valid `User-Agent` header** with each request - Requests without proper authentication will return a `401 Unauthorized` error ### Error Handling The API returns consistent error codes and messages to help you troubleshoot issues. Each response includes a `statusCode` attribute indicating the outcome of your request. ### Rate Limits The API implements rate limiting to ensure stability. If you exceed the limits, requests will return a `429 Too Many Requests` status code. # noqa: E501 + +The version of the OpenAPI document: 1.13.0 +Generated by: https://openapi-generator.tech +""" + +import sys +import unittest + +import Monei +from Monei.model.tokenize_ucp_request_signals import TokenizeUcpRequestSignals + + +class TestTokenizeUcpRequestSignals(unittest.TestCase): + """TokenizeUcpRequestSignals unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testTokenizeUcpRequestSignals(self): + """Test TokenizeUcpRequestSignals""" + # FIXME: construct object with mandatory attributes with example values + # model = TokenizeUcpRequestSignals() # noqa: E501 + pass + + +if __name__ == "__main__": + unittest.main() diff --git a/test/test_tokenize_ucp_request_usage_limits.py b/test/test_tokenize_ucp_request_usage_limits.py new file mode 100644 index 0000000..0b706dc --- /dev/null +++ b/test/test_tokenize_ucp_request_usage_limits.py @@ -0,0 +1,34 @@ +""" +MONEI API v1 + +The MONEI API is organized around REST principles. Our API is designed to be intuitive and developer-friendly. ### Base URL All API requests should be made to: ``` https://api.monei.com/v1 ``` ### Environment MONEI provides two environments: - **Test Environment**: For development and testing without processing real payments - **Live Environment**: For processing real transactions in production ### Client Libraries We provide official SDKs to simplify integration: - [PHP SDK](https://github.com/MONEI/monei-php-sdk) - [Python SDK](https://github.com/MONEI/monei-python-sdk) - [Node.js SDK](https://github.com/MONEI/monei-node-sdk) - [Postman Collection](https://postman.monei.com/) Our SDKs handle authentication, error handling, and request formatting automatically. You can download the OpenAPI specification from the https://js.monei.com/api/v1/openapi.json and generate your own client library using the [OpenAPI Generator](https://openapi-generator.tech/). ### Important Requirements - All API requests must be made over HTTPS - If you are not using our official SDKs, you **must provide a valid `User-Agent` header** with each request - Requests without proper authentication will return a `401 Unauthorized` error ### Error Handling The API returns consistent error codes and messages to help you troubleshoot issues. Each response includes a `statusCode` attribute indicating the outcome of your request. ### Rate Limits The API implements rate limiting to ensure stability. If you exceed the limits, requests will return a `429 Too Many Requests` status code. # noqa: E501 + +The version of the OpenAPI document: 1.13.0 +Generated by: https://openapi-generator.tech +""" + +import sys +import unittest + +import Monei +from Monei.model.tokenize_ucp_request_usage_limits import TokenizeUcpRequestUsageLimits + + +class TestTokenizeUcpRequestUsageLimits(unittest.TestCase): + """TokenizeUcpRequestUsageLimits unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testTokenizeUcpRequestUsageLimits(self): + """Test TokenizeUcpRequestUsageLimits""" + # FIXME: construct object with mandatory attributes with example values + # model = TokenizeUcpRequestUsageLimits() # noqa: E501 + pass + + +if __name__ == "__main__": + unittest.main() diff --git a/test/test_ucp_api.py b/test/test_ucp_api.py new file mode 100644 index 0000000..539fed6 --- /dev/null +++ b/test/test_ucp_api.py @@ -0,0 +1,34 @@ +""" +MONEI API v1 + +The MONEI API is organized around REST principles. Our API is designed to be intuitive and developer-friendly. ### Base URL All API requests should be made to: ``` https://api.monei.com/v1 ``` ### Environment MONEI provides two environments: - **Test Environment**: For development and testing without processing real payments - **Live Environment**: For processing real transactions in production ### Client Libraries We provide official SDKs to simplify integration: - [PHP SDK](https://github.com/MONEI/monei-php-sdk) - [Python SDK](https://github.com/MONEI/monei-python-sdk) - [Node.js SDK](https://github.com/MONEI/monei-node-sdk) - [Postman Collection](https://postman.monei.com/) Our SDKs handle authentication, error handling, and request formatting automatically. You can download the OpenAPI specification from the https://js.monei.com/api/v1/openapi.json and generate your own client library using the [OpenAPI Generator](https://openapi-generator.tech/). ### Important Requirements - All API requests must be made over HTTPS - If you are not using our official SDKs, you **must provide a valid `User-Agent` header** with each request - Requests without proper authentication will return a `401 Unauthorized` error ### Error Handling The API returns consistent error codes and messages to help you troubleshoot issues. Each response includes a `statusCode` attribute indicating the outcome of your request. ### Rate Limits The API implements rate limiting to ensure stability. If you exceed the limits, requests will return a `429 Too Many Requests` status code. # noqa: E501 + +The version of the OpenAPI document: 1.13.0 +Generated by: https://openapi-generator.tech +""" + +import unittest + +import Monei +from Monei.api.ucp_api import UCPApi # noqa: E501 + + +class TestUCPApi(unittest.TestCase): + """UCPApi unit test stubs""" + + def setUp(self): + self.api = UCPApi() # noqa: E501 + + def tearDown(self): + pass + + def test_tokenize(self): + """Test case for tokenize + + Tokenize a UCP Card # noqa: E501 + """ + pass + + +if __name__ == "__main__": + unittest.main() diff --git a/test/test_ucp_tokenize200_response.py b/test/test_ucp_tokenize200_response.py new file mode 100644 index 0000000..8313d94 --- /dev/null +++ b/test/test_ucp_tokenize200_response.py @@ -0,0 +1,34 @@ +""" +MONEI API v1 + +The MONEI API is organized around REST principles. Our API is designed to be intuitive and developer-friendly. ### Base URL All API requests should be made to: ``` https://api.monei.com/v1 ``` ### Environment MONEI provides two environments: - **Test Environment**: For development and testing without processing real payments - **Live Environment**: For processing real transactions in production ### Client Libraries We provide official SDKs to simplify integration: - [PHP SDK](https://github.com/MONEI/monei-php-sdk) - [Python SDK](https://github.com/MONEI/monei-python-sdk) - [Node.js SDK](https://github.com/MONEI/monei-node-sdk) - [Postman Collection](https://postman.monei.com/) Our SDKs handle authentication, error handling, and request formatting automatically. You can download the OpenAPI specification from the https://js.monei.com/api/v1/openapi.json and generate your own client library using the [OpenAPI Generator](https://openapi-generator.tech/). ### Important Requirements - All API requests must be made over HTTPS - If you are not using our official SDKs, you **must provide a valid `User-Agent` header** with each request - Requests without proper authentication will return a `401 Unauthorized` error ### Error Handling The API returns consistent error codes and messages to help you troubleshoot issues. Each response includes a `statusCode` attribute indicating the outcome of your request. ### Rate Limits The API implements rate limiting to ensure stability. If you exceed the limits, requests will return a `429 Too Many Requests` status code. # noqa: E501 + +The version of the OpenAPI document: 1.13.0 +Generated by: https://openapi-generator.tech +""" + +import sys +import unittest + +import Monei +from Monei.model.ucp_tokenize200_response import UcpTokenize200Response + + +class TestUcpTokenize200Response(unittest.TestCase): + """UcpTokenize200Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testUcpTokenize200Response(self): + """Test UcpTokenize200Response""" + # FIXME: construct object with mandatory attributes with example values + # model = UcpTokenize200Response() # noqa: E501 + pass + + +if __name__ == "__main__": + unittest.main() diff --git a/test/test_update_webhook_request.py b/test/test_update_webhook_request.py new file mode 100644 index 0000000..7ba2c38 --- /dev/null +++ b/test/test_update_webhook_request.py @@ -0,0 +1,37 @@ +""" +MONEI API v1 + +The MONEI API is organized around REST principles. Our API is designed to be intuitive and developer-friendly. ### Base URL All API requests should be made to: ``` https://api.monei.com/v1 ``` ### Environment MONEI provides two environments: - **Test Environment**: For development and testing without processing real payments - **Live Environment**: For processing real transactions in production ### Client Libraries We provide official SDKs to simplify integration: - [PHP SDK](https://github.com/MONEI/monei-php-sdk) - [Python SDK](https://github.com/MONEI/monei-python-sdk) - [Node.js SDK](https://github.com/MONEI/monei-node-sdk) - [Postman Collection](https://postman.monei.com/) Our SDKs handle authentication, error handling, and request formatting automatically. You can download the OpenAPI specification from the https://js.monei.com/api/v1/openapi.json and generate your own client library using the [OpenAPI Generator](https://openapi-generator.tech/). ### Important Requirements - All API requests must be made over HTTPS - If you are not using our official SDKs, you **must provide a valid `User-Agent` header** with each request - Requests without proper authentication will return a `401 Unauthorized` error ### Error Handling The API returns consistent error codes and messages to help you troubleshoot issues. Each response includes a `statusCode` attribute indicating the outcome of your request. ### Rate Limits The API implements rate limiting to ensure stability. If you exceed the limits, requests will return a `429 Too Many Requests` status code. # noqa: E501 + +The version of the OpenAPI document: 1.13.0 +Generated by: https://openapi-generator.tech +""" + +import sys +import unittest + +import Monei +from Monei.model.webhook_event_types import WebhookEventTypes + +globals()["WebhookEventTypes"] = WebhookEventTypes +from Monei.model.update_webhook_request import UpdateWebhookRequest + + +class TestUpdateWebhookRequest(unittest.TestCase): + """UpdateWebhookRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testUpdateWebhookRequest(self): + """Test UpdateWebhookRequest""" + # FIXME: construct object with mandatory attributes with example values + # model = UpdateWebhookRequest() # noqa: E501 + pass + + +if __name__ == "__main__": + unittest.main() diff --git a/test/test_webhook.py b/test/test_webhook.py new file mode 100644 index 0000000..de7edde --- /dev/null +++ b/test/test_webhook.py @@ -0,0 +1,37 @@ +""" +MONEI API v1 + +The MONEI API is organized around REST principles. Our API is designed to be intuitive and developer-friendly. ### Base URL All API requests should be made to: ``` https://api.monei.com/v1 ``` ### Environment MONEI provides two environments: - **Test Environment**: For development and testing without processing real payments - **Live Environment**: For processing real transactions in production ### Client Libraries We provide official SDKs to simplify integration: - [PHP SDK](https://github.com/MONEI/monei-php-sdk) - [Python SDK](https://github.com/MONEI/monei-python-sdk) - [Node.js SDK](https://github.com/MONEI/monei-node-sdk) - [Postman Collection](https://postman.monei.com/) Our SDKs handle authentication, error handling, and request formatting automatically. You can download the OpenAPI specification from the https://js.monei.com/api/v1/openapi.json and generate your own client library using the [OpenAPI Generator](https://openapi-generator.tech/). ### Important Requirements - All API requests must be made over HTTPS - If you are not using our official SDKs, you **must provide a valid `User-Agent` header** with each request - Requests without proper authentication will return a `401 Unauthorized` error ### Error Handling The API returns consistent error codes and messages to help you troubleshoot issues. Each response includes a `statusCode` attribute indicating the outcome of your request. ### Rate Limits The API implements rate limiting to ensure stability. If you exceed the limits, requests will return a `429 Too Many Requests` status code. # noqa: E501 + +The version of the OpenAPI document: 1.13.0 +Generated by: https://openapi-generator.tech +""" + +import sys +import unittest + +import Monei +from Monei.model.webhook_event_types import WebhookEventTypes + +globals()["WebhookEventTypes"] = WebhookEventTypes +from Monei.model.webhook import Webhook + + +class TestWebhook(unittest.TestCase): + """Webhook unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testWebhook(self): + """Test Webhook""" + # FIXME: construct object with mandatory attributes with example values + # model = Webhook() # noqa: E501 + pass + + +if __name__ == "__main__": + unittest.main() diff --git a/test/test_webhook_event_types.py b/test/test_webhook_event_types.py new file mode 100644 index 0000000..a10fe3f --- /dev/null +++ b/test/test_webhook_event_types.py @@ -0,0 +1,34 @@ +""" +MONEI API v1 + +The MONEI API is organized around REST principles. Our API is designed to be intuitive and developer-friendly. ### Base URL All API requests should be made to: ``` https://api.monei.com/v1 ``` ### Environment MONEI provides two environments: - **Test Environment**: For development and testing without processing real payments - **Live Environment**: For processing real transactions in production ### Client Libraries We provide official SDKs to simplify integration: - [PHP SDK](https://github.com/MONEI/monei-php-sdk) - [Python SDK](https://github.com/MONEI/monei-python-sdk) - [Node.js SDK](https://github.com/MONEI/monei-node-sdk) - [Postman Collection](https://postman.monei.com/) Our SDKs handle authentication, error handling, and request formatting automatically. You can download the OpenAPI specification from the https://js.monei.com/api/v1/openapi.json and generate your own client library using the [OpenAPI Generator](https://openapi-generator.tech/). ### Important Requirements - All API requests must be made over HTTPS - If you are not using our official SDKs, you **must provide a valid `User-Agent` header** with each request - Requests without proper authentication will return a `401 Unauthorized` error ### Error Handling The API returns consistent error codes and messages to help you troubleshoot issues. Each response includes a `statusCode` attribute indicating the outcome of your request. ### Rate Limits The API implements rate limiting to ensure stability. If you exceed the limits, requests will return a `429 Too Many Requests` status code. # noqa: E501 + +The version of the OpenAPI document: 1.13.0 +Generated by: https://openapi-generator.tech +""" + +import sys +import unittest + +import Monei +from Monei.model.webhook_event_types import WebhookEventTypes + + +class TestWebhookEventTypes(unittest.TestCase): + """WebhookEventTypes unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testWebhookEventTypes(self): + """Test WebhookEventTypes""" + # FIXME: construct object with mandatory attributes with example values + # model = WebhookEventTypes() # noqa: E501 + pass + + +if __name__ == "__main__": + unittest.main() diff --git a/test/test_webhook_list.py b/test/test_webhook_list.py new file mode 100644 index 0000000..2ee509a --- /dev/null +++ b/test/test_webhook_list.py @@ -0,0 +1,37 @@ +""" +MONEI API v1 + +The MONEI API is organized around REST principles. Our API is designed to be intuitive and developer-friendly. ### Base URL All API requests should be made to: ``` https://api.monei.com/v1 ``` ### Environment MONEI provides two environments: - **Test Environment**: For development and testing without processing real payments - **Live Environment**: For processing real transactions in production ### Client Libraries We provide official SDKs to simplify integration: - [PHP SDK](https://github.com/MONEI/monei-php-sdk) - [Python SDK](https://github.com/MONEI/monei-python-sdk) - [Node.js SDK](https://github.com/MONEI/monei-node-sdk) - [Postman Collection](https://postman.monei.com/) Our SDKs handle authentication, error handling, and request formatting automatically. You can download the OpenAPI specification from the https://js.monei.com/api/v1/openapi.json and generate your own client library using the [OpenAPI Generator](https://openapi-generator.tech/). ### Important Requirements - All API requests must be made over HTTPS - If you are not using our official SDKs, you **must provide a valid `User-Agent` header** with each request - Requests without proper authentication will return a `401 Unauthorized` error ### Error Handling The API returns consistent error codes and messages to help you troubleshoot issues. Each response includes a `statusCode` attribute indicating the outcome of your request. ### Rate Limits The API implements rate limiting to ensure stability. If you exceed the limits, requests will return a `429 Too Many Requests` status code. # noqa: E501 + +The version of the OpenAPI document: 1.13.0 +Generated by: https://openapi-generator.tech +""" + +import sys +import unittest + +import Monei +from Monei.model.webhook import Webhook + +globals()["Webhook"] = Webhook +from Monei.model.webhook_list import WebhookList + + +class TestWebhookList(unittest.TestCase): + """WebhookList unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testWebhookList(self): + """Test WebhookList""" + # FIXME: construct object with mandatory attributes with example values + # model = WebhookList() # noqa: E501 + pass + + +if __name__ == "__main__": + unittest.main() diff --git a/test/test_webhooks.py b/test/test_webhooks.py new file mode 100644 index 0000000..446fb61 --- /dev/null +++ b/test/test_webhooks.py @@ -0,0 +1,105 @@ +import unittest +from unittest.mock import patch + +from Monei import ( + CreateWebhookRequest, + MoneiClient, + UpdateWebhookRequest, + WebhookEventTypes, + WebhooksApi, +) +from Monei.api_client import ApiClient +from test.test_subscriptions_preview import _response + + +WEBHOOK_ID = "a4e1d1dd-e0c2-4f7a-a2b1-2b0f1f9b6b1e" +WEBHOOK_URL = "https://example.com/webhooks/monei" +WEBHOOK = { + "id": WEBHOOK_ID, + "url": WEBHOOK_URL, + "eventTypes": ["CHARGE_SUCCEEDED"], + "enabled": True, + "createdAt": 1790000000, +} + + +class TestWebhooks(unittest.TestCase): + def setUp(self): + self.monei = MoneiClient(api_key="test_api_key") + + @patch.object(ApiClient, "request") + def test_create_uses_server_default_and_returns_signing_secret(self, request): + request.return_value = _response(dict(WEBHOOK, signingSecret="whsec_test")) + + webhook = self.monei.webhooks.create( + CreateWebhookRequest( + url=WEBHOOK_URL, + event_types=WebhookEventTypes(["CHARGE_SUCCEEDED"]), + ) + ) + + self.assertIsInstance(self.monei.Webhooks, WebhooksApi) + self.assertIs(self.monei.webhooks, self.monei.Webhooks) + method, url = request.call_args.args[:2] + self.assertEqual(method, "POST") + self.assertTrue(url.endswith("/webhooks")) + self.assertEqual( + request.call_args.kwargs["body"], + {"url": WEBHOOK_URL, "eventTypes": ["CHARGE_SUCCEEDED"]}, + ) + self.assertEqual(webhook.signing_secret, "whsec_test") + + @patch.object(ApiClient, "request") + def test_list_returns_webhook_items(self, request): + request.return_value = _response({"items": [WEBHOOK]}) + + webhooks = self.monei.webhooks.list() + + method, url = request.call_args.args[:2] + self.assertEqual(method, "GET") + self.assertTrue(url.endswith("/webhooks")) + self.assertEqual([webhook.id for webhook in webhooks.items], [WEBHOOK_ID]) + + @patch.object(ApiClient, "request") + def test_update_sends_all_fields_and_can_disable_a_webhook(self, request): + request.return_value = _response(dict(WEBHOOK, enabled=False)) + + webhook = self.monei.webhooks.update( + WEBHOOK_ID, + UpdateWebhookRequest( + url=WEBHOOK_URL, + event_types=WebhookEventTypes(["CHARGE_SUCCEEDED"]), + enabled=False, + ), + ) + + method, url = request.call_args.args[:2] + self.assertEqual(method, "PUT") + self.assertTrue(url.endswith(f"/webhooks/{WEBHOOK_ID}")) + self.assertEqual( + request.call_args.kwargs["body"], + { + "url": WEBHOOK_URL, + "eventTypes": ["CHARGE_SUCCEEDED"], + "enabled": False, + }, + ) + self.assertIs(webhook.enabled, False) + + def test_update_requires_enabled(self): + with self.assertRaisesRegex(TypeError, "enabled"): + UpdateWebhookRequest( + url=WEBHOOK_URL, + event_types=WebhookEventTypes(["CHARGE_SUCCEEDED"]), + ) + + @patch.object(ApiClient, "request") + def test_delete_uses_the_webhook_id_and_returns_success(self, request): + request.return_value = _response({"success": True}) + + deleted_webhook = self.monei.webhooks.delete(WEBHOOK_ID) + + method, url = request.call_args.args[:2] + self.assertEqual(method, "DELETE") + self.assertTrue(url.endswith(f"/webhooks/{WEBHOOK_ID}")) + self.assertIs(deleted_webhook.success, True) diff --git a/test/test_webhooks_api.py b/test/test_webhooks_api.py new file mode 100644 index 0000000..90fbf64 --- /dev/null +++ b/test/test_webhooks_api.py @@ -0,0 +1,55 @@ +""" +MONEI API v1 + +The MONEI API is organized around REST principles. Our API is designed to be intuitive and developer-friendly. ### Base URL All API requests should be made to: ``` https://api.monei.com/v1 ``` ### Environment MONEI provides two environments: - **Test Environment**: For development and testing without processing real payments - **Live Environment**: For processing real transactions in production ### Client Libraries We provide official SDKs to simplify integration: - [PHP SDK](https://github.com/MONEI/monei-php-sdk) - [Python SDK](https://github.com/MONEI/monei-python-sdk) - [Node.js SDK](https://github.com/MONEI/monei-node-sdk) - [Postman Collection](https://postman.monei.com/) Our SDKs handle authentication, error handling, and request formatting automatically. You can download the OpenAPI specification from the https://js.monei.com/api/v1/openapi.json and generate your own client library using the [OpenAPI Generator](https://openapi-generator.tech/). ### Important Requirements - All API requests must be made over HTTPS - If you are not using our official SDKs, you **must provide a valid `User-Agent` header** with each request - Requests without proper authentication will return a `401 Unauthorized` error ### Error Handling The API returns consistent error codes and messages to help you troubleshoot issues. Each response includes a `statusCode` attribute indicating the outcome of your request. ### Rate Limits The API implements rate limiting to ensure stability. If you exceed the limits, requests will return a `429 Too Many Requests` status code. # noqa: E501 + +The version of the OpenAPI document: 1.13.0 +Generated by: https://openapi-generator.tech +""" + +import unittest + +import Monei +from Monei.api.webhooks_api import WebhooksApi # noqa: E501 + + +class TestWebhooksApi(unittest.TestCase): + """WebhooksApi unit test stubs""" + + def setUp(self): + self.api = WebhooksApi() # noqa: E501 + + def tearDown(self): + pass + + def test_create(self): + """Test case for create + + Create Webhook # noqa: E501 + """ + pass + + def test_delete(self): + """Test case for delete + + Delete Webhook # noqa: E501 + """ + pass + + def test_list(self): + """Test case for list + + List Webhooks # noqa: E501 + """ + pass + + def test_update(self): + """Test case for update + + Update Webhook # noqa: E501 + """ + pass + + +if __name__ == "__main__": + unittest.main()