diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000..fea89fb --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,36 @@ +// For format details, see https://aka.ms/devcontainer.json. For config options, see the +// README at: https://github.com/devcontainers/templates/tree/main/src/python +{ + "name": "Python 3", + // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile + "image": "mcr.microsoft.com/devcontainers/python:0-3.7" + + // Features to add to the dev container. More info: https://containers.dev/features. + // "features": {}, + + // Use 'forwardPorts' to make a list of ports inside the container available locally. + // "forwardPorts": [], + + // Use 'postCreateCommand' to run commands after the container is created. + ,"containerEnv": { + "BASE_PATH" : "http://host.docker.internal:3000" + }, + "postCreateCommand": "pip3 install --user -r requirements.txt && pip install twine && pip install build", + "customizations": { + "vscode": { + "extensions": [ + "ms-vscode.makefile-tools", + "donjayamanne.python-extension-pack", + "GitHub.copilot", + "ms-python.python", + "Cameron.vscode-pytest" + ] + } + } + + // Configure tool-specific properties. + // "customizations": {}, + + // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. + // "remoteUser": "root" +} diff --git a/.openapi-generator-ignore b/.openapi-generator-ignore index 7b7c7e7..340fe04 100644 --- a/.openapi-generator-ignore +++ b/.openapi-generator-ignore @@ -16,4 +16,5 @@ git_push.sh appveyor.yml .openapi-generator/ .openapi-generator -.github/workflows/python.yml \ No newline at end of file +.github/workflows/python.yml +README.md \ No newline at end of file diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index efc36d8..6cf8752 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -2,7 +2,7 @@ AUTHORS.md CODE_OF_CONDUCT.md LICENSE -README.md +VERSION conekta/__init__.py conekta/api/__init__.py conekta/api/antifraud_api.py @@ -28,6 +28,7 @@ conekta/api/transfers_api.py conekta/api/webhook_keys_api.py conekta/api/webhooks_api.py conekta/api_client.py +conekta/api_response.py conekta/configuration.py conekta/exceptions.py conekta/models/__init__.py @@ -446,6 +447,7 @@ docs/WebhookResponse.md docs/WebhookUpdateRequest.md docs/WebhooksApi.md docs/WhitelistlistRuleResponse.md +pyproject.toml requirements.txt setup.cfg setup.py diff --git a/.openapi-generator/VERSION b/.openapi-generator/VERSION index c0be8a7..cd802a1 100644 --- a/.openapi-generator/VERSION +++ b/.openapi-generator/VERSION @@ -1 +1 @@ -6.4.0 \ No newline at end of file +6.6.0 \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..97db8c0 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,4 @@ +{ + "python.testing.unittestEnabled": false, + "python.testing.pytestEnabled": true +} \ No newline at end of file diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..f7f330b --- /dev/null +++ b/Makefile @@ -0,0 +1,5 @@ +python-test: + pytest + +clean: + rm -rf ./dist \ No newline at end of file diff --git a/README.md b/README.md index 5f9c4b4..423b292 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# conekta-python +# conekta Conekta sdk This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: @@ -46,11 +46,9 @@ import conekta Please follow the [installation procedure](#installation--usage) and then run the following: ```python -from __future__ import print_function import time import conekta -import os from conekta.rest import ApiException from pprint import pprint @@ -387,7 +385,7 @@ Class | Method | HTTP request | Description - [WebhookUpdateRequest](docs/WebhookUpdateRequest.md) - [WhitelistlistRuleResponse](docs/WhitelistlistRuleResponse.md) - + ## Documentation For Authorization @@ -400,4 +398,3 @@ Class | Method | HTTP request | Description engineering@conekta.com - diff --git a/VERSION b/VERSION new file mode 100644 index 0000000..09b254e --- /dev/null +++ b/VERSION @@ -0,0 +1 @@ +6.0.0 diff --git a/conekta/__init__.py b/conekta/__init__.py index 6cdf4a1..05816aa 100644 --- a/conekta/__init__.py +++ b/conekta/__init__.py @@ -9,11 +9,11 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" -from __future__ import absolute_import __version__ = "6.0.0" @@ -42,6 +42,7 @@ from conekta.api.webhooks_api import WebhooksApi # import ApiClient +from conekta.api_response import ApiResponse from conekta.api_client import ApiClient from conekta.configuration import Configuration from conekta.exceptions import OpenApiException @@ -50,6 +51,7 @@ from conekta.exceptions import ApiKeyError from conekta.exceptions import ApiAttributeError from conekta.exceptions import ApiException + # import models into sdk package from conekta.models.api_key_create_response import ApiKeyCreateResponse from conekta.models.api_key_create_response_all_of import ApiKeyCreateResponseAllOf diff --git a/conekta/api/__init__.py b/conekta/api/__init__.py index f76d6f9..cac28f6 100644 --- a/conekta/api/__init__.py +++ b/conekta/api/__init__.py @@ -1,5 +1,3 @@ -from __future__ import absolute_import - # flake8: noqa # import apis into api package @@ -25,3 +23,4 @@ from conekta.api.transfers_api import TransfersApi from conekta.api.webhook_keys_api import WebhookKeysApi from conekta.api.webhooks_api import WebhooksApi + diff --git a/conekta/api/antifraud_api.py b/conekta/api/antifraud_api.py index ae14dc2..ba0193b 100644 --- a/conekta/api/antifraud_api.py +++ b/conekta/api/antifraud_api.py @@ -7,13 +7,15 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" -from __future__ import absolute_import import re # noqa: F401 +import io +import warnings from pydantic import validate_arguments, ValidationError from typing_extensions import Annotated @@ -30,6 +32,7 @@ from conekta.models.whitelistlist_rule_response import WhitelistlistRuleResponse from conekta.api_client import ApiClient +from conekta.api_response import ApiResponse from conekta.exceptions import ( # noqa: F401 ApiTypeError, ApiValueError @@ -64,10 +67,6 @@ def create_rule_blacklist(self, create_risk_rules_data : Annotated[CreateRiskRul :type accept_language: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -78,10 +77,12 @@ def create_rule_blacklist(self, create_risk_rules_data : Annotated[CreateRiskRul :rtype: BlacklistRuleResponse """ kwargs['_return_http_data_only'] = True + if '_preload_content' in kwargs: + raise ValueError("Error! Please call the create_rule_blacklist_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.create_rule_blacklist_with_http_info(create_risk_rules_data, accept_language, **kwargs) # noqa: E501 @validate_arguments - def create_rule_blacklist_with_http_info(self, create_risk_rules_data : Annotated[CreateRiskRulesData, Field(..., description="requested field for blacklist rule")], accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, **kwargs): # noqa: E501 + def create_rule_blacklist_with_http_info(self, create_risk_rules_data : Annotated[CreateRiskRulesData, Field(..., description="requested field for blacklist rule")], accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, **kwargs) -> ApiResponse: # noqa: E501 """Create blacklisted rule # noqa: E501 This method makes a synchronous HTTP request by default. To make an @@ -96,13 +97,14 @@ def create_rule_blacklist_with_http_info(self, create_risk_rules_data : Annotate :type accept_language: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -153,7 +155,6 @@ def create_rule_blacklist_with_http_info(self, create_risk_rules_data : Annotate # process the query parameters _query_params = [] - # process the header parameters _header_params = dict(_params.get('_headers', {})) if _params['accept_language']: @@ -162,10 +163,9 @@ def create_rule_blacklist_with_http_info(self, create_risk_rules_data : Annotate # process the form parameters _form_params = [] _files = {} - # process the body parameter _body_params = None - if _params['create_risk_rules_data']: + if _params['create_risk_rules_data'] is not None: _body_params = _params['create_risk_rules_data'] # set the HTTP header `Accept` @@ -221,10 +221,6 @@ def create_rule_whitelist(self, accept_language : Annotated[Optional[StrictStr], :type create_risk_rules_data: CreateRiskRulesData :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -235,10 +231,12 @@ def create_rule_whitelist(self, accept_language : Annotated[Optional[StrictStr], :rtype: WhitelistlistRuleResponse """ kwargs['_return_http_data_only'] = True + if '_preload_content' in kwargs: + raise ValueError("Error! Please call the create_rule_whitelist_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.create_rule_whitelist_with_http_info(accept_language, create_risk_rules_data, **kwargs) # noqa: E501 @validate_arguments - def create_rule_whitelist_with_http_info(self, accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, create_risk_rules_data : Optional[CreateRiskRulesData] = None, **kwargs): # noqa: E501 + def create_rule_whitelist_with_http_info(self, accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, create_risk_rules_data : Optional[CreateRiskRulesData] = None, **kwargs) -> ApiResponse: # noqa: E501 """Create whitelisted rule # noqa: E501 This method makes a synchronous HTTP request by default. To make an @@ -253,13 +251,14 @@ def create_rule_whitelist_with_http_info(self, accept_language : Annotated[Optio :type create_risk_rules_data: CreateRiskRulesData :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -310,7 +309,6 @@ def create_rule_whitelist_with_http_info(self, accept_language : Annotated[Optio # process the query parameters _query_params = [] - # process the header parameters _header_params = dict(_params.get('_headers', {})) if _params['accept_language']: @@ -319,10 +317,9 @@ def create_rule_whitelist_with_http_info(self, accept_language : Annotated[Optio # process the form parameters _form_params = [] _files = {} - # process the body parameter _body_params = None - if _params['create_risk_rules_data']: + if _params['create_risk_rules_data'] is not None: _body_params = _params['create_risk_rules_data'] # set the HTTP header `Accept` @@ -381,10 +378,6 @@ def delete_rule_blacklist(self, id : Annotated[StrictStr, Field(..., description :type x_child_company_id: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -395,10 +388,12 @@ def delete_rule_blacklist(self, id : Annotated[StrictStr, Field(..., description :rtype: DeletedBlacklistRuleResponse """ kwargs['_return_http_data_only'] = True + if '_preload_content' in kwargs: + raise ValueError("Error! Please call the delete_rule_blacklist_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.delete_rule_blacklist_with_http_info(id, accept_language, x_child_company_id, **kwargs) # noqa: E501 @validate_arguments - def delete_rule_blacklist_with_http_info(self, id : Annotated[StrictStr, Field(..., description="Identifier of the resource")], accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, x_child_company_id : Annotated[Optional[StrictStr], Field(description="In the case of a holding company, the company id of the child company to which will process the request.")] = None, **kwargs): # noqa: E501 + def delete_rule_blacklist_with_http_info(self, id : Annotated[StrictStr, Field(..., description="Identifier of the resource")], accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, x_child_company_id : Annotated[Optional[StrictStr], Field(description="In the case of a holding company, the company id of the child company to which will process the request.")] = None, **kwargs) -> ApiResponse: # noqa: E501 """Delete blacklisted rule # noqa: E501 This method makes a synchronous HTTP request by default. To make an @@ -415,13 +410,14 @@ def delete_rule_blacklist_with_http_info(self, id : Annotated[StrictStr, Field(. :type x_child_company_id: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -473,23 +469,22 @@ def delete_rule_blacklist_with_http_info(self, id : Annotated[StrictStr, Field(. if _params['id']: _path_params['id'] = _params['id'] + # process the query parameters _query_params = [] - # process the header parameters _header_params = dict(_params.get('_headers', {})) if _params['accept_language']: _header_params['Accept-Language'] = _params['accept_language'] + if _params['x_child_company_id']: _header_params['X-Child-Company-Id'] = _params['x_child_company_id'] # process the form parameters _form_params = [] _files = {} - # process the body parameter _body_params = None - # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( ['application/vnd.conekta-v2.1.0+json']) # noqa: E501 @@ -539,10 +534,6 @@ def delete_rule_whitelist(self, id : Annotated[StrictStr, Field(..., description :type x_child_company_id: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -553,10 +544,12 @@ def delete_rule_whitelist(self, id : Annotated[StrictStr, Field(..., description :rtype: DeletedWhitelistRuleResponse """ kwargs['_return_http_data_only'] = True + if '_preload_content' in kwargs: + raise ValueError("Error! Please call the delete_rule_whitelist_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.delete_rule_whitelist_with_http_info(id, accept_language, x_child_company_id, **kwargs) # noqa: E501 @validate_arguments - def delete_rule_whitelist_with_http_info(self, id : Annotated[StrictStr, Field(..., description="Identifier of the resource")], accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, x_child_company_id : Annotated[Optional[StrictStr], Field(description="In the case of a holding company, the company id of the child company to which will process the request.")] = None, **kwargs): # noqa: E501 + def delete_rule_whitelist_with_http_info(self, id : Annotated[StrictStr, Field(..., description="Identifier of the resource")], accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, x_child_company_id : Annotated[Optional[StrictStr], Field(description="In the case of a holding company, the company id of the child company to which will process the request.")] = None, **kwargs) -> ApiResponse: # noqa: E501 """Delete whitelisted rule # noqa: E501 This method makes a synchronous HTTP request by default. To make an @@ -573,13 +566,14 @@ def delete_rule_whitelist_with_http_info(self, id : Annotated[StrictStr, Field(. :type x_child_company_id: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -631,23 +625,22 @@ def delete_rule_whitelist_with_http_info(self, id : Annotated[StrictStr, Field(. if _params['id']: _path_params['id'] = _params['id'] + # process the query parameters _query_params = [] - # process the header parameters _header_params = dict(_params.get('_headers', {})) if _params['accept_language']: _header_params['Accept-Language'] = _params['accept_language'] + if _params['x_child_company_id']: _header_params['X-Child-Company-Id'] = _params['x_child_company_id'] # process the form parameters _form_params = [] _files = {} - # process the body parameter _body_params = None - # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( ['application/vnd.conekta-v2.1.0+json']) # noqa: E501 @@ -695,10 +688,6 @@ def get_rule_blacklist(self, accept_language : Annotated[Optional[StrictStr], Fi :type accept_language: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -709,10 +698,12 @@ def get_rule_blacklist(self, accept_language : Annotated[Optional[StrictStr], Fi :rtype: RiskRulesList """ kwargs['_return_http_data_only'] = True + if '_preload_content' in kwargs: + raise ValueError("Error! Please call the get_rule_blacklist_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.get_rule_blacklist_with_http_info(accept_language, **kwargs) # noqa: E501 @validate_arguments - def get_rule_blacklist_with_http_info(self, accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, **kwargs): # noqa: E501 + def get_rule_blacklist_with_http_info(self, accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, **kwargs) -> ApiResponse: # noqa: E501 """Get list of blacklisted rules # noqa: E501 Return all rules # noqa: E501 @@ -726,13 +717,14 @@ def get_rule_blacklist_with_http_info(self, accept_language : Annotated[Optional :type accept_language: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -782,7 +774,6 @@ def get_rule_blacklist_with_http_info(self, accept_language : Annotated[Optional # process the query parameters _query_params = [] - # process the header parameters _header_params = dict(_params.get('_headers', {})) if _params['accept_language']: @@ -791,10 +782,8 @@ def get_rule_blacklist_with_http_info(self, accept_language : Annotated[Optional # process the form parameters _form_params = [] _files = {} - # process the body parameter _body_params = None - # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( ['application/vnd.conekta-v2.1.0+json']) # noqa: E501 @@ -840,10 +829,6 @@ def get_rule_whitelist(self, accept_language : Annotated[Optional[StrictStr], Fi :type accept_language: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -854,10 +839,12 @@ def get_rule_whitelist(self, accept_language : Annotated[Optional[StrictStr], Fi :rtype: RiskRulesList """ kwargs['_return_http_data_only'] = True + if '_preload_content' in kwargs: + raise ValueError("Error! Please call the get_rule_whitelist_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.get_rule_whitelist_with_http_info(accept_language, **kwargs) # noqa: E501 @validate_arguments - def get_rule_whitelist_with_http_info(self, accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, **kwargs): # noqa: E501 + def get_rule_whitelist_with_http_info(self, accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, **kwargs) -> ApiResponse: # noqa: E501 """Get a list of whitelisted rules # noqa: E501 Return all rules # noqa: E501 @@ -871,13 +858,14 @@ def get_rule_whitelist_with_http_info(self, accept_language : Annotated[Optional :type accept_language: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -927,7 +915,6 @@ def get_rule_whitelist_with_http_info(self, accept_language : Annotated[Optional # process the query parameters _query_params = [] - # process the header parameters _header_params = dict(_params.get('_headers', {})) if _params['accept_language']: @@ -936,10 +923,8 @@ def get_rule_whitelist_with_http_info(self, accept_language : Annotated[Optional # process the form parameters _form_params = [] _files = {} - # process the body parameter _body_params = None - # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( ['application/vnd.conekta-v2.1.0+json']) # noqa: E501 diff --git a/conekta/api/api_keys_api.py b/conekta/api/api_keys_api.py index b783eae..078618b 100644 --- a/conekta/api/api_keys_api.py +++ b/conekta/api/api_keys_api.py @@ -7,13 +7,15 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" -from __future__ import absolute_import import re # noqa: F401 +import io +import warnings from pydantic import validate_arguments, ValidationError from typing_extensions import Annotated @@ -30,6 +32,7 @@ from conekta.models.get_api_keys_response import GetApiKeysResponse from conekta.api_client import ApiClient +from conekta.api_response import ApiResponse from conekta.exceptions import ( # noqa: F401 ApiTypeError, ApiValueError @@ -67,10 +70,6 @@ def create_api_key(self, api_key_request : Annotated[ApiKeyRequest, Field(..., d :type x_child_company_id: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -81,10 +80,12 @@ def create_api_key(self, api_key_request : Annotated[ApiKeyRequest, Field(..., d :rtype: ApiKeyCreateResponse """ kwargs['_return_http_data_only'] = True + if '_preload_content' in kwargs: + raise ValueError("Error! Please call the create_api_key_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.create_api_key_with_http_info(api_key_request, accept_language, x_child_company_id, **kwargs) # noqa: E501 @validate_arguments - def create_api_key_with_http_info(self, api_key_request : Annotated[ApiKeyRequest, Field(..., description="requested field for a api keys")], accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, x_child_company_id : Annotated[Optional[StrictStr], Field(description="In the case of a holding company, the company id of the child company to which will process the request.")] = None, **kwargs): # noqa: E501 + def create_api_key_with_http_info(self, api_key_request : Annotated[ApiKeyRequest, Field(..., description="requested field for a api keys")], accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, x_child_company_id : Annotated[Optional[StrictStr], Field(description="In the case of a holding company, the company id of the child company to which will process the request.")] = None, **kwargs) -> ApiResponse: # noqa: E501 """Create Api Key # noqa: E501 Create a api key # noqa: E501 @@ -102,13 +103,14 @@ def create_api_key_with_http_info(self, api_key_request : Annotated[ApiKeyReques :type x_child_company_id: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -160,21 +162,20 @@ def create_api_key_with_http_info(self, api_key_request : Annotated[ApiKeyReques # process the query parameters _query_params = [] - # process the header parameters _header_params = dict(_params.get('_headers', {})) if _params['accept_language']: _header_params['Accept-Language'] = _params['accept_language'] + if _params['x_child_company_id']: _header_params['X-Child-Company-Id'] = _params['x_child_company_id'] # process the form parameters _form_params = [] _files = {} - # process the body parameter _body_params = None - if _params['api_key_request']: + if _params['api_key_request'] is not None: _body_params = _params['api_key_request'] # set the HTTP header `Accept` @@ -232,10 +233,6 @@ def delete_api_key(self, id : Annotated[StrictStr, Field(..., description="Ident :type accept_language: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -246,10 +243,12 @@ def delete_api_key(self, id : Annotated[StrictStr, Field(..., description="Ident :rtype: DeleteApiKeysResponse """ kwargs['_return_http_data_only'] = True + if '_preload_content' in kwargs: + raise ValueError("Error! Please call the delete_api_key_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.delete_api_key_with_http_info(id, accept_language, **kwargs) # noqa: E501 @validate_arguments - def delete_api_key_with_http_info(self, id : Annotated[StrictStr, Field(..., description="Identifier of the resource")], accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, **kwargs): # noqa: E501 + def delete_api_key_with_http_info(self, id : Annotated[StrictStr, Field(..., description="Identifier of the resource")], accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, **kwargs) -> ApiResponse: # noqa: E501 """Delete Api Key # noqa: E501 Deletes a api key that corresponds to a api key ID # noqa: E501 @@ -265,13 +264,14 @@ def delete_api_key_with_http_info(self, id : Annotated[StrictStr, Field(..., des :type accept_language: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -322,9 +322,9 @@ def delete_api_key_with_http_info(self, id : Annotated[StrictStr, Field(..., des if _params['id']: _path_params['id'] = _params['id'] + # process the query parameters _query_params = [] - # process the header parameters _header_params = dict(_params.get('_headers', {})) if _params['accept_language']: @@ -333,10 +333,8 @@ def delete_api_key_with_http_info(self, id : Annotated[StrictStr, Field(..., des # process the form parameters _form_params = [] _files = {} - # process the body parameter _body_params = None - # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( ['application/vnd.conekta-v2.1.0+json']) # noqa: E501 @@ -387,10 +385,6 @@ def get_api_key(self, id : Annotated[StrictStr, Field(..., description="Identifi :type x_child_company_id: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -401,10 +395,12 @@ def get_api_key(self, id : Annotated[StrictStr, Field(..., description="Identifi :rtype: ApiKeyResponse """ kwargs['_return_http_data_only'] = True + if '_preload_content' in kwargs: + raise ValueError("Error! Please call the get_api_key_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.get_api_key_with_http_info(id, accept_language, x_child_company_id, **kwargs) # noqa: E501 @validate_arguments - def get_api_key_with_http_info(self, id : Annotated[StrictStr, Field(..., description="Identifier of the resource")], accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, x_child_company_id : Annotated[Optional[StrictStr], Field(description="In the case of a holding company, the company id of the child company to which will process the request.")] = None, **kwargs): # noqa: E501 + def get_api_key_with_http_info(self, id : Annotated[StrictStr, Field(..., description="Identifier of the resource")], accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, x_child_company_id : Annotated[Optional[StrictStr], Field(description="In the case of a holding company, the company id of the child company to which will process the request.")] = None, **kwargs) -> ApiResponse: # noqa: E501 """Get Api Key # noqa: E501 Gets a api key that corresponds to a api key ID # noqa: E501 @@ -422,13 +418,14 @@ def get_api_key_with_http_info(self, id : Annotated[StrictStr, Field(..., descri :type x_child_company_id: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -480,23 +477,22 @@ def get_api_key_with_http_info(self, id : Annotated[StrictStr, Field(..., descri if _params['id']: _path_params['id'] = _params['id'] + # process the query parameters _query_params = [] - # process the header parameters _header_params = dict(_params.get('_headers', {})) if _params['accept_language']: _header_params['Accept-Language'] = _params['accept_language'] + if _params['x_child_company_id']: _header_params['X-Child-Company-Id'] = _params['x_child_company_id'] # process the form parameters _form_params = [] _files = {} - # process the body parameter _body_params = None - # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( ['application/vnd.conekta-v2.1.0+json']) # noqa: E501 @@ -553,10 +549,6 @@ def get_api_keys(self, accept_language : Annotated[Optional[StrictStr], Field(de :type previous: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -567,10 +559,12 @@ def get_api_keys(self, accept_language : Annotated[Optional[StrictStr], Field(de :rtype: GetApiKeysResponse """ kwargs['_return_http_data_only'] = True + if '_preload_content' in kwargs: + raise ValueError("Error! Please call the get_api_keys_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.get_api_keys_with_http_info(accept_language, x_child_company_id, limit, search, next, previous, **kwargs) # noqa: E501 @validate_arguments - def get_api_keys_with_http_info(self, accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, x_child_company_id : Annotated[Optional[StrictStr], Field(description="In the case of a holding company, the company id of the child company to which will process the request.")] = None, limit : Annotated[Optional[conint(strict=True, le=250, ge=1)], Field(description="The numbers of items to return, the maximum value is 250")] = None, search : Annotated[Optional[StrictStr], Field(description="General order search, e.g. by mail, reference etc.")] = None, next : Annotated[Optional[StrictStr], Field(description="next page")] = None, previous : Annotated[Optional[StrictStr], Field(description="previous page")] = None, **kwargs): # noqa: E501 + def get_api_keys_with_http_info(self, accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, x_child_company_id : Annotated[Optional[StrictStr], Field(description="In the case of a holding company, the company id of the child company to which will process the request.")] = None, limit : Annotated[Optional[conint(strict=True, le=250, ge=1)], Field(description="The numbers of items to return, the maximum value is 250")] = None, search : Annotated[Optional[StrictStr], Field(description="General order search, e.g. by mail, reference etc.")] = None, next : Annotated[Optional[StrictStr], Field(description="next page")] = None, previous : Annotated[Optional[StrictStr], Field(description="previous page")] = None, **kwargs) -> ApiResponse: # noqa: E501 """Get list of Api Keys # noqa: E501 Consume the list of api keys you have # noqa: E501 @@ -594,13 +588,14 @@ def get_api_keys_with_http_info(self, accept_language : Annotated[Optional[Stric :type previous: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -657,10 +652,13 @@ def get_api_keys_with_http_info(self, accept_language : Annotated[Optional[Stric _query_params = [] if _params.get('limit') is not None: # noqa: E501 _query_params.append(('limit', _params['limit'])) + if _params.get('search') is not None: # noqa: E501 _query_params.append(('search', _params['search'])) + if _params.get('next') is not None: # noqa: E501 _query_params.append(('next', _params['next'])) + if _params.get('previous') is not None: # noqa: E501 _query_params.append(('previous', _params['previous'])) @@ -668,16 +666,15 @@ def get_api_keys_with_http_info(self, accept_language : Annotated[Optional[Stric _header_params = dict(_params.get('_headers', {})) if _params['accept_language']: _header_params['Accept-Language'] = _params['accept_language'] + if _params['x_child_company_id']: _header_params['X-Child-Company-Id'] = _params['x_child_company_id'] # process the form parameters _form_params = [] _files = {} - # process the body parameter _body_params = None - # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( ['application/vnd.conekta-v2.1.0+json']) # noqa: E501 @@ -727,10 +724,6 @@ def update_api_key(self, id : Annotated[StrictStr, Field(..., description="Ident :type api_key_update_request: ApiKeyUpdateRequest :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -741,10 +734,12 @@ def update_api_key(self, id : Annotated[StrictStr, Field(..., description="Ident :rtype: ApiKeyResponse """ kwargs['_return_http_data_only'] = True + if '_preload_content' in kwargs: + raise ValueError("Error! Please call the update_api_key_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.update_api_key_with_http_info(id, accept_language, api_key_update_request, **kwargs) # noqa: E501 @validate_arguments - def update_api_key_with_http_info(self, id : Annotated[StrictStr, Field(..., description="Identifier of the resource")], accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, api_key_update_request : Optional[ApiKeyUpdateRequest] = None, **kwargs): # noqa: E501 + def update_api_key_with_http_info(self, id : Annotated[StrictStr, Field(..., description="Identifier of the resource")], accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, api_key_update_request : Optional[ApiKeyUpdateRequest] = None, **kwargs) -> ApiResponse: # noqa: E501 """Update Api Key # noqa: E501 Update an existing api key # noqa: E501 @@ -762,13 +757,14 @@ def update_api_key_with_http_info(self, id : Annotated[StrictStr, Field(..., des :type api_key_update_request: ApiKeyUpdateRequest :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -820,9 +816,9 @@ def update_api_key_with_http_info(self, id : Annotated[StrictStr, Field(..., des if _params['id']: _path_params['id'] = _params['id'] + # process the query parameters _query_params = [] - # process the header parameters _header_params = dict(_params.get('_headers', {})) if _params['accept_language']: @@ -831,10 +827,9 @@ def update_api_key_with_http_info(self, id : Annotated[StrictStr, Field(..., des # process the form parameters _form_params = [] _files = {} - # process the body parameter _body_params = None - if _params['api_key_update_request']: + if _params['api_key_update_request'] is not None: _body_params = _params['api_key_update_request'] # set the HTTP header `Accept` diff --git a/conekta/api/charges_api.py b/conekta/api/charges_api.py index 874d921..246053a 100644 --- a/conekta/api/charges_api.py +++ b/conekta/api/charges_api.py @@ -7,13 +7,15 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" -from __future__ import absolute_import import re # noqa: F401 +import io +import warnings from pydantic import validate_arguments, ValidationError from typing_extensions import Annotated @@ -27,6 +29,7 @@ from conekta.models.get_charges_response import GetChargesResponse from conekta.api_client import ApiClient +from conekta.api_response import ApiResponse from conekta.exceptions import ( # noqa: F401 ApiTypeError, ApiValueError @@ -69,10 +72,6 @@ def get_charges(self, accept_language : Annotated[Optional[StrictStr], Field(des :type previous: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -83,10 +82,12 @@ def get_charges(self, accept_language : Annotated[Optional[StrictStr], Field(des :rtype: GetChargesResponse """ kwargs['_return_http_data_only'] = True + if '_preload_content' in kwargs: + raise ValueError("Error! Please call the get_charges_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.get_charges_with_http_info(accept_language, x_child_company_id, limit, search, next, previous, **kwargs) # noqa: E501 @validate_arguments - def get_charges_with_http_info(self, accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, x_child_company_id : Annotated[Optional[StrictStr], Field(description="In the case of a holding company, the company id of the child company to which will process the request.")] = None, limit : Annotated[Optional[conint(strict=True, le=250, ge=1)], Field(description="The numbers of items to return, the maximum value is 250")] = None, search : Annotated[Optional[StrictStr], Field(description="General order search, e.g. by mail, reference etc.")] = None, next : Annotated[Optional[StrictStr], Field(description="next page")] = None, previous : Annotated[Optional[StrictStr], Field(description="previous page")] = None, **kwargs): # noqa: E501 + def get_charges_with_http_info(self, accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, x_child_company_id : Annotated[Optional[StrictStr], Field(description="In the case of a holding company, the company id of the child company to which will process the request.")] = None, limit : Annotated[Optional[conint(strict=True, le=250, ge=1)], Field(description="The numbers of items to return, the maximum value is 250")] = None, search : Annotated[Optional[StrictStr], Field(description="General order search, e.g. by mail, reference etc.")] = None, next : Annotated[Optional[StrictStr], Field(description="next page")] = None, previous : Annotated[Optional[StrictStr], Field(description="previous page")] = None, **kwargs) -> ApiResponse: # noqa: E501 """Get A List of Charges # noqa: E501 This method makes a synchronous HTTP request by default. To make an @@ -109,13 +110,14 @@ def get_charges_with_http_info(self, accept_language : Annotated[Optional[Strict :type previous: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -172,10 +174,13 @@ def get_charges_with_http_info(self, accept_language : Annotated[Optional[Strict _query_params = [] if _params.get('limit') is not None: # noqa: E501 _query_params.append(('limit', _params['limit'])) + if _params.get('search') is not None: # noqa: E501 _query_params.append(('search', _params['search'])) + if _params.get('next') is not None: # noqa: E501 _query_params.append(('next', _params['next'])) + if _params.get('previous') is not None: # noqa: E501 _query_params.append(('previous', _params['previous'])) @@ -183,16 +188,15 @@ def get_charges_with_http_info(self, accept_language : Annotated[Optional[Strict _header_params = dict(_params.get('_headers', {})) if _params['accept_language']: _header_params['Accept-Language'] = _params['accept_language'] + if _params['x_child_company_id']: _header_params['X-Child-Company-Id'] = _params['x_child_company_id'] # process the form parameters _form_params = [] _files = {} - # process the body parameter _body_params = None - # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( ['application/vnd.conekta-v2.1.0+json']) # noqa: E501 @@ -244,10 +248,6 @@ def orders_create_charge(self, id : Annotated[StrictStr, Field(..., description= :type x_child_company_id: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -258,10 +258,12 @@ def orders_create_charge(self, id : Annotated[StrictStr, Field(..., description= :rtype: ChargeOrderResponse """ kwargs['_return_http_data_only'] = True + if '_preload_content' in kwargs: + raise ValueError("Error! Please call the orders_create_charge_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.orders_create_charge_with_http_info(id, charge_request, accept_language, x_child_company_id, **kwargs) # noqa: E501 @validate_arguments - def orders_create_charge_with_http_info(self, id : Annotated[StrictStr, Field(..., description="Identifier of the resource")], charge_request : Annotated[ChargeRequest, Field(..., description="requested field for a charge")], accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, x_child_company_id : Annotated[Optional[StrictStr], Field(description="In the case of a holding company, the company id of the child company to which will process the request.")] = None, **kwargs): # noqa: E501 + def orders_create_charge_with_http_info(self, id : Annotated[StrictStr, Field(..., description="Identifier of the resource")], charge_request : Annotated[ChargeRequest, Field(..., description="requested field for a charge")], accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, x_child_company_id : Annotated[Optional[StrictStr], Field(description="In the case of a holding company, the company id of the child company to which will process the request.")] = None, **kwargs) -> ApiResponse: # noqa: E501 """Create charge # noqa: E501 Create charge for an existing orden # noqa: E501 @@ -281,13 +283,14 @@ def orders_create_charge_with_http_info(self, id : Annotated[StrictStr, Field(.. :type x_child_company_id: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -340,23 +343,23 @@ def orders_create_charge_with_http_info(self, id : Annotated[StrictStr, Field(.. if _params['id']: _path_params['id'] = _params['id'] + # process the query parameters _query_params = [] - # process the header parameters _header_params = dict(_params.get('_headers', {})) if _params['accept_language']: _header_params['Accept-Language'] = _params['accept_language'] + if _params['x_child_company_id']: _header_params['X-Child-Company-Id'] = _params['x_child_company_id'] # process the form parameters _form_params = [] _files = {} - # process the body parameter _body_params = None - if _params['charge_request']: + if _params['charge_request'] is not None: _body_params = _params['charge_request'] # set the HTTP header `Accept` diff --git a/conekta/api/companies_api.py b/conekta/api/companies_api.py index c4098da..7563914 100644 --- a/conekta/api/companies_api.py +++ b/conekta/api/companies_api.py @@ -7,13 +7,15 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" -from __future__ import absolute_import import re # noqa: F401 +import io +import warnings from pydantic import validate_arguments, ValidationError from typing_extensions import Annotated @@ -26,6 +28,7 @@ from conekta.models.get_companies_response import GetCompaniesResponse from conekta.api_client import ApiClient +from conekta.api_response import ApiResponse from conekta.exceptions import ( # noqa: F401 ApiTypeError, ApiValueError @@ -67,10 +70,6 @@ def get_companies(self, accept_language : Annotated[Optional[StrictStr], Field(d :type previous: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -81,10 +80,12 @@ def get_companies(self, accept_language : Annotated[Optional[StrictStr], Field(d :rtype: GetCompaniesResponse """ kwargs['_return_http_data_only'] = True + if '_preload_content' in kwargs: + raise ValueError("Error! Please call the get_companies_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.get_companies_with_http_info(accept_language, limit, search, next, previous, **kwargs) # noqa: E501 @validate_arguments - def get_companies_with_http_info(self, accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, limit : Annotated[Optional[conint(strict=True, le=250, ge=1)], Field(description="The numbers of items to return, the maximum value is 250")] = None, search : Annotated[Optional[StrictStr], Field(description="General order search, e.g. by mail, reference etc.")] = None, next : Annotated[Optional[StrictStr], Field(description="next page")] = None, previous : Annotated[Optional[StrictStr], Field(description="previous page")] = None, **kwargs): # noqa: E501 + def get_companies_with_http_info(self, accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, limit : Annotated[Optional[conint(strict=True, le=250, ge=1)], Field(description="The numbers of items to return, the maximum value is 250")] = None, search : Annotated[Optional[StrictStr], Field(description="General order search, e.g. by mail, reference etc.")] = None, next : Annotated[Optional[StrictStr], Field(description="next page")] = None, previous : Annotated[Optional[StrictStr], Field(description="previous page")] = None, **kwargs) -> ApiResponse: # noqa: E501 """Get List of Companies # noqa: E501 Consume the list of child companies. This is used for holding companies with several child entities. # noqa: E501 @@ -106,13 +107,14 @@ def get_companies_with_http_info(self, accept_language : Annotated[Optional[Stri :type previous: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -168,10 +170,13 @@ def get_companies_with_http_info(self, accept_language : Annotated[Optional[Stri _query_params = [] if _params.get('limit') is not None: # noqa: E501 _query_params.append(('limit', _params['limit'])) + if _params.get('search') is not None: # noqa: E501 _query_params.append(('search', _params['search'])) + if _params.get('next') is not None: # noqa: E501 _query_params.append(('next', _params['next'])) + if _params.get('previous') is not None: # noqa: E501 _query_params.append(('previous', _params['previous'])) @@ -183,10 +188,8 @@ def get_companies_with_http_info(self, accept_language : Annotated[Optional[Stri # process the form parameters _form_params = [] _files = {} - # process the body parameter _body_params = None - # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( ['application/vnd.conekta-v2.1.0+json']) # noqa: E501 @@ -233,10 +236,6 @@ def get_company(self, id : Annotated[StrictStr, Field(..., description="Identifi :type accept_language: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -247,10 +246,12 @@ def get_company(self, id : Annotated[StrictStr, Field(..., description="Identifi :rtype: CompanyResponse """ kwargs['_return_http_data_only'] = True + if '_preload_content' in kwargs: + raise ValueError("Error! Please call the get_company_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.get_company_with_http_info(id, accept_language, **kwargs) # noqa: E501 @validate_arguments - def get_company_with_http_info(self, id : Annotated[StrictStr, Field(..., description="Identifier of the resource")], accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, **kwargs): # noqa: E501 + def get_company_with_http_info(self, id : Annotated[StrictStr, Field(..., description="Identifier of the resource")], accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, **kwargs) -> ApiResponse: # noqa: E501 """Get Company # noqa: E501 This method makes a synchronous HTTP request by default. To make an @@ -265,13 +266,14 @@ def get_company_with_http_info(self, id : Annotated[StrictStr, Field(..., descri :type accept_language: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -322,9 +324,9 @@ def get_company_with_http_info(self, id : Annotated[StrictStr, Field(..., descri if _params['id']: _path_params['id'] = _params['id'] + # process the query parameters _query_params = [] - # process the header parameters _header_params = dict(_params.get('_headers', {})) if _params['accept_language']: @@ -333,10 +335,8 @@ def get_company_with_http_info(self, id : Annotated[StrictStr, Field(..., descri # process the form parameters _form_params = [] _files = {} - # process the body parameter _body_params = None - # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( ['application/vnd.conekta-v2.1.0+json']) # noqa: E501 diff --git a/conekta/api/customers_api.py b/conekta/api/customers_api.py index 3d9dbab..d350db1 100644 --- a/conekta/api/customers_api.py +++ b/conekta/api/customers_api.py @@ -7,13 +7,15 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" -from __future__ import absolute_import import re # noqa: F401 +import io +import warnings from pydantic import validate_arguments, ValidationError from typing_extensions import Annotated @@ -32,6 +34,7 @@ from conekta.models.update_customer_fiscal_entities_response import UpdateCustomerFiscalEntitiesResponse from conekta.api_client import ApiClient +from conekta.api_response import ApiResponse from conekta.exceptions import ( # noqa: F401 ApiTypeError, ApiValueError @@ -69,10 +72,6 @@ def create_customer(self, customer : Annotated[Customer, Field(..., description= :type x_child_company_id: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -83,10 +82,12 @@ def create_customer(self, customer : Annotated[Customer, Field(..., description= :rtype: CustomerResponse """ kwargs['_return_http_data_only'] = True + if '_preload_content' in kwargs: + raise ValueError("Error! Please call the create_customer_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.create_customer_with_http_info(customer, accept_language, x_child_company_id, **kwargs) # noqa: E501 @validate_arguments - def create_customer_with_http_info(self, customer : Annotated[Customer, Field(..., description="requested field for customer")], accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, x_child_company_id : Annotated[Optional[StrictStr], Field(description="In the case of a holding company, the company id of the child company to which will process the request.")] = None, **kwargs): # noqa: E501 + def create_customer_with_http_info(self, customer : Annotated[Customer, Field(..., description="requested field for customer")], accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, x_child_company_id : Annotated[Optional[StrictStr], Field(description="In the case of a holding company, the company id of the child company to which will process the request.")] = None, **kwargs) -> ApiResponse: # noqa: E501 """Create customer # noqa: E501 The purpose of business is to create and keep a customer, you will learn what elements you need to create a customer. Remember the credit and debit card tokenization process: [https://developers.conekta.com/page/web-checkout-tokenizer](https://developers.conekta.com/page/web-checkout-tokenizer) # noqa: E501 @@ -104,13 +105,14 @@ def create_customer_with_http_info(self, customer : Annotated[Customer, Field(.. :type x_child_company_id: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -162,21 +164,20 @@ def create_customer_with_http_info(self, customer : Annotated[Customer, Field(.. # process the query parameters _query_params = [] - # process the header parameters _header_params = dict(_params.get('_headers', {})) if _params['accept_language']: _header_params['Accept-Language'] = _params['accept_language'] + if _params['x_child_company_id']: _header_params['X-Child-Company-Id'] = _params['x_child_company_id'] # process the form parameters _form_params = [] _files = {} - # process the body parameter _body_params = None - if _params['customer']: + if _params['customer'] is not None: _body_params = _params['customer'] # set the HTTP header `Accept` @@ -239,10 +240,6 @@ def create_customer_fiscal_entities(self, id : Annotated[StrictStr, Field(..., d :type x_child_company_id: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -253,10 +250,12 @@ def create_customer_fiscal_entities(self, id : Annotated[StrictStr, Field(..., d :rtype: CreateCustomerFiscalEntitiesResponse """ kwargs['_return_http_data_only'] = True + if '_preload_content' in kwargs: + raise ValueError("Error! Please call the create_customer_fiscal_entities_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.create_customer_fiscal_entities_with_http_info(id, customer_fiscal_entities_request, accept_language, x_child_company_id, **kwargs) # noqa: E501 @validate_arguments - def create_customer_fiscal_entities_with_http_info(self, id : Annotated[StrictStr, Field(..., description="Identifier of the resource")], customer_fiscal_entities_request : Annotated[CustomerFiscalEntitiesRequest, Field(..., description="requested field for customer fiscal entities")], accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, x_child_company_id : Annotated[Optional[StrictStr], Field(description="In the case of a holding company, the company id of the child company to which will process the request.")] = None, **kwargs): # noqa: E501 + def create_customer_fiscal_entities_with_http_info(self, id : Annotated[StrictStr, Field(..., description="Identifier of the resource")], customer_fiscal_entities_request : Annotated[CustomerFiscalEntitiesRequest, Field(..., description="requested field for customer fiscal entities")], accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, x_child_company_id : Annotated[Optional[StrictStr], Field(description="In the case of a holding company, the company id of the child company to which will process the request.")] = None, **kwargs) -> ApiResponse: # noqa: E501 """Create Fiscal Entity # noqa: E501 Create Fiscal entity resource that corresponds to a customer ID. # noqa: E501 @@ -276,13 +275,14 @@ def create_customer_fiscal_entities_with_http_info(self, id : Annotated[StrictSt :type x_child_company_id: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -335,23 +335,23 @@ def create_customer_fiscal_entities_with_http_info(self, id : Annotated[StrictSt if _params['id']: _path_params['id'] = _params['id'] + # process the query parameters _query_params = [] - # process the header parameters _header_params = dict(_params.get('_headers', {})) if _params['accept_language']: _header_params['Accept-Language'] = _params['accept_language'] + if _params['x_child_company_id']: _header_params['X-Child-Company-Id'] = _params['x_child_company_id'] # process the form parameters _form_params = [] _files = {} - # process the body parameter _body_params = None - if _params['customer_fiscal_entities_request']: + if _params['customer_fiscal_entities_request'] is not None: _body_params = _params['customer_fiscal_entities_request'] # set the HTTP header `Accept` @@ -412,10 +412,6 @@ def delete_customer_by_id(self, id : Annotated[StrictStr, Field(..., description :type x_child_company_id: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -426,10 +422,12 @@ def delete_customer_by_id(self, id : Annotated[StrictStr, Field(..., description :rtype: CustomerResponse """ kwargs['_return_http_data_only'] = True + if '_preload_content' in kwargs: + raise ValueError("Error! Please call the delete_customer_by_id_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.delete_customer_by_id_with_http_info(id, accept_language, x_child_company_id, **kwargs) # noqa: E501 @validate_arguments - def delete_customer_by_id_with_http_info(self, id : Annotated[StrictStr, Field(..., description="Identifier of the resource")], accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, x_child_company_id : Annotated[Optional[StrictStr], Field(description="In the case of a holding company, the company id of the child company to which will process the request.")] = None, **kwargs): # noqa: E501 + def delete_customer_by_id_with_http_info(self, id : Annotated[StrictStr, Field(..., description="Identifier of the resource")], accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, x_child_company_id : Annotated[Optional[StrictStr], Field(description="In the case of a holding company, the company id of the child company to which will process the request.")] = None, **kwargs) -> ApiResponse: # noqa: E501 """Delete Customer # noqa: E501 Deleted a customer resource that corresponds to a customer ID. # noqa: E501 @@ -447,13 +445,14 @@ def delete_customer_by_id_with_http_info(self, id : Annotated[StrictStr, Field(. :type x_child_company_id: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -505,23 +504,22 @@ def delete_customer_by_id_with_http_info(self, id : Annotated[StrictStr, Field(. if _params['id']: _path_params['id'] = _params['id'] + # process the query parameters _query_params = [] - # process the header parameters _header_params = dict(_params.get('_headers', {})) if _params['accept_language']: _header_params['Accept-Language'] = _params['accept_language'] + if _params['x_child_company_id']: _header_params['X-Child-Company-Id'] = _params['x_child_company_id'] # process the form parameters _form_params = [] _files = {} - # process the body parameter _body_params = None - # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( ['application/vnd.conekta-v2.1.0+json']) # noqa: E501 @@ -573,10 +571,6 @@ def get_customer_by_id(self, id : Annotated[StrictStr, Field(..., description="I :type x_child_company_id: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -587,10 +581,12 @@ def get_customer_by_id(self, id : Annotated[StrictStr, Field(..., description="I :rtype: CustomerResponse """ kwargs['_return_http_data_only'] = True + if '_preload_content' in kwargs: + raise ValueError("Error! Please call the get_customer_by_id_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.get_customer_by_id_with_http_info(id, accept_language, x_child_company_id, **kwargs) # noqa: E501 @validate_arguments - def get_customer_by_id_with_http_info(self, id : Annotated[StrictStr, Field(..., description="Identifier of the resource")], accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, x_child_company_id : Annotated[Optional[StrictStr], Field(description="In the case of a holding company, the company id of the child company to which will process the request.")] = None, **kwargs): # noqa: E501 + def get_customer_by_id_with_http_info(self, id : Annotated[StrictStr, Field(..., description="Identifier of the resource")], accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, x_child_company_id : Annotated[Optional[StrictStr], Field(description="In the case of a holding company, the company id of the child company to which will process the request.")] = None, **kwargs) -> ApiResponse: # noqa: E501 """Get Customer # noqa: E501 Gets a customer resource that corresponds to a customer ID. # noqa: E501 @@ -608,13 +604,14 @@ def get_customer_by_id_with_http_info(self, id : Annotated[StrictStr, Field(..., :type x_child_company_id: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -666,23 +663,22 @@ def get_customer_by_id_with_http_info(self, id : Annotated[StrictStr, Field(..., if _params['id']: _path_params['id'] = _params['id'] + # process the query parameters _query_params = [] - # process the header parameters _header_params = dict(_params.get('_headers', {})) if _params['accept_language']: _header_params['Accept-Language'] = _params['accept_language'] + if _params['x_child_company_id']: _header_params['X-Child-Company-Id'] = _params['x_child_company_id'] # process the form parameters _form_params = [] _files = {} - # process the body parameter _body_params = None - # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( ['application/vnd.conekta-v2.1.0+json']) # noqa: E501 @@ -739,10 +735,6 @@ def get_customers(self, accept_language : Annotated[Optional[StrictStr], Field(d :type previous: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -753,10 +745,12 @@ def get_customers(self, accept_language : Annotated[Optional[StrictStr], Field(d :rtype: CustomersResponse """ kwargs['_return_http_data_only'] = True + if '_preload_content' in kwargs: + raise ValueError("Error! Please call the get_customers_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.get_customers_with_http_info(accept_language, x_child_company_id, limit, search, next, previous, **kwargs) # noqa: E501 @validate_arguments - def get_customers_with_http_info(self, accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, x_child_company_id : Annotated[Optional[StrictStr], Field(description="In the case of a holding company, the company id of the child company to which will process the request.")] = None, limit : Annotated[Optional[conint(strict=True, le=250, ge=1)], Field(description="The numbers of items to return, the maximum value is 250")] = None, search : Annotated[Optional[StrictStr], Field(description="General order search, e.g. by mail, reference etc.")] = None, next : Annotated[Optional[StrictStr], Field(description="next page")] = None, previous : Annotated[Optional[StrictStr], Field(description="previous page")] = None, **kwargs): # noqa: E501 + def get_customers_with_http_info(self, accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, x_child_company_id : Annotated[Optional[StrictStr], Field(description="In the case of a holding company, the company id of the child company to which will process the request.")] = None, limit : Annotated[Optional[conint(strict=True, le=250, ge=1)], Field(description="The numbers of items to return, the maximum value is 250")] = None, search : Annotated[Optional[StrictStr], Field(description="General order search, e.g. by mail, reference etc.")] = None, next : Annotated[Optional[StrictStr], Field(description="next page")] = None, previous : Annotated[Optional[StrictStr], Field(description="previous page")] = None, **kwargs) -> ApiResponse: # noqa: E501 """Get a list of customers # noqa: E501 The purpose of business is to create and maintain a client, you will learn what elements you need to obtain a list of clients, which can be paged. # noqa: E501 @@ -780,13 +774,14 @@ def get_customers_with_http_info(self, accept_language : Annotated[Optional[Stri :type previous: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -843,10 +838,13 @@ def get_customers_with_http_info(self, accept_language : Annotated[Optional[Stri _query_params = [] if _params.get('limit') is not None: # noqa: E501 _query_params.append(('limit', _params['limit'])) + if _params.get('search') is not None: # noqa: E501 _query_params.append(('search', _params['search'])) + if _params.get('next') is not None: # noqa: E501 _query_params.append(('next', _params['next'])) + if _params.get('previous') is not None: # noqa: E501 _query_params.append(('previous', _params['previous'])) @@ -854,16 +852,15 @@ def get_customers_with_http_info(self, accept_language : Annotated[Optional[Stri _header_params = dict(_params.get('_headers', {})) if _params['accept_language']: _header_params['Accept-Language'] = _params['accept_language'] + if _params['x_child_company_id']: _header_params['X-Child-Company-Id'] = _params['x_child_company_id'] # process the form parameters _form_params = [] _files = {} - # process the body parameter _body_params = None - # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( ['application/vnd.conekta-v2.1.0+json']) # noqa: E501 @@ -915,10 +912,6 @@ def update_customer(self, id : Annotated[StrictStr, Field(..., description="Iden :type x_child_company_id: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -929,10 +922,12 @@ def update_customer(self, id : Annotated[StrictStr, Field(..., description="Iden :rtype: CustomerResponse """ kwargs['_return_http_data_only'] = True + if '_preload_content' in kwargs: + raise ValueError("Error! Please call the update_customer_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.update_customer_with_http_info(id, update_customer, accept_language, x_child_company_id, **kwargs) # noqa: E501 @validate_arguments - def update_customer_with_http_info(self, id : Annotated[StrictStr, Field(..., description="Identifier of the resource")], update_customer : Annotated[UpdateCustomer, Field(..., description="requested field for customer")], accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, x_child_company_id : Annotated[Optional[StrictStr], Field(description="In the case of a holding company, the company id of the child company to which will process the request.")] = None, **kwargs): # noqa: E501 + def update_customer_with_http_info(self, id : Annotated[StrictStr, Field(..., description="Identifier of the resource")], update_customer : Annotated[UpdateCustomer, Field(..., description="requested field for customer")], accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, x_child_company_id : Annotated[Optional[StrictStr], Field(description="In the case of a holding company, the company id of the child company to which will process the request.")] = None, **kwargs) -> ApiResponse: # noqa: E501 """Update customer # noqa: E501 You can update customer-related data # noqa: E501 @@ -952,13 +947,14 @@ def update_customer_with_http_info(self, id : Annotated[StrictStr, Field(..., de :type x_child_company_id: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1011,23 +1007,23 @@ def update_customer_with_http_info(self, id : Annotated[StrictStr, Field(..., de if _params['id']: _path_params['id'] = _params['id'] + # process the query parameters _query_params = [] - # process the header parameters _header_params = dict(_params.get('_headers', {})) if _params['accept_language']: _header_params['Accept-Language'] = _params['accept_language'] + if _params['x_child_company_id']: _header_params['X-Child-Company-Id'] = _params['x_child_company_id'] # process the form parameters _form_params = [] _files = {} - # process the body parameter _body_params = None - if _params['update_customer']: + if _params['update_customer'] is not None: _body_params = _params['update_customer'] # set the HTTP header `Accept` @@ -1092,10 +1088,6 @@ def update_customer_fiscal_entities(self, id : Annotated[StrictStr, Field(..., d :type x_child_company_id: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1106,10 +1098,12 @@ def update_customer_fiscal_entities(self, id : Annotated[StrictStr, Field(..., d :rtype: UpdateCustomerFiscalEntitiesResponse """ kwargs['_return_http_data_only'] = True + if '_preload_content' in kwargs: + raise ValueError("Error! Please call the update_customer_fiscal_entities_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.update_customer_fiscal_entities_with_http_info(id, fiscal_entities_id, customer_update_fiscal_entities_request, accept_language, x_child_company_id, **kwargs) # noqa: E501 @validate_arguments - def update_customer_fiscal_entities_with_http_info(self, id : Annotated[StrictStr, Field(..., description="Identifier of the resource")], fiscal_entities_id : Annotated[StrictStr, Field(..., description="identifier")], customer_update_fiscal_entities_request : Annotated[CustomerUpdateFiscalEntitiesRequest, Field(..., description="requested field for customer update fiscal entities")], accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, x_child_company_id : Annotated[Optional[StrictStr], Field(description="In the case of a holding company, the company id of the child company to which will process the request.")] = None, **kwargs): # noqa: E501 + def update_customer_fiscal_entities_with_http_info(self, id : Annotated[StrictStr, Field(..., description="Identifier of the resource")], fiscal_entities_id : Annotated[StrictStr, Field(..., description="identifier")], customer_update_fiscal_entities_request : Annotated[CustomerUpdateFiscalEntitiesRequest, Field(..., description="requested field for customer update fiscal entities")], accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, x_child_company_id : Annotated[Optional[StrictStr], Field(description="In the case of a holding company, the company id of the child company to which will process the request.")] = None, **kwargs) -> ApiResponse: # noqa: E501 """Update Fiscal Entity # noqa: E501 Update Fiscal Entity resource that corresponds to a customer ID. # noqa: E501 @@ -1131,13 +1125,14 @@ def update_customer_fiscal_entities_with_http_info(self, id : Annotated[StrictSt :type x_child_company_id: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1190,26 +1185,27 @@ def update_customer_fiscal_entities_with_http_info(self, id : Annotated[StrictSt _path_params = {} if _params['id']: _path_params['id'] = _params['id'] + if _params['fiscal_entities_id']: _path_params['fiscal_entities_id'] = _params['fiscal_entities_id'] + # process the query parameters _query_params = [] - # process the header parameters _header_params = dict(_params.get('_headers', {})) if _params['accept_language']: _header_params['Accept-Language'] = _params['accept_language'] + if _params['x_child_company_id']: _header_params['X-Child-Company-Id'] = _params['x_child_company_id'] # process the form parameters _form_params = [] _files = {} - # process the body parameter _body_params = None - if _params['customer_update_fiscal_entities_request']: + if _params['customer_update_fiscal_entities_request'] is not None: _body_params = _params['customer_update_fiscal_entities_request'] # set the HTTP header `Accept` diff --git a/conekta/api/discounts_api.py b/conekta/api/discounts_api.py index 953ac88..5b23d33 100644 --- a/conekta/api/discounts_api.py +++ b/conekta/api/discounts_api.py @@ -7,13 +7,15 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" -from __future__ import absolute_import import re # noqa: F401 +import io +import warnings from pydantic import validate_arguments, ValidationError from typing_extensions import Annotated @@ -27,6 +29,7 @@ from conekta.models.update_order_discount_lines_request import UpdateOrderDiscountLinesRequest from conekta.api_client import ApiClient +from conekta.api_response import ApiResponse from conekta.exceptions import ( # noqa: F401 ApiTypeError, ApiValueError @@ -66,10 +69,6 @@ def orders_create_discount_line(self, id : Annotated[StrictStr, Field(..., descr :type x_child_company_id: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -80,10 +79,12 @@ def orders_create_discount_line(self, id : Annotated[StrictStr, Field(..., descr :rtype: DiscountLinesResponse """ kwargs['_return_http_data_only'] = True + if '_preload_content' in kwargs: + raise ValueError("Error! Please call the orders_create_discount_line_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.orders_create_discount_line_with_http_info(id, order_discount_lines_request, accept_language, x_child_company_id, **kwargs) # noqa: E501 @validate_arguments - def orders_create_discount_line_with_http_info(self, id : Annotated[StrictStr, Field(..., description="Identifier of the resource")], order_discount_lines_request : Annotated[OrderDiscountLinesRequest, Field(..., description="requested field for a discount lines")], accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, x_child_company_id : Annotated[Optional[StrictStr], Field(description="In the case of a holding company, the company id of the child company to which will process the request.")] = None, **kwargs): # noqa: E501 + def orders_create_discount_line_with_http_info(self, id : Annotated[StrictStr, Field(..., description="Identifier of the resource")], order_discount_lines_request : Annotated[OrderDiscountLinesRequest, Field(..., description="requested field for a discount lines")], accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, x_child_company_id : Annotated[Optional[StrictStr], Field(description="In the case of a holding company, the company id of the child company to which will process the request.")] = None, **kwargs) -> ApiResponse: # noqa: E501 """Create Discount # noqa: E501 Create discount lines for an existing orden # noqa: E501 @@ -103,13 +104,14 @@ def orders_create_discount_line_with_http_info(self, id : Annotated[StrictStr, F :type x_child_company_id: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -162,23 +164,23 @@ def orders_create_discount_line_with_http_info(self, id : Annotated[StrictStr, F if _params['id']: _path_params['id'] = _params['id'] + # process the query parameters _query_params = [] - # process the header parameters _header_params = dict(_params.get('_headers', {})) if _params['accept_language']: _header_params['Accept-Language'] = _params['accept_language'] + if _params['x_child_company_id']: _header_params['X-Child-Company-Id'] = _params['x_child_company_id'] # process the form parameters _form_params = [] _files = {} - # process the body parameter _body_params = None - if _params['order_discount_lines_request']: + if _params['order_discount_lines_request'] is not None: _body_params = _params['order_discount_lines_request'] # set the HTTP header `Accept` @@ -240,10 +242,6 @@ def orders_delete_discount_lines(self, id : Annotated[StrictStr, Field(..., desc :type x_child_company_id: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -254,10 +252,12 @@ def orders_delete_discount_lines(self, id : Annotated[StrictStr, Field(..., desc :rtype: DiscountLinesResponse """ kwargs['_return_http_data_only'] = True + if '_preload_content' in kwargs: + raise ValueError("Error! Please call the orders_delete_discount_lines_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.orders_delete_discount_lines_with_http_info(id, discount_lines_id, accept_language, x_child_company_id, **kwargs) # noqa: E501 @validate_arguments - def orders_delete_discount_lines_with_http_info(self, id : Annotated[StrictStr, Field(..., description="Identifier of the resource")], discount_lines_id : Annotated[StrictStr, Field(..., description="identifier")], accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, x_child_company_id : Annotated[Optional[StrictStr], Field(description="In the case of a holding company, the company id of the child company to which will process the request.")] = None, **kwargs): # noqa: E501 + def orders_delete_discount_lines_with_http_info(self, id : Annotated[StrictStr, Field(..., description="Identifier of the resource")], discount_lines_id : Annotated[StrictStr, Field(..., description="identifier")], accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, x_child_company_id : Annotated[Optional[StrictStr], Field(description="In the case of a holding company, the company id of the child company to which will process the request.")] = None, **kwargs) -> ApiResponse: # noqa: E501 """Delete Discount # noqa: E501 Delete an existing discount lines for an existing orden # noqa: E501 @@ -277,13 +277,14 @@ def orders_delete_discount_lines_with_http_info(self, id : Annotated[StrictStr, :type x_child_company_id: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -335,26 +336,26 @@ def orders_delete_discount_lines_with_http_info(self, id : Annotated[StrictStr, _path_params = {} if _params['id']: _path_params['id'] = _params['id'] + if _params['discount_lines_id']: _path_params['discount_lines_id'] = _params['discount_lines_id'] + # process the query parameters _query_params = [] - # process the header parameters _header_params = dict(_params.get('_headers', {})) if _params['accept_language']: _header_params['Accept-Language'] = _params['accept_language'] + if _params['x_child_company_id']: _header_params['X-Child-Company-Id'] = _params['x_child_company_id'] # process the form parameters _form_params = [] _files = {} - # process the body parameter _body_params = None - # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( ['application/vnd.conekta-v2.1.0+json']) # noqa: E501 @@ -410,10 +411,6 @@ def orders_update_discount_lines(self, id : Annotated[StrictStr, Field(..., desc :type x_child_company_id: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -424,10 +421,12 @@ def orders_update_discount_lines(self, id : Annotated[StrictStr, Field(..., desc :rtype: DiscountLinesResponse """ kwargs['_return_http_data_only'] = True + if '_preload_content' in kwargs: + raise ValueError("Error! Please call the orders_update_discount_lines_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.orders_update_discount_lines_with_http_info(id, discount_lines_id, update_order_discount_lines_request, accept_language, x_child_company_id, **kwargs) # noqa: E501 @validate_arguments - def orders_update_discount_lines_with_http_info(self, id : Annotated[StrictStr, Field(..., description="Identifier of the resource")], discount_lines_id : Annotated[StrictStr, Field(..., description="identifier")], update_order_discount_lines_request : Annotated[UpdateOrderDiscountLinesRequest, Field(..., description="requested field for a discount lines")], accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, x_child_company_id : Annotated[Optional[StrictStr], Field(description="In the case of a holding company, the company id of the child company to which will process the request.")] = None, **kwargs): # noqa: E501 + def orders_update_discount_lines_with_http_info(self, id : Annotated[StrictStr, Field(..., description="Identifier of the resource")], discount_lines_id : Annotated[StrictStr, Field(..., description="identifier")], update_order_discount_lines_request : Annotated[UpdateOrderDiscountLinesRequest, Field(..., description="requested field for a discount lines")], accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, x_child_company_id : Annotated[Optional[StrictStr], Field(description="In the case of a holding company, the company id of the child company to which will process the request.")] = None, **kwargs) -> ApiResponse: # noqa: E501 """Update Discount # noqa: E501 Update an existing discount lines for an existing orden # noqa: E501 @@ -449,13 +448,14 @@ def orders_update_discount_lines_with_http_info(self, id : Annotated[StrictStr, :type x_child_company_id: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -508,26 +508,27 @@ def orders_update_discount_lines_with_http_info(self, id : Annotated[StrictStr, _path_params = {} if _params['id']: _path_params['id'] = _params['id'] + if _params['discount_lines_id']: _path_params['discount_lines_id'] = _params['discount_lines_id'] + # process the query parameters _query_params = [] - # process the header parameters _header_params = dict(_params.get('_headers', {})) if _params['accept_language']: _header_params['Accept-Language'] = _params['accept_language'] + if _params['x_child_company_id']: _header_params['X-Child-Company-Id'] = _params['x_child_company_id'] # process the form parameters _form_params = [] _files = {} - # process the body parameter _body_params = None - if _params['update_order_discount_lines_request']: + if _params['update_order_discount_lines_request'] is not None: _body_params = _params['update_order_discount_lines_request'] # set the HTTP header `Accept` diff --git a/conekta/api/events_api.py b/conekta/api/events_api.py index be47b1e..46b49ab 100644 --- a/conekta/api/events_api.py +++ b/conekta/api/events_api.py @@ -7,13 +7,15 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" -from __future__ import absolute_import import re # noqa: F401 +import io +import warnings from pydantic import validate_arguments, ValidationError from typing_extensions import Annotated @@ -27,6 +29,7 @@ from conekta.models.get_events_response import GetEventsResponse from conekta.api_client import ApiClient +from conekta.api_response import ApiResponse from conekta.exceptions import ( # noqa: F401 ApiTypeError, ApiValueError @@ -64,10 +67,6 @@ def get_event(self, id : Annotated[StrictStr, Field(..., description="Identifier :type x_child_company_id: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -78,10 +77,12 @@ def get_event(self, id : Annotated[StrictStr, Field(..., description="Identifier :rtype: EventResponse """ kwargs['_return_http_data_only'] = True + if '_preload_content' in kwargs: + raise ValueError("Error! Please call the get_event_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.get_event_with_http_info(id, accept_language, x_child_company_id, **kwargs) # noqa: E501 @validate_arguments - def get_event_with_http_info(self, id : Annotated[StrictStr, Field(..., description="Identifier of the resource")], accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, x_child_company_id : Annotated[Optional[StrictStr], Field(description="In the case of a holding company, the company id of the child company to which will process the request.")] = None, **kwargs): # noqa: E501 + def get_event_with_http_info(self, id : Annotated[StrictStr, Field(..., description="Identifier of the resource")], accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, x_child_company_id : Annotated[Optional[StrictStr], Field(description="In the case of a holding company, the company id of the child company to which will process the request.")] = None, **kwargs) -> ApiResponse: # noqa: E501 """Get Event # noqa: E501 Returns a single event # noqa: E501 @@ -99,13 +100,14 @@ def get_event_with_http_info(self, id : Annotated[StrictStr, Field(..., descript :type x_child_company_id: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -157,23 +159,22 @@ def get_event_with_http_info(self, id : Annotated[StrictStr, Field(..., descript if _params['id']: _path_params['id'] = _params['id'] + # process the query parameters _query_params = [] - # process the header parameters _header_params = dict(_params.get('_headers', {})) if _params['accept_language']: _header_params['Accept-Language'] = _params['accept_language'] + if _params['x_child_company_id']: _header_params['X-Child-Company-Id'] = _params['x_child_company_id'] # process the form parameters _form_params = [] _files = {} - # process the body parameter _body_params = None - # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( ['application/vnd.conekta-v2.1.0+json']) # noqa: E501 @@ -229,10 +230,6 @@ def get_events(self, accept_language : Annotated[Optional[StrictStr], Field(desc :type previous: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -243,10 +240,12 @@ def get_events(self, accept_language : Annotated[Optional[StrictStr], Field(desc :rtype: GetEventsResponse """ kwargs['_return_http_data_only'] = True + if '_preload_content' in kwargs: + raise ValueError("Error! Please call the get_events_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.get_events_with_http_info(accept_language, x_child_company_id, limit, search, next, previous, **kwargs) # noqa: E501 @validate_arguments - def get_events_with_http_info(self, accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, x_child_company_id : Annotated[Optional[StrictStr], Field(description="In the case of a holding company, the company id of the child company to which will process the request.")] = None, limit : Annotated[Optional[conint(strict=True, le=250, ge=1)], Field(description="The numbers of items to return, the maximum value is 250")] = None, search : Annotated[Optional[StrictStr], Field(description="General order search, e.g. by mail, reference etc.")] = None, next : Annotated[Optional[StrictStr], Field(description="next page")] = None, previous : Annotated[Optional[StrictStr], Field(description="previous page")] = None, **kwargs): # noqa: E501 + def get_events_with_http_info(self, accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, x_child_company_id : Annotated[Optional[StrictStr], Field(description="In the case of a holding company, the company id of the child company to which will process the request.")] = None, limit : Annotated[Optional[conint(strict=True, le=250, ge=1)], Field(description="The numbers of items to return, the maximum value is 250")] = None, search : Annotated[Optional[StrictStr], Field(description="General order search, e.g. by mail, reference etc.")] = None, next : Annotated[Optional[StrictStr], Field(description="next page")] = None, previous : Annotated[Optional[StrictStr], Field(description="previous page")] = None, **kwargs) -> ApiResponse: # noqa: E501 """Get list of Events # noqa: E501 This method makes a synchronous HTTP request by default. To make an @@ -269,13 +268,14 @@ def get_events_with_http_info(self, accept_language : Annotated[Optional[StrictS :type previous: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -332,10 +332,13 @@ def get_events_with_http_info(self, accept_language : Annotated[Optional[StrictS _query_params = [] if _params.get('limit') is not None: # noqa: E501 _query_params.append(('limit', _params['limit'])) + if _params.get('search') is not None: # noqa: E501 _query_params.append(('search', _params['search'])) + if _params.get('next') is not None: # noqa: E501 _query_params.append(('next', _params['next'])) + if _params.get('previous') is not None: # noqa: E501 _query_params.append(('previous', _params['previous'])) @@ -343,16 +346,15 @@ def get_events_with_http_info(self, accept_language : Annotated[Optional[StrictS _header_params = dict(_params.get('_headers', {})) if _params['accept_language']: _header_params['Accept-Language'] = _params['accept_language'] + if _params['x_child_company_id']: _header_params['X-Child-Company-Id'] = _params['x_child_company_id'] # process the form parameters _form_params = [] _files = {} - # process the body parameter _body_params = None - # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( ['application/vnd.conekta-v2.1.0+json']) # noqa: E501 @@ -402,10 +404,6 @@ def resend_event(self, event_id : Annotated[StrictStr, Field(..., description="e :type accept_language: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -416,10 +414,12 @@ def resend_event(self, event_id : Annotated[StrictStr, Field(..., description="e :rtype: EventsResendResponse """ kwargs['_return_http_data_only'] = True + if '_preload_content' in kwargs: + raise ValueError("Error! Please call the resend_event_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.resend_event_with_http_info(event_id, webhook_log_id, accept_language, **kwargs) # noqa: E501 @validate_arguments - def resend_event_with_http_info(self, event_id : Annotated[StrictStr, Field(..., description="event identifier")], webhook_log_id : Annotated[StrictStr, Field(..., description="webhook log identifier")], accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, **kwargs): # noqa: E501 + def resend_event_with_http_info(self, event_id : Annotated[StrictStr, Field(..., description="event identifier")], webhook_log_id : Annotated[StrictStr, Field(..., description="webhook log identifier")], accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, **kwargs) -> ApiResponse: # noqa: E501 """Resend Event # noqa: E501 Try to send an event # noqa: E501 @@ -437,13 +437,14 @@ def resend_event_with_http_info(self, event_id : Annotated[StrictStr, Field(..., :type accept_language: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -494,12 +495,13 @@ def resend_event_with_http_info(self, event_id : Annotated[StrictStr, Field(..., _path_params = {} if _params['event_id']: _path_params['event_id'] = _params['event_id'] + if _params['webhook_log_id']: _path_params['webhook_log_id'] = _params['webhook_log_id'] + # process the query parameters _query_params = [] - # process the header parameters _header_params = dict(_params.get('_headers', {})) if _params['accept_language']: @@ -508,10 +510,8 @@ def resend_event_with_http_info(self, event_id : Annotated[StrictStr, Field(..., # process the form parameters _form_params = [] _files = {} - # process the body parameter _body_params = None - # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( ['application/vnd.conekta-v2.1.0+json']) # noqa: E501 diff --git a/conekta/api/logs_api.py b/conekta/api/logs_api.py index e7c5120..fc15a12 100644 --- a/conekta/api/logs_api.py +++ b/conekta/api/logs_api.py @@ -7,13 +7,15 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" -from __future__ import absolute_import import re # noqa: F401 +import io +import warnings from pydantic import validate_arguments, ValidationError from typing_extensions import Annotated @@ -26,6 +28,7 @@ from conekta.models.logs_response import LogsResponse from conekta.api_client import ApiClient +from conekta.api_response import ApiResponse from conekta.exceptions import ( # noqa: F401 ApiTypeError, ApiValueError @@ -63,10 +66,6 @@ def get_log_by_id(self, id : Annotated[StrictStr, Field(..., description="Identi :type x_child_company_id: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -77,10 +76,12 @@ def get_log_by_id(self, id : Annotated[StrictStr, Field(..., description="Identi :rtype: LogResponse """ kwargs['_return_http_data_only'] = True + if '_preload_content' in kwargs: + raise ValueError("Error! Please call the get_log_by_id_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.get_log_by_id_with_http_info(id, accept_language, x_child_company_id, **kwargs) # noqa: E501 @validate_arguments - def get_log_by_id_with_http_info(self, id : Annotated[StrictStr, Field(..., description="Identifier of the resource")], accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, x_child_company_id : Annotated[Optional[StrictStr], Field(description="In the case of a holding company, the company id of the child company to which will process the request.")] = None, **kwargs): # noqa: E501 + def get_log_by_id_with_http_info(self, id : Annotated[StrictStr, Field(..., description="Identifier of the resource")], accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, x_child_company_id : Annotated[Optional[StrictStr], Field(description="In the case of a holding company, the company id of the child company to which will process the request.")] = None, **kwargs) -> ApiResponse: # noqa: E501 """Get Log # noqa: E501 Get the details of a specific log # noqa: E501 @@ -98,13 +99,14 @@ def get_log_by_id_with_http_info(self, id : Annotated[StrictStr, Field(..., desc :type x_child_company_id: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -156,23 +158,22 @@ def get_log_by_id_with_http_info(self, id : Annotated[StrictStr, Field(..., desc if _params['id']: _path_params['id'] = _params['id'] + # process the query parameters _query_params = [] - # process the header parameters _header_params = dict(_params.get('_headers', {})) if _params['accept_language']: _header_params['Accept-Language'] = _params['accept_language'] + if _params['x_child_company_id']: _header_params['X-Child-Company-Id'] = _params['x_child_company_id'] # process the form parameters _form_params = [] _files = {} - # process the body parameter _body_params = None - # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( ['application/vnd.conekta-v2.1.0+json']) # noqa: E501 @@ -229,10 +230,6 @@ def get_logs(self, accept_language : Annotated[Optional[StrictStr], Field(descri :type previous: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -243,10 +240,12 @@ def get_logs(self, accept_language : Annotated[Optional[StrictStr], Field(descri :rtype: LogsResponse """ kwargs['_return_http_data_only'] = True + if '_preload_content' in kwargs: + raise ValueError("Error! Please call the get_logs_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.get_logs_with_http_info(accept_language, x_child_company_id, limit, search, next, previous, **kwargs) # noqa: E501 @validate_arguments - def get_logs_with_http_info(self, accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, x_child_company_id : Annotated[Optional[StrictStr], Field(description="In the case of a holding company, the company id of the child company to which will process the request.")] = None, limit : Annotated[Optional[conint(strict=True, le=250, ge=1)], Field(description="The numbers of items to return, the maximum value is 250")] = None, search : Annotated[Optional[StrictStr], Field(description="General order search, e.g. by mail, reference etc.")] = None, next : Annotated[Optional[StrictStr], Field(description="next page")] = None, previous : Annotated[Optional[StrictStr], Field(description="previous page")] = None, **kwargs): # noqa: E501 + def get_logs_with_http_info(self, accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, x_child_company_id : Annotated[Optional[StrictStr], Field(description="In the case of a holding company, the company id of the child company to which will process the request.")] = None, limit : Annotated[Optional[conint(strict=True, le=250, ge=1)], Field(description="The numbers of items to return, the maximum value is 250")] = None, search : Annotated[Optional[StrictStr], Field(description="General order search, e.g. by mail, reference etc.")] = None, next : Annotated[Optional[StrictStr], Field(description="next page")] = None, previous : Annotated[Optional[StrictStr], Field(description="previous page")] = None, **kwargs) -> ApiResponse: # noqa: E501 """Get List Of Logs # noqa: E501 Get log details in the form of a list # noqa: E501 @@ -270,13 +269,14 @@ def get_logs_with_http_info(self, accept_language : Annotated[Optional[StrictStr :type previous: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -333,10 +333,13 @@ def get_logs_with_http_info(self, accept_language : Annotated[Optional[StrictStr _query_params = [] if _params.get('limit') is not None: # noqa: E501 _query_params.append(('limit', _params['limit'])) + if _params.get('search') is not None: # noqa: E501 _query_params.append(('search', _params['search'])) + if _params.get('next') is not None: # noqa: E501 _query_params.append(('next', _params['next'])) + if _params.get('previous') is not None: # noqa: E501 _query_params.append(('previous', _params['previous'])) @@ -344,16 +347,15 @@ def get_logs_with_http_info(self, accept_language : Annotated[Optional[StrictStr _header_params = dict(_params.get('_headers', {})) if _params['accept_language']: _header_params['Accept-Language'] = _params['accept_language'] + if _params['x_child_company_id']: _header_params['X-Child-Company-Id'] = _params['x_child_company_id'] # process the form parameters _form_params = [] _files = {} - # process the body parameter _body_params = None - # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( ['application/vnd.conekta-v2.1.0+json']) # noqa: E501 diff --git a/conekta/api/orders_api.py b/conekta/api/orders_api.py index 09f3ff2..b37bd0a 100644 --- a/conekta/api/orders_api.py +++ b/conekta/api/orders_api.py @@ -7,13 +7,15 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" -from __future__ import absolute_import import re # noqa: F401 +import io +import warnings from pydantic import validate_arguments, ValidationError from typing_extensions import Annotated @@ -30,6 +32,7 @@ from conekta.models.order_update_request import OrderUpdateRequest from conekta.api_client import ApiClient +from conekta.api_response import ApiResponse from conekta.exceptions import ( # noqa: F401 ApiTypeError, ApiValueError @@ -67,10 +70,6 @@ def cancel_order(self, id : Annotated[StrictStr, Field(..., description="Identif :type x_child_company_id: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -81,10 +80,12 @@ def cancel_order(self, id : Annotated[StrictStr, Field(..., description="Identif :rtype: OrderResponse """ kwargs['_return_http_data_only'] = True + if '_preload_content' in kwargs: + raise ValueError("Error! Please call the cancel_order_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.cancel_order_with_http_info(id, accept_language, x_child_company_id, **kwargs) # noqa: E501 @validate_arguments - def cancel_order_with_http_info(self, id : Annotated[StrictStr, Field(..., description="Identifier of the resource")], accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, x_child_company_id : Annotated[Optional[StrictStr], Field(description="In the case of a holding company, the company id of the child company to which will process the request.")] = None, **kwargs): # noqa: E501 + def cancel_order_with_http_info(self, id : Annotated[StrictStr, Field(..., description="Identifier of the resource")], accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, x_child_company_id : Annotated[Optional[StrictStr], Field(description="In the case of a holding company, the company id of the child company to which will process the request.")] = None, **kwargs) -> ApiResponse: # noqa: E501 """Cancel Order # noqa: E501 Cancel an order that has been previously created. # noqa: E501 @@ -102,13 +103,14 @@ def cancel_order_with_http_info(self, id : Annotated[StrictStr, Field(..., descr :type x_child_company_id: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -160,23 +162,22 @@ def cancel_order_with_http_info(self, id : Annotated[StrictStr, Field(..., descr if _params['id']: _path_params['id'] = _params['id'] + # process the query parameters _query_params = [] - # process the header parameters _header_params = dict(_params.get('_headers', {})) if _params['accept_language']: _header_params['Accept-Language'] = _params['accept_language'] + if _params['x_child_company_id']: _header_params['X-Child-Company-Id'] = _params['x_child_company_id'] # process the form parameters _form_params = [] _files = {} - # process the body parameter _body_params = None - # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( ['application/vnd.conekta-v2.1.0+json']) # noqa: E501 @@ -229,10 +230,6 @@ def create_order(self, order_request : Annotated[OrderRequest, Field(..., descri :type x_child_company_id: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -243,10 +240,12 @@ def create_order(self, order_request : Annotated[OrderRequest, Field(..., descri :rtype: OrderResponse """ kwargs['_return_http_data_only'] = True + if '_preload_content' in kwargs: + raise ValueError("Error! Please call the create_order_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.create_order_with_http_info(order_request, accept_language, x_child_company_id, **kwargs) # noqa: E501 @validate_arguments - def create_order_with_http_info(self, order_request : Annotated[OrderRequest, Field(..., description="requested field for order")], accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, x_child_company_id : Annotated[Optional[StrictStr], Field(description="In the case of a holding company, the company id of the child company to which will process the request.")] = None, **kwargs): # noqa: E501 + def create_order_with_http_info(self, order_request : Annotated[OrderRequest, Field(..., description="requested field for order")], accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, x_child_company_id : Annotated[Optional[StrictStr], Field(description="In the case of a holding company, the company id of the child company to which will process the request.")] = None, **kwargs) -> ApiResponse: # noqa: E501 """Create order # noqa: E501 Create a new order. # noqa: E501 @@ -264,13 +263,14 @@ def create_order_with_http_info(self, order_request : Annotated[OrderRequest, Fi :type x_child_company_id: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -322,21 +322,20 @@ def create_order_with_http_info(self, order_request : Annotated[OrderRequest, Fi # process the query parameters _query_params = [] - # process the header parameters _header_params = dict(_params.get('_headers', {})) if _params['accept_language']: _header_params['Accept-Language'] = _params['accept_language'] + if _params['x_child_company_id']: _header_params['X-Child-Company-Id'] = _params['x_child_company_id'] # process the form parameters _form_params = [] _files = {} - # process the body parameter _body_params = None - if _params['order_request']: + if _params['order_request'] is not None: _body_params = _params['order_request'] # set the HTTP header `Accept` @@ -397,10 +396,6 @@ def get_order_by_id(self, id : Annotated[StrictStr, Field(..., description="Iden :type x_child_company_id: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -411,10 +406,12 @@ def get_order_by_id(self, id : Annotated[StrictStr, Field(..., description="Iden :rtype: OrderResponse """ kwargs['_return_http_data_only'] = True + if '_preload_content' in kwargs: + raise ValueError("Error! Please call the get_order_by_id_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.get_order_by_id_with_http_info(id, accept_language, x_child_company_id, **kwargs) # noqa: E501 @validate_arguments - def get_order_by_id_with_http_info(self, id : Annotated[StrictStr, Field(..., description="Identifier of the resource")], accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, x_child_company_id : Annotated[Optional[StrictStr], Field(description="In the case of a holding company, the company id of the child company to which will process the request.")] = None, **kwargs): # noqa: E501 + def get_order_by_id_with_http_info(self, id : Annotated[StrictStr, Field(..., description="Identifier of the resource")], accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, x_child_company_id : Annotated[Optional[StrictStr], Field(description="In the case of a holding company, the company id of the child company to which will process the request.")] = None, **kwargs) -> ApiResponse: # noqa: E501 """Get Order # noqa: E501 Info for a specific order # noqa: E501 @@ -432,13 +429,14 @@ def get_order_by_id_with_http_info(self, id : Annotated[StrictStr, Field(..., de :type x_child_company_id: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -490,23 +488,22 @@ def get_order_by_id_with_http_info(self, id : Annotated[StrictStr, Field(..., de if _params['id']: _path_params['id'] = _params['id'] + # process the query parameters _query_params = [] - # process the header parameters _header_params = dict(_params.get('_headers', {})) if _params['accept_language']: _header_params['Accept-Language'] = _params['accept_language'] + if _params['x_child_company_id']: _header_params['X-Child-Company-Id'] = _params['x_child_company_id'] # process the form parameters _form_params = [] _files = {} - # process the body parameter _body_params = None - # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( ['application/vnd.conekta-v2.1.0+json']) # noqa: E501 @@ -563,10 +560,6 @@ def get_orders(self, accept_language : Annotated[Optional[StrictStr], Field(desc :type previous: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -577,10 +570,12 @@ def get_orders(self, accept_language : Annotated[Optional[StrictStr], Field(desc :rtype: GetOrdersResponse """ kwargs['_return_http_data_only'] = True + if '_preload_content' in kwargs: + raise ValueError("Error! Please call the get_orders_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.get_orders_with_http_info(accept_language, x_child_company_id, limit, search, next, previous, **kwargs) # noqa: E501 @validate_arguments - def get_orders_with_http_info(self, accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, x_child_company_id : Annotated[Optional[StrictStr], Field(description="In the case of a holding company, the company id of the child company to which will process the request.")] = None, limit : Annotated[Optional[conint(strict=True, le=250, ge=1)], Field(description="The numbers of items to return, the maximum value is 250")] = None, search : Annotated[Optional[StrictStr], Field(description="General order search, e.g. by mail, reference etc.")] = None, next : Annotated[Optional[StrictStr], Field(description="next page")] = None, previous : Annotated[Optional[StrictStr], Field(description="previous page")] = None, **kwargs): # noqa: E501 + def get_orders_with_http_info(self, accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, x_child_company_id : Annotated[Optional[StrictStr], Field(description="In the case of a holding company, the company id of the child company to which will process the request.")] = None, limit : Annotated[Optional[conint(strict=True, le=250, ge=1)], Field(description="The numbers of items to return, the maximum value is 250")] = None, search : Annotated[Optional[StrictStr], Field(description="General order search, e.g. by mail, reference etc.")] = None, next : Annotated[Optional[StrictStr], Field(description="next page")] = None, previous : Annotated[Optional[StrictStr], Field(description="previous page")] = None, **kwargs) -> ApiResponse: # noqa: E501 """Get a list of Orders # noqa: E501 Get order details in the form of a list # noqa: E501 @@ -604,13 +599,14 @@ def get_orders_with_http_info(self, accept_language : Annotated[Optional[StrictS :type previous: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -667,10 +663,13 @@ def get_orders_with_http_info(self, accept_language : Annotated[Optional[StrictS _query_params = [] if _params.get('limit') is not None: # noqa: E501 _query_params.append(('limit', _params['limit'])) + if _params.get('search') is not None: # noqa: E501 _query_params.append(('search', _params['search'])) + if _params.get('next') is not None: # noqa: E501 _query_params.append(('next', _params['next'])) + if _params.get('previous') is not None: # noqa: E501 _query_params.append(('previous', _params['previous'])) @@ -678,16 +677,15 @@ def get_orders_with_http_info(self, accept_language : Annotated[Optional[StrictS _header_params = dict(_params.get('_headers', {})) if _params['accept_language']: _header_params['Accept-Language'] = _params['accept_language'] + if _params['x_child_company_id']: _header_params['X-Child-Company-Id'] = _params['x_child_company_id'] # process the form parameters _form_params = [] _files = {} - # process the body parameter _body_params = None - # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( ['application/vnd.conekta-v2.1.0+json']) # noqa: E501 @@ -739,10 +737,6 @@ def order_cancel_refund(self, id : Annotated[StrictStr, Field(..., description=" :type x_child_company_id: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -753,10 +747,12 @@ def order_cancel_refund(self, id : Annotated[StrictStr, Field(..., description=" :rtype: OrderResponse """ kwargs['_return_http_data_only'] = True + if '_preload_content' in kwargs: + raise ValueError("Error! Please call the order_cancel_refund_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.order_cancel_refund_with_http_info(id, refund_id, accept_language, x_child_company_id, **kwargs) # noqa: E501 @validate_arguments - def order_cancel_refund_with_http_info(self, id : Annotated[StrictStr, Field(..., description="Identifier of the resource")], refund_id : Annotated[StrictStr, Field(..., description="refund identifier")], accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, x_child_company_id : Annotated[Optional[StrictStr], Field(description="In the case of a holding company, the company id of the child company to which will process the request.")] = None, **kwargs): # noqa: E501 + def order_cancel_refund_with_http_info(self, id : Annotated[StrictStr, Field(..., description="Identifier of the resource")], refund_id : Annotated[StrictStr, Field(..., description="refund identifier")], accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, x_child_company_id : Annotated[Optional[StrictStr], Field(description="In the case of a holding company, the company id of the child company to which will process the request.")] = None, **kwargs) -> ApiResponse: # noqa: E501 """Cancel Refund # noqa: E501 A refunded order describes the items, amount, and reason an order is being refunded. # noqa: E501 @@ -776,13 +772,14 @@ def order_cancel_refund_with_http_info(self, id : Annotated[StrictStr, Field(... :type x_child_company_id: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -834,26 +831,26 @@ def order_cancel_refund_with_http_info(self, id : Annotated[StrictStr, Field(... _path_params = {} if _params['id']: _path_params['id'] = _params['id'] + if _params['refund_id']: _path_params['refund_id'] = _params['refund_id'] + # process the query parameters _query_params = [] - # process the header parameters _header_params = dict(_params.get('_headers', {})) if _params['accept_language']: _header_params['Accept-Language'] = _params['accept_language'] + if _params['x_child_company_id']: _header_params['X-Child-Company-Id'] = _params['x_child_company_id'] # process the form parameters _form_params = [] _files = {} - # process the body parameter _body_params = None - # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( ['application/vnd.conekta-v2.1.0+json']) # noqa: E501 @@ -908,10 +905,6 @@ def order_refund(self, id : Annotated[StrictStr, Field(..., description="Identif :type x_child_company_id: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -922,10 +915,12 @@ def order_refund(self, id : Annotated[StrictStr, Field(..., description="Identif :rtype: OrderResponse """ kwargs['_return_http_data_only'] = True + if '_preload_content' in kwargs: + raise ValueError("Error! Please call the order_refund_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.order_refund_with_http_info(id, order_refund_request, accept_language, x_child_company_id, **kwargs) # noqa: E501 @validate_arguments - def order_refund_with_http_info(self, id : Annotated[StrictStr, Field(..., description="Identifier of the resource")], order_refund_request : Annotated[OrderRefundRequest, Field(..., description="requested field for a refund")], accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, x_child_company_id : Annotated[Optional[StrictStr], Field(description="In the case of a holding company, the company id of the child company to which will process the request.")] = None, **kwargs): # noqa: E501 + def order_refund_with_http_info(self, id : Annotated[StrictStr, Field(..., description="Identifier of the resource")], order_refund_request : Annotated[OrderRefundRequest, Field(..., description="requested field for a refund")], accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, x_child_company_id : Annotated[Optional[StrictStr], Field(description="In the case of a holding company, the company id of the child company to which will process the request.")] = None, **kwargs) -> ApiResponse: # noqa: E501 """Refund Order # noqa: E501 A refunded order describes the items, amount, and reason an order is being refunded. # noqa: E501 @@ -945,13 +940,14 @@ def order_refund_with_http_info(self, id : Annotated[StrictStr, Field(..., descr :type x_child_company_id: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1004,23 +1000,23 @@ def order_refund_with_http_info(self, id : Annotated[StrictStr, Field(..., descr if _params['id']: _path_params['id'] = _params['id'] + # process the query parameters _query_params = [] - # process the header parameters _header_params = dict(_params.get('_headers', {})) if _params['accept_language']: _header_params['Accept-Language'] = _params['accept_language'] + if _params['x_child_company_id']: _header_params['X-Child-Company-Id'] = _params['x_child_company_id'] # process the form parameters _form_params = [] _files = {} - # process the body parameter _body_params = None - if _params['order_refund_request']: + if _params['order_refund_request'] is not None: _body_params = _params['order_refund_request'] # set the HTTP header `Accept` @@ -1084,10 +1080,6 @@ def orders_create_capture(self, id : Annotated[StrictStr, Field(..., description :type order_capture_request: OrderCaptureRequest :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1098,10 +1090,12 @@ def orders_create_capture(self, id : Annotated[StrictStr, Field(..., description :rtype: OrderResponse """ kwargs['_return_http_data_only'] = True + if '_preload_content' in kwargs: + raise ValueError("Error! Please call the orders_create_capture_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.orders_create_capture_with_http_info(id, accept_language, x_child_company_id, order_capture_request, **kwargs) # noqa: E501 @validate_arguments - def orders_create_capture_with_http_info(self, id : Annotated[StrictStr, Field(..., description="Identifier of the resource")], accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, x_child_company_id : Annotated[Optional[StrictStr], Field(description="In the case of a holding company, the company id of the child company to which will process the request.")] = None, order_capture_request : Annotated[Optional[OrderCaptureRequest], Field(description="requested fields for capture order")] = None, **kwargs): # noqa: E501 + def orders_create_capture_with_http_info(self, id : Annotated[StrictStr, Field(..., description="Identifier of the resource")], accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, x_child_company_id : Annotated[Optional[StrictStr], Field(description="In the case of a holding company, the company id of the child company to which will process the request.")] = None, order_capture_request : Annotated[Optional[OrderCaptureRequest], Field(description="requested fields for capture order")] = None, **kwargs) -> ApiResponse: # noqa: E501 """Capture Order # noqa: E501 Processes an order that has been previously authorized. # noqa: E501 @@ -1121,13 +1115,14 @@ def orders_create_capture_with_http_info(self, id : Annotated[StrictStr, Field(. :type order_capture_request: OrderCaptureRequest :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1180,23 +1175,23 @@ def orders_create_capture_with_http_info(self, id : Annotated[StrictStr, Field(. if _params['id']: _path_params['id'] = _params['id'] + # process the query parameters _query_params = [] - # process the header parameters _header_params = dict(_params.get('_headers', {})) if _params['accept_language']: _header_params['Accept-Language'] = _params['accept_language'] + if _params['x_child_company_id']: _header_params['X-Child-Company-Id'] = _params['x_child_company_id'] # process the form parameters _form_params = [] _files = {} - # process the body parameter _body_params = None - if _params['order_capture_request']: + if _params['order_capture_request'] is not None: _body_params = _params['order_capture_request'] # set the HTTP header `Accept` @@ -1257,10 +1252,6 @@ def update_order(self, id : Annotated[StrictStr, Field(..., description="Identif :type accept_language: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1271,10 +1262,12 @@ def update_order(self, id : Annotated[StrictStr, Field(..., description="Identif :rtype: OrderResponse """ kwargs['_return_http_data_only'] = True + if '_preload_content' in kwargs: + raise ValueError("Error! Please call the update_order_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.update_order_with_http_info(id, order_update_request, accept_language, **kwargs) # noqa: E501 @validate_arguments - def update_order_with_http_info(self, id : Annotated[StrictStr, Field(..., description="Identifier of the resource")], order_update_request : Annotated[OrderUpdateRequest, Field(..., description="requested field for an order")], accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, **kwargs): # noqa: E501 + def update_order_with_http_info(self, id : Annotated[StrictStr, Field(..., description="Identifier of the resource")], order_update_request : Annotated[OrderUpdateRequest, Field(..., description="requested field for an order")], accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, **kwargs) -> ApiResponse: # noqa: E501 """Update Order # noqa: E501 Update an existing Order. # noqa: E501 @@ -1292,13 +1285,14 @@ def update_order_with_http_info(self, id : Annotated[StrictStr, Field(..., descr :type accept_language: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1350,9 +1344,9 @@ def update_order_with_http_info(self, id : Annotated[StrictStr, Field(..., descr if _params['id']: _path_params['id'] = _params['id'] + # process the query parameters _query_params = [] - # process the header parameters _header_params = dict(_params.get('_headers', {})) if _params['accept_language']: @@ -1361,10 +1355,9 @@ def update_order_with_http_info(self, id : Annotated[StrictStr, Field(..., descr # process the form parameters _form_params = [] _files = {} - # process the body parameter _body_params = None - if _params['order_update_request']: + if _params['order_update_request'] is not None: _body_params = _params['order_update_request'] # set the HTTP header `Accept` diff --git a/conekta/api/payment_link_api.py b/conekta/api/payment_link_api.py index 1a686bd..73d75ed 100644 --- a/conekta/api/payment_link_api.py +++ b/conekta/api/payment_link_api.py @@ -7,13 +7,15 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" -from __future__ import absolute_import import re # noqa: F401 +import io +import warnings from pydantic import validate_arguments, ValidationError from typing_extensions import Annotated @@ -29,6 +31,7 @@ from conekta.models.sms_checkout_request import SmsCheckoutRequest from conekta.api_client import ApiClient +from conekta.api_response import ApiResponse from conekta.exceptions import ( # noqa: F401 ApiTypeError, ApiValueError @@ -65,10 +68,6 @@ def cancel_checkout(self, id : Annotated[StrictStr, Field(..., description="Iden :type x_child_company_id: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -79,10 +78,12 @@ def cancel_checkout(self, id : Annotated[StrictStr, Field(..., description="Iden :rtype: CheckoutResponse """ kwargs['_return_http_data_only'] = True + if '_preload_content' in kwargs: + raise ValueError("Error! Please call the cancel_checkout_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.cancel_checkout_with_http_info(id, accept_language, x_child_company_id, **kwargs) # noqa: E501 @validate_arguments - def cancel_checkout_with_http_info(self, id : Annotated[StrictStr, Field(..., description="Identifier of the resource")], accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, x_child_company_id : Annotated[Optional[StrictStr], Field(description="In the case of a holding company, the company id of the child company to which will process the request.")] = None, **kwargs): # noqa: E501 + def cancel_checkout_with_http_info(self, id : Annotated[StrictStr, Field(..., description="Identifier of the resource")], accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, x_child_company_id : Annotated[Optional[StrictStr], Field(description="In the case of a holding company, the company id of the child company to which will process the request.")] = None, **kwargs) -> ApiResponse: # noqa: E501 """Cancel Payment Link # noqa: E501 This method makes a synchronous HTTP request by default. To make an @@ -99,13 +100,14 @@ def cancel_checkout_with_http_info(self, id : Annotated[StrictStr, Field(..., de :type x_child_company_id: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -157,23 +159,22 @@ def cancel_checkout_with_http_info(self, id : Annotated[StrictStr, Field(..., de if _params['id']: _path_params['id'] = _params['id'] + # process the query parameters _query_params = [] - # process the header parameters _header_params = dict(_params.get('_headers', {})) if _params['accept_language']: _header_params['Accept-Language'] = _params['accept_language'] + if _params['x_child_company_id']: _header_params['X-Child-Company-Id'] = _params['x_child_company_id'] # process the form parameters _form_params = [] _files = {} - # process the body parameter _body_params = None - # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( ['application/vnd.conekta-v2.1.0+json']) # noqa: E501 @@ -225,10 +226,6 @@ def create_checkout(self, checkout : Annotated[Checkout, Field(..., description= :type x_child_company_id: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -239,10 +236,12 @@ def create_checkout(self, checkout : Annotated[Checkout, Field(..., description= :rtype: CheckoutResponse """ kwargs['_return_http_data_only'] = True + if '_preload_content' in kwargs: + raise ValueError("Error! Please call the create_checkout_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.create_checkout_with_http_info(checkout, accept_language, x_child_company_id, **kwargs) # noqa: E501 @validate_arguments - def create_checkout_with_http_info(self, checkout : Annotated[Checkout, Field(..., description="requested field for checkout")], accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, x_child_company_id : Annotated[Optional[StrictStr], Field(description="In the case of a holding company, the company id of the child company to which will process the request.")] = None, **kwargs): # noqa: E501 + def create_checkout_with_http_info(self, checkout : Annotated[Checkout, Field(..., description="requested field for checkout")], accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, x_child_company_id : Annotated[Optional[StrictStr], Field(description="In the case of a holding company, the company id of the child company to which will process the request.")] = None, **kwargs) -> ApiResponse: # noqa: E501 """Create Unique Payment Link # noqa: E501 This method makes a synchronous HTTP request by default. To make an @@ -259,13 +258,14 @@ def create_checkout_with_http_info(self, checkout : Annotated[Checkout, Field(.. :type x_child_company_id: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -317,21 +317,20 @@ def create_checkout_with_http_info(self, checkout : Annotated[Checkout, Field(.. # process the query parameters _query_params = [] - # process the header parameters _header_params = dict(_params.get('_headers', {})) if _params['accept_language']: _header_params['Accept-Language'] = _params['accept_language'] + if _params['x_child_company_id']: _header_params['X-Child-Company-Id'] = _params['x_child_company_id'] # process the form parameters _form_params = [] _files = {} - # process the body parameter _body_params = None - if _params['checkout']: + if _params['checkout'] is not None: _body_params = _params['checkout'] # set the HTTP header `Accept` @@ -393,10 +392,6 @@ def email_checkout(self, id : Annotated[StrictStr, Field(..., description="Ident :type x_child_company_id: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -407,10 +402,12 @@ def email_checkout(self, id : Annotated[StrictStr, Field(..., description="Ident :rtype: CheckoutResponse """ kwargs['_return_http_data_only'] = True + if '_preload_content' in kwargs: + raise ValueError("Error! Please call the email_checkout_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.email_checkout_with_http_info(id, email_checkout_request, accept_language, x_child_company_id, **kwargs) # noqa: E501 @validate_arguments - def email_checkout_with_http_info(self, id : Annotated[StrictStr, Field(..., description="Identifier of the resource")], email_checkout_request : Annotated[EmailCheckoutRequest, Field(..., description="requested field for sms checkout")], accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, x_child_company_id : Annotated[Optional[StrictStr], Field(description="In the case of a holding company, the company id of the child company to which will process the request.")] = None, **kwargs): # noqa: E501 + def email_checkout_with_http_info(self, id : Annotated[StrictStr, Field(..., description="Identifier of the resource")], email_checkout_request : Annotated[EmailCheckoutRequest, Field(..., description="requested field for sms checkout")], accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, x_child_company_id : Annotated[Optional[StrictStr], Field(description="In the case of a holding company, the company id of the child company to which will process the request.")] = None, **kwargs) -> ApiResponse: # noqa: E501 """Send an email # noqa: E501 This method makes a synchronous HTTP request by default. To make an @@ -429,13 +426,14 @@ def email_checkout_with_http_info(self, id : Annotated[StrictStr, Field(..., des :type x_child_company_id: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -488,23 +486,23 @@ def email_checkout_with_http_info(self, id : Annotated[StrictStr, Field(..., des if _params['id']: _path_params['id'] = _params['id'] + # process the query parameters _query_params = [] - # process the header parameters _header_params = dict(_params.get('_headers', {})) if _params['accept_language']: _header_params['Accept-Language'] = _params['accept_language'] + if _params['x_child_company_id']: _header_params['X-Child-Company-Id'] = _params['x_child_company_id'] # process the form parameters _form_params = [] _files = {} - # process the body parameter _body_params = None - if _params['email_checkout_request']: + if _params['email_checkout_request'] is not None: _body_params = _params['email_checkout_request'] # set the HTTP header `Accept` @@ -565,10 +563,6 @@ def get_checkout(self, id : Annotated[StrictStr, Field(..., description="Identif :type x_child_company_id: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -579,10 +573,12 @@ def get_checkout(self, id : Annotated[StrictStr, Field(..., description="Identif :rtype: CheckoutResponse """ kwargs['_return_http_data_only'] = True + if '_preload_content' in kwargs: + raise ValueError("Error! Please call the get_checkout_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.get_checkout_with_http_info(id, accept_language, x_child_company_id, **kwargs) # noqa: E501 @validate_arguments - def get_checkout_with_http_info(self, id : Annotated[StrictStr, Field(..., description="Identifier of the resource")], accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, x_child_company_id : Annotated[Optional[StrictStr], Field(description="In the case of a holding company, the company id of the child company to which will process the request.")] = None, **kwargs): # noqa: E501 + def get_checkout_with_http_info(self, id : Annotated[StrictStr, Field(..., description="Identifier of the resource")], accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, x_child_company_id : Annotated[Optional[StrictStr], Field(description="In the case of a holding company, the company id of the child company to which will process the request.")] = None, **kwargs) -> ApiResponse: # noqa: E501 """Get a payment link by ID # noqa: E501 This method makes a synchronous HTTP request by default. To make an @@ -599,13 +595,14 @@ def get_checkout_with_http_info(self, id : Annotated[StrictStr, Field(..., descr :type x_child_company_id: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -657,23 +654,22 @@ def get_checkout_with_http_info(self, id : Annotated[StrictStr, Field(..., descr if _params['id']: _path_params['id'] = _params['id'] + # process the query parameters _query_params = [] - # process the header parameters _header_params = dict(_params.get('_headers', {})) if _params['accept_language']: _header_params['Accept-Language'] = _params['accept_language'] + if _params['x_child_company_id']: _header_params['X-Child-Company-Id'] = _params['x_child_company_id'] # process the form parameters _form_params = [] _files = {} - # process the body parameter _body_params = None - # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( ['application/vnd.conekta-v2.1.0+json']) # noqa: E501 @@ -732,10 +728,6 @@ def get_checkouts(self, accept_language : Annotated[Optional[StrictStr], Field(d :type previous: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -746,10 +738,12 @@ def get_checkouts(self, accept_language : Annotated[Optional[StrictStr], Field(d :rtype: CheckoutsResponse """ kwargs['_return_http_data_only'] = True + if '_preload_content' in kwargs: + raise ValueError("Error! Please call the get_checkouts_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.get_checkouts_with_http_info(accept_language, x_child_company_id, limit, search, next, previous, **kwargs) # noqa: E501 @validate_arguments - def get_checkouts_with_http_info(self, accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, x_child_company_id : Annotated[Optional[StrictStr], Field(description="In the case of a holding company, the company id of the child company to which will process the request.")] = None, limit : Annotated[Optional[conint(strict=True, le=250, ge=1)], Field(description="The numbers of items to return, the maximum value is 250")] = None, search : Annotated[Optional[StrictStr], Field(description="General order search, e.g. by mail, reference etc.")] = None, next : Annotated[Optional[StrictStr], Field(description="next page")] = None, previous : Annotated[Optional[StrictStr], Field(description="previous page")] = None, **kwargs): # noqa: E501 + def get_checkouts_with_http_info(self, accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, x_child_company_id : Annotated[Optional[StrictStr], Field(description="In the case of a holding company, the company id of the child company to which will process the request.")] = None, limit : Annotated[Optional[conint(strict=True, le=250, ge=1)], Field(description="The numbers of items to return, the maximum value is 250")] = None, search : Annotated[Optional[StrictStr], Field(description="General order search, e.g. by mail, reference etc.")] = None, next : Annotated[Optional[StrictStr], Field(description="next page")] = None, previous : Annotated[Optional[StrictStr], Field(description="previous page")] = None, **kwargs) -> ApiResponse: # noqa: E501 """Get a list of payment links # noqa: E501 Returns a list of links generated by the merchant # noqa: E501 @@ -773,13 +767,14 @@ def get_checkouts_with_http_info(self, accept_language : Annotated[Optional[Stri :type previous: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -836,10 +831,13 @@ def get_checkouts_with_http_info(self, accept_language : Annotated[Optional[Stri _query_params = [] if _params.get('limit') is not None: # noqa: E501 _query_params.append(('limit', _params['limit'])) + if _params.get('search') is not None: # noqa: E501 _query_params.append(('search', _params['search'])) + if _params.get('next') is not None: # noqa: E501 _query_params.append(('next', _params['next'])) + if _params.get('previous') is not None: # noqa: E501 _query_params.append(('previous', _params['previous'])) @@ -847,16 +845,15 @@ def get_checkouts_with_http_info(self, accept_language : Annotated[Optional[Stri _header_params = dict(_params.get('_headers', {})) if _params['accept_language']: _header_params['Accept-Language'] = _params['accept_language'] + if _params['x_child_company_id']: _header_params['X-Child-Company-Id'] = _params['x_child_company_id'] # process the form parameters _form_params = [] _files = {} - # process the body parameter _body_params = None - # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( ['application/vnd.conekta-v2.1.0+json']) # noqa: E501 @@ -909,10 +906,6 @@ def sms_checkout(self, id : Annotated[StrictStr, Field(..., description="Identif :type x_child_company_id: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -923,10 +916,12 @@ def sms_checkout(self, id : Annotated[StrictStr, Field(..., description="Identif :rtype: CheckoutResponse """ kwargs['_return_http_data_only'] = True + if '_preload_content' in kwargs: + raise ValueError("Error! Please call the sms_checkout_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.sms_checkout_with_http_info(id, sms_checkout_request, accept_language, x_child_company_id, **kwargs) # noqa: E501 @validate_arguments - def sms_checkout_with_http_info(self, id : Annotated[StrictStr, Field(..., description="Identifier of the resource")], sms_checkout_request : Annotated[SmsCheckoutRequest, Field(..., description="requested field for sms checkout")], accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, x_child_company_id : Annotated[Optional[StrictStr], Field(description="In the case of a holding company, the company id of the child company to which will process the request.")] = None, **kwargs): # noqa: E501 + def sms_checkout_with_http_info(self, id : Annotated[StrictStr, Field(..., description="Identifier of the resource")], sms_checkout_request : Annotated[SmsCheckoutRequest, Field(..., description="requested field for sms checkout")], accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, x_child_company_id : Annotated[Optional[StrictStr], Field(description="In the case of a holding company, the company id of the child company to which will process the request.")] = None, **kwargs) -> ApiResponse: # noqa: E501 """Send an sms # noqa: E501 This method makes a synchronous HTTP request by default. To make an @@ -945,13 +940,14 @@ def sms_checkout_with_http_info(self, id : Annotated[StrictStr, Field(..., descr :type x_child_company_id: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1004,23 +1000,23 @@ def sms_checkout_with_http_info(self, id : Annotated[StrictStr, Field(..., descr if _params['id']: _path_params['id'] = _params['id'] + # process the query parameters _query_params = [] - # process the header parameters _header_params = dict(_params.get('_headers', {})) if _params['accept_language']: _header_params['Accept-Language'] = _params['accept_language'] + if _params['x_child_company_id']: _header_params['X-Child-Company-Id'] = _params['x_child_company_id'] # process the form parameters _form_params = [] _files = {} - # process the body parameter _body_params = None - if _params['sms_checkout_request']: + if _params['sms_checkout_request'] is not None: _body_params = _params['sms_checkout_request'] # set the HTTP header `Accept` diff --git a/conekta/api/payment_methods_api.py b/conekta/api/payment_methods_api.py index 75552f9..43f8ca3 100644 --- a/conekta/api/payment_methods_api.py +++ b/conekta/api/payment_methods_api.py @@ -7,13 +7,15 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" -from __future__ import absolute_import import re # noqa: F401 +import io +import warnings from pydantic import validate_arguments, ValidationError from typing_extensions import Annotated @@ -29,6 +31,7 @@ from conekta.models.update_payment_methods import UpdatePaymentMethods from conekta.api_client import ApiClient +from conekta.api_response import ApiResponse from conekta.exceptions import ( # noqa: F401 ApiTypeError, ApiValueError @@ -68,10 +71,6 @@ def create_customer_payment_methods(self, id : Annotated[StrictStr, Field(..., d :type x_child_company_id: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -82,10 +81,12 @@ def create_customer_payment_methods(self, id : Annotated[StrictStr, Field(..., d :rtype: CreateCustomerPaymentMethodsResponse """ kwargs['_return_http_data_only'] = True + if '_preload_content' in kwargs: + raise ValueError("Error! Please call the create_customer_payment_methods_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.create_customer_payment_methods_with_http_info(id, create_customer_payment_methods_request, accept_language, x_child_company_id, **kwargs) # noqa: E501 @validate_arguments - def create_customer_payment_methods_with_http_info(self, id : Annotated[StrictStr, Field(..., description="Identifier of the resource")], create_customer_payment_methods_request : Annotated[CreateCustomerPaymentMethodsRequest, Field(..., description="requested field for customer payment methods")], accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, x_child_company_id : Annotated[Optional[StrictStr], Field(description="In the case of a holding company, the company id of the child company to which will process the request.")] = None, **kwargs): # noqa: E501 + def create_customer_payment_methods_with_http_info(self, id : Annotated[StrictStr, Field(..., description="Identifier of the resource")], create_customer_payment_methods_request : Annotated[CreateCustomerPaymentMethodsRequest, Field(..., description="requested field for customer payment methods")], accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, x_child_company_id : Annotated[Optional[StrictStr], Field(description="In the case of a holding company, the company id of the child company to which will process the request.")] = None, **kwargs) -> ApiResponse: # noqa: E501 """Create Payment Method # noqa: E501 Create a payment method for a customer. # noqa: E501 @@ -105,13 +106,14 @@ def create_customer_payment_methods_with_http_info(self, id : Annotated[StrictSt :type x_child_company_id: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -164,23 +166,23 @@ def create_customer_payment_methods_with_http_info(self, id : Annotated[StrictSt if _params['id']: _path_params['id'] = _params['id'] + # process the query parameters _query_params = [] - # process the header parameters _header_params = dict(_params.get('_headers', {})) if _params['accept_language']: _header_params['Accept-Language'] = _params['accept_language'] + if _params['x_child_company_id']: _header_params['X-Child-Company-Id'] = _params['x_child_company_id'] # process the form parameters _form_params = [] _files = {} - # process the body parameter _body_params = None - if _params['create_customer_payment_methods_request']: + if _params['create_customer_payment_methods_request'] is not None: _body_params = _params['create_customer_payment_methods_request'] # set the HTTP header `Accept` @@ -243,10 +245,6 @@ def delete_customer_payment_methods(self, id : Annotated[StrictStr, Field(..., d :type x_child_company_id: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -257,10 +255,12 @@ def delete_customer_payment_methods(self, id : Annotated[StrictStr, Field(..., d :rtype: UpdateCustomerPaymentMethodsResponse """ kwargs['_return_http_data_only'] = True + if '_preload_content' in kwargs: + raise ValueError("Error! Please call the delete_customer_payment_methods_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.delete_customer_payment_methods_with_http_info(id, payment_method_id, accept_language, x_child_company_id, **kwargs) # noqa: E501 @validate_arguments - def delete_customer_payment_methods_with_http_info(self, id : Annotated[StrictStr, Field(..., description="Identifier of the resource")], payment_method_id : Annotated[StrictStr, Field(..., description="Identifier of the payment method")], accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, x_child_company_id : Annotated[Optional[StrictStr], Field(description="In the case of a holding company, the company id of the child company to which will process the request.")] = None, **kwargs): # noqa: E501 + def delete_customer_payment_methods_with_http_info(self, id : Annotated[StrictStr, Field(..., description="Identifier of the resource")], payment_method_id : Annotated[StrictStr, Field(..., description="Identifier of the payment method")], accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, x_child_company_id : Annotated[Optional[StrictStr], Field(description="In the case of a holding company, the company id of the child company to which will process the request.")] = None, **kwargs) -> ApiResponse: # noqa: E501 """Delete Payment Method # noqa: E501 Delete an existing payment method # noqa: E501 @@ -280,13 +280,14 @@ def delete_customer_payment_methods_with_http_info(self, id : Annotated[StrictSt :type x_child_company_id: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -338,26 +339,26 @@ def delete_customer_payment_methods_with_http_info(self, id : Annotated[StrictSt _path_params = {} if _params['id']: _path_params['id'] = _params['id'] + if _params['payment_method_id']: _path_params['payment_method_id'] = _params['payment_method_id'] + # process the query parameters _query_params = [] - # process the header parameters _header_params = dict(_params.get('_headers', {})) if _params['accept_language']: _header_params['Accept-Language'] = _params['accept_language'] + if _params['x_child_company_id']: _header_params['X-Child-Company-Id'] = _params['x_child_company_id'] # process the form parameters _form_params = [] _files = {} - # process the body parameter _body_params = None - # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( ['application/vnd.conekta-v2.1.0+json']) # noqa: E501 @@ -417,10 +418,6 @@ def get_customer_payment_methods(self, id : Annotated[StrictStr, Field(..., desc :type search: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -431,10 +428,12 @@ def get_customer_payment_methods(self, id : Annotated[StrictStr, Field(..., desc :rtype: GetPaymentMethodResponse """ kwargs['_return_http_data_only'] = True + if '_preload_content' in kwargs: + raise ValueError("Error! Please call the get_customer_payment_methods_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.get_customer_payment_methods_with_http_info(id, accept_language, x_child_company_id, limit, next, previous, search, **kwargs) # noqa: E501 @validate_arguments - def get_customer_payment_methods_with_http_info(self, id : Annotated[StrictStr, Field(..., description="Identifier of the resource")], accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, x_child_company_id : Annotated[Optional[StrictStr], Field(description="In the case of a holding company, the company id of the child company to which will process the request.")] = None, limit : Annotated[Optional[conint(strict=True, le=250, ge=1)], Field(description="The numbers of items to return, the maximum value is 250")] = None, next : Annotated[Optional[StrictStr], Field(description="next page")] = None, previous : Annotated[Optional[StrictStr], Field(description="previous page")] = None, search : Annotated[Optional[StrictStr], Field(description="General order search, e.g. by mail, reference etc.")] = None, **kwargs): # noqa: E501 + def get_customer_payment_methods_with_http_info(self, id : Annotated[StrictStr, Field(..., description="Identifier of the resource")], accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, x_child_company_id : Annotated[Optional[StrictStr], Field(description="In the case of a holding company, the company id of the child company to which will process the request.")] = None, limit : Annotated[Optional[conint(strict=True, le=250, ge=1)], Field(description="The numbers of items to return, the maximum value is 250")] = None, next : Annotated[Optional[StrictStr], Field(description="next page")] = None, previous : Annotated[Optional[StrictStr], Field(description="previous page")] = None, search : Annotated[Optional[StrictStr], Field(description="General order search, e.g. by mail, reference etc.")] = None, **kwargs) -> ApiResponse: # noqa: E501 """Get Payment Methods # noqa: E501 Get a list of Payment Methods # noqa: E501 @@ -460,13 +459,14 @@ def get_customer_payment_methods_with_http_info(self, id : Annotated[StrictStr, :type search: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -522,14 +522,18 @@ def get_customer_payment_methods_with_http_info(self, id : Annotated[StrictStr, if _params['id']: _path_params['id'] = _params['id'] + # process the query parameters _query_params = [] if _params.get('limit') is not None: # noqa: E501 _query_params.append(('limit', _params['limit'])) + if _params.get('next') is not None: # noqa: E501 _query_params.append(('next', _params['next'])) + if _params.get('previous') is not None: # noqa: E501 _query_params.append(('previous', _params['previous'])) + if _params.get('search') is not None: # noqa: E501 _query_params.append(('search', _params['search'])) @@ -537,16 +541,15 @@ def get_customer_payment_methods_with_http_info(self, id : Annotated[StrictStr, _header_params = dict(_params.get('_headers', {})) if _params['accept_language']: _header_params['Accept-Language'] = _params['accept_language'] + if _params['x_child_company_id']: _header_params['X-Child-Company-Id'] = _params['x_child_company_id'] # process the form parameters _form_params = [] _files = {} - # process the body parameter _body_params = None - # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( ['application/vnd.conekta-v2.1.0+json']) # noqa: E501 @@ -601,10 +604,6 @@ def update_customer_payment_methods(self, id : Annotated[StrictStr, Field(..., d :type x_child_company_id: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -615,10 +614,12 @@ def update_customer_payment_methods(self, id : Annotated[StrictStr, Field(..., d :rtype: UpdateCustomerPaymentMethodsResponse """ kwargs['_return_http_data_only'] = True + if '_preload_content' in kwargs: + raise ValueError("Error! Please call the update_customer_payment_methods_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.update_customer_payment_methods_with_http_info(id, payment_method_id, update_payment_methods, accept_language, x_child_company_id, **kwargs) # noqa: E501 @validate_arguments - def update_customer_payment_methods_with_http_info(self, id : Annotated[StrictStr, Field(..., description="Identifier of the resource")], payment_method_id : Annotated[StrictStr, Field(..., description="Identifier of the payment method")], update_payment_methods : Annotated[UpdatePaymentMethods, Field(..., description="requested field for customer payment methods")], accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, x_child_company_id : Annotated[Optional[StrictStr], Field(description="In the case of a holding company, the company id of the child company to which will process the request.")] = None, **kwargs): # noqa: E501 + def update_customer_payment_methods_with_http_info(self, id : Annotated[StrictStr, Field(..., description="Identifier of the resource")], payment_method_id : Annotated[StrictStr, Field(..., description="Identifier of the payment method")], update_payment_methods : Annotated[UpdatePaymentMethods, Field(..., description="requested field for customer payment methods")], accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, x_child_company_id : Annotated[Optional[StrictStr], Field(description="In the case of a holding company, the company id of the child company to which will process the request.")] = None, **kwargs) -> ApiResponse: # noqa: E501 """Update Payment Method # noqa: E501 Gets a payment Method that corresponds to a customer ID. # noqa: E501 @@ -640,13 +641,14 @@ def update_customer_payment_methods_with_http_info(self, id : Annotated[StrictSt :type x_child_company_id: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -699,26 +701,27 @@ def update_customer_payment_methods_with_http_info(self, id : Annotated[StrictSt _path_params = {} if _params['id']: _path_params['id'] = _params['id'] + if _params['payment_method_id']: _path_params['payment_method_id'] = _params['payment_method_id'] + # process the query parameters _query_params = [] - # process the header parameters _header_params = dict(_params.get('_headers', {})) if _params['accept_language']: _header_params['Accept-Language'] = _params['accept_language'] + if _params['x_child_company_id']: _header_params['X-Child-Company-Id'] = _params['x_child_company_id'] # process the form parameters _form_params = [] _files = {} - # process the body parameter _body_params = None - if _params['update_payment_methods']: + if _params['update_payment_methods'] is not None: _body_params = _params['update_payment_methods'] # set the HTTP header `Accept` diff --git a/conekta/api/plans_api.py b/conekta/api/plans_api.py index 440f8cc..f25fc4b 100644 --- a/conekta/api/plans_api.py +++ b/conekta/api/plans_api.py @@ -7,13 +7,15 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" -from __future__ import absolute_import import re # noqa: F401 +import io +import warnings from pydantic import validate_arguments, ValidationError from typing_extensions import Annotated @@ -28,6 +30,7 @@ from conekta.models.plan_update_request import PlanUpdateRequest from conekta.api_client import ApiClient +from conekta.api_response import ApiResponse from conekta.exceptions import ( # noqa: F401 ApiTypeError, ApiValueError @@ -65,10 +68,6 @@ def create_plan(self, plan_request : Annotated[PlanRequest, Field(..., descripti :type x_child_company_id: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -79,10 +78,12 @@ def create_plan(self, plan_request : Annotated[PlanRequest, Field(..., descripti :rtype: PlanResponse """ kwargs['_return_http_data_only'] = True + if '_preload_content' in kwargs: + raise ValueError("Error! Please call the create_plan_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.create_plan_with_http_info(plan_request, accept_language, x_child_company_id, **kwargs) # noqa: E501 @validate_arguments - def create_plan_with_http_info(self, plan_request : Annotated[PlanRequest, Field(..., description="requested field for plan")], accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, x_child_company_id : Annotated[Optional[StrictStr], Field(description="In the case of a holding company, the company id of the child company to which will process the request.")] = None, **kwargs): # noqa: E501 + def create_plan_with_http_info(self, plan_request : Annotated[PlanRequest, Field(..., description="requested field for plan")], accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, x_child_company_id : Annotated[Optional[StrictStr], Field(description="In the case of a holding company, the company id of the child company to which will process the request.")] = None, **kwargs) -> ApiResponse: # noqa: E501 """Create Plan # noqa: E501 Create a new plan for an existing order # noqa: E501 @@ -100,13 +101,14 @@ def create_plan_with_http_info(self, plan_request : Annotated[PlanRequest, Field :type x_child_company_id: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -158,21 +160,20 @@ def create_plan_with_http_info(self, plan_request : Annotated[PlanRequest, Field # process the query parameters _query_params = [] - # process the header parameters _header_params = dict(_params.get('_headers', {})) if _params['accept_language']: _header_params['Accept-Language'] = _params['accept_language'] + if _params['x_child_company_id']: _header_params['X-Child-Company-Id'] = _params['x_child_company_id'] # process the form parameters _form_params = [] _files = {} - # process the body parameter _body_params = None - if _params['plan_request']: + if _params['plan_request'] is not None: _body_params = _params['plan_request'] # set the HTTP header `Accept` @@ -229,10 +230,6 @@ def delete_plan(self, id : Annotated[StrictStr, Field(..., description="Identifi :type accept_language: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -243,10 +240,12 @@ def delete_plan(self, id : Annotated[StrictStr, Field(..., description="Identifi :rtype: PlanResponse """ kwargs['_return_http_data_only'] = True + if '_preload_content' in kwargs: + raise ValueError("Error! Please call the delete_plan_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.delete_plan_with_http_info(id, accept_language, **kwargs) # noqa: E501 @validate_arguments - def delete_plan_with_http_info(self, id : Annotated[StrictStr, Field(..., description="Identifier of the resource")], accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, **kwargs): # noqa: E501 + def delete_plan_with_http_info(self, id : Annotated[StrictStr, Field(..., description="Identifier of the resource")], accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, **kwargs) -> ApiResponse: # noqa: E501 """Delete Plan # noqa: E501 This method makes a synchronous HTTP request by default. To make an @@ -261,13 +260,14 @@ def delete_plan_with_http_info(self, id : Annotated[StrictStr, Field(..., descri :type accept_language: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -318,9 +318,9 @@ def delete_plan_with_http_info(self, id : Annotated[StrictStr, Field(..., descri if _params['id']: _path_params['id'] = _params['id'] + # process the query parameters _query_params = [] - # process the header parameters _header_params = dict(_params.get('_headers', {})) if _params['accept_language']: @@ -329,10 +329,8 @@ def delete_plan_with_http_info(self, id : Annotated[StrictStr, Field(..., descri # process the form parameters _form_params = [] _files = {} - # process the body parameter _body_params = None - # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( ['application/vnd.conekta-v2.1.0+json']) # noqa: E501 @@ -383,10 +381,6 @@ def get_plan(self, id : Annotated[StrictStr, Field(..., description="Identifier :type x_child_company_id: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -397,10 +391,12 @@ def get_plan(self, id : Annotated[StrictStr, Field(..., description="Identifier :rtype: PlanResponse """ kwargs['_return_http_data_only'] = True + if '_preload_content' in kwargs: + raise ValueError("Error! Please call the get_plan_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.get_plan_with_http_info(id, accept_language, x_child_company_id, **kwargs) # noqa: E501 @validate_arguments - def get_plan_with_http_info(self, id : Annotated[StrictStr, Field(..., description="Identifier of the resource")], accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, x_child_company_id : Annotated[Optional[StrictStr], Field(description="In the case of a holding company, the company id of the child company to which will process the request.")] = None, **kwargs): # noqa: E501 + def get_plan_with_http_info(self, id : Annotated[StrictStr, Field(..., description="Identifier of the resource")], accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, x_child_company_id : Annotated[Optional[StrictStr], Field(description="In the case of a holding company, the company id of the child company to which will process the request.")] = None, **kwargs) -> ApiResponse: # noqa: E501 """Get Plan # noqa: E501 This method makes a synchronous HTTP request by default. To make an @@ -417,13 +413,14 @@ def get_plan_with_http_info(self, id : Annotated[StrictStr, Field(..., descripti :type x_child_company_id: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -475,23 +472,22 @@ def get_plan_with_http_info(self, id : Annotated[StrictStr, Field(..., descripti if _params['id']: _path_params['id'] = _params['id'] + # process the query parameters _query_params = [] - # process the header parameters _header_params = dict(_params.get('_headers', {})) if _params['accept_language']: _header_params['Accept-Language'] = _params['accept_language'] + if _params['x_child_company_id']: _header_params['X-Child-Company-Id'] = _params['x_child_company_id'] # process the form parameters _form_params = [] _files = {} - # process the body parameter _body_params = None - # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( ['application/vnd.conekta-v2.1.0+json']) # noqa: E501 @@ -548,10 +544,6 @@ def get_plans(self, accept_language : Annotated[Optional[StrictStr], Field(descr :type previous: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -562,10 +554,12 @@ def get_plans(self, accept_language : Annotated[Optional[StrictStr], Field(descr :rtype: GetPlansResponse """ kwargs['_return_http_data_only'] = True + if '_preload_content' in kwargs: + raise ValueError("Error! Please call the get_plans_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.get_plans_with_http_info(accept_language, x_child_company_id, limit, search, next, previous, **kwargs) # noqa: E501 @validate_arguments - def get_plans_with_http_info(self, accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, x_child_company_id : Annotated[Optional[StrictStr], Field(description="In the case of a holding company, the company id of the child company to which will process the request.")] = None, limit : Annotated[Optional[conint(strict=True, le=250, ge=1)], Field(description="The numbers of items to return, the maximum value is 250")] = None, search : Annotated[Optional[StrictStr], Field(description="General order search, e.g. by mail, reference etc.")] = None, next : Annotated[Optional[StrictStr], Field(description="next page")] = None, previous : Annotated[Optional[StrictStr], Field(description="previous page")] = None, **kwargs): # noqa: E501 + def get_plans_with_http_info(self, accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, x_child_company_id : Annotated[Optional[StrictStr], Field(description="In the case of a holding company, the company id of the child company to which will process the request.")] = None, limit : Annotated[Optional[conint(strict=True, le=250, ge=1)], Field(description="The numbers of items to return, the maximum value is 250")] = None, search : Annotated[Optional[StrictStr], Field(description="General order search, e.g. by mail, reference etc.")] = None, next : Annotated[Optional[StrictStr], Field(description="next page")] = None, previous : Annotated[Optional[StrictStr], Field(description="previous page")] = None, **kwargs) -> ApiResponse: # noqa: E501 """Get A List of Plans # noqa: E501 This method makes a synchronous HTTP request by default. To make an @@ -588,13 +582,14 @@ def get_plans_with_http_info(self, accept_language : Annotated[Optional[StrictSt :type previous: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -651,10 +646,13 @@ def get_plans_with_http_info(self, accept_language : Annotated[Optional[StrictSt _query_params = [] if _params.get('limit') is not None: # noqa: E501 _query_params.append(('limit', _params['limit'])) + if _params.get('search') is not None: # noqa: E501 _query_params.append(('search', _params['search'])) + if _params.get('next') is not None: # noqa: E501 _query_params.append(('next', _params['next'])) + if _params.get('previous') is not None: # noqa: E501 _query_params.append(('previous', _params['previous'])) @@ -662,16 +660,15 @@ def get_plans_with_http_info(self, accept_language : Annotated[Optional[StrictSt _header_params = dict(_params.get('_headers', {})) if _params['accept_language']: _header_params['Accept-Language'] = _params['accept_language'] + if _params['x_child_company_id']: _header_params['X-Child-Company-Id'] = _params['x_child_company_id'] # process the form parameters _form_params = [] _files = {} - # process the body parameter _body_params = None - # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( ['application/vnd.conekta-v2.1.0+json']) # noqa: E501 @@ -723,10 +720,6 @@ def update_plan(self, id : Annotated[StrictStr, Field(..., description="Identifi :type x_child_company_id: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -737,10 +730,12 @@ def update_plan(self, id : Annotated[StrictStr, Field(..., description="Identifi :rtype: PlanResponse """ kwargs['_return_http_data_only'] = True + if '_preload_content' in kwargs: + raise ValueError("Error! Please call the update_plan_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.update_plan_with_http_info(id, plan_update_request, accept_language, x_child_company_id, **kwargs) # noqa: E501 @validate_arguments - def update_plan_with_http_info(self, id : Annotated[StrictStr, Field(..., description="Identifier of the resource")], plan_update_request : Annotated[PlanUpdateRequest, Field(..., description="requested field for plan")], accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, x_child_company_id : Annotated[Optional[StrictStr], Field(description="In the case of a holding company, the company id of the child company to which will process the request.")] = None, **kwargs): # noqa: E501 + def update_plan_with_http_info(self, id : Annotated[StrictStr, Field(..., description="Identifier of the resource")], plan_update_request : Annotated[PlanUpdateRequest, Field(..., description="requested field for plan")], accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, x_child_company_id : Annotated[Optional[StrictStr], Field(description="In the case of a holding company, the company id of the child company to which will process the request.")] = None, **kwargs) -> ApiResponse: # noqa: E501 """Update Plan # noqa: E501 This method makes a synchronous HTTP request by default. To make an @@ -759,13 +754,14 @@ def update_plan_with_http_info(self, id : Annotated[StrictStr, Field(..., descri :type x_child_company_id: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -818,23 +814,23 @@ def update_plan_with_http_info(self, id : Annotated[StrictStr, Field(..., descri if _params['id']: _path_params['id'] = _params['id'] + # process the query parameters _query_params = [] - # process the header parameters _header_params = dict(_params.get('_headers', {})) if _params['accept_language']: _header_params['Accept-Language'] = _params['accept_language'] + if _params['x_child_company_id']: _header_params['X-Child-Company-Id'] = _params['x_child_company_id'] # process the form parameters _form_params = [] _files = {} - # process the body parameter _body_params = None - if _params['plan_update_request']: + if _params['plan_update_request'] is not None: _body_params = _params['plan_update_request'] # set the HTTP header `Accept` diff --git a/conekta/api/products_api.py b/conekta/api/products_api.py index a6ff3e2..a1139c1 100644 --- a/conekta/api/products_api.py +++ b/conekta/api/products_api.py @@ -7,13 +7,15 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" -from __future__ import absolute_import import re # noqa: F401 +import io +import warnings from pydantic import validate_arguments, ValidationError from typing_extensions import Annotated @@ -27,6 +29,7 @@ from conekta.models.update_product import UpdateProduct from conekta.api_client import ApiClient +from conekta.api_response import ApiResponse from conekta.exceptions import ( # noqa: F401 ApiTypeError, ApiValueError @@ -66,10 +69,6 @@ def orders_create_product(self, id : Annotated[StrictStr, Field(..., description :type x_child_company_id: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -80,10 +79,12 @@ def orders_create_product(self, id : Annotated[StrictStr, Field(..., description :rtype: ProductOrderResponse """ kwargs['_return_http_data_only'] = True + if '_preload_content' in kwargs: + raise ValueError("Error! Please call the orders_create_product_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.orders_create_product_with_http_info(id, product, accept_language, x_child_company_id, **kwargs) # noqa: E501 @validate_arguments - def orders_create_product_with_http_info(self, id : Annotated[StrictStr, Field(..., description="Identifier of the resource")], product : Annotated[Product, Field(..., description="requested field for a product")], accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, x_child_company_id : Annotated[Optional[StrictStr], Field(description="In the case of a holding company, the company id of the child company to which will process the request.")] = None, **kwargs): # noqa: E501 + def orders_create_product_with_http_info(self, id : Annotated[StrictStr, Field(..., description="Identifier of the resource")], product : Annotated[Product, Field(..., description="requested field for a product")], accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, x_child_company_id : Annotated[Optional[StrictStr], Field(description="In the case of a holding company, the company id of the child company to which will process the request.")] = None, **kwargs) -> ApiResponse: # noqa: E501 """Create Product # noqa: E501 Create a new product for an existing order. # noqa: E501 @@ -103,13 +104,14 @@ def orders_create_product_with_http_info(self, id : Annotated[StrictStr, Field(. :type x_child_company_id: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -162,23 +164,23 @@ def orders_create_product_with_http_info(self, id : Annotated[StrictStr, Field(. if _params['id']: _path_params['id'] = _params['id'] + # process the query parameters _query_params = [] - # process the header parameters _header_params = dict(_params.get('_headers', {})) if _params['accept_language']: _header_params['Accept-Language'] = _params['accept_language'] + if _params['x_child_company_id']: _header_params['X-Child-Company-Id'] = _params['x_child_company_id'] # process the form parameters _form_params = [] _files = {} - # process the body parameter _body_params = None - if _params['product']: + if _params['product'] is not None: _body_params = _params['product'] # set the HTTP header `Accept` @@ -240,10 +242,6 @@ def orders_delete_product(self, id : Annotated[StrictStr, Field(..., description :type x_child_company_id: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -254,10 +252,12 @@ def orders_delete_product(self, id : Annotated[StrictStr, Field(..., description :rtype: ProductOrderResponse """ kwargs['_return_http_data_only'] = True + if '_preload_content' in kwargs: + raise ValueError("Error! Please call the orders_delete_product_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.orders_delete_product_with_http_info(id, line_item_id, accept_language, x_child_company_id, **kwargs) # noqa: E501 @validate_arguments - def orders_delete_product_with_http_info(self, id : Annotated[StrictStr, Field(..., description="Identifier of the resource")], line_item_id : Annotated[StrictStr, Field(..., description="identifier")], accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, x_child_company_id : Annotated[Optional[StrictStr], Field(description="In the case of a holding company, the company id of the child company to which will process the request.")] = None, **kwargs): # noqa: E501 + def orders_delete_product_with_http_info(self, id : Annotated[StrictStr, Field(..., description="Identifier of the resource")], line_item_id : Annotated[StrictStr, Field(..., description="identifier")], accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, x_child_company_id : Annotated[Optional[StrictStr], Field(description="In the case of a holding company, the company id of the child company to which will process the request.")] = None, **kwargs) -> ApiResponse: # noqa: E501 """Delete Product # noqa: E501 Delete product for an existing orden # noqa: E501 @@ -277,13 +277,14 @@ def orders_delete_product_with_http_info(self, id : Annotated[StrictStr, Field(. :type x_child_company_id: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -335,26 +336,26 @@ def orders_delete_product_with_http_info(self, id : Annotated[StrictStr, Field(. _path_params = {} if _params['id']: _path_params['id'] = _params['id'] + if _params['line_item_id']: _path_params['line_item_id'] = _params['line_item_id'] + # process the query parameters _query_params = [] - # process the header parameters _header_params = dict(_params.get('_headers', {})) if _params['accept_language']: _header_params['Accept-Language'] = _params['accept_language'] + if _params['x_child_company_id']: _header_params['X-Child-Company-Id'] = _params['x_child_company_id'] # process the form parameters _form_params = [] _files = {} - # process the body parameter _body_params = None - # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( ['application/vnd.conekta-v2.1.0+json']) # noqa: E501 @@ -410,10 +411,6 @@ def orders_update_product(self, id : Annotated[StrictStr, Field(..., description :type x_child_company_id: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -424,10 +421,12 @@ def orders_update_product(self, id : Annotated[StrictStr, Field(..., description :rtype: ProductOrderResponse """ kwargs['_return_http_data_only'] = True + if '_preload_content' in kwargs: + raise ValueError("Error! Please call the orders_update_product_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.orders_update_product_with_http_info(id, line_item_id, update_product, accept_language, x_child_company_id, **kwargs) # noqa: E501 @validate_arguments - def orders_update_product_with_http_info(self, id : Annotated[StrictStr, Field(..., description="Identifier of the resource")], line_item_id : Annotated[StrictStr, Field(..., description="identifier")], update_product : Annotated[UpdateProduct, Field(..., description="requested field for products")], accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, x_child_company_id : Annotated[Optional[StrictStr], Field(description="In the case of a holding company, the company id of the child company to which will process the request.")] = None, **kwargs): # noqa: E501 + def orders_update_product_with_http_info(self, id : Annotated[StrictStr, Field(..., description="Identifier of the resource")], line_item_id : Annotated[StrictStr, Field(..., description="identifier")], update_product : Annotated[UpdateProduct, Field(..., description="requested field for products")], accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, x_child_company_id : Annotated[Optional[StrictStr], Field(description="In the case of a holding company, the company id of the child company to which will process the request.")] = None, **kwargs) -> ApiResponse: # noqa: E501 """Update Product # noqa: E501 Update an existing product for an existing orden # noqa: E501 @@ -449,13 +448,14 @@ def orders_update_product_with_http_info(self, id : Annotated[StrictStr, Field(. :type x_child_company_id: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -508,26 +508,27 @@ def orders_update_product_with_http_info(self, id : Annotated[StrictStr, Field(. _path_params = {} if _params['id']: _path_params['id'] = _params['id'] + if _params['line_item_id']: _path_params['line_item_id'] = _params['line_item_id'] + # process the query parameters _query_params = [] - # process the header parameters _header_params = dict(_params.get('_headers', {})) if _params['accept_language']: _header_params['Accept-Language'] = _params['accept_language'] + if _params['x_child_company_id']: _header_params['X-Child-Company-Id'] = _params['x_child_company_id'] # process the form parameters _form_params = [] _files = {} - # process the body parameter _body_params = None - if _params['update_product']: + if _params['update_product'] is not None: _body_params = _params['update_product'] # set the HTTP header `Accept` diff --git a/conekta/api/shipping_contacts_api.py b/conekta/api/shipping_contacts_api.py index 701238a..2685774 100644 --- a/conekta/api/shipping_contacts_api.py +++ b/conekta/api/shipping_contacts_api.py @@ -7,13 +7,15 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" -from __future__ import absolute_import import re # noqa: F401 +import io +import warnings from pydantic import validate_arguments, ValidationError from typing_extensions import Annotated @@ -27,6 +29,7 @@ from conekta.models.customer_update_shipping_contacts import CustomerUpdateShippingContacts from conekta.api_client import ApiClient +from conekta.api_response import ApiResponse from conekta.exceptions import ( # noqa: F401 ApiTypeError, ApiValueError @@ -66,10 +69,6 @@ def create_customer_shipping_contacts(self, id : Annotated[StrictStr, Field(..., :type x_child_company_id: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -80,10 +79,12 @@ def create_customer_shipping_contacts(self, id : Annotated[StrictStr, Field(..., :rtype: CustomerShippingContactsResponse """ kwargs['_return_http_data_only'] = True + if '_preload_content' in kwargs: + raise ValueError("Error! Please call the create_customer_shipping_contacts_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.create_customer_shipping_contacts_with_http_info(id, customer_shipping_contacts, accept_language, x_child_company_id, **kwargs) # noqa: E501 @validate_arguments - def create_customer_shipping_contacts_with_http_info(self, id : Annotated[StrictStr, Field(..., description="Identifier of the resource")], customer_shipping_contacts : Annotated[CustomerShippingContacts, Field(..., description="requested field for customer shippings contacts")], accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, x_child_company_id : Annotated[Optional[StrictStr], Field(description="In the case of a holding company, the company id of the child company to which will process the request.")] = None, **kwargs): # noqa: E501 + def create_customer_shipping_contacts_with_http_info(self, id : Annotated[StrictStr, Field(..., description="Identifier of the resource")], customer_shipping_contacts : Annotated[CustomerShippingContacts, Field(..., description="requested field for customer shippings contacts")], accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, x_child_company_id : Annotated[Optional[StrictStr], Field(description="In the case of a holding company, the company id of the child company to which will process the request.")] = None, **kwargs) -> ApiResponse: # noqa: E501 """Create a shipping contacts # noqa: E501 Create a shipping contacts for a customer. # noqa: E501 @@ -103,13 +104,14 @@ def create_customer_shipping_contacts_with_http_info(self, id : Annotated[Strict :type x_child_company_id: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -162,23 +164,23 @@ def create_customer_shipping_contacts_with_http_info(self, id : Annotated[Strict if _params['id']: _path_params['id'] = _params['id'] + # process the query parameters _query_params = [] - # process the header parameters _header_params = dict(_params.get('_headers', {})) if _params['accept_language']: _header_params['Accept-Language'] = _params['accept_language'] + if _params['x_child_company_id']: _header_params['X-Child-Company-Id'] = _params['x_child_company_id'] # process the form parameters _form_params = [] _files = {} - # process the body parameter _body_params = None - if _params['customer_shipping_contacts']: + if _params['customer_shipping_contacts'] is not None: _body_params = _params['customer_shipping_contacts'] # set the HTTP header `Accept` @@ -241,10 +243,6 @@ def delete_customer_shipping_contacts(self, id : Annotated[StrictStr, Field(..., :type x_child_company_id: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -255,10 +253,12 @@ def delete_customer_shipping_contacts(self, id : Annotated[StrictStr, Field(..., :rtype: CustomerShippingContactsResponse """ kwargs['_return_http_data_only'] = True + if '_preload_content' in kwargs: + raise ValueError("Error! Please call the delete_customer_shipping_contacts_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.delete_customer_shipping_contacts_with_http_info(id, shipping_contacts_id, accept_language, x_child_company_id, **kwargs) # noqa: E501 @validate_arguments - def delete_customer_shipping_contacts_with_http_info(self, id : Annotated[StrictStr, Field(..., description="Identifier of the resource")], shipping_contacts_id : Annotated[StrictStr, Field(..., description="identifier")], accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, x_child_company_id : Annotated[Optional[StrictStr], Field(description="In the case of a holding company, the company id of the child company to which will process the request.")] = None, **kwargs): # noqa: E501 + def delete_customer_shipping_contacts_with_http_info(self, id : Annotated[StrictStr, Field(..., description="Identifier of the resource")], shipping_contacts_id : Annotated[StrictStr, Field(..., description="identifier")], accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, x_child_company_id : Annotated[Optional[StrictStr], Field(description="In the case of a holding company, the company id of the child company to which will process the request.")] = None, **kwargs) -> ApiResponse: # noqa: E501 """Delete shipping contacts # noqa: E501 Delete shipping contact that corresponds to a customer ID. # noqa: E501 @@ -278,13 +278,14 @@ def delete_customer_shipping_contacts_with_http_info(self, id : Annotated[Strict :type x_child_company_id: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -336,26 +337,26 @@ def delete_customer_shipping_contacts_with_http_info(self, id : Annotated[Strict _path_params = {} if _params['id']: _path_params['id'] = _params['id'] + if _params['shipping_contacts_id']: _path_params['shipping_contacts_id'] = _params['shipping_contacts_id'] + # process the query parameters _query_params = [] - # process the header parameters _header_params = dict(_params.get('_headers', {})) if _params['accept_language']: _header_params['Accept-Language'] = _params['accept_language'] + if _params['x_child_company_id']: _header_params['X-Child-Company-Id'] = _params['x_child_company_id'] # process the form parameters _form_params = [] _files = {} - # process the body parameter _body_params = None - # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( ['application/vnd.conekta-v2.1.0+json']) # noqa: E501 @@ -411,10 +412,6 @@ def update_customer_shipping_contacts(self, id : Annotated[StrictStr, Field(..., :type x_child_company_id: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -425,10 +422,12 @@ def update_customer_shipping_contacts(self, id : Annotated[StrictStr, Field(..., :rtype: CustomerShippingContactsResponse """ kwargs['_return_http_data_only'] = True + if '_preload_content' in kwargs: + raise ValueError("Error! Please call the update_customer_shipping_contacts_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.update_customer_shipping_contacts_with_http_info(id, shipping_contacts_id, customer_update_shipping_contacts, accept_language, x_child_company_id, **kwargs) # noqa: E501 @validate_arguments - def update_customer_shipping_contacts_with_http_info(self, id : Annotated[StrictStr, Field(..., description="Identifier of the resource")], shipping_contacts_id : Annotated[StrictStr, Field(..., description="identifier")], customer_update_shipping_contacts : Annotated[CustomerUpdateShippingContacts, Field(..., description="requested field for customer update shippings contacts")], accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, x_child_company_id : Annotated[Optional[StrictStr], Field(description="In the case of a holding company, the company id of the child company to which will process the request.")] = None, **kwargs): # noqa: E501 + def update_customer_shipping_contacts_with_http_info(self, id : Annotated[StrictStr, Field(..., description="Identifier of the resource")], shipping_contacts_id : Annotated[StrictStr, Field(..., description="identifier")], customer_update_shipping_contacts : Annotated[CustomerUpdateShippingContacts, Field(..., description="requested field for customer update shippings contacts")], accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, x_child_company_id : Annotated[Optional[StrictStr], Field(description="In the case of a holding company, the company id of the child company to which will process the request.")] = None, **kwargs) -> ApiResponse: # noqa: E501 """Update shipping contacts # noqa: E501 Update shipping contact that corresponds to a customer ID. # noqa: E501 @@ -450,13 +449,14 @@ def update_customer_shipping_contacts_with_http_info(self, id : Annotated[Strict :type x_child_company_id: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -509,26 +509,27 @@ def update_customer_shipping_contacts_with_http_info(self, id : Annotated[Strict _path_params = {} if _params['id']: _path_params['id'] = _params['id'] + if _params['shipping_contacts_id']: _path_params['shipping_contacts_id'] = _params['shipping_contacts_id'] + # process the query parameters _query_params = [] - # process the header parameters _header_params = dict(_params.get('_headers', {})) if _params['accept_language']: _header_params['Accept-Language'] = _params['accept_language'] + if _params['x_child_company_id']: _header_params['X-Child-Company-Id'] = _params['x_child_company_id'] # process the form parameters _form_params = [] _files = {} - # process the body parameter _body_params = None - if _params['customer_update_shipping_contacts']: + if _params['customer_update_shipping_contacts'] is not None: _body_params = _params['customer_update_shipping_contacts'] # set the HTTP header `Accept` diff --git a/conekta/api/shippings_api.py b/conekta/api/shippings_api.py index fceb613..8e738f5 100644 --- a/conekta/api/shippings_api.py +++ b/conekta/api/shippings_api.py @@ -7,13 +7,15 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" -from __future__ import absolute_import import re # noqa: F401 +import io +import warnings from pydantic import validate_arguments, ValidationError from typing_extensions import Annotated @@ -26,6 +28,7 @@ from conekta.models.shipping_request import ShippingRequest from conekta.api_client import ApiClient +from conekta.api_response import ApiResponse from conekta.exceptions import ( # noqa: F401 ApiTypeError, ApiValueError @@ -65,10 +68,6 @@ def orders_create_shipping(self, id : Annotated[StrictStr, Field(..., descriptio :type x_child_company_id: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -79,10 +78,12 @@ def orders_create_shipping(self, id : Annotated[StrictStr, Field(..., descriptio :rtype: ShippingOrderResponse """ kwargs['_return_http_data_only'] = True + if '_preload_content' in kwargs: + raise ValueError("Error! Please call the orders_create_shipping_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.orders_create_shipping_with_http_info(id, shipping_request, accept_language, x_child_company_id, **kwargs) # noqa: E501 @validate_arguments - def orders_create_shipping_with_http_info(self, id : Annotated[StrictStr, Field(..., description="Identifier of the resource")], shipping_request : Annotated[ShippingRequest, Field(..., description="requested field for a shipping")], accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, x_child_company_id : Annotated[Optional[StrictStr], Field(description="In the case of a holding company, the company id of the child company to which will process the request.")] = None, **kwargs): # noqa: E501 + def orders_create_shipping_with_http_info(self, id : Annotated[StrictStr, Field(..., description="Identifier of the resource")], shipping_request : Annotated[ShippingRequest, Field(..., description="requested field for a shipping")], accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, x_child_company_id : Annotated[Optional[StrictStr], Field(description="In the case of a holding company, the company id of the child company to which will process the request.")] = None, **kwargs) -> ApiResponse: # noqa: E501 """Create Shipping # noqa: E501 Create new shipping for an existing orden # noqa: E501 @@ -102,13 +103,14 @@ def orders_create_shipping_with_http_info(self, id : Annotated[StrictStr, Field( :type x_child_company_id: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -161,23 +163,23 @@ def orders_create_shipping_with_http_info(self, id : Annotated[StrictStr, Field( if _params['id']: _path_params['id'] = _params['id'] + # process the query parameters _query_params = [] - # process the header parameters _header_params = dict(_params.get('_headers', {})) if _params['accept_language']: _header_params['Accept-Language'] = _params['accept_language'] + if _params['x_child_company_id']: _header_params['X-Child-Company-Id'] = _params['x_child_company_id'] # process the form parameters _form_params = [] _files = {} - # process the body parameter _body_params = None - if _params['shipping_request']: + if _params['shipping_request'] is not None: _body_params = _params['shipping_request'] # set the HTTP header `Accept` @@ -239,10 +241,6 @@ def orders_delete_shipping(self, id : Annotated[StrictStr, Field(..., descriptio :type x_child_company_id: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -253,10 +251,12 @@ def orders_delete_shipping(self, id : Annotated[StrictStr, Field(..., descriptio :rtype: ShippingOrderResponse """ kwargs['_return_http_data_only'] = True + if '_preload_content' in kwargs: + raise ValueError("Error! Please call the orders_delete_shipping_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.orders_delete_shipping_with_http_info(id, shipping_id, accept_language, x_child_company_id, **kwargs) # noqa: E501 @validate_arguments - def orders_delete_shipping_with_http_info(self, id : Annotated[StrictStr, Field(..., description="Identifier of the resource")], shipping_id : Annotated[StrictStr, Field(..., description="identifier")], accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, x_child_company_id : Annotated[Optional[StrictStr], Field(description="In the case of a holding company, the company id of the child company to which will process the request.")] = None, **kwargs): # noqa: E501 + def orders_delete_shipping_with_http_info(self, id : Annotated[StrictStr, Field(..., description="Identifier of the resource")], shipping_id : Annotated[StrictStr, Field(..., description="identifier")], accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, x_child_company_id : Annotated[Optional[StrictStr], Field(description="In the case of a holding company, the company id of the child company to which will process the request.")] = None, **kwargs) -> ApiResponse: # noqa: E501 """Delete Shipping # noqa: E501 Delete shipping # noqa: E501 @@ -276,13 +276,14 @@ def orders_delete_shipping_with_http_info(self, id : Annotated[StrictStr, Field( :type x_child_company_id: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -334,26 +335,26 @@ def orders_delete_shipping_with_http_info(self, id : Annotated[StrictStr, Field( _path_params = {} if _params['id']: _path_params['id'] = _params['id'] + if _params['shipping_id']: _path_params['shipping_id'] = _params['shipping_id'] + # process the query parameters _query_params = [] - # process the header parameters _header_params = dict(_params.get('_headers', {})) if _params['accept_language']: _header_params['Accept-Language'] = _params['accept_language'] + if _params['x_child_company_id']: _header_params['X-Child-Company-Id'] = _params['x_child_company_id'] # process the form parameters _form_params = [] _files = {} - # process the body parameter _body_params = None - # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( ['application/vnd.conekta-v2.1.0+json']) # noqa: E501 @@ -409,10 +410,6 @@ def orders_update_shipping(self, id : Annotated[StrictStr, Field(..., descriptio :type x_child_company_id: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -423,10 +420,12 @@ def orders_update_shipping(self, id : Annotated[StrictStr, Field(..., descriptio :rtype: ShippingOrderResponse """ kwargs['_return_http_data_only'] = True + if '_preload_content' in kwargs: + raise ValueError("Error! Please call the orders_update_shipping_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.orders_update_shipping_with_http_info(id, shipping_id, shipping_request, accept_language, x_child_company_id, **kwargs) # noqa: E501 @validate_arguments - def orders_update_shipping_with_http_info(self, id : Annotated[StrictStr, Field(..., description="Identifier of the resource")], shipping_id : Annotated[StrictStr, Field(..., description="identifier")], shipping_request : Annotated[ShippingRequest, Field(..., description="requested field for a shipping")], accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, x_child_company_id : Annotated[Optional[StrictStr], Field(description="In the case of a holding company, the company id of the child company to which will process the request.")] = None, **kwargs): # noqa: E501 + def orders_update_shipping_with_http_info(self, id : Annotated[StrictStr, Field(..., description="Identifier of the resource")], shipping_id : Annotated[StrictStr, Field(..., description="identifier")], shipping_request : Annotated[ShippingRequest, Field(..., description="requested field for a shipping")], accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, x_child_company_id : Annotated[Optional[StrictStr], Field(description="In the case of a holding company, the company id of the child company to which will process the request.")] = None, **kwargs) -> ApiResponse: # noqa: E501 """Update Shipping # noqa: E501 Update existing shipping for an existing orden # noqa: E501 @@ -448,13 +447,14 @@ def orders_update_shipping_with_http_info(self, id : Annotated[StrictStr, Field( :type x_child_company_id: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -507,26 +507,27 @@ def orders_update_shipping_with_http_info(self, id : Annotated[StrictStr, Field( _path_params = {} if _params['id']: _path_params['id'] = _params['id'] + if _params['shipping_id']: _path_params['shipping_id'] = _params['shipping_id'] + # process the query parameters _query_params = [] - # process the header parameters _header_params = dict(_params.get('_headers', {})) if _params['accept_language']: _header_params['Accept-Language'] = _params['accept_language'] + if _params['x_child_company_id']: _header_params['X-Child-Company-Id'] = _params['x_child_company_id'] # process the form parameters _form_params = [] _files = {} - # process the body parameter _body_params = None - if _params['shipping_request']: + if _params['shipping_request'] is not None: _body_params = _params['shipping_request'] # set the HTTP header `Accept` diff --git a/conekta/api/subscriptions_api.py b/conekta/api/subscriptions_api.py index e7af3f8..883ab83 100644 --- a/conekta/api/subscriptions_api.py +++ b/conekta/api/subscriptions_api.py @@ -7,13 +7,15 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" -from __future__ import absolute_import import re # noqa: F401 +import io +import warnings from pydantic import validate_arguments, ValidationError from typing_extensions import Annotated @@ -28,6 +30,7 @@ from conekta.models.subscription_update_request import SubscriptionUpdateRequest from conekta.api_client import ApiClient +from conekta.api_response import ApiResponse from conekta.exceptions import ( # noqa: F401 ApiTypeError, ApiValueError @@ -65,10 +68,6 @@ def cancel_subscription(self, id : Annotated[StrictStr, Field(..., description=" :type x_child_company_id: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -79,10 +78,12 @@ def cancel_subscription(self, id : Annotated[StrictStr, Field(..., description=" :rtype: SubscriptionResponse """ kwargs['_return_http_data_only'] = True + if '_preload_content' in kwargs: + raise ValueError("Error! Please call the cancel_subscription_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.cancel_subscription_with_http_info(id, accept_language, x_child_company_id, **kwargs) # noqa: E501 @validate_arguments - def cancel_subscription_with_http_info(self, id : Annotated[StrictStr, Field(..., description="Identifier of the resource")], accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, x_child_company_id : Annotated[Optional[StrictStr], Field(description="In the case of a holding company, the company id of the child company to which will process the request.")] = None, **kwargs): # noqa: E501 + def cancel_subscription_with_http_info(self, id : Annotated[StrictStr, Field(..., description="Identifier of the resource")], accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, x_child_company_id : Annotated[Optional[StrictStr], Field(description="In the case of a holding company, the company id of the child company to which will process the request.")] = None, **kwargs) -> ApiResponse: # noqa: E501 """Cancel Subscription # noqa: E501 You can cancel the subscription to stop the plans that your customers consume # noqa: E501 @@ -100,13 +101,14 @@ def cancel_subscription_with_http_info(self, id : Annotated[StrictStr, Field(... :type x_child_company_id: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -158,23 +160,22 @@ def cancel_subscription_with_http_info(self, id : Annotated[StrictStr, Field(... if _params['id']: _path_params['id'] = _params['id'] + # process the query parameters _query_params = [] - # process the header parameters _header_params = dict(_params.get('_headers', {})) if _params['accept_language']: _header_params['Accept-Language'] = _params['accept_language'] + if _params['x_child_company_id']: _header_params['X-Child-Company-Id'] = _params['x_child_company_id'] # process the form parameters _form_params = [] _files = {} - # process the body parameter _body_params = None - # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( ['application/vnd.conekta-v2.1.0+json']) # noqa: E501 @@ -227,10 +228,6 @@ def create_subscription(self, id : Annotated[StrictStr, Field(..., description=" :type x_child_company_id: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -241,10 +238,12 @@ def create_subscription(self, id : Annotated[StrictStr, Field(..., description=" :rtype: SubscriptionResponse """ kwargs['_return_http_data_only'] = True + if '_preload_content' in kwargs: + raise ValueError("Error! Please call the create_subscription_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.create_subscription_with_http_info(id, subscription_request, accept_language, x_child_company_id, **kwargs) # noqa: E501 @validate_arguments - def create_subscription_with_http_info(self, id : Annotated[StrictStr, Field(..., description="Identifier of the resource")], subscription_request : Annotated[SubscriptionRequest, Field(..., description="requested field for subscriptions")], accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, x_child_company_id : Annotated[Optional[StrictStr], Field(description="In the case of a holding company, the company id of the child company to which will process the request.")] = None, **kwargs): # noqa: E501 + def create_subscription_with_http_info(self, id : Annotated[StrictStr, Field(..., description="Identifier of the resource")], subscription_request : Annotated[SubscriptionRequest, Field(..., description="requested field for subscriptions")], accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, x_child_company_id : Annotated[Optional[StrictStr], Field(description="In the case of a holding company, the company id of the child company to which will process the request.")] = None, **kwargs) -> ApiResponse: # noqa: E501 """Create Subscription # noqa: E501 You can create the subscription to include the plans that your customers consume # noqa: E501 @@ -264,13 +263,14 @@ def create_subscription_with_http_info(self, id : Annotated[StrictStr, Field(... :type x_child_company_id: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -323,23 +323,23 @@ def create_subscription_with_http_info(self, id : Annotated[StrictStr, Field(... if _params['id']: _path_params['id'] = _params['id'] + # process the query parameters _query_params = [] - # process the header parameters _header_params = dict(_params.get('_headers', {})) if _params['accept_language']: _header_params['Accept-Language'] = _params['accept_language'] + if _params['x_child_company_id']: _header_params['X-Child-Company-Id'] = _params['x_child_company_id'] # process the form parameters _form_params = [] _files = {} - # process the body parameter _body_params = None - if _params['subscription_request']: + if _params['subscription_request'] is not None: _body_params = _params['subscription_request'] # set the HTTP header `Accept` @@ -400,10 +400,6 @@ def get_all_events_from_subscription(self, id : Annotated[StrictStr, Field(..., :type x_child_company_id: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -414,10 +410,12 @@ def get_all_events_from_subscription(self, id : Annotated[StrictStr, Field(..., :rtype: SubscriptionEventsResponse """ kwargs['_return_http_data_only'] = True + if '_preload_content' in kwargs: + raise ValueError("Error! Please call the get_all_events_from_subscription_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.get_all_events_from_subscription_with_http_info(id, accept_language, x_child_company_id, **kwargs) # noqa: E501 @validate_arguments - def get_all_events_from_subscription_with_http_info(self, id : Annotated[StrictStr, Field(..., description="Identifier of the resource")], accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, x_child_company_id : Annotated[Optional[StrictStr], Field(description="In the case of a holding company, the company id of the child company to which will process the request.")] = None, **kwargs): # noqa: E501 + def get_all_events_from_subscription_with_http_info(self, id : Annotated[StrictStr, Field(..., description="Identifier of the resource")], accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, x_child_company_id : Annotated[Optional[StrictStr], Field(description="In the case of a holding company, the company id of the child company to which will process the request.")] = None, **kwargs) -> ApiResponse: # noqa: E501 """Get Events By Subscription # noqa: E501 You can get the events of the subscription(s) of a client, with the customer id # noqa: E501 @@ -435,13 +433,14 @@ def get_all_events_from_subscription_with_http_info(self, id : Annotated[StrictS :type x_child_company_id: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -493,23 +492,22 @@ def get_all_events_from_subscription_with_http_info(self, id : Annotated[StrictS if _params['id']: _path_params['id'] = _params['id'] + # process the query parameters _query_params = [] - # process the header parameters _header_params = dict(_params.get('_headers', {})) if _params['accept_language']: _header_params['Accept-Language'] = _params['accept_language'] + if _params['x_child_company_id']: _header_params['X-Child-Company-Id'] = _params['x_child_company_id'] # process the form parameters _form_params = [] _files = {} - # process the body parameter _body_params = None - # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( ['application/vnd.conekta-v2.1.0+json']) # noqa: E501 @@ -559,10 +557,6 @@ def get_subscription(self, id : Annotated[StrictStr, Field(..., description="Ide :type accept_language: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -573,10 +567,12 @@ def get_subscription(self, id : Annotated[StrictStr, Field(..., description="Ide :rtype: SubscriptionResponse """ kwargs['_return_http_data_only'] = True + if '_preload_content' in kwargs: + raise ValueError("Error! Please call the get_subscription_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.get_subscription_with_http_info(id, accept_language, **kwargs) # noqa: E501 @validate_arguments - def get_subscription_with_http_info(self, id : Annotated[StrictStr, Field(..., description="Identifier of the resource")], accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, **kwargs): # noqa: E501 + def get_subscription_with_http_info(self, id : Annotated[StrictStr, Field(..., description="Identifier of the resource")], accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, **kwargs) -> ApiResponse: # noqa: E501 """Get Subscription # noqa: E501 This method makes a synchronous HTTP request by default. To make an @@ -591,13 +587,14 @@ def get_subscription_with_http_info(self, id : Annotated[StrictStr, Field(..., d :type accept_language: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -648,9 +645,9 @@ def get_subscription_with_http_info(self, id : Annotated[StrictStr, Field(..., d if _params['id']: _path_params['id'] = _params['id'] + # process the query parameters _query_params = [] - # process the header parameters _header_params = dict(_params.get('_headers', {})) if _params['accept_language']: @@ -659,10 +656,8 @@ def get_subscription_with_http_info(self, id : Annotated[StrictStr, Field(..., d # process the form parameters _form_params = [] _files = {} - # process the body parameter _body_params = None - # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( ['application/vnd.conekta-v2.1.0+json']) # noqa: E501 @@ -713,10 +708,6 @@ def pause_subscription(self, id : Annotated[StrictStr, Field(..., description="I :type x_child_company_id: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -727,10 +718,12 @@ def pause_subscription(self, id : Annotated[StrictStr, Field(..., description="I :rtype: SubscriptionResponse """ kwargs['_return_http_data_only'] = True + if '_preload_content' in kwargs: + raise ValueError("Error! Please call the pause_subscription_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.pause_subscription_with_http_info(id, accept_language, x_child_company_id, **kwargs) # noqa: E501 @validate_arguments - def pause_subscription_with_http_info(self, id : Annotated[StrictStr, Field(..., description="Identifier of the resource")], accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, x_child_company_id : Annotated[Optional[StrictStr], Field(description="In the case of a holding company, the company id of the child company to which will process the request.")] = None, **kwargs): # noqa: E501 + def pause_subscription_with_http_info(self, id : Annotated[StrictStr, Field(..., description="Identifier of the resource")], accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, x_child_company_id : Annotated[Optional[StrictStr], Field(description="In the case of a holding company, the company id of the child company to which will process the request.")] = None, **kwargs) -> ApiResponse: # noqa: E501 """Pause Subscription # noqa: E501 You can pause the subscription to stop the plans that your customers consume # noqa: E501 @@ -748,13 +741,14 @@ def pause_subscription_with_http_info(self, id : Annotated[StrictStr, Field(..., :type x_child_company_id: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -806,23 +800,22 @@ def pause_subscription_with_http_info(self, id : Annotated[StrictStr, Field(..., if _params['id']: _path_params['id'] = _params['id'] + # process the query parameters _query_params = [] - # process the header parameters _header_params = dict(_params.get('_headers', {})) if _params['accept_language']: _header_params['Accept-Language'] = _params['accept_language'] + if _params['x_child_company_id']: _header_params['X-Child-Company-Id'] = _params['x_child_company_id'] # process the form parameters _form_params = [] _files = {} - # process the body parameter _body_params = None - # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( ['application/vnd.conekta-v2.1.0+json']) # noqa: E501 @@ -874,10 +867,6 @@ def resume_subscription(self, id : Annotated[StrictStr, Field(..., description=" :type x_child_company_id: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -888,10 +877,12 @@ def resume_subscription(self, id : Annotated[StrictStr, Field(..., description=" :rtype: SubscriptionResponse """ kwargs['_return_http_data_only'] = True + if '_preload_content' in kwargs: + raise ValueError("Error! Please call the resume_subscription_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.resume_subscription_with_http_info(id, accept_language, x_child_company_id, **kwargs) # noqa: E501 @validate_arguments - def resume_subscription_with_http_info(self, id : Annotated[StrictStr, Field(..., description="Identifier of the resource")], accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, x_child_company_id : Annotated[Optional[StrictStr], Field(description="In the case of a holding company, the company id of the child company to which will process the request.")] = None, **kwargs): # noqa: E501 + def resume_subscription_with_http_info(self, id : Annotated[StrictStr, Field(..., description="Identifier of the resource")], accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, x_child_company_id : Annotated[Optional[StrictStr], Field(description="In the case of a holding company, the company id of the child company to which will process the request.")] = None, **kwargs) -> ApiResponse: # noqa: E501 """Resume Subscription # noqa: E501 You can resume the subscription to start the plans that your customers consume # noqa: E501 @@ -909,13 +900,14 @@ def resume_subscription_with_http_info(self, id : Annotated[StrictStr, Field(... :type x_child_company_id: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -967,23 +959,22 @@ def resume_subscription_with_http_info(self, id : Annotated[StrictStr, Field(... if _params['id']: _path_params['id'] = _params['id'] + # process the query parameters _query_params = [] - # process the header parameters _header_params = dict(_params.get('_headers', {})) if _params['accept_language']: _header_params['Accept-Language'] = _params['accept_language'] + if _params['x_child_company_id']: _header_params['X-Child-Company-Id'] = _params['x_child_company_id'] # process the form parameters _form_params = [] _files = {} - # process the body parameter _body_params = None - # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( ['application/vnd.conekta-v2.1.0+json']) # noqa: E501 @@ -1038,10 +1029,6 @@ def update_subscription(self, id : Annotated[StrictStr, Field(..., description=" :type x_child_company_id: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1052,10 +1039,12 @@ def update_subscription(self, id : Annotated[StrictStr, Field(..., description=" :rtype: SubscriptionResponse """ kwargs['_return_http_data_only'] = True + if '_preload_content' in kwargs: + raise ValueError("Error! Please call the update_subscription_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.update_subscription_with_http_info(id, subscription_update_request, accept_language, x_child_company_id, **kwargs) # noqa: E501 @validate_arguments - def update_subscription_with_http_info(self, id : Annotated[StrictStr, Field(..., description="Identifier of the resource")], subscription_update_request : Annotated[SubscriptionUpdateRequest, Field(..., description="requested field for update a subscription")], accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, x_child_company_id : Annotated[Optional[StrictStr], Field(description="In the case of a holding company, the company id of the child company to which will process the request.")] = None, **kwargs): # noqa: E501 + def update_subscription_with_http_info(self, id : Annotated[StrictStr, Field(..., description="Identifier of the resource")], subscription_update_request : Annotated[SubscriptionUpdateRequest, Field(..., description="requested field for update a subscription")], accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, x_child_company_id : Annotated[Optional[StrictStr], Field(description="In the case of a holding company, the company id of the child company to which will process the request.")] = None, **kwargs) -> ApiResponse: # noqa: E501 """Update Subscription # noqa: E501 You can modify the subscription to change the plans that your customers consume # noqa: E501 @@ -1075,13 +1064,14 @@ def update_subscription_with_http_info(self, id : Annotated[StrictStr, Field(... :type x_child_company_id: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1134,23 +1124,23 @@ def update_subscription_with_http_info(self, id : Annotated[StrictStr, Field(... if _params['id']: _path_params['id'] = _params['id'] + # process the query parameters _query_params = [] - # process the header parameters _header_params = dict(_params.get('_headers', {})) if _params['accept_language']: _header_params['Accept-Language'] = _params['accept_language'] + if _params['x_child_company_id']: _header_params['X-Child-Company-Id'] = _params['x_child_company_id'] # process the form parameters _form_params = [] _files = {} - # process the body parameter _body_params = None - if _params['subscription_update_request']: + if _params['subscription_update_request'] is not None: _body_params = _params['subscription_update_request'] # set the HTTP header `Accept` diff --git a/conekta/api/taxes_api.py b/conekta/api/taxes_api.py index 9b350c6..1154651 100644 --- a/conekta/api/taxes_api.py +++ b/conekta/api/taxes_api.py @@ -7,13 +7,15 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" -from __future__ import absolute_import import re # noqa: F401 +import io +import warnings from pydantic import validate_arguments, ValidationError from typing_extensions import Annotated @@ -27,6 +29,7 @@ from conekta.models.update_order_tax_response import UpdateOrderTaxResponse from conekta.api_client import ApiClient +from conekta.api_response import ApiResponse from conekta.exceptions import ( # noqa: F401 ApiTypeError, ApiValueError @@ -66,10 +69,6 @@ def orders_create_taxes(self, id : Annotated[StrictStr, Field(..., description=" :type x_child_company_id: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -80,10 +79,12 @@ def orders_create_taxes(self, id : Annotated[StrictStr, Field(..., description=" :rtype: UpdateOrderTaxResponse """ kwargs['_return_http_data_only'] = True + if '_preload_content' in kwargs: + raise ValueError("Error! Please call the orders_create_taxes_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.orders_create_taxes_with_http_info(id, order_tax_request, accept_language, x_child_company_id, **kwargs) # noqa: E501 @validate_arguments - def orders_create_taxes_with_http_info(self, id : Annotated[StrictStr, Field(..., description="Identifier of the resource")], order_tax_request : Annotated[OrderTaxRequest, Field(..., description="requested field for a taxes")], accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, x_child_company_id : Annotated[Optional[StrictStr], Field(description="In the case of a holding company, the company id of the child company to which will process the request.")] = None, **kwargs): # noqa: E501 + def orders_create_taxes_with_http_info(self, id : Annotated[StrictStr, Field(..., description="Identifier of the resource")], order_tax_request : Annotated[OrderTaxRequest, Field(..., description="requested field for a taxes")], accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, x_child_company_id : Annotated[Optional[StrictStr], Field(description="In the case of a holding company, the company id of the child company to which will process the request.")] = None, **kwargs) -> ApiResponse: # noqa: E501 """Create Tax # noqa: E501 Create new taxes for an existing orden # noqa: E501 @@ -103,13 +104,14 @@ def orders_create_taxes_with_http_info(self, id : Annotated[StrictStr, Field(... :type x_child_company_id: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -162,23 +164,23 @@ def orders_create_taxes_with_http_info(self, id : Annotated[StrictStr, Field(... if _params['id']: _path_params['id'] = _params['id'] + # process the query parameters _query_params = [] - # process the header parameters _header_params = dict(_params.get('_headers', {})) if _params['accept_language']: _header_params['Accept-Language'] = _params['accept_language'] + if _params['x_child_company_id']: _header_params['X-Child-Company-Id'] = _params['x_child_company_id'] # process the form parameters _form_params = [] _files = {} - # process the body parameter _body_params = None - if _params['order_tax_request']: + if _params['order_tax_request'] is not None: _body_params = _params['order_tax_request'] # set the HTTP header `Accept` @@ -240,10 +242,6 @@ def orders_delete_taxes(self, id : Annotated[StrictStr, Field(..., description=" :type x_child_company_id: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -254,10 +252,12 @@ def orders_delete_taxes(self, id : Annotated[StrictStr, Field(..., description=" :rtype: UpdateOrderTaxResponse """ kwargs['_return_http_data_only'] = True + if '_preload_content' in kwargs: + raise ValueError("Error! Please call the orders_delete_taxes_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.orders_delete_taxes_with_http_info(id, tax_id, accept_language, x_child_company_id, **kwargs) # noqa: E501 @validate_arguments - def orders_delete_taxes_with_http_info(self, id : Annotated[StrictStr, Field(..., description="Identifier of the resource")], tax_id : Annotated[StrictStr, Field(..., description="identifier")], accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, x_child_company_id : Annotated[Optional[StrictStr], Field(description="In the case of a holding company, the company id of the child company to which will process the request.")] = None, **kwargs): # noqa: E501 + def orders_delete_taxes_with_http_info(self, id : Annotated[StrictStr, Field(..., description="Identifier of the resource")], tax_id : Annotated[StrictStr, Field(..., description="identifier")], accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, x_child_company_id : Annotated[Optional[StrictStr], Field(description="In the case of a holding company, the company id of the child company to which will process the request.")] = None, **kwargs) -> ApiResponse: # noqa: E501 """Delete Tax # noqa: E501 Delete taxes for an existing orden # noqa: E501 @@ -277,13 +277,14 @@ def orders_delete_taxes_with_http_info(self, id : Annotated[StrictStr, Field(... :type x_child_company_id: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -335,26 +336,26 @@ def orders_delete_taxes_with_http_info(self, id : Annotated[StrictStr, Field(... _path_params = {} if _params['id']: _path_params['id'] = _params['id'] + if _params['tax_id']: _path_params['tax_id'] = _params['tax_id'] + # process the query parameters _query_params = [] - # process the header parameters _header_params = dict(_params.get('_headers', {})) if _params['accept_language']: _header_params['Accept-Language'] = _params['accept_language'] + if _params['x_child_company_id']: _header_params['X-Child-Company-Id'] = _params['x_child_company_id'] # process the form parameters _form_params = [] _files = {} - # process the body parameter _body_params = None - # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( ['application/vnd.conekta-v2.1.0+json']) # noqa: E501 @@ -410,10 +411,6 @@ def orders_update_taxes(self, id : Annotated[StrictStr, Field(..., description=" :type x_child_company_id: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -424,10 +421,12 @@ def orders_update_taxes(self, id : Annotated[StrictStr, Field(..., description=" :rtype: UpdateOrderTaxResponse """ kwargs['_return_http_data_only'] = True + if '_preload_content' in kwargs: + raise ValueError("Error! Please call the orders_update_taxes_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.orders_update_taxes_with_http_info(id, tax_id, update_order_tax_request, accept_language, x_child_company_id, **kwargs) # noqa: E501 @validate_arguments - def orders_update_taxes_with_http_info(self, id : Annotated[StrictStr, Field(..., description="Identifier of the resource")], tax_id : Annotated[StrictStr, Field(..., description="identifier")], update_order_tax_request : Annotated[UpdateOrderTaxRequest, Field(..., description="requested field for taxes")], accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, x_child_company_id : Annotated[Optional[StrictStr], Field(description="In the case of a holding company, the company id of the child company to which will process the request.")] = None, **kwargs): # noqa: E501 + def orders_update_taxes_with_http_info(self, id : Annotated[StrictStr, Field(..., description="Identifier of the resource")], tax_id : Annotated[StrictStr, Field(..., description="identifier")], update_order_tax_request : Annotated[UpdateOrderTaxRequest, Field(..., description="requested field for taxes")], accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, x_child_company_id : Annotated[Optional[StrictStr], Field(description="In the case of a holding company, the company id of the child company to which will process the request.")] = None, **kwargs) -> ApiResponse: # noqa: E501 """Update Tax # noqa: E501 Update taxes for an existing orden # noqa: E501 @@ -449,13 +448,14 @@ def orders_update_taxes_with_http_info(self, id : Annotated[StrictStr, Field(... :type x_child_company_id: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -508,26 +508,27 @@ def orders_update_taxes_with_http_info(self, id : Annotated[StrictStr, Field(... _path_params = {} if _params['id']: _path_params['id'] = _params['id'] + if _params['tax_id']: _path_params['tax_id'] = _params['tax_id'] + # process the query parameters _query_params = [] - # process the header parameters _header_params = dict(_params.get('_headers', {})) if _params['accept_language']: _header_params['Accept-Language'] = _params['accept_language'] + if _params['x_child_company_id']: _header_params['X-Child-Company-Id'] = _params['x_child_company_id'] # process the form parameters _form_params = [] _files = {} - # process the body parameter _body_params = None - if _params['update_order_tax_request']: + if _params['update_order_tax_request'] is not None: _body_params = _params['update_order_tax_request'] # set the HTTP header `Accept` diff --git a/conekta/api/tokens_api.py b/conekta/api/tokens_api.py index 487cd69..a7b96b7 100644 --- a/conekta/api/tokens_api.py +++ b/conekta/api/tokens_api.py @@ -7,13 +7,15 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" -from __future__ import absolute_import import re # noqa: F401 +import io +import warnings from pydantic import validate_arguments, ValidationError from typing_extensions import Annotated @@ -26,6 +28,7 @@ from conekta.models.token_response import TokenResponse from conekta.api_client import ApiClient +from conekta.api_response import ApiResponse from conekta.exceptions import ( # noqa: F401 ApiTypeError, ApiValueError @@ -61,10 +64,6 @@ def create_token(self, token : Annotated[Token, Field(..., description="requeste :type accept_language: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -75,10 +74,12 @@ def create_token(self, token : Annotated[Token, Field(..., description="requeste :rtype: TokenResponse """ kwargs['_return_http_data_only'] = True + if '_preload_content' in kwargs: + raise ValueError("Error! Please call the create_token_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.create_token_with_http_info(token, accept_language, **kwargs) # noqa: E501 @validate_arguments - def create_token_with_http_info(self, token : Annotated[Token, Field(..., description="requested field for token")], accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, **kwargs): # noqa: E501 + def create_token_with_http_info(self, token : Annotated[Token, Field(..., description="requested field for token")], accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, **kwargs) -> ApiResponse: # noqa: E501 """Create Token # noqa: E501 Generate a payment token, to associate it with a card # noqa: E501 @@ -94,13 +95,14 @@ def create_token_with_http_info(self, token : Annotated[Token, Field(..., descri :type accept_language: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -151,7 +153,6 @@ def create_token_with_http_info(self, token : Annotated[Token, Field(..., descri # process the query parameters _query_params = [] - # process the header parameters _header_params = dict(_params.get('_headers', {})) if _params['accept_language']: @@ -160,10 +161,9 @@ def create_token_with_http_info(self, token : Annotated[Token, Field(..., descri # process the form parameters _form_params = [] _files = {} - # process the body parameter _body_params = None - if _params['token']: + if _params['token'] is not None: _body_params = _params['token'] # set the HTTP header `Accept` diff --git a/conekta/api/transactions_api.py b/conekta/api/transactions_api.py index 46a4856..2df195e 100644 --- a/conekta/api/transactions_api.py +++ b/conekta/api/transactions_api.py @@ -7,13 +7,15 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" -from __future__ import absolute_import import re # noqa: F401 +import io +import warnings from pydantic import validate_arguments, ValidationError from typing_extensions import Annotated @@ -26,6 +28,7 @@ from conekta.models.transaction_response import TransactionResponse from conekta.api_client import ApiClient +from conekta.api_response import ApiResponse from conekta.exceptions import ( # noqa: F401 ApiTypeError, ApiValueError @@ -63,10 +66,6 @@ def get_transaction(self, id : Annotated[StrictStr, Field(..., description="Iden :type x_child_company_id: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -77,10 +76,12 @@ def get_transaction(self, id : Annotated[StrictStr, Field(..., description="Iden :rtype: TransactionResponse """ kwargs['_return_http_data_only'] = True + if '_preload_content' in kwargs: + raise ValueError("Error! Please call the get_transaction_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.get_transaction_with_http_info(id, accept_language, x_child_company_id, **kwargs) # noqa: E501 @validate_arguments - def get_transaction_with_http_info(self, id : Annotated[StrictStr, Field(..., description="Identifier of the resource")], accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, x_child_company_id : Annotated[Optional[StrictStr], Field(description="In the case of a holding company, the company id of the child company to which will process the request.")] = None, **kwargs): # noqa: E501 + def get_transaction_with_http_info(self, id : Annotated[StrictStr, Field(..., description="Identifier of the resource")], accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, x_child_company_id : Annotated[Optional[StrictStr], Field(description="In the case of a holding company, the company id of the child company to which will process the request.")] = None, **kwargs) -> ApiResponse: # noqa: E501 """Get transaction # noqa: E501 Get the details of a transaction # noqa: E501 @@ -98,13 +99,14 @@ def get_transaction_with_http_info(self, id : Annotated[StrictStr, Field(..., de :type x_child_company_id: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -156,23 +158,22 @@ def get_transaction_with_http_info(self, id : Annotated[StrictStr, Field(..., de if _params['id']: _path_params['id'] = _params['id'] + # process the query parameters _query_params = [] - # process the header parameters _header_params = dict(_params.get('_headers', {})) if _params['accept_language']: _header_params['Accept-Language'] = _params['accept_language'] + if _params['x_child_company_id']: _header_params['X-Child-Company-Id'] = _params['x_child_company_id'] # process the form parameters _form_params = [] _files = {} - # process the body parameter _body_params = None - # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( ['application/vnd.conekta-v2.1.0+json']) # noqa: E501 @@ -229,10 +230,6 @@ def get_transactions(self, accept_language : Annotated[Optional[StrictStr], Fiel :type previous: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -243,10 +240,12 @@ def get_transactions(self, accept_language : Annotated[Optional[StrictStr], Fiel :rtype: GetTransactionsResponse """ kwargs['_return_http_data_only'] = True + if '_preload_content' in kwargs: + raise ValueError("Error! Please call the get_transactions_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.get_transactions_with_http_info(accept_language, x_child_company_id, limit, search, next, previous, **kwargs) # noqa: E501 @validate_arguments - def get_transactions_with_http_info(self, accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, x_child_company_id : Annotated[Optional[StrictStr], Field(description="In the case of a holding company, the company id of the child company to which will process the request.")] = None, limit : Annotated[Optional[conint(strict=True, le=250, ge=1)], Field(description="The numbers of items to return, the maximum value is 250")] = None, search : Annotated[Optional[StrictStr], Field(description="General order search, e.g. by mail, reference etc.")] = None, next : Annotated[Optional[StrictStr], Field(description="next page")] = None, previous : Annotated[Optional[StrictStr], Field(description="previous page")] = None, **kwargs): # noqa: E501 + def get_transactions_with_http_info(self, accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, x_child_company_id : Annotated[Optional[StrictStr], Field(description="In the case of a holding company, the company id of the child company to which will process the request.")] = None, limit : Annotated[Optional[conint(strict=True, le=250, ge=1)], Field(description="The numbers of items to return, the maximum value is 250")] = None, search : Annotated[Optional[StrictStr], Field(description="General order search, e.g. by mail, reference etc.")] = None, next : Annotated[Optional[StrictStr], Field(description="next page")] = None, previous : Annotated[Optional[StrictStr], Field(description="previous page")] = None, **kwargs) -> ApiResponse: # noqa: E501 """Get List transactions # noqa: E501 Get transaction details in the form of a list # noqa: E501 @@ -270,13 +269,14 @@ def get_transactions_with_http_info(self, accept_language : Annotated[Optional[S :type previous: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -333,10 +333,13 @@ def get_transactions_with_http_info(self, accept_language : Annotated[Optional[S _query_params = [] if _params.get('limit') is not None: # noqa: E501 _query_params.append(('limit', _params['limit'])) + if _params.get('search') is not None: # noqa: E501 _query_params.append(('search', _params['search'])) + if _params.get('next') is not None: # noqa: E501 _query_params.append(('next', _params['next'])) + if _params.get('previous') is not None: # noqa: E501 _query_params.append(('previous', _params['previous'])) @@ -344,16 +347,15 @@ def get_transactions_with_http_info(self, accept_language : Annotated[Optional[S _header_params = dict(_params.get('_headers', {})) if _params['accept_language']: _header_params['Accept-Language'] = _params['accept_language'] + if _params['x_child_company_id']: _header_params['X-Child-Company-Id'] = _params['x_child_company_id'] # process the form parameters _form_params = [] _files = {} - # process the body parameter _body_params = None - # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( ['application/vnd.conekta-v2.1.0+json']) # noqa: E501 diff --git a/conekta/api/transfers_api.py b/conekta/api/transfers_api.py index 4ff7a54..89e7790 100644 --- a/conekta/api/transfers_api.py +++ b/conekta/api/transfers_api.py @@ -7,13 +7,15 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" -from __future__ import absolute_import import re # noqa: F401 +import io +import warnings from pydantic import validate_arguments, ValidationError from typing_extensions import Annotated @@ -26,6 +28,7 @@ from conekta.models.transfer_response import TransferResponse from conekta.api_client import ApiClient +from conekta.api_response import ApiResponse from conekta.exceptions import ( # noqa: F401 ApiTypeError, ApiValueError @@ -63,10 +66,6 @@ def get_transfer(self, id : Annotated[StrictStr, Field(..., description="Identif :type x_child_company_id: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -77,10 +76,12 @@ def get_transfer(self, id : Annotated[StrictStr, Field(..., description="Identif :rtype: TransferResponse """ kwargs['_return_http_data_only'] = True + if '_preload_content' in kwargs: + raise ValueError("Error! Please call the get_transfer_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.get_transfer_with_http_info(id, accept_language, x_child_company_id, **kwargs) # noqa: E501 @validate_arguments - def get_transfer_with_http_info(self, id : Annotated[StrictStr, Field(..., description="Identifier of the resource")], accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, x_child_company_id : Annotated[Optional[StrictStr], Field(description="In the case of a holding company, the company id of the child company to which will process the request.")] = None, **kwargs): # noqa: E501 + def get_transfer_with_http_info(self, id : Annotated[StrictStr, Field(..., description="Identifier of the resource")], accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, x_child_company_id : Annotated[Optional[StrictStr], Field(description="In the case of a holding company, the company id of the child company to which will process the request.")] = None, **kwargs) -> ApiResponse: # noqa: E501 """Get Transfer # noqa: E501 Get the details of a Transfer # noqa: E501 @@ -98,13 +99,14 @@ def get_transfer_with_http_info(self, id : Annotated[StrictStr, Field(..., descr :type x_child_company_id: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -156,23 +158,22 @@ def get_transfer_with_http_info(self, id : Annotated[StrictStr, Field(..., descr if _params['id']: _path_params['id'] = _params['id'] + # process the query parameters _query_params = [] - # process the header parameters _header_params = dict(_params.get('_headers', {})) if _params['accept_language']: _header_params['Accept-Language'] = _params['accept_language'] + if _params['x_child_company_id']: _header_params['X-Child-Company-Id'] = _params['x_child_company_id'] # process the form parameters _form_params = [] _files = {} - # process the body parameter _body_params = None - # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( ['application/vnd.conekta-v2.1.0+json']) # noqa: E501 @@ -229,10 +230,6 @@ def get_transfers(self, accept_language : Annotated[Optional[StrictStr], Field(d :type previous: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -243,10 +240,12 @@ def get_transfers(self, accept_language : Annotated[Optional[StrictStr], Field(d :rtype: GetTransfersResponse """ kwargs['_return_http_data_only'] = True + if '_preload_content' in kwargs: + raise ValueError("Error! Please call the get_transfers_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.get_transfers_with_http_info(accept_language, x_child_company_id, limit, search, next, previous, **kwargs) # noqa: E501 @validate_arguments - def get_transfers_with_http_info(self, accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, x_child_company_id : Annotated[Optional[StrictStr], Field(description="In the case of a holding company, the company id of the child company to which will process the request.")] = None, limit : Annotated[Optional[conint(strict=True, le=250, ge=1)], Field(description="The numbers of items to return, the maximum value is 250")] = None, search : Annotated[Optional[StrictStr], Field(description="General order search, e.g. by mail, reference etc.")] = None, next : Annotated[Optional[StrictStr], Field(description="next page")] = None, previous : Annotated[Optional[StrictStr], Field(description="previous page")] = None, **kwargs): # noqa: E501 + def get_transfers_with_http_info(self, accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, x_child_company_id : Annotated[Optional[StrictStr], Field(description="In the case of a holding company, the company id of the child company to which will process the request.")] = None, limit : Annotated[Optional[conint(strict=True, le=250, ge=1)], Field(description="The numbers of items to return, the maximum value is 250")] = None, search : Annotated[Optional[StrictStr], Field(description="General order search, e.g. by mail, reference etc.")] = None, next : Annotated[Optional[StrictStr], Field(description="next page")] = None, previous : Annotated[Optional[StrictStr], Field(description="previous page")] = None, **kwargs) -> ApiResponse: # noqa: E501 """Get a list of transfers # noqa: E501 Get transfers details in the form of a list # noqa: E501 @@ -270,13 +269,14 @@ def get_transfers_with_http_info(self, accept_language : Annotated[Optional[Stri :type previous: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -333,10 +333,13 @@ def get_transfers_with_http_info(self, accept_language : Annotated[Optional[Stri _query_params = [] if _params.get('limit') is not None: # noqa: E501 _query_params.append(('limit', _params['limit'])) + if _params.get('search') is not None: # noqa: E501 _query_params.append(('search', _params['search'])) + if _params.get('next') is not None: # noqa: E501 _query_params.append(('next', _params['next'])) + if _params.get('previous') is not None: # noqa: E501 _query_params.append(('previous', _params['previous'])) @@ -344,16 +347,15 @@ def get_transfers_with_http_info(self, accept_language : Annotated[Optional[Stri _header_params = dict(_params.get('_headers', {})) if _params['accept_language']: _header_params['Accept-Language'] = _params['accept_language'] + if _params['x_child_company_id']: _header_params['X-Child-Company-Id'] = _params['x_child_company_id'] # process the form parameters _form_params = [] _files = {} - # process the body parameter _body_params = None - # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( ['application/vnd.conekta-v2.1.0+json']) # noqa: E501 diff --git a/conekta/api/webhook_keys_api.py b/conekta/api/webhook_keys_api.py index 4f1d9b9..1907617 100644 --- a/conekta/api/webhook_keys_api.py +++ b/conekta/api/webhook_keys_api.py @@ -7,13 +7,15 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" -from __future__ import absolute_import import re # noqa: F401 +import io +import warnings from pydantic import validate_arguments, ValidationError from typing_extensions import Annotated @@ -30,6 +32,7 @@ from conekta.models.webhook_key_update_request import WebhookKeyUpdateRequest from conekta.api_client import ApiClient +from conekta.api_response import ApiResponse from conekta.exceptions import ( # noqa: F401 ApiTypeError, ApiValueError @@ -65,10 +68,6 @@ def create_webhook_key(self, accept_language : Annotated[Optional[StrictStr], Fi :type webhook_key_request: WebhookKeyRequest :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -79,10 +78,12 @@ def create_webhook_key(self, accept_language : Annotated[Optional[StrictStr], Fi :rtype: WebhookKeyCreateResponse """ kwargs['_return_http_data_only'] = True + if '_preload_content' in kwargs: + raise ValueError("Error! Please call the create_webhook_key_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.create_webhook_key_with_http_info(accept_language, webhook_key_request, **kwargs) # noqa: E501 @validate_arguments - def create_webhook_key_with_http_info(self, accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, webhook_key_request : Optional[WebhookKeyRequest] = None, **kwargs): # noqa: E501 + def create_webhook_key_with_http_info(self, accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, webhook_key_request : Optional[WebhookKeyRequest] = None, **kwargs) -> ApiResponse: # noqa: E501 """Create Webhook Key # noqa: E501 Create a webhook key # noqa: E501 @@ -98,13 +99,14 @@ def create_webhook_key_with_http_info(self, accept_language : Annotated[Optional :type webhook_key_request: WebhookKeyRequest :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -155,7 +157,6 @@ def create_webhook_key_with_http_info(self, accept_language : Annotated[Optional # process the query parameters _query_params = [] - # process the header parameters _header_params = dict(_params.get('_headers', {})) if _params['accept_language']: @@ -164,10 +165,9 @@ def create_webhook_key_with_http_info(self, accept_language : Annotated[Optional # process the form parameters _form_params = [] _files = {} - # process the body parameter _body_params = None - if _params['webhook_key_request']: + if _params['webhook_key_request'] is not None: _body_params = _params['webhook_key_request'] # set the HTTP header `Accept` @@ -223,10 +223,6 @@ def delete_webhook_key(self, id : Annotated[StrictStr, Field(..., description="I :type accept_language: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -237,10 +233,12 @@ def delete_webhook_key(self, id : Annotated[StrictStr, Field(..., description="I :rtype: WebhookKeyDeleteResponse """ kwargs['_return_http_data_only'] = True + if '_preload_content' in kwargs: + raise ValueError("Error! Please call the delete_webhook_key_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.delete_webhook_key_with_http_info(id, accept_language, **kwargs) # noqa: E501 @validate_arguments - def delete_webhook_key_with_http_info(self, id : Annotated[StrictStr, Field(..., description="Identifier of the resource")], accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, **kwargs): # noqa: E501 + def delete_webhook_key_with_http_info(self, id : Annotated[StrictStr, Field(..., description="Identifier of the resource")], accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, **kwargs) -> ApiResponse: # noqa: E501 """Delete Webhook key # noqa: E501 This method makes a synchronous HTTP request by default. To make an @@ -255,13 +253,14 @@ def delete_webhook_key_with_http_info(self, id : Annotated[StrictStr, Field(..., :type accept_language: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -312,9 +311,9 @@ def delete_webhook_key_with_http_info(self, id : Annotated[StrictStr, Field(..., if _params['id']: _path_params['id'] = _params['id'] + # process the query parameters _query_params = [] - # process the header parameters _header_params = dict(_params.get('_headers', {})) if _params['accept_language']: @@ -323,10 +322,8 @@ def delete_webhook_key_with_http_info(self, id : Annotated[StrictStr, Field(..., # process the form parameters _form_params = [] _files = {} - # process the body parameter _body_params = None - # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( ['application/vnd.conekta-v2.1.0+json']) # noqa: E501 @@ -376,10 +373,6 @@ def get_webhook_key(self, id : Annotated[StrictStr, Field(..., description="Iden :type x_child_company_id: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -390,10 +383,12 @@ def get_webhook_key(self, id : Annotated[StrictStr, Field(..., description="Iden :rtype: WebhookKeyResponse """ kwargs['_return_http_data_only'] = True + if '_preload_content' in kwargs: + raise ValueError("Error! Please call the get_webhook_key_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.get_webhook_key_with_http_info(id, accept_language, x_child_company_id, **kwargs) # noqa: E501 @validate_arguments - def get_webhook_key_with_http_info(self, id : Annotated[StrictStr, Field(..., description="Identifier of the resource")], accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, x_child_company_id : Annotated[Optional[StrictStr], Field(description="In the case of a holding company, the company id of the child company to which will process the request.")] = None, **kwargs): # noqa: E501 + def get_webhook_key_with_http_info(self, id : Annotated[StrictStr, Field(..., description="Identifier of the resource")], accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, x_child_company_id : Annotated[Optional[StrictStr], Field(description="In the case of a holding company, the company id of the child company to which will process the request.")] = None, **kwargs) -> ApiResponse: # noqa: E501 """Get Webhook Key # noqa: E501 This method makes a synchronous HTTP request by default. To make an @@ -410,13 +405,14 @@ def get_webhook_key_with_http_info(self, id : Annotated[StrictStr, Field(..., de :type x_child_company_id: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -468,23 +464,22 @@ def get_webhook_key_with_http_info(self, id : Annotated[StrictStr, Field(..., de if _params['id']: _path_params['id'] = _params['id'] + # process the query parameters _query_params = [] - # process the header parameters _header_params = dict(_params.get('_headers', {})) if _params['accept_language']: _header_params['Accept-Language'] = _params['accept_language'] + if _params['x_child_company_id']: _header_params['X-Child-Company-Id'] = _params['x_child_company_id'] # process the form parameters _form_params = [] _files = {} - # process the body parameter _body_params = None - # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( ['application/vnd.conekta-v2.1.0+json']) # noqa: E501 @@ -541,10 +536,6 @@ def get_webhook_keys(self, accept_language : Annotated[Optional[StrictStr], Fiel :type previous: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -555,10 +546,12 @@ def get_webhook_keys(self, accept_language : Annotated[Optional[StrictStr], Fiel :rtype: GetWebhookKeysResponse """ kwargs['_return_http_data_only'] = True + if '_preload_content' in kwargs: + raise ValueError("Error! Please call the get_webhook_keys_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.get_webhook_keys_with_http_info(accept_language, x_child_company_id, limit, search, next, previous, **kwargs) # noqa: E501 @validate_arguments - def get_webhook_keys_with_http_info(self, accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, x_child_company_id : Annotated[Optional[StrictStr], Field(description="In the case of a holding company, the company id of the child company to which will process the request.")] = None, limit : Annotated[Optional[conint(strict=True, le=250, ge=1)], Field(description="The numbers of items to return, the maximum value is 250")] = None, search : Annotated[Optional[StrictStr], Field(description="General order search, e.g. by mail, reference etc.")] = None, next : Annotated[Optional[StrictStr], Field(description="next page")] = None, previous : Annotated[Optional[StrictStr], Field(description="previous page")] = None, **kwargs): # noqa: E501 + def get_webhook_keys_with_http_info(self, accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, x_child_company_id : Annotated[Optional[StrictStr], Field(description="In the case of a holding company, the company id of the child company to which will process the request.")] = None, limit : Annotated[Optional[conint(strict=True, le=250, ge=1)], Field(description="The numbers of items to return, the maximum value is 250")] = None, search : Annotated[Optional[StrictStr], Field(description="General order search, e.g. by mail, reference etc.")] = None, next : Annotated[Optional[StrictStr], Field(description="next page")] = None, previous : Annotated[Optional[StrictStr], Field(description="previous page")] = None, **kwargs) -> ApiResponse: # noqa: E501 """Get List of Webhook Keys # noqa: E501 Consume the list of webhook keys you have # noqa: E501 @@ -582,13 +575,14 @@ def get_webhook_keys_with_http_info(self, accept_language : Annotated[Optional[S :type previous: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -645,10 +639,13 @@ def get_webhook_keys_with_http_info(self, accept_language : Annotated[Optional[S _query_params = [] if _params.get('limit') is not None: # noqa: E501 _query_params.append(('limit', _params['limit'])) + if _params.get('search') is not None: # noqa: E501 _query_params.append(('search', _params['search'])) + if _params.get('next') is not None: # noqa: E501 _query_params.append(('next', _params['next'])) + if _params.get('previous') is not None: # noqa: E501 _query_params.append(('previous', _params['previous'])) @@ -656,16 +653,15 @@ def get_webhook_keys_with_http_info(self, accept_language : Annotated[Optional[S _header_params = dict(_params.get('_headers', {})) if _params['accept_language']: _header_params['Accept-Language'] = _params['accept_language'] + if _params['x_child_company_id']: _header_params['X-Child-Company-Id'] = _params['x_child_company_id'] # process the form parameters _form_params = [] _files = {} - # process the body parameter _body_params = None - # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( ['application/vnd.conekta-v2.1.0+json']) # noqa: E501 @@ -715,10 +711,6 @@ def update_webhook_key(self, id : Annotated[StrictStr, Field(..., description="I :type webhook_key_update_request: WebhookKeyUpdateRequest :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -729,10 +721,12 @@ def update_webhook_key(self, id : Annotated[StrictStr, Field(..., description="I :rtype: WebhookKeyResponse """ kwargs['_return_http_data_only'] = True + if '_preload_content' in kwargs: + raise ValueError("Error! Please call the update_webhook_key_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.update_webhook_key_with_http_info(id, accept_language, webhook_key_update_request, **kwargs) # noqa: E501 @validate_arguments - def update_webhook_key_with_http_info(self, id : Annotated[StrictStr, Field(..., description="Identifier of the resource")], accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, webhook_key_update_request : Optional[WebhookKeyUpdateRequest] = None, **kwargs): # noqa: E501 + def update_webhook_key_with_http_info(self, id : Annotated[StrictStr, Field(..., description="Identifier of the resource")], accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, webhook_key_update_request : Optional[WebhookKeyUpdateRequest] = None, **kwargs) -> ApiResponse: # noqa: E501 """Update Webhook Key # noqa: E501 updates an existing webhook key # noqa: E501 @@ -750,13 +744,14 @@ def update_webhook_key_with_http_info(self, id : Annotated[StrictStr, Field(..., :type webhook_key_update_request: WebhookKeyUpdateRequest :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -808,9 +803,9 @@ def update_webhook_key_with_http_info(self, id : Annotated[StrictStr, Field(..., if _params['id']: _path_params['id'] = _params['id'] + # process the query parameters _query_params = [] - # process the header parameters _header_params = dict(_params.get('_headers', {})) if _params['accept_language']: @@ -819,10 +814,9 @@ def update_webhook_key_with_http_info(self, id : Annotated[StrictStr, Field(..., # process the form parameters _form_params = [] _files = {} - # process the body parameter _body_params = None - if _params['webhook_key_update_request']: + if _params['webhook_key_update_request'] is not None: _body_params = _params['webhook_key_update_request'] # set the HTTP header `Accept` diff --git a/conekta/api/webhooks_api.py b/conekta/api/webhooks_api.py index 5faddcc..bc134b9 100644 --- a/conekta/api/webhooks_api.py +++ b/conekta/api/webhooks_api.py @@ -7,13 +7,15 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" -from __future__ import absolute_import import re # noqa: F401 +import io +import warnings from pydantic import validate_arguments, ValidationError from typing_extensions import Annotated @@ -28,6 +30,7 @@ from conekta.models.webhook_update_request import WebhookUpdateRequest from conekta.api_client import ApiClient +from conekta.api_response import ApiResponse from conekta.exceptions import ( # noqa: F401 ApiTypeError, ApiValueError @@ -63,10 +66,6 @@ def create_webhook(self, webhook_request : Annotated[WebhookRequest, Field(..., :type accept_language: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -77,10 +76,12 @@ def create_webhook(self, webhook_request : Annotated[WebhookRequest, Field(..., :rtype: WebhookResponse """ kwargs['_return_http_data_only'] = True + if '_preload_content' in kwargs: + raise ValueError("Error! Please call the create_webhook_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.create_webhook_with_http_info(webhook_request, accept_language, **kwargs) # noqa: E501 @validate_arguments - def create_webhook_with_http_info(self, webhook_request : Annotated[WebhookRequest, Field(..., description="requested field for webhook")], accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, **kwargs): # noqa: E501 + def create_webhook_with_http_info(self, webhook_request : Annotated[WebhookRequest, Field(..., description="requested field for webhook")], accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, **kwargs) -> ApiResponse: # noqa: E501 """Create Webhook # noqa: E501 What we do at Conekta translates into events. For example, an event of interest to us occurs at the time a payment is successfully processed. At that moment we will be interested in doing several things: Send an email to the buyer, generate an invoice, start the process of shipping the product, etc. # noqa: E501 @@ -96,13 +97,14 @@ def create_webhook_with_http_info(self, webhook_request : Annotated[WebhookReque :type accept_language: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -153,7 +155,6 @@ def create_webhook_with_http_info(self, webhook_request : Annotated[WebhookReque # process the query parameters _query_params = [] - # process the header parameters _header_params = dict(_params.get('_headers', {})) if _params['accept_language']: @@ -162,10 +163,9 @@ def create_webhook_with_http_info(self, webhook_request : Annotated[WebhookReque # process the form parameters _form_params = [] _files = {} - # process the body parameter _body_params = None - if _params['webhook_request']: + if _params['webhook_request'] is not None: _body_params = _params['webhook_request'] # set the HTTP header `Accept` @@ -221,10 +221,6 @@ def delete_webhook(self, id : Annotated[StrictStr, Field(..., description="Ident :type accept_language: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -235,10 +231,12 @@ def delete_webhook(self, id : Annotated[StrictStr, Field(..., description="Ident :rtype: WebhookResponse """ kwargs['_return_http_data_only'] = True + if '_preload_content' in kwargs: + raise ValueError("Error! Please call the delete_webhook_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.delete_webhook_with_http_info(id, accept_language, **kwargs) # noqa: E501 @validate_arguments - def delete_webhook_with_http_info(self, id : Annotated[StrictStr, Field(..., description="Identifier of the resource")], accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, **kwargs): # noqa: E501 + def delete_webhook_with_http_info(self, id : Annotated[StrictStr, Field(..., description="Identifier of the resource")], accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, **kwargs) -> ApiResponse: # noqa: E501 """Delete Webhook # noqa: E501 This method makes a synchronous HTTP request by default. To make an @@ -253,13 +251,14 @@ def delete_webhook_with_http_info(self, id : Annotated[StrictStr, Field(..., des :type accept_language: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -310,9 +309,9 @@ def delete_webhook_with_http_info(self, id : Annotated[StrictStr, Field(..., des if _params['id']: _path_params['id'] = _params['id'] + # process the query parameters _query_params = [] - # process the header parameters _header_params = dict(_params.get('_headers', {})) if _params['accept_language']: @@ -321,10 +320,8 @@ def delete_webhook_with_http_info(self, id : Annotated[StrictStr, Field(..., des # process the form parameters _form_params = [] _files = {} - # process the body parameter _body_params = None - # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( ['application/vnd.conekta-v2.1.0+json']) # noqa: E501 @@ -374,10 +371,6 @@ def get_webhook(self, id : Annotated[StrictStr, Field(..., description="Identifi :type x_child_company_id: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -388,10 +381,12 @@ def get_webhook(self, id : Annotated[StrictStr, Field(..., description="Identifi :rtype: WebhookResponse """ kwargs['_return_http_data_only'] = True + if '_preload_content' in kwargs: + raise ValueError("Error! Please call the get_webhook_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.get_webhook_with_http_info(id, accept_language, x_child_company_id, **kwargs) # noqa: E501 @validate_arguments - def get_webhook_with_http_info(self, id : Annotated[StrictStr, Field(..., description="Identifier of the resource")], accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, x_child_company_id : Annotated[Optional[StrictStr], Field(description="In the case of a holding company, the company id of the child company to which will process the request.")] = None, **kwargs): # noqa: E501 + def get_webhook_with_http_info(self, id : Annotated[StrictStr, Field(..., description="Identifier of the resource")], accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, x_child_company_id : Annotated[Optional[StrictStr], Field(description="In the case of a holding company, the company id of the child company to which will process the request.")] = None, **kwargs) -> ApiResponse: # noqa: E501 """Get Webhook # noqa: E501 This method makes a synchronous HTTP request by default. To make an @@ -408,13 +403,14 @@ def get_webhook_with_http_info(self, id : Annotated[StrictStr, Field(..., descri :type x_child_company_id: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -466,23 +462,22 @@ def get_webhook_with_http_info(self, id : Annotated[StrictStr, Field(..., descri if _params['id']: _path_params['id'] = _params['id'] + # process the query parameters _query_params = [] - # process the header parameters _header_params = dict(_params.get('_headers', {})) if _params['accept_language']: _header_params['Accept-Language'] = _params['accept_language'] + if _params['x_child_company_id']: _header_params['X-Child-Company-Id'] = _params['x_child_company_id'] # process the form parameters _form_params = [] _files = {} - # process the body parameter _body_params = None - # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( ['application/vnd.conekta-v2.1.0+json']) # noqa: E501 @@ -539,10 +534,6 @@ def get_webhooks(self, accept_language : Annotated[Optional[StrictStr], Field(de :type previous: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -553,10 +544,12 @@ def get_webhooks(self, accept_language : Annotated[Optional[StrictStr], Field(de :rtype: GetWebhooksResponse """ kwargs['_return_http_data_only'] = True + if '_preload_content' in kwargs: + raise ValueError("Error! Please call the get_webhooks_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.get_webhooks_with_http_info(accept_language, x_child_company_id, limit, search, next, previous, **kwargs) # noqa: E501 @validate_arguments - def get_webhooks_with_http_info(self, accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, x_child_company_id : Annotated[Optional[StrictStr], Field(description="In the case of a holding company, the company id of the child company to which will process the request.")] = None, limit : Annotated[Optional[conint(strict=True, le=250, ge=1)], Field(description="The numbers of items to return, the maximum value is 250")] = None, search : Annotated[Optional[StrictStr], Field(description="General order search, e.g. by mail, reference etc.")] = None, next : Annotated[Optional[StrictStr], Field(description="next page")] = None, previous : Annotated[Optional[StrictStr], Field(description="previous page")] = None, **kwargs): # noqa: E501 + def get_webhooks_with_http_info(self, accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, x_child_company_id : Annotated[Optional[StrictStr], Field(description="In the case of a holding company, the company id of the child company to which will process the request.")] = None, limit : Annotated[Optional[conint(strict=True, le=250, ge=1)], Field(description="The numbers of items to return, the maximum value is 250")] = None, search : Annotated[Optional[StrictStr], Field(description="General order search, e.g. by mail, reference etc.")] = None, next : Annotated[Optional[StrictStr], Field(description="next page")] = None, previous : Annotated[Optional[StrictStr], Field(description="previous page")] = None, **kwargs) -> ApiResponse: # noqa: E501 """Get List of Webhooks # noqa: E501 Consume the list of webhooks you have, each environment supports 10 webhooks (For production and testing) # noqa: E501 @@ -580,13 +573,14 @@ def get_webhooks_with_http_info(self, accept_language : Annotated[Optional[Stric :type previous: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -643,10 +637,13 @@ def get_webhooks_with_http_info(self, accept_language : Annotated[Optional[Stric _query_params = [] if _params.get('limit') is not None: # noqa: E501 _query_params.append(('limit', _params['limit'])) + if _params.get('search') is not None: # noqa: E501 _query_params.append(('search', _params['search'])) + if _params.get('next') is not None: # noqa: E501 _query_params.append(('next', _params['next'])) + if _params.get('previous') is not None: # noqa: E501 _query_params.append(('previous', _params['previous'])) @@ -654,16 +651,15 @@ def get_webhooks_with_http_info(self, accept_language : Annotated[Optional[Stric _header_params = dict(_params.get('_headers', {})) if _params['accept_language']: _header_params['Accept-Language'] = _params['accept_language'] + if _params['x_child_company_id']: _header_params['X-Child-Company-Id'] = _params['x_child_company_id'] # process the form parameters _form_params = [] _files = {} - # process the body parameter _body_params = None - # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( ['application/vnd.conekta-v2.1.0+json']) # noqa: E501 @@ -711,10 +707,6 @@ def test_webhook(self, id : Annotated[StrictStr, Field(..., description="Identif :type accept_language: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -725,10 +717,12 @@ def test_webhook(self, id : Annotated[StrictStr, Field(..., description="Identif :rtype: WebhookResponse """ kwargs['_return_http_data_only'] = True + if '_preload_content' in kwargs: + raise ValueError("Error! Please call the test_webhook_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.test_webhook_with_http_info(id, accept_language, **kwargs) # noqa: E501 @validate_arguments - def test_webhook_with_http_info(self, id : Annotated[StrictStr, Field(..., description="Identifier of the resource")], accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, **kwargs): # noqa: E501 + def test_webhook_with_http_info(self, id : Annotated[StrictStr, Field(..., description="Identifier of the resource")], accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, **kwargs) -> ApiResponse: # noqa: E501 """Test Webhook # noqa: E501 Send a webhook.ping event # noqa: E501 @@ -744,13 +738,14 @@ def test_webhook_with_http_info(self, id : Annotated[StrictStr, Field(..., descr :type accept_language: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -801,9 +796,9 @@ def test_webhook_with_http_info(self, id : Annotated[StrictStr, Field(..., descr if _params['id']: _path_params['id'] = _params['id'] + # process the query parameters _query_params = [] - # process the header parameters _header_params = dict(_params.get('_headers', {})) if _params['accept_language']: @@ -812,10 +807,8 @@ def test_webhook_with_http_info(self, id : Annotated[StrictStr, Field(..., descr # process the form parameters _form_params = [] _files = {} - # process the body parameter _body_params = None - # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( ['application/vnd.conekta-v2.1.0+json']) # noqa: E501 @@ -868,10 +861,6 @@ def update_webhook(self, id : Annotated[StrictStr, Field(..., description="Ident :type x_child_company_id: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -882,10 +871,12 @@ def update_webhook(self, id : Annotated[StrictStr, Field(..., description="Ident :rtype: WebhookResponse """ kwargs['_return_http_data_only'] = True + if '_preload_content' in kwargs: + raise ValueError("Error! Please call the update_webhook_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.update_webhook_with_http_info(id, webhook_update_request, accept_language, x_child_company_id, **kwargs) # noqa: E501 @validate_arguments - def update_webhook_with_http_info(self, id : Annotated[StrictStr, Field(..., description="Identifier of the resource")], webhook_update_request : Annotated[WebhookUpdateRequest, Field(..., description="requested fields in order to update a webhook")], accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, x_child_company_id : Annotated[Optional[StrictStr], Field(description="In the case of a holding company, the company id of the child company to which will process the request.")] = None, **kwargs): # noqa: E501 + def update_webhook_with_http_info(self, id : Annotated[StrictStr, Field(..., description="Identifier of the resource")], webhook_update_request : Annotated[WebhookUpdateRequest, Field(..., description="requested fields in order to update a webhook")], accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, x_child_company_id : Annotated[Optional[StrictStr], Field(description="In the case of a holding company, the company id of the child company to which will process the request.")] = None, **kwargs) -> ApiResponse: # noqa: E501 """Update Webhook # noqa: E501 updates an existing webhook # noqa: E501 @@ -905,13 +896,14 @@ def update_webhook_with_http_info(self, id : Annotated[StrictStr, Field(..., des :type x_child_company_id: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -964,23 +956,23 @@ def update_webhook_with_http_info(self, id : Annotated[StrictStr, Field(..., des if _params['id']: _path_params['id'] = _params['id'] + # process the query parameters _query_params = [] - # process the header parameters _header_params = dict(_params.get('_headers', {})) if _params['accept_language']: _header_params['Accept-Language'] = _params['accept_language'] + if _params['x_child_company_id']: _header_params['X-Child-Company-Id'] = _params['x_child_company_id'] # process the form parameters _form_params = [] _files = {} - # process the body parameter _body_params = None - if _params['webhook_update_request']: + if _params['webhook_update_request'] is not None: _body_params = _params['webhook_update_request'] # set the HTTP header `Accept` diff --git a/conekta/api_client.py b/conekta/api_client.py index 8380a0c..6da6a07 100644 --- a/conekta/api_client.py +++ b/conekta/api_client.py @@ -1,4 +1,5 @@ # coding: utf-8 + """ Conekta API @@ -6,10 +7,11 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ -from __future__ import absolute_import import atexit import datetime @@ -25,6 +27,7 @@ from urllib.parse import quote from conekta.configuration import Configuration +from conekta.api_response import ApiResponse import conekta.models from conekta import rest from conekta.exceptions import ApiValueError, ApiException @@ -38,10 +41,6 @@ class ApiClient(object): the methods and models for each application are generated from the OpenAPI templates. - NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - Do not edit the class manually. - :param configuration: .Configuration object for this client :param header_name: a header to pass when making calls to the API. :param header_value: a header value to pass when making calls to @@ -74,7 +73,7 @@ class ApiClient(object): def __init__(self, configuration=None, header_name=None, header_value=None, cookie=None, pool_threads=1): - # use default configuraiton if none is provided + # use default configuration if none is provided if configuration is None: configuration = Configuration.get_default() self.configuration = configuration @@ -242,33 +241,36 @@ def __call_api( self.last_response = response_data - return_data = response_data - - if not _preload_content: - return return_data - - response_type = response_types_map.get(str(response_data.status), None) - - if response_type not in ["file", "bytes"]: - match = None - content_type = response_data.getheader('content-type') - if content_type is not None: - match = re.search(r"charset=([a-zA-Z\-\d]+)[\s;]?", content_type) - encoding = match.group(1) if match else "utf-8" - response_data.data = response_data.data.decode(encoding) - - # deserialize response data - - if response_type: - return_data = self.deserialize(response_data, response_type) - else: - return_data = None + return_data = None # assuming derialization is not needed + # data needs deserialization or returns HTTP data (deserialized) only + if _preload_content or _return_http_data_only: + response_type = response_types_map.get(str(response_data.status), None) + + if response_type == "bytearray": + response_data.data = response_data.data + else: + match = None + content_type = response_data.getheader('content-type') + if content_type is not None: + match = re.search(r"charset=([a-zA-Z\-\d]+)[\s;]?", content_type) + encoding = match.group(1) if match else "utf-8" + response_data.data = response_data.data.decode(encoding) + + # deserialize response data + if response_type == "bytearray": + return_data = response_data.data + elif response_type: + return_data = self.deserialize(response_data, response_type) + else: + return_data = None if _return_http_data_only: - return (return_data) + return return_data else: - return (return_data, response_data.status, - response_data.getheaders()) + return ApiResponse(status_code = response_data.status, + data = return_data, + headers = response_data.getheaders(), + raw_data = response_data.data) def sanitize_for_serialization(self, obj): """Builds a JSON POST object. @@ -376,8 +378,8 @@ def call_api(self, resource_path, method, body=None, post_params=None, files=None, response_types_map=None, auth_settings=None, async_req=None, _return_http_data_only=None, - collection_formats=None,_preload_content=True, - _request_timeout=None, _host=None, _request_auth=None): + collection_formats=None, _preload_content=True, + _request_timeout=None, _host=None, _request_auth=None): """Makes the HTTP request (synchronous) and returns deserialized data. To make an async_req request, set the async_req parameter. @@ -396,13 +398,14 @@ def call_api(self, resource_path, method, :param files dict: key -> filename, value -> filepath, for `multipart/form-data`. :param async_req bool: execute request asynchronously - :param _return_http_data_only: response data without head status code - and headers + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. :param collection_formats: dict of collection formats for path, query, header, and post parameters. - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -544,6 +547,8 @@ def parameters_to_url_query(self, params, collection_formats): v = str(v) if isinstance(v, bool): v = str(v).lower() + if isinstance(v, dict): + v = json.dumps(v) if k in collection_formats: collection_format = collection_formats[k] @@ -561,7 +566,7 @@ def parameters_to_url_query(self, params, collection_formats): new_params.append( (k, delimiter.join(quote(str(value)) for value in v))) else: - new_params.append((k, v)) + new_params.append((k, quote(str(v)))) return "&".join(["=".join(item) for item in new_params]) diff --git a/conekta/api_response.py b/conekta/api_response.py new file mode 100644 index 0000000..d81c2ff --- /dev/null +++ b/conekta/api_response.py @@ -0,0 +1,25 @@ +"""API response object.""" + +from __future__ import annotations +from typing import Any, Dict, Optional +from pydantic import Field, StrictInt, StrictStr + +class ApiResponse: + """ + API response object + """ + + status_code: Optional[StrictInt] = Field(None, description="HTTP status code") + headers: Optional[Dict[StrictStr, StrictStr]] = Field(None, description="HTTP headers") + data: Optional[Any] = Field(None, description="Deserialized data given the data type") + raw_data: Optional[Any] = Field(None, description="Raw data (HTTP response body)") + + def __init__(self, + status_code=None, + headers=None, + data=None, + raw_data=None): + self.status_code = status_code + self.headers = headers + self.data = data + self.raw_data = raw_data diff --git a/conekta/configuration.py b/conekta/configuration.py index 35dfb10..762e412 100644 --- a/conekta/configuration.py +++ b/conekta/configuration.py @@ -7,7 +7,9 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ @@ -148,6 +150,10 @@ def __init__(self, host=None, self.assert_hostname = None """Set this to True/False to enable/disable SSL hostname verification. """ + self.tls_server_name = None + """SSL/TLS Server Name Indication (SNI) + Set this to the SNI value expected by the server. + """ self.connection_pool_maxsize = multiprocessing.cpu_count() * 5 """urllib3 connection pool's maximum number of connections saved diff --git a/conekta/exceptions.py b/conekta/exceptions.py index c0f0d25..372429d 100644 --- a/conekta/exceptions.py +++ b/conekta/exceptions.py @@ -7,7 +7,9 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ diff --git a/conekta/models/__init__.py b/conekta/models/__init__.py index 3301d76..375a80c 100644 --- a/conekta/models/__init__.py +++ b/conekta/models/__init__.py @@ -8,11 +8,11 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" -from __future__ import absolute_import # import models into model package from conekta.models.api_key_create_response import ApiKeyCreateResponse diff --git a/conekta/models/api_key_create_response.py b/conekta/models/api_key_create_response.py index a4584b5..a32d409 100644 --- a/conekta/models/api_key_create_response.py +++ b/conekta/models/api_key_create_response.py @@ -7,12 +7,13 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -22,10 +23,8 @@ from pydantic import BaseModel, Field, StrictBool, StrictInt, StrictStr class ApiKeyCreateResponse(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + ApiKeyCreateResponse """ authentication_token: Optional[StrictStr] = Field(None, description="It is occupied as a user when authenticated with basic authentication, with a blank password. This value will only appear once, in the request to create a new key") active: Optional[StrictBool] = Field(None, description="Indicates if the api key is active") @@ -39,6 +38,7 @@ class ApiKeyCreateResponse(BaseModel): __properties = ["authentication_token", "active", "created_at", "description", "id", "livemode", "object", "prefix", "role"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -69,7 +69,7 @@ def from_dict(cls, obj: dict) -> ApiKeyCreateResponse: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return ApiKeyCreateResponse.parse_obj(obj) _obj = ApiKeyCreateResponse.parse_obj({ diff --git a/conekta/models/api_key_create_response_all_of.py b/conekta/models/api_key_create_response_all_of.py index 96fd0c9..f76ca4e 100644 --- a/conekta/models/api_key_create_response_all_of.py +++ b/conekta/models/api_key_create_response_all_of.py @@ -7,12 +7,13 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -22,15 +23,14 @@ from pydantic import BaseModel, Field, StrictStr class ApiKeyCreateResponseAllOf(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + ApiKeyCreateResponseAllOf """ authentication_token: Optional[StrictStr] = Field(None, description="It is occupied as a user when authenticated with basic authentication, with a blank password. This value will only appear once, in the request to create a new key") __properties = ["authentication_token"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -61,7 +61,7 @@ def from_dict(cls, obj: dict) -> ApiKeyCreateResponseAllOf: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return ApiKeyCreateResponseAllOf.parse_obj(obj) _obj = ApiKeyCreateResponseAllOf.parse_obj({ diff --git a/conekta/models/api_key_request.py b/conekta/models/api_key_request.py index 29401ce..7513b55 100644 --- a/conekta/models/api_key_request.py +++ b/conekta/models/api_key_request.py @@ -7,12 +7,13 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -22,17 +23,16 @@ from pydantic import BaseModel, Field, StrictBool, StrictStr class ApiKeyRequest(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + ApiKeyRequest """ active: StrictBool = Field(..., description="Indicates if the api key is active") description: StrictStr = Field(..., description="Detail of the use that will be given to the api key") - role: StrictStr = ... + role: StrictStr = Field(...) __properties = ["active", "description", "role"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -63,7 +63,7 @@ def from_dict(cls, obj: dict) -> ApiKeyRequest: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return ApiKeyRequest.parse_obj(obj) _obj = ApiKeyRequest.parse_obj({ diff --git a/conekta/models/api_key_response.py b/conekta/models/api_key_response.py index 9c31222..5a3077f 100644 --- a/conekta/models/api_key_response.py +++ b/conekta/models/api_key_response.py @@ -7,12 +7,13 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -22,10 +23,8 @@ from pydantic import BaseModel, Field, StrictBool, StrictInt, StrictStr class ApiKeyResponse(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + api keys model """ active: Optional[StrictBool] = Field(None, description="Indicates if the api key is active") created_at: Optional[StrictInt] = Field(None, description="Unix timestamp in seconds with the creation date of the api key") @@ -38,6 +37,7 @@ class ApiKeyResponse(BaseModel): __properties = ["active", "created_at", "description", "id", "livemode", "object", "prefix", "role"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -68,7 +68,7 @@ def from_dict(cls, obj: dict) -> ApiKeyResponse: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return ApiKeyResponse.parse_obj(obj) _obj = ApiKeyResponse.parse_obj({ diff --git a/conekta/models/api_key_update_request.py b/conekta/models/api_key_update_request.py index 6879c40..dfa76ee 100644 --- a/conekta/models/api_key_update_request.py +++ b/conekta/models/api_key_update_request.py @@ -7,12 +7,13 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -22,16 +23,15 @@ from pydantic import BaseModel, Field, StrictBool, StrictStr class ApiKeyUpdateRequest(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + ApiKeyUpdateRequest """ active: Optional[StrictBool] = Field(None, description="Indicates if the webhook key is active") description: Optional[StrictStr] = Field(None, description="Detail of the use that will be given to the api key") __properties = ["active", "description"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -62,7 +62,7 @@ def from_dict(cls, obj: dict) -> ApiKeyUpdateRequest: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return ApiKeyUpdateRequest.parse_obj(obj) _obj = ApiKeyUpdateRequest.parse_obj({ diff --git a/conekta/models/blacklist_rule_response.py b/conekta/models/blacklist_rule_response.py index 4c878af..157eca4 100644 --- a/conekta/models/blacklist_rule_response.py +++ b/conekta/models/blacklist_rule_response.py @@ -7,12 +7,13 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -22,10 +23,8 @@ from pydantic import BaseModel, Field, StrictStr class BlacklistRuleResponse(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + BlacklistRuleResponse """ id: Optional[StrictStr] = Field(None, description="Blacklist rule id") field: Optional[StrictStr] = Field(None, description="field used for blacklists rule") @@ -34,6 +33,7 @@ class BlacklistRuleResponse(BaseModel): __properties = ["id", "field", "value", "description"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -64,7 +64,7 @@ def from_dict(cls, obj: dict) -> BlacklistRuleResponse: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return BlacklistRuleResponse.parse_obj(obj) _obj = BlacklistRuleResponse.parse_obj({ diff --git a/conekta/models/charge_data_payment_method_bank_transfer_response.py b/conekta/models/charge_data_payment_method_bank_transfer_response.py index 92485bc..370a46c 100644 --- a/conekta/models/charge_data_payment_method_bank_transfer_response.py +++ b/conekta/models/charge_data_payment_method_bank_transfer_response.py @@ -7,25 +7,24 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json from typing import Any, List, Optional -from pydantic import BaseModel, StrictInt, StrictStr +from pydantic import BaseModel, StrictInt, StrictStr, conlist class ChargeDataPaymentMethodBankTransferResponse(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + use for bank transfer responses """ bank: Optional[StrictStr] = None clabe: Optional[StrictStr] = None @@ -36,7 +35,7 @@ class ChargeDataPaymentMethodBankTransferResponse(BaseModel): issuing_account_number: Optional[StrictStr] = None issuing_account_holder_name: Optional[StrictStr] = None issuing_account_tax_id: Optional[StrictStr] = None - payment_attempts: Optional[List[Any]] = None + payment_attempts: Optional[conlist(Any)] = None receiving_account_holder_name: Optional[StrictStr] = None receiving_account_number: Optional[StrictStr] = None receiving_account_bank: Optional[StrictStr] = None @@ -46,6 +45,7 @@ class ChargeDataPaymentMethodBankTransferResponse(BaseModel): __properties = ["bank", "clabe", "description", "executed_at", "expires_at", "issuing_account_bank", "issuing_account_number", "issuing_account_holder_name", "issuing_account_tax_id", "payment_attempts", "receiving_account_holder_name", "receiving_account_number", "receiving_account_bank", "receiving_account_tax_id", "reference_number", "tracking_code"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -69,43 +69,53 @@ def to_dict(self): }, exclude_none=True) # set to None if description (nullable) is None - if self.description is None: + # and __fields_set__ contains the field + if self.description is None and "description" in self.__fields_set__: _dict['description'] = None # set to None if executed_at (nullable) is None - if self.executed_at is None: + # and __fields_set__ contains the field + if self.executed_at is None and "executed_at" in self.__fields_set__: _dict['executed_at'] = None # set to None if issuing_account_bank (nullable) is None - if self.issuing_account_bank is None: + # and __fields_set__ contains the field + if self.issuing_account_bank is None and "issuing_account_bank" in self.__fields_set__: _dict['issuing_account_bank'] = None # set to None if issuing_account_number (nullable) is None - if self.issuing_account_number is None: + # and __fields_set__ contains the field + if self.issuing_account_number is None and "issuing_account_number" in self.__fields_set__: _dict['issuing_account_number'] = None # set to None if issuing_account_holder_name (nullable) is None - if self.issuing_account_holder_name is None: + # and __fields_set__ contains the field + if self.issuing_account_holder_name is None and "issuing_account_holder_name" in self.__fields_set__: _dict['issuing_account_holder_name'] = None # set to None if issuing_account_tax_id (nullable) is None - if self.issuing_account_tax_id is None: + # and __fields_set__ contains the field + if self.issuing_account_tax_id is None and "issuing_account_tax_id" in self.__fields_set__: _dict['issuing_account_tax_id'] = None # set to None if receiving_account_holder_name (nullable) is None - if self.receiving_account_holder_name is None: + # and __fields_set__ contains the field + if self.receiving_account_holder_name is None and "receiving_account_holder_name" in self.__fields_set__: _dict['receiving_account_holder_name'] = None # set to None if receiving_account_tax_id (nullable) is None - if self.receiving_account_tax_id is None: + # and __fields_set__ contains the field + if self.receiving_account_tax_id is None and "receiving_account_tax_id" in self.__fields_set__: _dict['receiving_account_tax_id'] = None # set to None if reference_number (nullable) is None - if self.reference_number is None: + # and __fields_set__ contains the field + if self.reference_number is None and "reference_number" in self.__fields_set__: _dict['reference_number'] = None # set to None if tracking_code (nullable) is None - if self.tracking_code is None: + # and __fields_set__ contains the field + if self.tracking_code is None and "tracking_code" in self.__fields_set__: _dict['tracking_code'] = None return _dict @@ -116,7 +126,7 @@ def from_dict(cls, obj: dict) -> ChargeDataPaymentMethodBankTransferResponse: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return ChargeDataPaymentMethodBankTransferResponse.parse_obj(obj) _obj = ChargeDataPaymentMethodBankTransferResponse.parse_obj({ diff --git a/conekta/models/charge_data_payment_method_card_response.py b/conekta/models/charge_data_payment_method_card_response.py index a27d404..46201a8 100644 --- a/conekta/models/charge_data_payment_method_card_response.py +++ b/conekta/models/charge_data_payment_method_card_response.py @@ -7,25 +7,24 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json from typing import Any, List, Optional -from pydantic import BaseModel, StrictStr +from pydantic import BaseModel, StrictStr, conlist class ChargeDataPaymentMethodCardResponse(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + use for card responses """ account_type: Optional[StrictStr] = None auth_code: Optional[StrictStr] = None @@ -33,13 +32,14 @@ class ChargeDataPaymentMethodCardResponse(BaseModel): country: Optional[StrictStr] = None exp_month: Optional[StrictStr] = None exp_year: Optional[StrictStr] = None - fraud_indicators: Optional[List[Any]] = None + fraud_indicators: Optional[conlist(Any)] = None issuer: Optional[StrictStr] = None last4: Optional[StrictStr] = None name: Optional[StrictStr] = None __properties = ["account_type", "auth_code", "brand", "country", "exp_month", "exp_year", "fraud_indicators", "issuer", "last4", "name"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -70,7 +70,7 @@ def from_dict(cls, obj: dict) -> ChargeDataPaymentMethodCardResponse: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return ChargeDataPaymentMethodCardResponse.parse_obj(obj) _obj = ChargeDataPaymentMethodCardResponse.parse_obj({ diff --git a/conekta/models/charge_data_payment_method_cash_response.py b/conekta/models/charge_data_payment_method_cash_response.py index 06ac16b..b32b691 100644 --- a/conekta/models/charge_data_payment_method_cash_response.py +++ b/conekta/models/charge_data_payment_method_cash_response.py @@ -7,12 +7,13 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -22,10 +23,8 @@ from pydantic import BaseModel, StrictInt, StrictStr class ChargeDataPaymentMethodCashResponse(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + use for cash responses """ auth_code: Optional[StrictInt] = None cashier_id: Optional[StrictStr] = None @@ -38,6 +37,7 @@ class ChargeDataPaymentMethodCashResponse(BaseModel): __properties = ["auth_code", "cashier_id", "reference", "barcode_url", "expires_at", "service_name", "store", "store_name"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -61,15 +61,18 @@ def to_dict(self): }, exclude_none=True) # set to None if auth_code (nullable) is None - if self.auth_code is None: + # and __fields_set__ contains the field + if self.auth_code is None and "auth_code" in self.__fields_set__: _dict['auth_code'] = None # set to None if cashier_id (nullable) is None - if self.cashier_id is None: + # and __fields_set__ contains the field + if self.cashier_id is None and "cashier_id" in self.__fields_set__: _dict['cashier_id'] = None # set to None if store (nullable) is None - if self.store is None: + # and __fields_set__ contains the field + if self.store is None and "store" in self.__fields_set__: _dict['store'] = None return _dict @@ -80,7 +83,7 @@ def from_dict(cls, obj: dict) -> ChargeDataPaymentMethodCashResponse: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return ChargeDataPaymentMethodCashResponse.parse_obj(obj) _obj = ChargeDataPaymentMethodCashResponse.parse_obj({ diff --git a/conekta/models/charge_order_response.py b/conekta/models/charge_order_response.py index 4bf568a..7b17431 100644 --- a/conekta/models/charge_order_response.py +++ b/conekta/models/charge_order_response.py @@ -7,27 +7,26 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json from typing import Any, Dict, List, Optional -from pydantic import BaseModel, Field, StrictBool, StrictInt, StrictStr +from pydantic import BaseModel, Field, StrictBool, StrictInt, StrictStr, conlist from conekta.models.charge_order_response_payment_method import ChargeOrderResponsePaymentMethod from conekta.models.charge_response_channel import ChargeResponseChannel class ChargeOrderResponse(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + ChargeOrderResponse """ amount: Optional[StrictInt] = None channel: Optional[ChargeResponseChannel] = None @@ -47,11 +46,12 @@ class ChargeOrderResponse(BaseModel): paid_at: Optional[StrictInt] = None payment_method: Optional[ChargeOrderResponsePaymentMethod] = None reference_id: Optional[StrictStr] = Field(None, description="Reference ID of the charge") - refunds: Optional[List[Dict[str, Any]]] = None + refunds: Optional[conlist(Dict[str, Any])] = None status: Optional[StrictStr] = None __properties = ["amount", "channel", "created_at", "currency", "customer_id", "description", "device_fingerprint", "failure_code", "failure_message", "fee", "id", "livemode", "monthly_installments", "object", "order_id", "paid_at", "payment_method", "reference_id", "refunds", "status"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -81,19 +81,23 @@ def to_dict(self): if self.payment_method: _dict['payment_method'] = self.payment_method.to_dict() # set to None if device_fingerprint (nullable) is None - if self.device_fingerprint is None: + # and __fields_set__ contains the field + if self.device_fingerprint is None and "device_fingerprint" in self.__fields_set__: _dict['device_fingerprint'] = None # set to None if monthly_installments (nullable) is None - if self.monthly_installments is None: + # and __fields_set__ contains the field + if self.monthly_installments is None and "monthly_installments" in self.__fields_set__: _dict['monthly_installments'] = None # set to None if paid_at (nullable) is None - if self.paid_at is None: + # and __fields_set__ contains the field + if self.paid_at is None and "paid_at" in self.__fields_set__: _dict['paid_at'] = None # set to None if reference_id (nullable) is None - if self.reference_id is None: + # and __fields_set__ contains the field + if self.reference_id is None and "reference_id" in self.__fields_set__: _dict['reference_id'] = None return _dict @@ -104,7 +108,7 @@ def from_dict(cls, obj: dict) -> ChargeOrderResponse: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return ChargeOrderResponse.parse_obj(obj) _obj = ChargeOrderResponse.parse_obj({ diff --git a/conekta/models/charge_order_response_payment_method.py b/conekta/models/charge_order_response_payment_method.py index 5751676..416ecdf 100644 --- a/conekta/models/charge_order_response_payment_method.py +++ b/conekta/models/charge_order_response_payment_method.py @@ -7,7 +7,9 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ @@ -28,10 +30,8 @@ CHARGEORDERRESPONSEPAYMENTMETHOD_ONE_OF_SCHEMAS = ["PaymentMethodBankTransfer", "PaymentMethodCard", "PaymentMethodCash"] class ChargeOrderResponsePaymentMethod(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + ChargeOrderResponsePaymentMethod """ # data type: PaymentMethodCash oneof_schema_1_validator: Optional[PaymentMethodCash] = None @@ -48,35 +48,42 @@ class Config: discriminator_value_class_map = { } + def __init__(self, *args, **kwargs): + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + @validator('actual_instance') def actual_instance_must_validate_oneof(cls, v): - instance = cls() + instance = ChargeOrderResponsePaymentMethod.construct() error_messages = [] match = 0 # validate data type: PaymentMethodCash - if type(v) is not PaymentMethodCash: + if not isinstance(v, PaymentMethodCash): error_messages.append(f"Error! Input type `{type(v)}` is not `PaymentMethodCash`") else: match += 1 - # validate data type: PaymentMethodCard - if type(v) is not PaymentMethodCard: + if not isinstance(v, PaymentMethodCard): error_messages.append(f"Error! Input type `{type(v)}` is not `PaymentMethodCard`") else: match += 1 - # validate data type: PaymentMethodBankTransfer - if type(v) is not PaymentMethodBankTransfer: + if not isinstance(v, PaymentMethodBankTransfer): error_messages.append(f"Error! Input type `{type(v)}` is not `PaymentMethodBankTransfer`") else: match += 1 - if match > 1: # more than 1 match - raise ValueError("Multiple matches found when deserializing the JSON string into ChargeOrderResponsePaymentMethod with oneOf schemas: PaymentMethodBankTransfer, PaymentMethodCard, PaymentMethodCash. Details: " + ", ".join(error_messages)) + raise ValueError("Multiple matches found when setting `actual_instance` in ChargeOrderResponsePaymentMethod with oneOf schemas: PaymentMethodBankTransfer, PaymentMethodCard, PaymentMethodCash. Details: " + ", ".join(error_messages)) elif match == 0: # no match - raise ValueError("No match found when deserializing the JSON string into ChargeOrderResponsePaymentMethod with oneOf schemas: PaymentMethodBankTransfer, PaymentMethodCard, PaymentMethodCash. Details: " + ", ".join(error_messages)) + raise ValueError("No match found when setting `actual_instance` in ChargeOrderResponsePaymentMethod with oneOf schemas: PaymentMethodBankTransfer, PaymentMethodCard, PaymentMethodCash. Details: " + ", ".join(error_messages)) else: return v @@ -87,7 +94,7 @@ def from_dict(cls, obj: dict) -> ChargeOrderResponsePaymentMethod: @classmethod def from_json(cls, json_str: str) -> ChargeOrderResponsePaymentMethod: """Returns the object represented by the json string""" - instance = cls() + instance = ChargeOrderResponsePaymentMethod.construct() error_messages = [] match = 0 @@ -130,19 +137,19 @@ def from_json(cls, json_str: str) -> ChargeOrderResponsePaymentMethod: try: instance.actual_instance = PaymentMethodCash.from_json(json_str) match += 1 - except ValidationError as e: + except (ValidationError, ValueError) as e: error_messages.append(str(e)) # deserialize data into PaymentMethodCard try: instance.actual_instance = PaymentMethodCard.from_json(json_str) match += 1 - except ValidationError as e: + except (ValidationError, ValueError) as e: error_messages.append(str(e)) # deserialize data into PaymentMethodBankTransfer try: instance.actual_instance = PaymentMethodBankTransfer.from_json(json_str) match += 1 - except ValidationError as e: + except (ValidationError, ValueError) as e: error_messages.append(str(e)) if match > 1: @@ -156,17 +163,26 @@ def from_json(cls, json_str: str) -> ChargeOrderResponsePaymentMethod: def to_json(self) -> str: """Returns the JSON representation of the actual instance""" - if self.actual_instance is not None: + if self.actual_instance is None: + return "null" + + to_json = getattr(self.actual_instance, "to_json", None) + if callable(to_json): return self.actual_instance.to_json() else: - return "null" + return json.dumps(self.actual_instance) def to_dict(self) -> dict: """Returns the dict representation of the actual instance""" - if self.actual_instance is not None: + if self.actual_instance is None: + return None + + to_dict = getattr(self.actual_instance, "to_dict", None) + if callable(to_dict): return self.actual_instance.to_dict() else: - return dict() + # primitive type + return self.actual_instance def to_str(self) -> str: """Returns the string representation of the actual instance""" diff --git a/conekta/models/charge_request.py b/conekta/models/charge_request.py index ce191f7..4226a25 100644 --- a/conekta/models/charge_request.py +++ b/conekta/models/charge_request.py @@ -7,12 +7,13 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -23,18 +24,17 @@ from conekta.models.charge_request_payment_method import ChargeRequestPaymentMethod class ChargeRequest(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + The charges to be made """ amount: Optional[StrictInt] = None monthly_installments: Optional[StrictInt] = Field(None, description="How many months without interest to apply, it can be 3, 6, 9, 12 or 18") - payment_method: ChargeRequestPaymentMethod = ... + payment_method: ChargeRequestPaymentMethod = Field(...) reference_id: Optional[StrictStr] = Field(None, description="Custom reference to add to the charge") __properties = ["amount", "monthly_installments", "payment_method", "reference_id"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -68,7 +68,7 @@ def from_dict(cls, obj: dict) -> ChargeRequest: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return ChargeRequest.parse_obj(obj) _obj = ChargeRequest.parse_obj({ diff --git a/conekta/models/charge_request_payment_method.py b/conekta/models/charge_request_payment_method.py index 954ce24..7a5580d 100644 --- a/conekta/models/charge_request_payment_method.py +++ b/conekta/models/charge_request_payment_method.py @@ -7,12 +7,13 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -22,18 +23,17 @@ from pydantic import BaseModel, Field, StrictInt, StrictStr class ChargeRequestPaymentMethod(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + Payment method used in the charge. Go to the [payment methods](https://developers.conekta.com/reference/m%C3%A9todos-de-pago) section for more details """ expires_at: Optional[StrictInt] = Field(None, description="Method expiration date as unix timestamp") - type: StrictStr = ... + type: StrictStr = Field(...) token_id: Optional[StrictStr] = None payment_source_id: Optional[StrictStr] = None __properties = ["expires_at", "type", "token_id", "payment_source_id"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -64,7 +64,7 @@ def from_dict(cls, obj: dict) -> ChargeRequestPaymentMethod: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return ChargeRequestPaymentMethod.parse_obj(obj) _obj = ChargeRequestPaymentMethod.parse_obj({ diff --git a/conekta/models/charge_response.py b/conekta/models/charge_response.py index 4ca165a..f25bd35 100644 --- a/conekta/models/charge_response.py +++ b/conekta/models/charge_response.py @@ -7,12 +7,13 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -25,10 +26,8 @@ from conekta.models.charge_response_refunds import ChargeResponseRefunds class ChargeResponse(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + ChargeResponse """ amount: Optional[StrictInt] = None channel: Optional[ChargeResponseChannel] = None @@ -52,6 +51,7 @@ class ChargeResponse(BaseModel): __properties = ["amount", "channel", "created_at", "currency", "customer_id", "description", "device_fingerprint", "failure_code", "failure_message", "fee", "id", "livemode", "object", "order_id", "paid_at", "payment_method", "reference_id", "refunds", "status"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -84,15 +84,18 @@ def to_dict(self): if self.refunds: _dict['refunds'] = self.refunds.to_dict() # set to None if paid_at (nullable) is None - if self.paid_at is None: + # and __fields_set__ contains the field + if self.paid_at is None and "paid_at" in self.__fields_set__: _dict['paid_at'] = None # set to None if reference_id (nullable) is None - if self.reference_id is None: + # and __fields_set__ contains the field + if self.reference_id is None and "reference_id" in self.__fields_set__: _dict['reference_id'] = None # set to None if refunds (nullable) is None - if self.refunds is None: + # and __fields_set__ contains the field + if self.refunds is None and "refunds" in self.__fields_set__: _dict['refunds'] = None return _dict @@ -103,7 +106,7 @@ def from_dict(cls, obj: dict) -> ChargeResponse: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return ChargeResponse.parse_obj(obj) _obj = ChargeResponse.parse_obj({ diff --git a/conekta/models/charge_response_channel.py b/conekta/models/charge_response_channel.py index 6719a5f..5ade12d 100644 --- a/conekta/models/charge_response_channel.py +++ b/conekta/models/charge_response_channel.py @@ -7,12 +7,13 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -22,10 +23,8 @@ from pydantic import BaseModel, StrictStr class ChargeResponseChannel(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + ChargeResponseChannel """ segment: Optional[StrictStr] = None checkout_request_id: Optional[StrictStr] = None @@ -34,6 +33,7 @@ class ChargeResponseChannel(BaseModel): __properties = ["segment", "checkout_request_id", "checkout_request_type", "id"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -64,7 +64,7 @@ def from_dict(cls, obj: dict) -> ChargeResponseChannel: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return ChargeResponseChannel.parse_obj(obj) _obj = ChargeResponseChannel.parse_obj({ diff --git a/conekta/models/charge_response_payment_method.py b/conekta/models/charge_response_payment_method.py index 96da6f7..fc08cce 100644 --- a/conekta/models/charge_response_payment_method.py +++ b/conekta/models/charge_response_payment_method.py @@ -7,7 +7,9 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ @@ -28,10 +30,8 @@ CHARGERESPONSEPAYMENTMETHOD_ONE_OF_SCHEMAS = ["PaymentMethodBankTransfer", "PaymentMethodCard", "PaymentMethodCash"] class ChargeResponsePaymentMethod(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + ChargeResponsePaymentMethod """ # data type: PaymentMethodCash oneof_schema_1_validator: Optional[PaymentMethodCash] = None @@ -48,35 +48,42 @@ class Config: discriminator_value_class_map = { } + def __init__(self, *args, **kwargs): + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + @validator('actual_instance') def actual_instance_must_validate_oneof(cls, v): - instance = cls() + instance = ChargeResponsePaymentMethod.construct() error_messages = [] match = 0 # validate data type: PaymentMethodCash - if type(v) is not PaymentMethodCash: + if not isinstance(v, PaymentMethodCash): error_messages.append(f"Error! Input type `{type(v)}` is not `PaymentMethodCash`") else: match += 1 - # validate data type: PaymentMethodCard - if type(v) is not PaymentMethodCard: + if not isinstance(v, PaymentMethodCard): error_messages.append(f"Error! Input type `{type(v)}` is not `PaymentMethodCard`") else: match += 1 - # validate data type: PaymentMethodBankTransfer - if type(v) is not PaymentMethodBankTransfer: + if not isinstance(v, PaymentMethodBankTransfer): error_messages.append(f"Error! Input type `{type(v)}` is not `PaymentMethodBankTransfer`") else: match += 1 - if match > 1: # more than 1 match - raise ValueError("Multiple matches found when deserializing the JSON string into ChargeResponsePaymentMethod with oneOf schemas: PaymentMethodBankTransfer, PaymentMethodCard, PaymentMethodCash. Details: " + ", ".join(error_messages)) + raise ValueError("Multiple matches found when setting `actual_instance` in ChargeResponsePaymentMethod with oneOf schemas: PaymentMethodBankTransfer, PaymentMethodCard, PaymentMethodCash. Details: " + ", ".join(error_messages)) elif match == 0: # no match - raise ValueError("No match found when deserializing the JSON string into ChargeResponsePaymentMethod with oneOf schemas: PaymentMethodBankTransfer, PaymentMethodCard, PaymentMethodCash. Details: " + ", ".join(error_messages)) + raise ValueError("No match found when setting `actual_instance` in ChargeResponsePaymentMethod with oneOf schemas: PaymentMethodBankTransfer, PaymentMethodCard, PaymentMethodCash. Details: " + ", ".join(error_messages)) else: return v @@ -87,7 +94,7 @@ def from_dict(cls, obj: dict) -> ChargeResponsePaymentMethod: @classmethod def from_json(cls, json_str: str) -> ChargeResponsePaymentMethod: """Returns the object represented by the json string""" - instance = cls() + instance = ChargeResponsePaymentMethod.construct() error_messages = [] match = 0 @@ -130,19 +137,19 @@ def from_json(cls, json_str: str) -> ChargeResponsePaymentMethod: try: instance.actual_instance = PaymentMethodCash.from_json(json_str) match += 1 - except ValidationError as e: + except (ValidationError, ValueError) as e: error_messages.append(str(e)) # deserialize data into PaymentMethodCard try: instance.actual_instance = PaymentMethodCard.from_json(json_str) match += 1 - except ValidationError as e: + except (ValidationError, ValueError) as e: error_messages.append(str(e)) # deserialize data into PaymentMethodBankTransfer try: instance.actual_instance = PaymentMethodBankTransfer.from_json(json_str) match += 1 - except ValidationError as e: + except (ValidationError, ValueError) as e: error_messages.append(str(e)) if match > 1: @@ -156,17 +163,26 @@ def from_json(cls, json_str: str) -> ChargeResponsePaymentMethod: def to_json(self) -> str: """Returns the JSON representation of the actual instance""" - if self.actual_instance is not None: + if self.actual_instance is None: + return "null" + + to_json = getattr(self.actual_instance, "to_json", None) + if callable(to_json): return self.actual_instance.to_json() else: - return "null" + return json.dumps(self.actual_instance) def to_dict(self) -> dict: """Returns the dict representation of the actual instance""" - if self.actual_instance is not None: + if self.actual_instance is None: + return None + + to_dict = getattr(self.actual_instance, "to_dict", None) + if callable(to_dict): return self.actual_instance.to_dict() else: - return dict() + # primitive type + return self.actual_instance def to_str(self) -> str: """Returns the string representation of the actual instance""" diff --git a/conekta/models/charge_response_refunds.py b/conekta/models/charge_response_refunds.py index ed9e47c..26d47f2 100644 --- a/conekta/models/charge_response_refunds.py +++ b/conekta/models/charge_response_refunds.py @@ -7,35 +7,35 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json from typing import List, Optional -from pydantic import BaseModel, Field, StrictBool, StrictStr +from pydantic import BaseModel, Field, StrictBool, StrictStr, conlist from conekta.models.charge_response_refunds_data import ChargeResponseRefundsData class ChargeResponseRefunds(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + ChargeResponseRefunds """ has_more: StrictBool = Field(..., description="Indicates if there are more pages to be requested") object: StrictStr = Field(..., description="Object type, in this case is list") next_page_url: Optional[StrictStr] = Field(None, description="URL of the next page.") previous_page_url: Optional[StrictStr] = Field(None, description="Url of the previous page.") - data: Optional[List[ChargeResponseRefundsData]] = None + data: Optional[conlist(ChargeResponseRefundsData)] = None __properties = ["has_more", "object", "next_page_url", "previous_page_url", "data"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -66,11 +66,13 @@ def to_dict(self): _items.append(_item.to_dict()) _dict['data'] = _items # set to None if next_page_url (nullable) is None - if self.next_page_url is None: + # and __fields_set__ contains the field + if self.next_page_url is None and "next_page_url" in self.__fields_set__: _dict['next_page_url'] = None # set to None if previous_page_url (nullable) is None - if self.previous_page_url is None: + # and __fields_set__ contains the field + if self.previous_page_url is None and "previous_page_url" in self.__fields_set__: _dict['previous_page_url'] = None return _dict @@ -81,7 +83,7 @@ def from_dict(cls, obj: dict) -> ChargeResponseRefunds: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return ChargeResponseRefunds.parse_obj(obj) _obj = ChargeResponseRefunds.parse_obj({ diff --git a/conekta/models/charge_response_refunds_all_of.py b/conekta/models/charge_response_refunds_all_of.py index 2070597..09c933e 100644 --- a/conekta/models/charge_response_refunds_all_of.py +++ b/conekta/models/charge_response_refunds_all_of.py @@ -7,31 +7,31 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json from typing import List, Optional -from pydantic import BaseModel +from pydantic import BaseModel, conlist from conekta.models.charge_response_refunds_data import ChargeResponseRefundsData class ChargeResponseRefundsAllOf(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. """ - data: Optional[List[ChargeResponseRefundsData]] = None + ChargeResponseRefundsAllOf + """ + data: Optional[conlist(ChargeResponseRefundsData)] = None __properties = ["data"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -69,7 +69,7 @@ def from_dict(cls, obj: dict) -> ChargeResponseRefundsAllOf: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return ChargeResponseRefundsAllOf.parse_obj(obj) _obj = ChargeResponseRefundsAllOf.parse_obj({ diff --git a/conekta/models/charge_response_refunds_data.py b/conekta/models/charge_response_refunds_data.py index e0a1338..7cfe6d7 100644 --- a/conekta/models/charge_response_refunds_data.py +++ b/conekta/models/charge_response_refunds_data.py @@ -7,12 +7,13 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -22,21 +23,20 @@ from pydantic import BaseModel, Field, StrictInt, StrictStr class ChargeResponseRefundsData(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. """ - amount: StrictInt = ... + ChargeResponseRefundsData + """ + amount: StrictInt = Field(...) auth_code: Optional[StrictStr] = None - created_at: StrictInt = ... + created_at: StrictInt = Field(...) expires_at: Optional[StrictInt] = Field(None, description="refund expiration date") - id: StrictStr = ... - object: StrictStr = ... + id: StrictStr = Field(...) + object: StrictStr = Field(...) status: Optional[StrictStr] = Field(None, description="refund status") __properties = ["amount", "auth_code", "created_at", "expires_at", "id", "object", "status"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -67,7 +67,7 @@ def from_dict(cls, obj: dict) -> ChargeResponseRefundsData: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return ChargeResponseRefundsData.parse_obj(obj) _obj = ChargeResponseRefundsData.parse_obj({ diff --git a/conekta/models/charges_data_response.py b/conekta/models/charges_data_response.py index a47f68a..a40484f 100644 --- a/conekta/models/charges_data_response.py +++ b/conekta/models/charges_data_response.py @@ -7,12 +7,13 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -25,10 +26,8 @@ from conekta.models.charge_response_refunds import ChargeResponseRefunds class ChargesDataResponse(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + ChargesDataResponse """ amount: Optional[StrictInt] = None channel: Optional[ChargeResponseChannel] = None @@ -52,6 +51,7 @@ class ChargesDataResponse(BaseModel): __properties = ["amount", "channel", "created_at", "currency", "customer_id", "description", "device_fingerprint", "failure_code", "failure_message", "fee", "id", "livemode", "object", "order_id", "paid_at", "payment_method", "reference_id", "refunds", "status"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -84,15 +84,18 @@ def to_dict(self): if self.refunds: _dict['refunds'] = self.refunds.to_dict() # set to None if paid_at (nullable) is None - if self.paid_at is None: + # and __fields_set__ contains the field + if self.paid_at is None and "paid_at" in self.__fields_set__: _dict['paid_at'] = None # set to None if reference_id (nullable) is None - if self.reference_id is None: + # and __fields_set__ contains the field + if self.reference_id is None and "reference_id" in self.__fields_set__: _dict['reference_id'] = None # set to None if refunds (nullable) is None - if self.refunds is None: + # and __fields_set__ contains the field + if self.refunds is None and "refunds" in self.__fields_set__: _dict['refunds'] = None return _dict @@ -103,7 +106,7 @@ def from_dict(cls, obj: dict) -> ChargesDataResponse: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return ChargesDataResponse.parse_obj(obj) _obj = ChargesDataResponse.parse_obj({ diff --git a/conekta/models/checkout.py b/conekta/models/checkout.py index 368be7c..a2c40b8 100644 --- a/conekta/models/checkout.py +++ b/conekta/models/checkout.py @@ -7,41 +7,41 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json from typing import List, Optional -from pydantic import BaseModel, Field, StrictBool, StrictInt, StrictStr +from pydantic import BaseModel, Field, StrictBool, StrictInt, StrictStr, conlist from conekta.models.checkout_order_template import CheckoutOrderTemplate class Checkout(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. """ - allowed_payment_methods: List[StrictStr] = Field(..., description="Those are the payment methods that will be available for the link") + It is a sub-resource of the Order model that can be stipulated in order to configure its corresponding checkout + """ + allowed_payment_methods: conlist(StrictStr) = Field(..., description="Those are the payment methods that will be available for the link") expires_at: StrictInt = Field(..., description="It is the time when the link will expire. It is expressed in seconds since the Unix epoch. The valid range is from 2 to 365 days (the valid range will be taken from the next day of the creation date at 00:01 hrs) ") monthly_installments_enabled: Optional[StrictBool] = Field(None, description="This flag allows you to specify if months without interest will be active.") - monthly_installments_options: Optional[List[StrictInt]] = Field(None, description="This field allows you to specify the number of months without interest.") + monthly_installments_options: Optional[conlist(StrictInt)] = Field(None, description="This field allows you to specify the number of months without interest.") name: StrictStr = Field(..., description="Reason for charge") needs_shipping_contact: Optional[StrictBool] = Field(None, description="This flag allows you to fill in the shipping information at checkout.") on_demand_enabled: Optional[StrictBool] = Field(None, description="This flag allows you to specify if the link will be on demand.") - order_template: CheckoutOrderTemplate = ... + order_template: CheckoutOrderTemplate = Field(...) payments_limit_count: Optional[StrictInt] = Field(None, description="It is the number of payments that can be made through the link.") recurrent: StrictBool = Field(..., description="false: single use. true: multiple payments") type: StrictStr = Field(..., description="It is the type of link that will be created. It must be a valid type.") __properties = ["allowed_payment_methods", "expires_at", "monthly_installments_enabled", "monthly_installments_options", "name", "needs_shipping_contact", "on_demand_enabled", "order_template", "payments_limit_count", "recurrent", "type"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -68,7 +68,8 @@ def to_dict(self): if self.order_template: _dict['order_template'] = self.order_template.to_dict() # set to None if on_demand_enabled (nullable) is None - if self.on_demand_enabled is None: + # and __fields_set__ contains the field + if self.on_demand_enabled is None and "on_demand_enabled" in self.__fields_set__: _dict['on_demand_enabled'] = None return _dict @@ -79,7 +80,7 @@ def from_dict(cls, obj: dict) -> Checkout: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return Checkout.parse_obj(obj) _obj = Checkout.parse_obj({ diff --git a/conekta/models/checkout_order_template.py b/conekta/models/checkout_order_template.py index f566d4e..d9544b9 100644 --- a/conekta/models/checkout_order_template.py +++ b/conekta/models/checkout_order_template.py @@ -7,35 +7,35 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json from typing import Any, Dict, List, Optional -from pydantic import BaseModel, Field, constr +from pydantic import BaseModel, Field, conlist, constr from conekta.models.checkout_order_template_customer_info import CheckoutOrderTemplateCustomerInfo from conekta.models.product import Product class CheckoutOrderTemplate(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + It maintains the attributes with which the order will be created when receiving a new payment. """ currency: constr(strict=True, max_length=3) = Field(..., description="It is the currency in which the order will be created. It must be a valid ISO 4217 currency code.") customer_info: Optional[CheckoutOrderTemplateCustomerInfo] = None - line_items: List[Product] = Field(..., description="They are the products to buy. Each contains the \"unit price\" and \"quantity\" parameters that are used to calculate the total amount of the order.") + line_items: conlist(Product) = Field(..., description="They are the products to buy. Each contains the \"unit price\" and \"quantity\" parameters that are used to calculate the total amount of the order.") metadata: Optional[Dict[str, Any]] = Field(None, description="It is a set of key-value pairs that you can attach to the order. It can be used to store additional information about the order in a structured format.") __properties = ["currency", "customer_info", "line_items", "metadata"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -76,7 +76,7 @@ def from_dict(cls, obj: dict) -> CheckoutOrderTemplate: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return CheckoutOrderTemplate.parse_obj(obj) _obj = CheckoutOrderTemplate.parse_obj({ diff --git a/conekta/models/checkout_order_template_customer_info.py b/conekta/models/checkout_order_template_customer_info.py index d9e5ed3..8881f60 100644 --- a/conekta/models/checkout_order_template_customer_info.py +++ b/conekta/models/checkout_order_template_customer_info.py @@ -7,7 +7,9 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ @@ -27,10 +29,8 @@ CHECKOUTORDERTEMPLATECUSTOMERINFO_ONE_OF_SCHEMAS = ["CustomerInfo", "CustomerInfoJustCustomerId"] class CheckoutOrderTemplateCustomerInfo(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + It is the information of the customer who will be created when receiving a new payment. """ # data type: CustomerInfo oneof_schema_1_validator: Optional[CustomerInfo] = None @@ -42,29 +42,37 @@ class CheckoutOrderTemplateCustomerInfo(BaseModel): class Config: validate_assignment = True + def __init__(self, *args, **kwargs): + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + @validator('actual_instance') def actual_instance_must_validate_oneof(cls, v): - instance = cls() + instance = CheckoutOrderTemplateCustomerInfo.construct() error_messages = [] match = 0 # validate data type: CustomerInfo - if type(v) is not CustomerInfo: + if not isinstance(v, CustomerInfo): error_messages.append(f"Error! Input type `{type(v)}` is not `CustomerInfo`") else: match += 1 - # validate data type: CustomerInfoJustCustomerId - if type(v) is not CustomerInfoJustCustomerId: + if not isinstance(v, CustomerInfoJustCustomerId): error_messages.append(f"Error! Input type `{type(v)}` is not `CustomerInfoJustCustomerId`") else: match += 1 - if match > 1: # more than 1 match - raise ValueError("Multiple matches found when deserializing the JSON string into CheckoutOrderTemplateCustomerInfo with oneOf schemas: CustomerInfo, CustomerInfoJustCustomerId. Details: " + ", ".join(error_messages)) + raise ValueError("Multiple matches found when setting `actual_instance` in CheckoutOrderTemplateCustomerInfo with oneOf schemas: CustomerInfo, CustomerInfoJustCustomerId. Details: " + ", ".join(error_messages)) elif match == 0: # no match - raise ValueError("No match found when deserializing the JSON string into CheckoutOrderTemplateCustomerInfo with oneOf schemas: CustomerInfo, CustomerInfoJustCustomerId. Details: " + ", ".join(error_messages)) + raise ValueError("No match found when setting `actual_instance` in CheckoutOrderTemplateCustomerInfo with oneOf schemas: CustomerInfo, CustomerInfoJustCustomerId. Details: " + ", ".join(error_messages)) else: return v @@ -75,7 +83,7 @@ def from_dict(cls, obj: dict) -> CheckoutOrderTemplateCustomerInfo: @classmethod def from_json(cls, json_str: str) -> CheckoutOrderTemplateCustomerInfo: """Returns the object represented by the json string""" - instance = cls() + instance = CheckoutOrderTemplateCustomerInfo.construct() error_messages = [] match = 0 @@ -83,13 +91,13 @@ def from_json(cls, json_str: str) -> CheckoutOrderTemplateCustomerInfo: try: instance.actual_instance = CustomerInfo.from_json(json_str) match += 1 - except ValidationError as e: + except (ValidationError, ValueError) as e: error_messages.append(str(e)) # deserialize data into CustomerInfoJustCustomerId try: instance.actual_instance = CustomerInfoJustCustomerId.from_json(json_str) match += 1 - except ValidationError as e: + except (ValidationError, ValueError) as e: error_messages.append(str(e)) if match > 1: @@ -103,17 +111,26 @@ def from_json(cls, json_str: str) -> CheckoutOrderTemplateCustomerInfo: def to_json(self) -> str: """Returns the JSON representation of the actual instance""" - if self.actual_instance is not None: + if self.actual_instance is None: + return "null" + + to_json = getattr(self.actual_instance, "to_json", None) + if callable(to_json): return self.actual_instance.to_json() else: - return "null" + return json.dumps(self.actual_instance) def to_dict(self) -> dict: """Returns the dict representation of the actual instance""" - if self.actual_instance is not None: + if self.actual_instance is None: + return None + + to_dict = getattr(self.actual_instance, "to_dict", None) + if callable(to_dict): return self.actual_instance.to_dict() else: - return dict() + # primitive type + return self.actual_instance def to_str(self) -> str: """Returns the string representation of the actual instance""" diff --git a/conekta/models/checkout_request.py b/conekta/models/checkout_request.py index 71aabbb..216a1f1 100644 --- a/conekta/models/checkout_request.py +++ b/conekta/models/checkout_request.py @@ -7,31 +7,30 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json from typing import List, Optional -from pydantic import BaseModel, Field, StrictBool, StrictInt, StrictStr +from pydantic import BaseModel, Field, StrictBool, StrictInt, StrictStr, conlist class CheckoutRequest(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. """ - allowed_payment_methods: List[StrictStr] = Field(..., description="Are the payment methods available for this link") + [Checkout](https://developers.conekta.com/reference/checkout) details + """ + allowed_payment_methods: conlist(StrictStr) = Field(..., description="Are the payment methods available for this link") expires_at: Optional[StrictInt] = Field(None, description="Unix timestamp of checkout expiration") failure_url: Optional[StrictStr] = Field(None, description="Redirection url back to the site in case of failed payment, applies only to HostedPayment.") monthly_installments_enabled: Optional[StrictBool] = None - monthly_installments_options: Optional[List[StrictInt]] = None + monthly_installments_options: Optional[conlist(StrictInt)] = None name: Optional[StrictStr] = Field(None, description="Reason for payment") on_demand_enabled: Optional[StrictBool] = None success_url: Optional[StrictStr] = Field(None, description="Redirection url back to the site in case of successful payment, applies only to HostedPayment") @@ -39,6 +38,7 @@ class CheckoutRequest(BaseModel): __properties = ["allowed_payment_methods", "expires_at", "failure_url", "monthly_installments_enabled", "monthly_installments_options", "name", "on_demand_enabled", "success_url", "type"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -69,7 +69,7 @@ def from_dict(cls, obj: dict) -> CheckoutRequest: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return CheckoutRequest.parse_obj(obj) _obj = CheckoutRequest.parse_obj({ diff --git a/conekta/models/checkout_response.py b/conekta/models/checkout_response.py index 93f45d5..1d4b06c 100644 --- a/conekta/models/checkout_response.py +++ b/conekta/models/checkout_response.py @@ -7,41 +7,40 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json from typing import Any, Dict, List, Optional -from pydantic import BaseModel, Field, StrictBool, StrictInt, StrictStr +from pydantic import BaseModel, Field, StrictBool, StrictInt, StrictStr, conlist class CheckoutResponse(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. """ - allowed_payment_methods: Optional[List[StrictStr]] = None + checkout response + """ + allowed_payment_methods: Optional[conlist(StrictStr)] = None can_not_expire: Optional[StrictBool] = None emails_sent: Optional[StrictInt] = None - exclude_card_networks: Optional[List[Dict[str, Any]]] = None + exclude_card_networks: Optional[conlist(Dict[str, Any])] = None expires_at: Optional[StrictInt] = None failure_url: Optional[StrictStr] = None force_3ds_flow: Optional[StrictBool] = None - id: StrictStr = ... - livemode: StrictBool = ... + id: StrictStr = Field(...) + livemode: StrictBool = Field(...) metadata: Optional[Dict[str, Any]] = None monthly_installments_enabled: Optional[StrictBool] = None - monthly_installments_options: Optional[List[StrictInt]] = None + monthly_installments_options: Optional[conlist(StrictInt)] = None name: StrictStr = Field(..., description="Reason for charge") needs_shipping_contact: Optional[StrictBool] = None - object: StrictStr = ... + object: StrictStr = Field(...) paid_payments_count: Optional[StrictInt] = None payments_limit_count: Optional[StrictInt] = None recurrent: Optional[StrictBool] = None @@ -55,6 +54,7 @@ class CheckoutResponse(BaseModel): __properties = ["allowed_payment_methods", "can_not_expire", "emails_sent", "exclude_card_networks", "expires_at", "failure_url", "force_3ds_flow", "id", "livemode", "metadata", "monthly_installments_enabled", "monthly_installments_options", "name", "needs_shipping_contact", "object", "paid_payments_count", "payments_limit_count", "recurrent", "slug", "sms_sent", "starts_at", "status", "success_url", "type", "url"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -78,7 +78,8 @@ def to_dict(self): }, exclude_none=True) # set to None if payments_limit_count (nullable) is None - if self.payments_limit_count is None: + # and __fields_set__ contains the field + if self.payments_limit_count is None and "payments_limit_count" in self.__fields_set__: _dict['payments_limit_count'] = None return _dict @@ -89,7 +90,7 @@ def from_dict(cls, obj: dict) -> CheckoutResponse: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return CheckoutResponse.parse_obj(obj) _obj = CheckoutResponse.parse_obj({ diff --git a/conekta/models/checkouts_response.py b/conekta/models/checkouts_response.py index 4526ea1..a6e4296 100644 --- a/conekta/models/checkouts_response.py +++ b/conekta/models/checkouts_response.py @@ -7,35 +7,35 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json from typing import List, Optional -from pydantic import BaseModel, Field, StrictBool, StrictStr +from pydantic import BaseModel, Field, StrictBool, StrictStr, conlist from conekta.models.checkout_response import CheckoutResponse class CheckoutsResponse(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + CheckoutsResponse """ has_more: StrictBool = Field(..., description="Indicates if there are more pages to be requested") object: StrictStr = Field(..., description="Object type, in this case is list") next_page_url: Optional[StrictStr] = Field(None, description="URL of the next page.") previous_page_url: Optional[StrictStr] = Field(None, description="Url of the previous page.") - data: Optional[List[CheckoutResponse]] = None + data: Optional[conlist(CheckoutResponse)] = None __properties = ["has_more", "object", "next_page_url", "previous_page_url", "data"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -66,11 +66,13 @@ def to_dict(self): _items.append(_item.to_dict()) _dict['data'] = _items # set to None if next_page_url (nullable) is None - if self.next_page_url is None: + # and __fields_set__ contains the field + if self.next_page_url is None and "next_page_url" in self.__fields_set__: _dict['next_page_url'] = None # set to None if previous_page_url (nullable) is None - if self.previous_page_url is None: + # and __fields_set__ contains the field + if self.previous_page_url is None and "previous_page_url" in self.__fields_set__: _dict['previous_page_url'] = None return _dict @@ -81,7 +83,7 @@ def from_dict(cls, obj: dict) -> CheckoutsResponse: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return CheckoutsResponse.parse_obj(obj) _obj = CheckoutsResponse.parse_obj({ diff --git a/conekta/models/checkouts_response_all_of.py b/conekta/models/checkouts_response_all_of.py index b0aec2f..f4b98cf 100644 --- a/conekta/models/checkouts_response_all_of.py +++ b/conekta/models/checkouts_response_all_of.py @@ -7,31 +7,31 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json from typing import List, Optional -from pydantic import BaseModel +from pydantic import BaseModel, conlist from conekta.models.checkout_response import CheckoutResponse class CheckoutsResponseAllOf(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. """ - data: Optional[List[CheckoutResponse]] = None + CheckoutsResponseAllOf + """ + data: Optional[conlist(CheckoutResponse)] = None __properties = ["data"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -69,7 +69,7 @@ def from_dict(cls, obj: dict) -> CheckoutsResponseAllOf: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return CheckoutsResponseAllOf.parse_obj(obj) _obj = CheckoutsResponseAllOf.parse_obj({ diff --git a/conekta/models/company_fiscal_info_address_response.py b/conekta/models/company_fiscal_info_address_response.py index 6b2535a..c113c19 100644 --- a/conekta/models/company_fiscal_info_address_response.py +++ b/conekta/models/company_fiscal_info_address_response.py @@ -7,12 +7,13 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -22,10 +23,8 @@ from pydantic import BaseModel, Field, StrictStr, validator class CompanyFiscalInfoAddressResponse(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + Company fiscal info address model """ object: Optional[StrictStr] = Field(None, description="The resource's type") street1: Optional[StrictStr] = Field(None, description="Street Address") @@ -39,15 +38,17 @@ class CompanyFiscalInfoAddressResponse(BaseModel): __properties = ["object", "street1", "street2", "city", "state", "country", "postal_code", "external_number", "internal_number"] @validator('object') - def object_validate_enum(cls, v): - if v is None: - return v + def object_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value - if v not in ('address'): - raise ValueError("must validate the enum values ('address')") - return v + if value not in ('address'): + raise ValueError("must be one of enum values ('address')") + return value class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -78,7 +79,7 @@ def from_dict(cls, obj: dict) -> CompanyFiscalInfoAddressResponse: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return CompanyFiscalInfoAddressResponse.parse_obj(obj) _obj = CompanyFiscalInfoAddressResponse.parse_obj({ diff --git a/conekta/models/company_fiscal_info_response.py b/conekta/models/company_fiscal_info_response.py index 7513260..d5b4cc7 100644 --- a/conekta/models/company_fiscal_info_response.py +++ b/conekta/models/company_fiscal_info_response.py @@ -7,12 +7,13 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -23,10 +24,8 @@ from conekta.models.company_fiscal_info_address_response import CompanyFiscalInfoAddressResponse class CompanyFiscalInfoResponse(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + Company fiscal info model """ object: Optional[StrictStr] = Field(None, description="The resource's type") tax_id: Optional[StrictStr] = Field(None, description="Tax ID of the company") @@ -38,15 +37,17 @@ class CompanyFiscalInfoResponse(BaseModel): __properties = ["object", "tax_id", "legal_entity_name", "business_type", "phone", "physical_person_business_type", "address"] @validator('object') - def object_validate_enum(cls, v): - if v is None: - return v + def object_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value - if v not in ('fiscal_info'): - raise ValueError("must validate the enum values ('fiscal_info')") - return v + if value not in ('fiscal_info'): + raise ValueError("must be one of enum values ('fiscal_info')") + return value class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -80,7 +81,7 @@ def from_dict(cls, obj: dict) -> CompanyFiscalInfoResponse: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return CompanyFiscalInfoResponse.parse_obj(obj) _obj = CompanyFiscalInfoResponse.parse_obj({ diff --git a/conekta/models/company_payout_destination_response.py b/conekta/models/company_payout_destination_response.py index 5951789..80bfd41 100644 --- a/conekta/models/company_payout_destination_response.py +++ b/conekta/models/company_payout_destination_response.py @@ -7,12 +7,13 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -22,10 +23,8 @@ from pydantic import BaseModel, Field, StrictStr, validator class CompanyPayoutDestinationResponse(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + Company payout destination model """ object: Optional[StrictStr] = Field(None, description="The resource's type") currency: Optional[StrictStr] = Field(None, description="currency of the receiving account") @@ -36,24 +35,27 @@ class CompanyPayoutDestinationResponse(BaseModel): __properties = ["object", "currency", "account_holder_name", "bank", "type", "account_number"] @validator('object') - def object_validate_enum(cls, v): - if v is None: - return v + def object_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value - if v not in ('payout_destination'): - raise ValueError("must validate the enum values ('payout_destination')") - return v + if value not in ('payout_destination'): + raise ValueError("must be one of enum values ('payout_destination')") + return value @validator('type') - def type_validate_enum(cls, v): - if v is None: - return v + def type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value - if v not in ('bank_account'): - raise ValueError("must validate the enum values ('bank_account')") - return v + if value not in ('bank_account'): + raise ValueError("must be one of enum values ('bank_account')") + return value class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -84,7 +86,7 @@ def from_dict(cls, obj: dict) -> CompanyPayoutDestinationResponse: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return CompanyPayoutDestinationResponse.parse_obj(obj) _obj = CompanyPayoutDestinationResponse.parse_obj({ diff --git a/conekta/models/company_response.py b/conekta/models/company_response.py index 9855d89..7231d6f 100644 --- a/conekta/models/company_response.py +++ b/conekta/models/company_response.py @@ -7,12 +7,13 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -24,10 +25,8 @@ from conekta.models.company_payout_destination_response import CompanyPayoutDestinationResponse class CompanyResponse(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + Company model """ id: Optional[StrictStr] = Field(None, description="The child company's unique identifier") created_at: Optional[StrictInt] = Field(None, description="The resource's creation date (unix timestamp)") @@ -40,15 +39,17 @@ class CompanyResponse(BaseModel): __properties = ["id", "created_at", "name", "object", "parent_company_id", "use_parent_fiscal_data", "payout_destination", "fiscal_info"] @validator('object') - def object_validate_enum(cls, v): - if v is None: - return v + def object_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value - if v not in ('company'): - raise ValueError("must validate the enum values ('company')") - return v + if value not in ('company'): + raise ValueError("must be one of enum values ('company')") + return value class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -85,7 +86,7 @@ def from_dict(cls, obj: dict) -> CompanyResponse: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return CompanyResponse.parse_obj(obj) _obj = CompanyResponse.parse_obj({ diff --git a/conekta/models/create_customer_fiscal_entities_response.py b/conekta/models/create_customer_fiscal_entities_response.py index 093779c..651c7f6 100644 --- a/conekta/models/create_customer_fiscal_entities_response.py +++ b/conekta/models/create_customer_fiscal_entities_response.py @@ -7,41 +7,41 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json from typing import Any, Dict, Optional -from pydantic import BaseModel, StrictBool, StrictInt, StrictStr +from pydantic import BaseModel, Field, StrictBool, StrictInt, StrictStr from conekta.models.customer_fiscal_entities_request_address import CustomerFiscalEntitiesRequestAddress class CreateCustomerFiscalEntitiesResponse(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. """ - address: CustomerFiscalEntitiesRequestAddress = ... + CreateCustomerFiscalEntitiesResponse + """ + address: CustomerFiscalEntitiesRequestAddress = Field(...) tax_id: Optional[StrictStr] = None email: Optional[StrictStr] = None phone: Optional[StrictStr] = None metadata: Optional[Dict[str, Dict[str, Any]]] = None company_name: Optional[StrictStr] = None - id: StrictStr = ... - object: StrictStr = ... - created_at: StrictInt = ... + id: StrictStr = Field(...) + object: StrictStr = Field(...) + created_at: StrictInt = Field(...) parent_id: Optional[StrictStr] = None default: Optional[StrictBool] = None __properties = ["address", "tax_id", "email", "phone", "metadata", "company_name", "id", "object", "created_at", "parent_id", "default"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -75,7 +75,7 @@ def from_dict(cls, obj: dict) -> CreateCustomerFiscalEntitiesResponse: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return CreateCustomerFiscalEntitiesResponse.parse_obj(obj) _obj = CreateCustomerFiscalEntitiesResponse.parse_obj({ diff --git a/conekta/models/create_customer_fiscal_entities_response_all_of.py b/conekta/models/create_customer_fiscal_entities_response_all_of.py index cff789e..7761f9e 100644 --- a/conekta/models/create_customer_fiscal_entities_response_all_of.py +++ b/conekta/models/create_customer_fiscal_entities_response_all_of.py @@ -7,34 +7,34 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json from typing import Optional -from pydantic import BaseModel, StrictBool, StrictInt, StrictStr +from pydantic import BaseModel, Field, StrictBool, StrictInt, StrictStr class CreateCustomerFiscalEntitiesResponseAllOf(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. """ - id: StrictStr = ... - object: StrictStr = ... - created_at: StrictInt = ... + CreateCustomerFiscalEntitiesResponseAllOf + """ + id: StrictStr = Field(...) + object: StrictStr = Field(...) + created_at: StrictInt = Field(...) parent_id: Optional[StrictStr] = None default: Optional[StrictBool] = None __properties = ["id", "object", "created_at", "parent_id", "default"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -65,7 +65,7 @@ def from_dict(cls, obj: dict) -> CreateCustomerFiscalEntitiesResponseAllOf: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return CreateCustomerFiscalEntitiesResponseAllOf.parse_obj(obj) _obj = CreateCustomerFiscalEntitiesResponseAllOf.parse_obj({ diff --git a/conekta/models/create_customer_payment_methods_request.py b/conekta/models/create_customer_payment_methods_request.py index 8a5ab4c..2f9242d 100644 --- a/conekta/models/create_customer_payment_methods_request.py +++ b/conekta/models/create_customer_payment_methods_request.py @@ -7,7 +7,9 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ @@ -28,10 +30,8 @@ CREATECUSTOMERPAYMENTMETHODSREQUEST_ONE_OF_SCHEMAS = ["PaymentMethodCardRequest", "PaymentMethodCashRequest", "PaymentMethodSpeiRequest"] class CreateCustomerPaymentMethodsRequest(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + Contains details of the payment methods that the customer has active or has used in Conekta """ # data type: PaymentMethodCardRequest oneof_schema_1_validator: Optional[PaymentMethodCardRequest] = None @@ -45,35 +45,42 @@ class CreateCustomerPaymentMethodsRequest(BaseModel): class Config: validate_assignment = True + def __init__(self, *args, **kwargs): + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + @validator('actual_instance') def actual_instance_must_validate_oneof(cls, v): - instance = cls() + instance = CreateCustomerPaymentMethodsRequest.construct() error_messages = [] match = 0 # validate data type: PaymentMethodCardRequest - if type(v) is not PaymentMethodCardRequest: + if not isinstance(v, PaymentMethodCardRequest): error_messages.append(f"Error! Input type `{type(v)}` is not `PaymentMethodCardRequest`") else: match += 1 - # validate data type: PaymentMethodCashRequest - if type(v) is not PaymentMethodCashRequest: + if not isinstance(v, PaymentMethodCashRequest): error_messages.append(f"Error! Input type `{type(v)}` is not `PaymentMethodCashRequest`") else: match += 1 - # validate data type: PaymentMethodSpeiRequest - if type(v) is not PaymentMethodSpeiRequest: + if not isinstance(v, PaymentMethodSpeiRequest): error_messages.append(f"Error! Input type `{type(v)}` is not `PaymentMethodSpeiRequest`") else: match += 1 - if match > 1: # more than 1 match - raise ValueError("Multiple matches found when deserializing the JSON string into CreateCustomerPaymentMethodsRequest with oneOf schemas: PaymentMethodCardRequest, PaymentMethodCashRequest, PaymentMethodSpeiRequest. Details: " + ", ".join(error_messages)) + raise ValueError("Multiple matches found when setting `actual_instance` in CreateCustomerPaymentMethodsRequest with oneOf schemas: PaymentMethodCardRequest, PaymentMethodCashRequest, PaymentMethodSpeiRequest. Details: " + ", ".join(error_messages)) elif match == 0: # no match - raise ValueError("No match found when deserializing the JSON string into CreateCustomerPaymentMethodsRequest with oneOf schemas: PaymentMethodCardRequest, PaymentMethodCashRequest, PaymentMethodSpeiRequest. Details: " + ", ".join(error_messages)) + raise ValueError("No match found when setting `actual_instance` in CreateCustomerPaymentMethodsRequest with oneOf schemas: PaymentMethodCardRequest, PaymentMethodCashRequest, PaymentMethodSpeiRequest. Details: " + ", ".join(error_messages)) else: return v @@ -84,7 +91,7 @@ def from_dict(cls, obj: dict) -> CreateCustomerPaymentMethodsRequest: @classmethod def from_json(cls, json_str: str) -> CreateCustomerPaymentMethodsRequest: """Returns the object represented by the json string""" - instance = cls() + instance = CreateCustomerPaymentMethodsRequest.construct() error_messages = [] match = 0 @@ -92,19 +99,19 @@ def from_json(cls, json_str: str) -> CreateCustomerPaymentMethodsRequest: try: instance.actual_instance = PaymentMethodCardRequest.from_json(json_str) match += 1 - except ValidationError as e: + except (ValidationError, ValueError) as e: error_messages.append(str(e)) # deserialize data into PaymentMethodCashRequest try: instance.actual_instance = PaymentMethodCashRequest.from_json(json_str) match += 1 - except ValidationError as e: + except (ValidationError, ValueError) as e: error_messages.append(str(e)) # deserialize data into PaymentMethodSpeiRequest try: instance.actual_instance = PaymentMethodSpeiRequest.from_json(json_str) match += 1 - except ValidationError as e: + except (ValidationError, ValueError) as e: error_messages.append(str(e)) if match > 1: @@ -118,17 +125,26 @@ def from_json(cls, json_str: str) -> CreateCustomerPaymentMethodsRequest: def to_json(self) -> str: """Returns the JSON representation of the actual instance""" - if self.actual_instance is not None: + if self.actual_instance is None: + return "null" + + to_json = getattr(self.actual_instance, "to_json", None) + if callable(to_json): return self.actual_instance.to_json() else: - return "null" + return json.dumps(self.actual_instance) def to_dict(self) -> dict: """Returns the dict representation of the actual instance""" - if self.actual_instance is not None: + if self.actual_instance is None: + return None + + to_dict = getattr(self.actual_instance, "to_dict", None) + if callable(to_dict): return self.actual_instance.to_dict() else: - return dict() + # primitive type + return self.actual_instance def to_str(self) -> str: """Returns the string representation of the actual instance""" diff --git a/conekta/models/create_customer_payment_methods_response.py b/conekta/models/create_customer_payment_methods_response.py index 9cb7ed1..d3a8ecf 100644 --- a/conekta/models/create_customer_payment_methods_response.py +++ b/conekta/models/create_customer_payment_methods_response.py @@ -7,7 +7,9 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ @@ -28,10 +30,8 @@ CREATECUSTOMERPAYMENTMETHODSRESPONSE_ONE_OF_SCHEMAS = ["PaymentMethodCardResponse", "PaymentMethodCashResponse", "PaymentMethodSpeiRecurrent"] class CreateCustomerPaymentMethodsResponse(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + CreateCustomerPaymentMethodsResponse """ # data type: PaymentMethodCashResponse oneof_schema_1_validator: Optional[PaymentMethodCashResponse] = None @@ -48,35 +48,42 @@ class Config: discriminator_value_class_map = { } + def __init__(self, *args, **kwargs): + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + @validator('actual_instance') def actual_instance_must_validate_oneof(cls, v): - instance = cls() + instance = CreateCustomerPaymentMethodsResponse.construct() error_messages = [] match = 0 # validate data type: PaymentMethodCashResponse - if type(v) is not PaymentMethodCashResponse: + if not isinstance(v, PaymentMethodCashResponse): error_messages.append(f"Error! Input type `{type(v)}` is not `PaymentMethodCashResponse`") else: match += 1 - # validate data type: PaymentMethodCardResponse - if type(v) is not PaymentMethodCardResponse: + if not isinstance(v, PaymentMethodCardResponse): error_messages.append(f"Error! Input type `{type(v)}` is not `PaymentMethodCardResponse`") else: match += 1 - # validate data type: PaymentMethodSpeiRecurrent - if type(v) is not PaymentMethodSpeiRecurrent: + if not isinstance(v, PaymentMethodSpeiRecurrent): error_messages.append(f"Error! Input type `{type(v)}` is not `PaymentMethodSpeiRecurrent`") else: match += 1 - if match > 1: # more than 1 match - raise ValueError("Multiple matches found when deserializing the JSON string into CreateCustomerPaymentMethodsResponse with oneOf schemas: PaymentMethodCardResponse, PaymentMethodCashResponse, PaymentMethodSpeiRecurrent. Details: " + ", ".join(error_messages)) + raise ValueError("Multiple matches found when setting `actual_instance` in CreateCustomerPaymentMethodsResponse with oneOf schemas: PaymentMethodCardResponse, PaymentMethodCashResponse, PaymentMethodSpeiRecurrent. Details: " + ", ".join(error_messages)) elif match == 0: # no match - raise ValueError("No match found when deserializing the JSON string into CreateCustomerPaymentMethodsResponse with oneOf schemas: PaymentMethodCardResponse, PaymentMethodCashResponse, PaymentMethodSpeiRecurrent. Details: " + ", ".join(error_messages)) + raise ValueError("No match found when setting `actual_instance` in CreateCustomerPaymentMethodsResponse with oneOf schemas: PaymentMethodCardResponse, PaymentMethodCashResponse, PaymentMethodSpeiRecurrent. Details: " + ", ".join(error_messages)) else: return v @@ -87,7 +94,7 @@ def from_dict(cls, obj: dict) -> CreateCustomerPaymentMethodsResponse: @classmethod def from_json(cls, json_str: str) -> CreateCustomerPaymentMethodsResponse: """Returns the object represented by the json string""" - instance = cls() + instance = CreateCustomerPaymentMethodsResponse.construct() error_messages = [] match = 0 @@ -135,19 +142,19 @@ def from_json(cls, json_str: str) -> CreateCustomerPaymentMethodsResponse: try: instance.actual_instance = PaymentMethodCashResponse.from_json(json_str) match += 1 - except ValidationError as e: + except (ValidationError, ValueError) as e: error_messages.append(str(e)) # deserialize data into PaymentMethodCardResponse try: instance.actual_instance = PaymentMethodCardResponse.from_json(json_str) match += 1 - except ValidationError as e: + except (ValidationError, ValueError) as e: error_messages.append(str(e)) # deserialize data into PaymentMethodSpeiRecurrent try: instance.actual_instance = PaymentMethodSpeiRecurrent.from_json(json_str) match += 1 - except ValidationError as e: + except (ValidationError, ValueError) as e: error_messages.append(str(e)) if match > 1: @@ -161,17 +168,26 @@ def from_json(cls, json_str: str) -> CreateCustomerPaymentMethodsResponse: def to_json(self) -> str: """Returns the JSON representation of the actual instance""" - if self.actual_instance is not None: + if self.actual_instance is None: + return "null" + + to_json = getattr(self.actual_instance, "to_json", None) + if callable(to_json): return self.actual_instance.to_json() else: - return "null" + return json.dumps(self.actual_instance) def to_dict(self) -> dict: """Returns the dict representation of the actual instance""" - if self.actual_instance is not None: + if self.actual_instance is None: + return None + + to_dict = getattr(self.actual_instance, "to_dict", None) + if callable(to_dict): return self.actual_instance.to_dict() else: - return dict() + # primitive type + return self.actual_instance def to_str(self) -> str: """Returns the string representation of the actual instance""" diff --git a/conekta/models/create_risk_rules_data.py b/conekta/models/create_risk_rules_data.py index 0a5f431..9e76b06 100644 --- a/conekta/models/create_risk_rules_data.py +++ b/conekta/models/create_risk_rules_data.py @@ -7,12 +7,13 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -22,10 +23,8 @@ from pydantic import BaseModel, Field, StrictStr class CreateRiskRulesData(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + CreateRiskRulesData """ description: StrictStr = Field(..., description="Description of the rule") field: StrictStr = Field(..., description="Field to be used for the rule") @@ -33,6 +32,7 @@ class CreateRiskRulesData(BaseModel): __properties = ["description", "field", "value"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -63,7 +63,7 @@ def from_dict(cls, obj: dict) -> CreateRiskRulesData: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return CreateRiskRulesData.parse_obj(obj) _obj = CreateRiskRulesData.parse_obj({ diff --git a/conekta/models/customer.py b/conekta/models/customer.py index a029470..857eebd 100644 --- a/conekta/models/customer.py +++ b/conekta/models/customer.py @@ -7,19 +7,20 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json from typing import Any, Dict, List, Optional -from pydantic import BaseModel, Field, StrictBool, StrictStr +from pydantic import BaseModel, Field, StrictBool, StrictStr, conlist from conekta.models.customer_antifraud_info import CustomerAntifraudInfo from conekta.models.customer_fiscal_entities_request import CustomerFiscalEntitiesRequest from conekta.models.customer_payment_methods_request import CustomerPaymentMethodsRequest @@ -27,10 +28,8 @@ from conekta.models.subscription_request import SubscriptionRequest class Customer(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + a customer """ antifraud_info: Optional[CustomerAntifraudInfo] = None corporate: Optional[StrictBool] = Field(False, description="It is a value that allows identifying if the email is corporate or not.") @@ -38,17 +37,18 @@ class Customer(BaseModel): email: StrictStr = Field(..., description="An email address is a series of customizable characters followed by a universal Internet symbol, the at symbol (@), the name of a host server, and a web domain ending (.mx, .com, .org, . net, etc).") default_payment_source_id: Optional[StrictStr] = Field(None, description="It is a parameter that allows to identify in the response, the Conekta ID of a payment method (payment_id)") default_shipping_contact_id: Optional[StrictStr] = Field(None, description="It is a parameter that allows to identify in the response, the Conekta ID of the shipping address (shipping_contact)") - fiscal_entities: Optional[List[CustomerFiscalEntitiesRequest]] = None + fiscal_entities: Optional[conlist(CustomerFiscalEntitiesRequest)] = None metadata: Optional[Dict[str, Any]] = None name: StrictStr = Field(..., description="Client's name") - payment_sources: Optional[List[CustomerPaymentMethodsRequest]] = Field(None, description="Contains details of the payment methods that the customer has active or has used in Conekta") + payment_sources: Optional[conlist(CustomerPaymentMethodsRequest)] = Field(None, description="Contains details of the payment methods that the customer has active or has used in Conekta") phone: StrictStr = Field(..., description="Is the customer's phone number") plan_id: Optional[StrictStr] = Field(None, description="Contains the ID of a plan, which could together with name, email and phone create a client directly to a subscription") - shipping_contacts: Optional[List[CustomerShippingContacts]] = Field(None, description="Contains the detail of the shipping addresses that the client has active or has used in Conekta") + shipping_contacts: Optional[conlist(CustomerShippingContacts)] = Field(None, description="Contains the detail of the shipping addresses that the client has active or has used in Conekta") subscription: Optional[SubscriptionRequest] = None __properties = ["antifraud_info", "corporate", "custom_reference", "email", "default_payment_source_id", "default_shipping_contact_id", "fiscal_entities", "metadata", "name", "payment_sources", "phone", "plan_id", "shipping_contacts", "subscription"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -99,7 +99,8 @@ def to_dict(self): if self.subscription: _dict['subscription'] = self.subscription.to_dict() # set to None if antifraud_info (nullable) is None - if self.antifraud_info is None: + # and __fields_set__ contains the field + if self.antifraud_info is None and "antifraud_info" in self.__fields_set__: _dict['antifraud_info'] = None return _dict @@ -110,7 +111,7 @@ def from_dict(cls, obj: dict) -> Customer: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return Customer.parse_obj(obj) _obj = Customer.parse_obj({ diff --git a/conekta/models/customer_address.py b/conekta/models/customer_address.py index 3b4f49d..308843d 100644 --- a/conekta/models/customer_address.py +++ b/conekta/models/customer_address.py @@ -7,12 +7,13 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -22,15 +23,13 @@ from pydantic import BaseModel, Field, StrictBool, StrictStr class CustomerAddress(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. """ - street1: StrictStr = ... + CustomerAddress + """ + street1: StrictStr = Field(...) street2: Optional[StrictStr] = None - postal_code: StrictStr = ... - city: StrictStr = ... + postal_code: StrictStr = Field(...) + city: StrictStr = Field(...) state: Optional[StrictStr] = None country: Optional[StrictStr] = Field(None, description="this field follows the [ISO 3166-1 alpha-2 standard](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)") residential: Optional[StrictBool] = None @@ -38,6 +37,7 @@ class CustomerAddress(BaseModel): __properties = ["street1", "street2", "postal_code", "city", "state", "country", "residential", "external_number"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -68,7 +68,7 @@ def from_dict(cls, obj: dict) -> CustomerAddress: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return CustomerAddress.parse_obj(obj) _obj = CustomerAddress.parse_obj({ diff --git a/conekta/models/customer_antifraud_info.py b/conekta/models/customer_antifraud_info.py index 5d4f165..06002ae 100644 --- a/conekta/models/customer_antifraud_info.py +++ b/conekta/models/customer_antifraud_info.py @@ -7,12 +7,13 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -22,16 +23,15 @@ from pydantic import BaseModel, StrictInt class CustomerAntifraudInfo(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + CustomerAntifraudInfo """ account_created_at: Optional[StrictInt] = None first_paid_at: Optional[StrictInt] = None __properties = ["account_created_at", "first_paid_at"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -62,7 +62,7 @@ def from_dict(cls, obj: dict) -> CustomerAntifraudInfo: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return CustomerAntifraudInfo.parse_obj(obj) _obj = CustomerAntifraudInfo.parse_obj({ diff --git a/conekta/models/customer_antifraud_info_response.py b/conekta/models/customer_antifraud_info_response.py index 2d5c450..08bef69 100644 --- a/conekta/models/customer_antifraud_info_response.py +++ b/conekta/models/customer_antifraud_info_response.py @@ -7,12 +7,13 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -22,16 +23,15 @@ from pydantic import BaseModel, StrictInt class CustomerAntifraudInfoResponse(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + CustomerAntifraudInfoResponse """ first_paid_at: Optional[StrictInt] = None account_created_at: Optional[StrictInt] = None __properties = ["first_paid_at", "account_created_at"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -62,7 +62,7 @@ def from_dict(cls, obj: dict) -> CustomerAntifraudInfoResponse: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return CustomerAntifraudInfoResponse.parse_obj(obj) _obj = CustomerAntifraudInfoResponse.parse_obj({ diff --git a/conekta/models/customer_fiscal_entities_data_response.py b/conekta/models/customer_fiscal_entities_data_response.py index 9e64a92..35c8ba7 100644 --- a/conekta/models/customer_fiscal_entities_data_response.py +++ b/conekta/models/customer_fiscal_entities_data_response.py @@ -7,41 +7,41 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json from typing import Any, Dict, Optional -from pydantic import BaseModel, StrictBool, StrictInt, StrictStr +from pydantic import BaseModel, Field, StrictBool, StrictInt, StrictStr from conekta.models.customer_fiscal_entities_request_address import CustomerFiscalEntitiesRequestAddress class CustomerFiscalEntitiesDataResponse(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. """ - address: CustomerFiscalEntitiesRequestAddress = ... + CustomerFiscalEntitiesDataResponse + """ + address: CustomerFiscalEntitiesRequestAddress = Field(...) tax_id: Optional[StrictStr] = None email: Optional[StrictStr] = None phone: Optional[StrictStr] = None metadata: Optional[Dict[str, Dict[str, Any]]] = None company_name: Optional[StrictStr] = None - id: StrictStr = ... - object: StrictStr = ... - created_at: StrictInt = ... + id: StrictStr = Field(...) + object: StrictStr = Field(...) + created_at: StrictInt = Field(...) parent_id: Optional[StrictStr] = None default: Optional[StrictBool] = None __properties = ["address", "tax_id", "email", "phone", "metadata", "company_name", "id", "object", "created_at", "parent_id", "default"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -75,7 +75,7 @@ def from_dict(cls, obj: dict) -> CustomerFiscalEntitiesDataResponse: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return CustomerFiscalEntitiesDataResponse.parse_obj(obj) _obj = CustomerFiscalEntitiesDataResponse.parse_obj({ diff --git a/conekta/models/customer_fiscal_entities_request.py b/conekta/models/customer_fiscal_entities_request.py index 216cef2..1450e59 100644 --- a/conekta/models/customer_fiscal_entities_request.py +++ b/conekta/models/customer_fiscal_entities_request.py @@ -7,28 +7,27 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json from typing import Any, Dict, Optional -from pydantic import BaseModel, StrictStr +from pydantic import BaseModel, Field, StrictStr from conekta.models.customer_fiscal_entities_request_address import CustomerFiscalEntitiesRequestAddress class CustomerFiscalEntitiesRequest(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. """ - address: CustomerFiscalEntitiesRequestAddress = ... + CustomerFiscalEntitiesRequest + """ + address: CustomerFiscalEntitiesRequestAddress = Field(...) tax_id: Optional[StrictStr] = None email: Optional[StrictStr] = None phone: Optional[StrictStr] = None @@ -37,6 +36,7 @@ class CustomerFiscalEntitiesRequest(BaseModel): __properties = ["address", "tax_id", "email", "phone", "metadata", "company_name"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -70,7 +70,7 @@ def from_dict(cls, obj: dict) -> CustomerFiscalEntitiesRequest: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return CustomerFiscalEntitiesRequest.parse_obj(obj) _obj = CustomerFiscalEntitiesRequest.parse_obj({ diff --git a/conekta/models/customer_fiscal_entities_request_address.py b/conekta/models/customer_fiscal_entities_request_address.py index 3b255cf..bc5c339 100644 --- a/conekta/models/customer_fiscal_entities_request_address.py +++ b/conekta/models/customer_fiscal_entities_request_address.py @@ -7,12 +7,13 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -22,15 +23,13 @@ from pydantic import BaseModel, Field, StrictBool, StrictStr class CustomerFiscalEntitiesRequestAddress(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. """ - street1: StrictStr = ... + CustomerFiscalEntitiesRequestAddress + """ + street1: StrictStr = Field(...) street2: Optional[StrictStr] = None - postal_code: StrictStr = ... - city: StrictStr = ... + postal_code: StrictStr = Field(...) + city: StrictStr = Field(...) state: Optional[StrictStr] = None country: Optional[StrictStr] = Field(None, description="this field follows the [ISO 3166-1 alpha-2 standard](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)") residential: Optional[StrictBool] = None @@ -38,6 +37,7 @@ class CustomerFiscalEntitiesRequestAddress(BaseModel): __properties = ["street1", "street2", "postal_code", "city", "state", "country", "residential", "external_number"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -68,7 +68,7 @@ def from_dict(cls, obj: dict) -> CustomerFiscalEntitiesRequestAddress: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return CustomerFiscalEntitiesRequestAddress.parse_obj(obj) _obj = CustomerFiscalEntitiesRequestAddress.parse_obj({ diff --git a/conekta/models/customer_fiscal_entities_response.py b/conekta/models/customer_fiscal_entities_response.py index 7addf18..343642e 100644 --- a/conekta/models/customer_fiscal_entities_response.py +++ b/conekta/models/customer_fiscal_entities_response.py @@ -7,33 +7,33 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json from typing import List, Optional -from pydantic import BaseModel, Field, StrictBool, StrictStr +from pydantic import BaseModel, Field, StrictBool, StrictStr, conlist from conekta.models.customer_fiscal_entities_data_response import CustomerFiscalEntitiesDataResponse class CustomerFiscalEntitiesResponse(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + CustomerFiscalEntitiesResponse """ has_more: StrictBool = Field(..., description="Indicates if there are more pages to be requested") object: StrictStr = Field(..., description="Object type, in this case is list") - data: Optional[List[CustomerFiscalEntitiesDataResponse]] = None + data: Optional[conlist(CustomerFiscalEntitiesDataResponse)] = None __properties = ["has_more", "object", "data"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -71,7 +71,7 @@ def from_dict(cls, obj: dict) -> CustomerFiscalEntitiesResponse: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return CustomerFiscalEntitiesResponse.parse_obj(obj) _obj = CustomerFiscalEntitiesResponse.parse_obj({ diff --git a/conekta/models/customer_fiscal_entities_response_all_of.py b/conekta/models/customer_fiscal_entities_response_all_of.py index 524ce6d..83f42b3 100644 --- a/conekta/models/customer_fiscal_entities_response_all_of.py +++ b/conekta/models/customer_fiscal_entities_response_all_of.py @@ -7,31 +7,31 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json from typing import List, Optional -from pydantic import BaseModel +from pydantic import BaseModel, conlist from conekta.models.customer_fiscal_entities_data_response import CustomerFiscalEntitiesDataResponse class CustomerFiscalEntitiesResponseAllOf(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. """ - data: Optional[List[CustomerFiscalEntitiesDataResponse]] = None + CustomerFiscalEntitiesResponseAllOf + """ + data: Optional[conlist(CustomerFiscalEntitiesDataResponse)] = None __properties = ["data"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -69,7 +69,7 @@ def from_dict(cls, obj: dict) -> CustomerFiscalEntitiesResponseAllOf: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return CustomerFiscalEntitiesResponseAllOf.parse_obj(obj) _obj = CustomerFiscalEntitiesResponseAllOf.parse_obj({ diff --git a/conekta/models/customer_info.py b/conekta/models/customer_info.py index 439776c..cc636d8 100644 --- a/conekta/models/customer_info.py +++ b/conekta/models/customer_info.py @@ -7,34 +7,34 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json from typing import Optional -from pydantic import BaseModel, StrictBool, StrictStr +from pydantic import BaseModel, Field, StrictBool, StrictStr class CustomerInfo(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. """ - name: StrictStr = ... - email: StrictStr = ... - phone: StrictStr = ... + CustomerInfo + """ + name: StrictStr = Field(...) + email: StrictStr = Field(...) + phone: StrictStr = Field(...) corporate: Optional[StrictBool] = None object: Optional[StrictStr] = None __properties = ["name", "email", "phone", "corporate", "object"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -65,7 +65,7 @@ def from_dict(cls, obj: dict) -> CustomerInfo: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return CustomerInfo.parse_obj(obj) _obj = CustomerInfo.parse_obj({ diff --git a/conekta/models/customer_info_just_customer_id.py b/conekta/models/customer_info_just_customer_id.py index 07f6cbd..e7b09f0 100644 --- a/conekta/models/customer_info_just_customer_id.py +++ b/conekta/models/customer_info_just_customer_id.py @@ -7,30 +7,30 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json -from pydantic import BaseModel, StrictStr +from pydantic import BaseModel, Field, StrictStr class CustomerInfoJustCustomerId(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. """ - customer_id: StrictStr = ... + CustomerInfoJustCustomerId + """ + customer_id: StrictStr = Field(...) __properties = ["customer_id"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -61,7 +61,7 @@ def from_dict(cls, obj: dict) -> CustomerInfoJustCustomerId: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return CustomerInfoJustCustomerId.parse_obj(obj) _obj = CustomerInfoJustCustomerId.parse_obj({ diff --git a/conekta/models/customer_info_just_customer_id_response.py b/conekta/models/customer_info_just_customer_id_response.py index ddf4744..845679e 100644 --- a/conekta/models/customer_info_just_customer_id_response.py +++ b/conekta/models/customer_info_just_customer_id_response.py @@ -7,12 +7,13 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -22,15 +23,14 @@ from pydantic import BaseModel, StrictStr class CustomerInfoJustCustomerIdResponse(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + CustomerInfoJustCustomerIdResponse """ customer_id: Optional[StrictStr] = None __properties = ["customer_id"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -61,7 +61,7 @@ def from_dict(cls, obj: dict) -> CustomerInfoJustCustomerIdResponse: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return CustomerInfoJustCustomerIdResponse.parse_obj(obj) _obj = CustomerInfoJustCustomerIdResponse.parse_obj({ diff --git a/conekta/models/customer_info_response.py b/conekta/models/customer_info_response.py index edb821b..525c09f 100644 --- a/conekta/models/customer_info_response.py +++ b/conekta/models/customer_info_response.py @@ -7,12 +7,13 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -22,10 +23,8 @@ from pydantic import BaseModel, StrictBool, StrictStr class CustomerInfoResponse(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + CustomerInfoResponse """ name: Optional[StrictStr] = None email: Optional[StrictStr] = None @@ -35,6 +34,7 @@ class CustomerInfoResponse(BaseModel): __properties = ["name", "email", "phone", "corporate", "object"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -65,7 +65,7 @@ def from_dict(cls, obj: dict) -> CustomerInfoResponse: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return CustomerInfoResponse.parse_obj(obj) _obj = CustomerInfoResponse.parse_obj({ diff --git a/conekta/models/customer_payment_method_request.py b/conekta/models/customer_payment_method_request.py index 0966ba4..0aacf83 100644 --- a/conekta/models/customer_payment_method_request.py +++ b/conekta/models/customer_payment_method_request.py @@ -7,12 +7,13 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -22,15 +23,14 @@ from pydantic import BaseModel, Field, StrictStr class CustomerPaymentMethodRequest(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + Contains details of the payment methods that the customer has active or has used in Conekta """ type: StrictStr = Field(..., description="Type of payment method") __properties = ["type"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -61,7 +61,7 @@ def from_dict(cls, obj: dict) -> CustomerPaymentMethodRequest: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return CustomerPaymentMethodRequest.parse_obj(obj) _obj = CustomerPaymentMethodRequest.parse_obj({ diff --git a/conekta/models/customer_payment_methods.py b/conekta/models/customer_payment_methods.py index 1be2ab8..d7dc293 100644 --- a/conekta/models/customer_payment_methods.py +++ b/conekta/models/customer_payment_methods.py @@ -7,31 +7,31 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json from typing import List, Optional -from pydantic import BaseModel +from pydantic import BaseModel, conlist from conekta.models.customer_payment_methods_data import CustomerPaymentMethodsData class CustomerPaymentMethods(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. """ - data: Optional[List[CustomerPaymentMethodsData]] = None + CustomerPaymentMethods + """ + data: Optional[conlist(CustomerPaymentMethodsData)] = None __properties = ["data"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -69,7 +69,7 @@ def from_dict(cls, obj: dict) -> CustomerPaymentMethods: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return CustomerPaymentMethods.parse_obj(obj) _obj = CustomerPaymentMethods.parse_obj({ diff --git a/conekta/models/customer_payment_methods_data.py b/conekta/models/customer_payment_methods_data.py index 2052cc6..9ed27c7 100644 --- a/conekta/models/customer_payment_methods_data.py +++ b/conekta/models/customer_payment_methods_data.py @@ -7,7 +7,9 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ @@ -28,10 +30,8 @@ CUSTOMERPAYMENTMETHODSDATA_ONE_OF_SCHEMAS = ["PaymentMethodCardResponse", "PaymentMethodCashResponse", "PaymentMethodSpeiRecurrent"] class CustomerPaymentMethodsData(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + CustomerPaymentMethodsData """ # data type: PaymentMethodCashResponse oneof_schema_1_validator: Optional[PaymentMethodCashResponse] = None @@ -48,35 +48,42 @@ class Config: discriminator_value_class_map = { } + def __init__(self, *args, **kwargs): + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + @validator('actual_instance') def actual_instance_must_validate_oneof(cls, v): - instance = cls() + instance = CustomerPaymentMethodsData.construct() error_messages = [] match = 0 # validate data type: PaymentMethodCashResponse - if type(v) is not PaymentMethodCashResponse: + if not isinstance(v, PaymentMethodCashResponse): error_messages.append(f"Error! Input type `{type(v)}` is not `PaymentMethodCashResponse`") else: match += 1 - # validate data type: PaymentMethodCardResponse - if type(v) is not PaymentMethodCardResponse: + if not isinstance(v, PaymentMethodCardResponse): error_messages.append(f"Error! Input type `{type(v)}` is not `PaymentMethodCardResponse`") else: match += 1 - # validate data type: PaymentMethodSpeiRecurrent - if type(v) is not PaymentMethodSpeiRecurrent: + if not isinstance(v, PaymentMethodSpeiRecurrent): error_messages.append(f"Error! Input type `{type(v)}` is not `PaymentMethodSpeiRecurrent`") else: match += 1 - if match > 1: # more than 1 match - raise ValueError("Multiple matches found when deserializing the JSON string into CustomerPaymentMethodsData with oneOf schemas: PaymentMethodCardResponse, PaymentMethodCashResponse, PaymentMethodSpeiRecurrent. Details: " + ", ".join(error_messages)) + raise ValueError("Multiple matches found when setting `actual_instance` in CustomerPaymentMethodsData with oneOf schemas: PaymentMethodCardResponse, PaymentMethodCashResponse, PaymentMethodSpeiRecurrent. Details: " + ", ".join(error_messages)) elif match == 0: # no match - raise ValueError("No match found when deserializing the JSON string into CustomerPaymentMethodsData with oneOf schemas: PaymentMethodCardResponse, PaymentMethodCashResponse, PaymentMethodSpeiRecurrent. Details: " + ", ".join(error_messages)) + raise ValueError("No match found when setting `actual_instance` in CustomerPaymentMethodsData with oneOf schemas: PaymentMethodCardResponse, PaymentMethodCashResponse, PaymentMethodSpeiRecurrent. Details: " + ", ".join(error_messages)) else: return v @@ -87,7 +94,7 @@ def from_dict(cls, obj: dict) -> CustomerPaymentMethodsData: @classmethod def from_json(cls, json_str: str) -> CustomerPaymentMethodsData: """Returns the object represented by the json string""" - instance = cls() + instance = CustomerPaymentMethodsData.construct() error_messages = [] match = 0 @@ -135,19 +142,19 @@ def from_json(cls, json_str: str) -> CustomerPaymentMethodsData: try: instance.actual_instance = PaymentMethodCashResponse.from_json(json_str) match += 1 - except ValidationError as e: + except (ValidationError, ValueError) as e: error_messages.append(str(e)) # deserialize data into PaymentMethodCardResponse try: instance.actual_instance = PaymentMethodCardResponse.from_json(json_str) match += 1 - except ValidationError as e: + except (ValidationError, ValueError) as e: error_messages.append(str(e)) # deserialize data into PaymentMethodSpeiRecurrent try: instance.actual_instance = PaymentMethodSpeiRecurrent.from_json(json_str) match += 1 - except ValidationError as e: + except (ValidationError, ValueError) as e: error_messages.append(str(e)) if match > 1: @@ -161,17 +168,26 @@ def from_json(cls, json_str: str) -> CustomerPaymentMethodsData: def to_json(self) -> str: """Returns the JSON representation of the actual instance""" - if self.actual_instance is not None: + if self.actual_instance is None: + return "null" + + to_json = getattr(self.actual_instance, "to_json", None) + if callable(to_json): return self.actual_instance.to_json() else: - return "null" + return json.dumps(self.actual_instance) def to_dict(self) -> dict: """Returns the dict representation of the actual instance""" - if self.actual_instance is not None: + if self.actual_instance is None: + return None + + to_dict = getattr(self.actual_instance, "to_dict", None) + if callable(to_dict): return self.actual_instance.to_dict() else: - return dict() + # primitive type + return self.actual_instance def to_str(self) -> str: """Returns the string representation of the actual instance""" diff --git a/conekta/models/customer_payment_methods_request.py b/conekta/models/customer_payment_methods_request.py index 05200eb..d17651c 100644 --- a/conekta/models/customer_payment_methods_request.py +++ b/conekta/models/customer_payment_methods_request.py @@ -7,7 +7,9 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ @@ -28,10 +30,8 @@ CUSTOMERPAYMENTMETHODSREQUEST_ONE_OF_SCHEMAS = ["PaymentMethodCardRequest", "PaymentMethodCashRequest", "PaymentMethodSpeiRequest"] class CustomerPaymentMethodsRequest(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + CustomerPaymentMethodsRequest """ # data type: PaymentMethodCardRequest oneof_schema_1_validator: Optional[PaymentMethodCardRequest] = None @@ -45,35 +45,42 @@ class CustomerPaymentMethodsRequest(BaseModel): class Config: validate_assignment = True + def __init__(self, *args, **kwargs): + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + @validator('actual_instance') def actual_instance_must_validate_oneof(cls, v): - instance = cls() + instance = CustomerPaymentMethodsRequest.construct() error_messages = [] match = 0 # validate data type: PaymentMethodCardRequest - if type(v) is not PaymentMethodCardRequest: + if not isinstance(v, PaymentMethodCardRequest): error_messages.append(f"Error! Input type `{type(v)}` is not `PaymentMethodCardRequest`") else: match += 1 - # validate data type: PaymentMethodCashRequest - if type(v) is not PaymentMethodCashRequest: + if not isinstance(v, PaymentMethodCashRequest): error_messages.append(f"Error! Input type `{type(v)}` is not `PaymentMethodCashRequest`") else: match += 1 - # validate data type: PaymentMethodSpeiRequest - if type(v) is not PaymentMethodSpeiRequest: + if not isinstance(v, PaymentMethodSpeiRequest): error_messages.append(f"Error! Input type `{type(v)}` is not `PaymentMethodSpeiRequest`") else: match += 1 - if match > 1: # more than 1 match - raise ValueError("Multiple matches found when deserializing the JSON string into CustomerPaymentMethodsRequest with oneOf schemas: PaymentMethodCardRequest, PaymentMethodCashRequest, PaymentMethodSpeiRequest. Details: " + ", ".join(error_messages)) + raise ValueError("Multiple matches found when setting `actual_instance` in CustomerPaymentMethodsRequest with oneOf schemas: PaymentMethodCardRequest, PaymentMethodCashRequest, PaymentMethodSpeiRequest. Details: " + ", ".join(error_messages)) elif match == 0: # no match - raise ValueError("No match found when deserializing the JSON string into CustomerPaymentMethodsRequest with oneOf schemas: PaymentMethodCardRequest, PaymentMethodCashRequest, PaymentMethodSpeiRequest. Details: " + ", ".join(error_messages)) + raise ValueError("No match found when setting `actual_instance` in CustomerPaymentMethodsRequest with oneOf schemas: PaymentMethodCardRequest, PaymentMethodCashRequest, PaymentMethodSpeiRequest. Details: " + ", ".join(error_messages)) else: return v @@ -84,7 +91,7 @@ def from_dict(cls, obj: dict) -> CustomerPaymentMethodsRequest: @classmethod def from_json(cls, json_str: str) -> CustomerPaymentMethodsRequest: """Returns the object represented by the json string""" - instance = cls() + instance = CustomerPaymentMethodsRequest.construct() error_messages = [] match = 0 @@ -92,19 +99,19 @@ def from_json(cls, json_str: str) -> CustomerPaymentMethodsRequest: try: instance.actual_instance = PaymentMethodCardRequest.from_json(json_str) match += 1 - except ValidationError as e: + except (ValidationError, ValueError) as e: error_messages.append(str(e)) # deserialize data into PaymentMethodCashRequest try: instance.actual_instance = PaymentMethodCashRequest.from_json(json_str) match += 1 - except ValidationError as e: + except (ValidationError, ValueError) as e: error_messages.append(str(e)) # deserialize data into PaymentMethodSpeiRequest try: instance.actual_instance = PaymentMethodSpeiRequest.from_json(json_str) match += 1 - except ValidationError as e: + except (ValidationError, ValueError) as e: error_messages.append(str(e)) if match > 1: @@ -118,17 +125,26 @@ def from_json(cls, json_str: str) -> CustomerPaymentMethodsRequest: def to_json(self) -> str: """Returns the JSON representation of the actual instance""" - if self.actual_instance is not None: + if self.actual_instance is None: + return "null" + + to_json = getattr(self.actual_instance, "to_json", None) + if callable(to_json): return self.actual_instance.to_json() else: - return "null" + return json.dumps(self.actual_instance) def to_dict(self) -> dict: """Returns the dict representation of the actual instance""" - if self.actual_instance is not None: + if self.actual_instance is None: + return None + + to_dict = getattr(self.actual_instance, "to_dict", None) + if callable(to_dict): return self.actual_instance.to_dict() else: - return dict() + # primitive type + return self.actual_instance def to_str(self) -> str: """Returns the string representation of the actual instance""" diff --git a/conekta/models/customer_payment_methods_response.py b/conekta/models/customer_payment_methods_response.py index 1462c1a..b9b55ce 100644 --- a/conekta/models/customer_payment_methods_response.py +++ b/conekta/models/customer_payment_methods_response.py @@ -7,35 +7,35 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json from typing import List, Optional -from pydantic import BaseModel, Field, StrictBool, StrictStr +from pydantic import BaseModel, Field, StrictBool, StrictStr, conlist from conekta.models.customer_payment_methods_data import CustomerPaymentMethodsData class CustomerPaymentMethodsResponse(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + CustomerPaymentMethodsResponse """ has_more: StrictBool = Field(..., description="Indicates if there are more pages to be requested") object: StrictStr = Field(..., description="Object type, in this case is list") next_page_url: Optional[StrictStr] = Field(None, description="URL of the next page.") previous_page_url: Optional[StrictStr] = Field(None, description="Url of the previous page.") - data: Optional[List[CustomerPaymentMethodsData]] = None + data: Optional[conlist(CustomerPaymentMethodsData)] = None __properties = ["has_more", "object", "next_page_url", "previous_page_url", "data"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -66,11 +66,13 @@ def to_dict(self): _items.append(_item.to_dict()) _dict['data'] = _items # set to None if next_page_url (nullable) is None - if self.next_page_url is None: + # and __fields_set__ contains the field + if self.next_page_url is None and "next_page_url" in self.__fields_set__: _dict['next_page_url'] = None # set to None if previous_page_url (nullable) is None - if self.previous_page_url is None: + # and __fields_set__ contains the field + if self.previous_page_url is None and "previous_page_url" in self.__fields_set__: _dict['previous_page_url'] = None return _dict @@ -81,7 +83,7 @@ def from_dict(cls, obj: dict) -> CustomerPaymentMethodsResponse: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return CustomerPaymentMethodsResponse.parse_obj(obj) _obj = CustomerPaymentMethodsResponse.parse_obj({ diff --git a/conekta/models/customer_response.py b/conekta/models/customer_response.py index e88079b..ec920c0 100644 --- a/conekta/models/customer_response.py +++ b/conekta/models/customer_response.py @@ -7,19 +7,20 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json from typing import Optional -from pydantic import BaseModel, StrictBool, StrictInt, StrictStr +from pydantic import BaseModel, Field, StrictBool, StrictInt, StrictStr from conekta.models.customer_antifraud_info_response import CustomerAntifraudInfoResponse from conekta.models.customer_fiscal_entities_response import CustomerFiscalEntitiesResponse from conekta.models.customer_payment_methods_response import CustomerPaymentMethodsResponse @@ -27,24 +28,22 @@ from conekta.models.subscription_response import SubscriptionResponse class CustomerResponse(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + customer response """ antifraud_info: Optional[CustomerAntifraudInfoResponse] = None corporate: Optional[StrictBool] = None - created_at: StrictInt = ... + created_at: StrictInt = Field(...) custom_reference: Optional[StrictStr] = None default_fiscal_entity_id: Optional[StrictStr] = None default_shipping_contact_id: Optional[StrictStr] = None default_payment_source_id: Optional[StrictStr] = None email: Optional[StrictStr] = None fiscal_entities: Optional[CustomerFiscalEntitiesResponse] = None - id: StrictStr = ... - livemode: StrictBool = ... + id: StrictStr = Field(...) + livemode: StrictBool = Field(...) name: Optional[StrictStr] = None - object: StrictStr = ... + object: StrictStr = Field(...) payment_sources: Optional[CustomerPaymentMethodsResponse] = None phone: Optional[StrictStr] = None shipping_contacts: Optional[CustomerResponseShippingContacts] = None @@ -52,6 +51,7 @@ class CustomerResponse(BaseModel): __properties = ["antifraud_info", "corporate", "created_at", "custom_reference", "default_fiscal_entity_id", "default_shipping_contact_id", "default_payment_source_id", "email", "fiscal_entities", "id", "livemode", "name", "object", "payment_sources", "phone", "shipping_contacts", "subscription"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -90,15 +90,18 @@ def to_dict(self): if self.subscription: _dict['subscription'] = self.subscription.to_dict() # set to None if antifraud_info (nullable) is None - if self.antifraud_info is None: + # and __fields_set__ contains the field + if self.antifraud_info is None and "antifraud_info" in self.__fields_set__: _dict['antifraud_info'] = None # set to None if default_fiscal_entity_id (nullable) is None - if self.default_fiscal_entity_id is None: + # and __fields_set__ contains the field + if self.default_fiscal_entity_id is None and "default_fiscal_entity_id" in self.__fields_set__: _dict['default_fiscal_entity_id'] = None # set to None if default_payment_source_id (nullable) is None - if self.default_payment_source_id is None: + # and __fields_set__ contains the field + if self.default_payment_source_id is None and "default_payment_source_id" in self.__fields_set__: _dict['default_payment_source_id'] = None return _dict @@ -109,7 +112,7 @@ def from_dict(cls, obj: dict) -> CustomerResponse: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return CustomerResponse.parse_obj(obj) _obj = CustomerResponse.parse_obj({ diff --git a/conekta/models/customer_response_shipping_contacts.py b/conekta/models/customer_response_shipping_contacts.py index e3fff37..6d16d24 100644 --- a/conekta/models/customer_response_shipping_contacts.py +++ b/conekta/models/customer_response_shipping_contacts.py @@ -7,33 +7,33 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json from typing import List, Optional -from pydantic import BaseModel, Field, StrictBool, StrictStr +from pydantic import BaseModel, Field, StrictBool, StrictStr, conlist from conekta.models.customer_shipping_contacts_data_response import CustomerShippingContactsDataResponse class CustomerResponseShippingContacts(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + CustomerResponseShippingContacts """ has_more: StrictBool = Field(..., description="Indicates if there are more pages to be requested") object: StrictStr = Field(..., description="Object type, in this case is list") - data: Optional[List[CustomerShippingContactsDataResponse]] = None + data: Optional[conlist(CustomerShippingContactsDataResponse)] = None __properties = ["has_more", "object", "data"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -71,7 +71,7 @@ def from_dict(cls, obj: dict) -> CustomerResponseShippingContacts: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return CustomerResponseShippingContacts.parse_obj(obj) _obj = CustomerResponseShippingContacts.parse_obj({ diff --git a/conekta/models/customer_response_shipping_contacts_all_of.py b/conekta/models/customer_response_shipping_contacts_all_of.py index c39a6bd..86e9a39 100644 --- a/conekta/models/customer_response_shipping_contacts_all_of.py +++ b/conekta/models/customer_response_shipping_contacts_all_of.py @@ -7,31 +7,31 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json from typing import List, Optional -from pydantic import BaseModel +from pydantic import BaseModel, conlist from conekta.models.customer_shipping_contacts_data_response import CustomerShippingContactsDataResponse class CustomerResponseShippingContactsAllOf(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. """ - data: Optional[List[CustomerShippingContactsDataResponse]] = None + CustomerResponseShippingContactsAllOf + """ + data: Optional[conlist(CustomerShippingContactsDataResponse)] = None __properties = ["data"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -69,7 +69,7 @@ def from_dict(cls, obj: dict) -> CustomerResponseShippingContactsAllOf: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return CustomerResponseShippingContactsAllOf.parse_obj(obj) _obj = CustomerResponseShippingContactsAllOf.parse_obj({ diff --git a/conekta/models/customer_shipping_contacts.py b/conekta/models/customer_shipping_contacts.py index 2f3b4bb..1bc3af0 100644 --- a/conekta/models/customer_shipping_contacts.py +++ b/conekta/models/customer_shipping_contacts.py @@ -7,12 +7,13 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -23,21 +24,20 @@ from conekta.models.customer_shipping_contacts_address import CustomerShippingContactsAddress class CustomerShippingContacts(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + [Shipping](https://developers.conekta.com/v2.1.0/reference/createcustomershippingcontacts) details, required in case of sending a shipping. If we do not receive a shipping_contact on the order, the default shipping_contact of the customer will be used. """ phone: Optional[StrictStr] = Field(None, description="Phone contact") receiver: Optional[StrictStr] = Field(None, description="Name of the person who will receive the order") between_streets: Optional[StrictStr] = Field(None, description="The street names between which the order will be delivered.") - address: CustomerShippingContactsAddress = ... + address: CustomerShippingContactsAddress = Field(...) parent_id: Optional[StrictStr] = None default: Optional[StrictBool] = None deleted: Optional[StrictBool] = None __properties = ["phone", "receiver", "between_streets", "address", "parent_id", "default", "deleted"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -64,11 +64,13 @@ def to_dict(self): if self.address: _dict['address'] = self.address.to_dict() # set to None if default (nullable) is None - if self.default is None: + # and __fields_set__ contains the field + if self.default is None and "default" in self.__fields_set__: _dict['default'] = None # set to None if deleted (nullable) is None - if self.deleted is None: + # and __fields_set__ contains the field + if self.deleted is None and "deleted" in self.__fields_set__: _dict['deleted'] = None return _dict @@ -79,7 +81,7 @@ def from_dict(cls, obj: dict) -> CustomerShippingContacts: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return CustomerShippingContacts.parse_obj(obj) _obj = CustomerShippingContacts.parse_obj({ diff --git a/conekta/models/customer_shipping_contacts_address.py b/conekta/models/customer_shipping_contacts_address.py index 178a756..1cdc3bd 100644 --- a/conekta/models/customer_shipping_contacts_address.py +++ b/conekta/models/customer_shipping_contacts_address.py @@ -7,12 +7,13 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -22,10 +23,8 @@ from pydantic import BaseModel, Field, StrictBool, StrictStr class CustomerShippingContactsAddress(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + Address of the person who will receive the order """ street1: Optional[StrictStr] = None street2: Optional[StrictStr] = None @@ -37,6 +36,7 @@ class CustomerShippingContactsAddress(BaseModel): __properties = ["street1", "street2", "postal_code", "city", "state", "country", "residential"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -60,7 +60,8 @@ def to_dict(self): }, exclude_none=True) # set to None if residential (nullable) is None - if self.residential is None: + # and __fields_set__ contains the field + if self.residential is None and "residential" in self.__fields_set__: _dict['residential'] = None return _dict @@ -71,7 +72,7 @@ def from_dict(cls, obj: dict) -> CustomerShippingContactsAddress: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return CustomerShippingContactsAddress.parse_obj(obj) _obj = CustomerShippingContactsAddress.parse_obj({ diff --git a/conekta/models/customer_shipping_contacts_data_response.py b/conekta/models/customer_shipping_contacts_data_response.py index b9b9820..96c039e 100644 --- a/conekta/models/customer_shipping_contacts_data_response.py +++ b/conekta/models/customer_shipping_contacts_data_response.py @@ -7,12 +7,13 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -23,24 +24,23 @@ from conekta.models.customer_shipping_contacts_address import CustomerShippingContactsAddress class CustomerShippingContactsDataResponse(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + CustomerShippingContactsDataResponse """ phone: Optional[StrictStr] = Field(None, description="Phone contact") receiver: Optional[StrictStr] = Field(None, description="Name of the person who will receive the order") between_streets: Optional[StrictStr] = Field(None, description="The street names between which the order will be delivered.") - address: CustomerShippingContactsAddress = ... + address: CustomerShippingContactsAddress = Field(...) parent_id: Optional[StrictStr] = None default: Optional[StrictBool] = None deleted: Optional[StrictBool] = None - id: StrictStr = ... - object: StrictStr = ... - created_at: StrictInt = ... + id: StrictStr = Field(...) + object: StrictStr = Field(...) + created_at: StrictInt = Field(...) __properties = ["phone", "receiver", "between_streets", "address", "parent_id", "default", "deleted", "id", "object", "created_at"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -67,11 +67,13 @@ def to_dict(self): if self.address: _dict['address'] = self.address.to_dict() # set to None if default (nullable) is None - if self.default is None: + # and __fields_set__ contains the field + if self.default is None and "default" in self.__fields_set__: _dict['default'] = None # set to None if deleted (nullable) is None - if self.deleted is None: + # and __fields_set__ contains the field + if self.deleted is None and "deleted" in self.__fields_set__: _dict['deleted'] = None return _dict @@ -82,7 +84,7 @@ def from_dict(cls, obj: dict) -> CustomerShippingContactsDataResponse: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return CustomerShippingContactsDataResponse.parse_obj(obj) _obj = CustomerShippingContactsDataResponse.parse_obj({ diff --git a/conekta/models/customer_shipping_contacts_data_response_all_of.py b/conekta/models/customer_shipping_contacts_data_response_all_of.py index f3c861b..5894cca 100644 --- a/conekta/models/customer_shipping_contacts_data_response_all_of.py +++ b/conekta/models/customer_shipping_contacts_data_response_all_of.py @@ -7,32 +7,32 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json -from pydantic import BaseModel, StrictInt, StrictStr +from pydantic import BaseModel, Field, StrictInt, StrictStr class CustomerShippingContactsDataResponseAllOf(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. """ - id: StrictStr = ... - object: StrictStr = ... - created_at: StrictInt = ... + CustomerShippingContactsDataResponseAllOf + """ + id: StrictStr = Field(...) + object: StrictStr = Field(...) + created_at: StrictInt = Field(...) __properties = ["id", "object", "created_at"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -63,7 +63,7 @@ def from_dict(cls, obj: dict) -> CustomerShippingContactsDataResponseAllOf: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return CustomerShippingContactsDataResponseAllOf.parse_obj(obj) _obj = CustomerShippingContactsDataResponseAllOf.parse_obj({ diff --git a/conekta/models/customer_shipping_contacts_response.py b/conekta/models/customer_shipping_contacts_response.py index e9b2e62..c17b6ff 100644 --- a/conekta/models/customer_shipping_contacts_response.py +++ b/conekta/models/customer_shipping_contacts_response.py @@ -7,12 +7,13 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -23,10 +24,8 @@ from conekta.models.customer_shipping_contacts_response_address import CustomerShippingContactsResponseAddress class CustomerShippingContactsResponse(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + Contains the detail of the shipping addresses that the client has active or has used in Conekta """ phone: Optional[StrictStr] = None receiver: Optional[StrictStr] = None @@ -41,6 +40,7 @@ class CustomerShippingContactsResponse(BaseModel): __properties = ["phone", "receiver", "between_streets", "address", "parent_id", "default", "id", "created_at", "object", "deleted"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -67,7 +67,8 @@ def to_dict(self): if self.address: _dict['address'] = self.address.to_dict() # set to None if between_streets (nullable) is None - if self.between_streets is None: + # and __fields_set__ contains the field + if self.between_streets is None and "between_streets" in self.__fields_set__: _dict['between_streets'] = None return _dict @@ -78,7 +79,7 @@ def from_dict(cls, obj: dict) -> CustomerShippingContactsResponse: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return CustomerShippingContactsResponse.parse_obj(obj) _obj = CustomerShippingContactsResponse.parse_obj({ diff --git a/conekta/models/customer_shipping_contacts_response_address.py b/conekta/models/customer_shipping_contacts_response_address.py index 7282af6..c05a0b7 100644 --- a/conekta/models/customer_shipping_contacts_response_address.py +++ b/conekta/models/customer_shipping_contacts_response_address.py @@ -7,12 +7,13 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -22,10 +23,8 @@ from pydantic import BaseModel, StrictBool, StrictStr class CustomerShippingContactsResponseAddress(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + CustomerShippingContactsResponseAddress """ object: Optional[StrictStr] = None street1: Optional[StrictStr] = None @@ -38,6 +37,7 @@ class CustomerShippingContactsResponseAddress(BaseModel): __properties = ["object", "street1", "street2", "postal_code", "city", "state", "country", "residential"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -68,7 +68,7 @@ def from_dict(cls, obj: dict) -> CustomerShippingContactsResponseAddress: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return CustomerShippingContactsResponseAddress.parse_obj(obj) _obj = CustomerShippingContactsResponseAddress.parse_obj({ diff --git a/conekta/models/customer_update_fiscal_entities_request.py b/conekta/models/customer_update_fiscal_entities_request.py index 4744acd..22afc1f 100644 --- a/conekta/models/customer_update_fiscal_entities_request.py +++ b/conekta/models/customer_update_fiscal_entities_request.py @@ -7,12 +7,13 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -23,10 +24,8 @@ from conekta.models.customer_fiscal_entities_request_address import CustomerFiscalEntitiesRequestAddress class CustomerUpdateFiscalEntitiesRequest(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + CustomerUpdateFiscalEntitiesRequest """ address: Optional[CustomerFiscalEntitiesRequestAddress] = None tax_id: Optional[StrictStr] = None @@ -37,6 +36,7 @@ class CustomerUpdateFiscalEntitiesRequest(BaseModel): __properties = ["address", "tax_id", "email", "phone", "metadata", "company_name"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -70,7 +70,7 @@ def from_dict(cls, obj: dict) -> CustomerUpdateFiscalEntitiesRequest: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return CustomerUpdateFiscalEntitiesRequest.parse_obj(obj) _obj = CustomerUpdateFiscalEntitiesRequest.parse_obj({ diff --git a/conekta/models/customer_update_shipping_contacts.py b/conekta/models/customer_update_shipping_contacts.py index 1e6fbe0..98303f9 100644 --- a/conekta/models/customer_update_shipping_contacts.py +++ b/conekta/models/customer_update_shipping_contacts.py @@ -7,12 +7,13 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -23,10 +24,8 @@ from conekta.models.customer_shipping_contacts_address import CustomerShippingContactsAddress class CustomerUpdateShippingContacts(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + [Shipping](https://developers.conekta.com/v2.1.0/reference/createcustomershippingcontacts) details, required in case of sending a shipping. If we do not receive a shipping_contact on the order, the default shipping_contact of the customer will be used. """ phone: Optional[StrictStr] = Field(None, description="Phone contact") receiver: Optional[StrictStr] = Field(None, description="Name of the person who will receive the order") @@ -38,6 +37,7 @@ class CustomerUpdateShippingContacts(BaseModel): __properties = ["phone", "receiver", "between_streets", "address", "parent_id", "default", "deleted"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -64,11 +64,13 @@ def to_dict(self): if self.address: _dict['address'] = self.address.to_dict() # set to None if default (nullable) is None - if self.default is None: + # and __fields_set__ contains the field + if self.default is None and "default" in self.__fields_set__: _dict['default'] = None # set to None if deleted (nullable) is None - if self.deleted is None: + # and __fields_set__ contains the field + if self.deleted is None and "deleted" in self.__fields_set__: _dict['deleted'] = None return _dict @@ -79,7 +81,7 @@ def from_dict(cls, obj: dict) -> CustomerUpdateShippingContacts: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return CustomerUpdateShippingContacts.parse_obj(obj) _obj = CustomerUpdateShippingContacts.parse_obj({ diff --git a/conekta/models/customers_response.py b/conekta/models/customers_response.py index aeaca0f..01ca42c 100644 --- a/conekta/models/customers_response.py +++ b/conekta/models/customers_response.py @@ -7,28 +7,27 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json from typing import List, Optional -from pydantic import BaseModel, Field, StrictBool, StrictStr +from pydantic import BaseModel, Field, StrictBool, StrictStr, conlist from conekta.models.customer_response import CustomerResponse class CustomersResponse(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. """ - data: Optional[List[CustomerResponse]] = None + CustomersResponse + """ + data: Optional[conlist(CustomerResponse)] = None has_more: StrictBool = Field(..., description="Indicates if there are more pages to be requested") object: StrictStr = Field(..., description="Object type, in this case is list") next_page_url: Optional[StrictStr] = Field(None, description="URL of the next page.") @@ -36,6 +35,7 @@ class CustomersResponse(BaseModel): __properties = ["data", "has_more", "object", "next_page_url", "previous_page_url"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -66,11 +66,13 @@ def to_dict(self): _items.append(_item.to_dict()) _dict['data'] = _items # set to None if next_page_url (nullable) is None - if self.next_page_url is None: + # and __fields_set__ contains the field + if self.next_page_url is None and "next_page_url" in self.__fields_set__: _dict['next_page_url'] = None # set to None if previous_page_url (nullable) is None - if self.previous_page_url is None: + # and __fields_set__ contains the field + if self.previous_page_url is None and "previous_page_url" in self.__fields_set__: _dict['previous_page_url'] = None return _dict @@ -81,7 +83,7 @@ def from_dict(cls, obj: dict) -> CustomersResponse: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return CustomersResponse.parse_obj(obj) _obj = CustomersResponse.parse_obj({ diff --git a/conekta/models/customers_response_all_of.py b/conekta/models/customers_response_all_of.py index 416b689..01d248e 100644 --- a/conekta/models/customers_response_all_of.py +++ b/conekta/models/customers_response_all_of.py @@ -7,31 +7,31 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json from typing import List, Optional -from pydantic import BaseModel +from pydantic import BaseModel, conlist from conekta.models.customer_response import CustomerResponse class CustomersResponseAllOf(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. """ - data: Optional[List[CustomerResponse]] = None + CustomersResponseAllOf + """ + data: Optional[conlist(CustomerResponse)] = None __properties = ["data"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -69,7 +69,7 @@ def from_dict(cls, obj: dict) -> CustomersResponseAllOf: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return CustomersResponseAllOf.parse_obj(obj) _obj = CustomersResponseAllOf.parse_obj({ diff --git a/conekta/models/delete_api_keys_response.py b/conekta/models/delete_api_keys_response.py index 4fdadc3..9bbf6c7 100644 --- a/conekta/models/delete_api_keys_response.py +++ b/conekta/models/delete_api_keys_response.py @@ -7,12 +7,13 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -22,10 +23,8 @@ from pydantic import BaseModel, Field, StrictBool, StrictInt, StrictStr class DeleteApiKeysResponse(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + DeleteApiKeysResponse """ active: Optional[StrictBool] = Field(None, description="Indicates if the api key is active") created_at: Optional[StrictInt] = Field(None, description="Unix timestamp in seconds with the creation date of the api key") @@ -39,6 +38,7 @@ class DeleteApiKeysResponse(BaseModel): __properties = ["active", "created_at", "description", "id", "livemode", "object", "prefix", "role", "deleted"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -69,7 +69,7 @@ def from_dict(cls, obj: dict) -> DeleteApiKeysResponse: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return DeleteApiKeysResponse.parse_obj(obj) _obj = DeleteApiKeysResponse.parse_obj({ diff --git a/conekta/models/delete_api_keys_response_all_of.py b/conekta/models/delete_api_keys_response_all_of.py index b67604d..1f5af50 100644 --- a/conekta/models/delete_api_keys_response_all_of.py +++ b/conekta/models/delete_api_keys_response_all_of.py @@ -7,12 +7,13 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -22,15 +23,14 @@ from pydantic import BaseModel, StrictBool class DeleteApiKeysResponseAllOf(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + DeleteApiKeysResponseAllOf """ deleted: Optional[StrictBool] = None __properties = ["deleted"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -61,7 +61,7 @@ def from_dict(cls, obj: dict) -> DeleteApiKeysResponseAllOf: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return DeleteApiKeysResponseAllOf.parse_obj(obj) _obj = DeleteApiKeysResponseAllOf.parse_obj({ diff --git a/conekta/models/deleted_blacklist_rule_response.py b/conekta/models/deleted_blacklist_rule_response.py index 8851649..06d1856 100644 --- a/conekta/models/deleted_blacklist_rule_response.py +++ b/conekta/models/deleted_blacklist_rule_response.py @@ -7,12 +7,13 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -22,10 +23,8 @@ from pydantic import BaseModel, Field, StrictStr class DeletedBlacklistRuleResponse(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + DeletedBlacklistRuleResponse """ id: Optional[StrictStr] = Field(None, description="Blacklist rule id") field: Optional[StrictStr] = Field(None, description="field used for blacklists rule deleted") @@ -34,6 +33,7 @@ class DeletedBlacklistRuleResponse(BaseModel): __properties = ["id", "field", "value", "description"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -64,7 +64,7 @@ def from_dict(cls, obj: dict) -> DeletedBlacklistRuleResponse: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return DeletedBlacklistRuleResponse.parse_obj(obj) _obj = DeletedBlacklistRuleResponse.parse_obj({ diff --git a/conekta/models/deleted_whitelist_rule_response.py b/conekta/models/deleted_whitelist_rule_response.py index d9823a9..2878ca0 100644 --- a/conekta/models/deleted_whitelist_rule_response.py +++ b/conekta/models/deleted_whitelist_rule_response.py @@ -7,12 +7,13 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -22,10 +23,8 @@ from pydantic import BaseModel, Field, StrictStr class DeletedWhitelistRuleResponse(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + DeletedWhitelistRuleResponse """ id: Optional[StrictStr] = Field(None, description="Whitelist rule id") field: Optional[StrictStr] = Field(None, description="field used for whitelists rule deleted") @@ -34,6 +33,7 @@ class DeletedWhitelistRuleResponse(BaseModel): __properties = ["id", "field", "value", "description"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -64,7 +64,7 @@ def from_dict(cls, obj: dict) -> DeletedWhitelistRuleResponse: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return DeletedWhitelistRuleResponse.parse_obj(obj) _obj = DeletedWhitelistRuleResponse.parse_obj({ diff --git a/conekta/models/details.py b/conekta/models/details.py index acf7645..225112b 100644 --- a/conekta/models/details.py +++ b/conekta/models/details.py @@ -7,31 +7,31 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json from typing import List, Optional -from pydantic import BaseModel +from pydantic import BaseModel, conlist from conekta.models.details_error import DetailsError class Details(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. """ - details: Optional[List[DetailsError]] = None + Details + """ + details: Optional[conlist(DetailsError)] = None __properties = ["details"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -69,7 +69,7 @@ def from_dict(cls, obj: dict) -> Details: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return Details.parse_obj(obj) _obj = Details.parse_obj({ diff --git a/conekta/models/details_error.py b/conekta/models/details_error.py index a9b6b21..807deb6 100644 --- a/conekta/models/details_error.py +++ b/conekta/models/details_error.py @@ -7,12 +7,13 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -22,10 +23,8 @@ from pydantic import BaseModel, StrictStr class DetailsError(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + DetailsError """ code: Optional[StrictStr] = None param: Optional[StrictStr] = None @@ -34,6 +33,7 @@ class DetailsError(BaseModel): __properties = ["code", "param", "message", "debug_message"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -57,7 +57,8 @@ def to_dict(self): }, exclude_none=True) # set to None if param (nullable) is None - if self.param is None: + # and __fields_set__ contains the field + if self.param is None and "param" in self.__fields_set__: _dict['param'] = None return _dict @@ -68,7 +69,7 @@ def from_dict(cls, obj: dict) -> DetailsError: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return DetailsError.parse_obj(obj) _obj = DetailsError.parse_obj({ diff --git a/conekta/models/discount_lines_data_response.py b/conekta/models/discount_lines_data_response.py index 66e6290..a828018 100644 --- a/conekta/models/discount_lines_data_response.py +++ b/conekta/models/discount_lines_data_response.py @@ -7,12 +7,13 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -22,10 +23,8 @@ from pydantic import BaseModel, Field, StrictStr, conint class DiscountLinesDataResponse(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + DiscountLinesDataResponse """ amount: conint(strict=True, ge=0) = Field(..., description="The amount to be deducted from the total sum of all payments, in cents.") code: StrictStr = Field(..., description="Discount code.") @@ -36,6 +35,7 @@ class DiscountLinesDataResponse(BaseModel): __properties = ["amount", "code", "type", "id", "object", "parent_id"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -66,7 +66,7 @@ def from_dict(cls, obj: dict) -> DiscountLinesDataResponse: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return DiscountLinesDataResponse.parse_obj(obj) _obj = DiscountLinesDataResponse.parse_obj({ diff --git a/conekta/models/discount_lines_response.py b/conekta/models/discount_lines_response.py index fe39632..66b62c1 100644 --- a/conekta/models/discount_lines_response.py +++ b/conekta/models/discount_lines_response.py @@ -7,12 +7,13 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -22,10 +23,8 @@ from pydantic import BaseModel, Field, StrictStr, conint class DiscountLinesResponse(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + DiscountLinesResponse """ amount: conint(strict=True, ge=0) = Field(..., description="The amount to be deducted from the total sum of all payments, in cents.") code: StrictStr = Field(..., description="Discount code.") @@ -36,6 +35,7 @@ class DiscountLinesResponse(BaseModel): __properties = ["amount", "code", "type", "id", "object", "parent_id"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -66,7 +66,7 @@ def from_dict(cls, obj: dict) -> DiscountLinesResponse: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return DiscountLinesResponse.parse_obj(obj) _obj = DiscountLinesResponse.parse_obj({ diff --git a/conekta/models/discount_lines_response_all_of.py b/conekta/models/discount_lines_response_all_of.py index 91196df..fc71b9a 100644 --- a/conekta/models/discount_lines_response_all_of.py +++ b/conekta/models/discount_lines_response_all_of.py @@ -7,12 +7,13 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -22,10 +23,8 @@ from pydantic import BaseModel, StrictStr class DiscountLinesResponseAllOf(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + DiscountLinesResponseAllOf """ id: Optional[StrictStr] = None object: Optional[StrictStr] = None @@ -33,6 +32,7 @@ class DiscountLinesResponseAllOf(BaseModel): __properties = ["id", "object", "parent_id"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -63,7 +63,7 @@ def from_dict(cls, obj: dict) -> DiscountLinesResponseAllOf: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return DiscountLinesResponseAllOf.parse_obj(obj) _obj = DiscountLinesResponseAllOf.parse_obj({ diff --git a/conekta/models/email_checkout_request.py b/conekta/models/email_checkout_request.py index e630205..c6ad33e 100644 --- a/conekta/models/email_checkout_request.py +++ b/conekta/models/email_checkout_request.py @@ -7,30 +7,30 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json -from pydantic import BaseModel, StrictStr +from pydantic import BaseModel, Field, StrictStr class EmailCheckoutRequest(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. """ - email: StrictStr = ... + EmailCheckoutRequest + """ + email: StrictStr = Field(...) __properties = ["email"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -61,7 +61,7 @@ def from_dict(cls, obj: dict) -> EmailCheckoutRequest: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return EmailCheckoutRequest.parse_obj(obj) _obj = EmailCheckoutRequest.parse_obj({ diff --git a/conekta/models/error.py b/conekta/models/error.py index 3fd4179..5833e9a 100644 --- a/conekta/models/error.py +++ b/conekta/models/error.py @@ -7,34 +7,34 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json from typing import List, Optional -from pydantic import BaseModel, Field, StrictStr +from pydantic import BaseModel, Field, StrictStr, conlist from conekta.models.details_error import DetailsError class Error(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. """ - details: Optional[List[DetailsError]] = None + err model + """ + details: Optional[conlist(DetailsError)] = None log_id: Optional[StrictStr] = Field(None, description="log id") type: Optional[StrictStr] = None object: Optional[StrictStr] = None __properties = ["details", "log_id", "type", "object"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -65,7 +65,8 @@ def to_dict(self): _items.append(_item.to_dict()) _dict['details'] = _items # set to None if log_id (nullable) is None - if self.log_id is None: + # and __fields_set__ contains the field + if self.log_id is None and "log_id" in self.__fields_set__: _dict['log_id'] = None return _dict @@ -76,7 +77,7 @@ def from_dict(cls, obj: dict) -> Error: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return Error.parse_obj(obj) _obj = Error.parse_obj({ diff --git a/conekta/models/error_all_of.py b/conekta/models/error_all_of.py index a227660..17a7d9a 100644 --- a/conekta/models/error_all_of.py +++ b/conekta/models/error_all_of.py @@ -7,12 +7,13 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -22,10 +23,8 @@ from pydantic import BaseModel, Field, StrictStr class ErrorAllOf(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + ErrorAllOf """ log_id: Optional[StrictStr] = Field(None, description="log id") type: Optional[StrictStr] = None @@ -33,6 +32,7 @@ class ErrorAllOf(BaseModel): __properties = ["log_id", "type", "object"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -56,7 +56,8 @@ def to_dict(self): }, exclude_none=True) # set to None if log_id (nullable) is None - if self.log_id is None: + # and __fields_set__ contains the field + if self.log_id is None and "log_id" in self.__fields_set__: _dict['log_id'] = None return _dict @@ -67,7 +68,7 @@ def from_dict(cls, obj: dict) -> ErrorAllOf: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return ErrorAllOf.parse_obj(obj) _obj = ErrorAllOf.parse_obj({ diff --git a/conekta/models/event_response.py b/conekta/models/event_response.py index b678f16..d6acec6 100644 --- a/conekta/models/event_response.py +++ b/conekta/models/event_response.py @@ -7,26 +7,25 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json from typing import Any, Dict, List, Optional -from pydantic import BaseModel, StrictBool, StrictInt, StrictStr +from pydantic import BaseModel, StrictBool, StrictInt, StrictStr, conlist from conekta.models.webhook_log import WebhookLog class EventResponse(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + event model """ created_at: Optional[StrictInt] = None data: Optional[Dict[str, Any]] = None @@ -34,11 +33,12 @@ class EventResponse(BaseModel): livemode: Optional[StrictBool] = None object: Optional[StrictStr] = None type: Optional[StrictStr] = None - webhook_logs: Optional[List[WebhookLog]] = None + webhook_logs: Optional[conlist(WebhookLog)] = None webhook_status: Optional[StrictStr] = None __properties = ["created_at", "data", "id", "livemode", "object", "type", "webhook_logs", "webhook_status"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -76,7 +76,7 @@ def from_dict(cls, obj: dict) -> EventResponse: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return EventResponse.parse_obj(obj) _obj = EventResponse.parse_obj({ diff --git a/conekta/models/events_resend_response.py b/conekta/models/events_resend_response.py index 34e657d..74d5712 100644 --- a/conekta/models/events_resend_response.py +++ b/conekta/models/events_resend_response.py @@ -7,12 +7,13 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -22,10 +23,8 @@ from pydantic import BaseModel, StrictInt, StrictStr class EventsResendResponse(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + event model """ failed_attempts: Optional[StrictInt] = None id: Optional[StrictStr] = None @@ -36,6 +35,7 @@ class EventsResendResponse(BaseModel): __properties = ["failed_attempts", "id", "last_attempted_at", "last_http_response_status", "response_data", "url"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -66,7 +66,7 @@ def from_dict(cls, obj: dict) -> EventsResendResponse: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return EventsResendResponse.parse_obj(obj) _obj = EventsResendResponse.parse_obj({ diff --git a/conekta/models/get_api_keys_response.py b/conekta/models/get_api_keys_response.py index ec3f468..5fac2a6 100644 --- a/conekta/models/get_api_keys_response.py +++ b/conekta/models/get_api_keys_response.py @@ -7,35 +7,35 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json from typing import List, Optional -from pydantic import BaseModel, Field, StrictBool, StrictStr +from pydantic import BaseModel, Field, StrictBool, StrictStr, conlist from conekta.models.api_key_response import ApiKeyResponse class GetApiKeysResponse(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + GetApiKeysResponse """ next_page_url: Optional[StrictStr] = Field(None, description="URL of the next page.") previous_page_url: Optional[StrictStr] = Field(None, description="Url of the previous page.") has_more: StrictBool = Field(..., description="Indicates if there are more pages to be requested") object: StrictStr = Field(..., description="Object type, in this case is list") - data: Optional[List[ApiKeyResponse]] = None + data: Optional[conlist(ApiKeyResponse)] = None __properties = ["next_page_url", "previous_page_url", "has_more", "object", "data"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -66,11 +66,13 @@ def to_dict(self): _items.append(_item.to_dict()) _dict['data'] = _items # set to None if next_page_url (nullable) is None - if self.next_page_url is None: + # and __fields_set__ contains the field + if self.next_page_url is None and "next_page_url" in self.__fields_set__: _dict['next_page_url'] = None # set to None if previous_page_url (nullable) is None - if self.previous_page_url is None: + # and __fields_set__ contains the field + if self.previous_page_url is None and "previous_page_url" in self.__fields_set__: _dict['previous_page_url'] = None return _dict @@ -81,7 +83,7 @@ def from_dict(cls, obj: dict) -> GetApiKeysResponse: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return GetApiKeysResponse.parse_obj(obj) _obj = GetApiKeysResponse.parse_obj({ diff --git a/conekta/models/get_api_keys_response_all_of.py b/conekta/models/get_api_keys_response_all_of.py index 7849b13..9b378ee 100644 --- a/conekta/models/get_api_keys_response_all_of.py +++ b/conekta/models/get_api_keys_response_all_of.py @@ -7,31 +7,31 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json from typing import List, Optional -from pydantic import BaseModel +from pydantic import BaseModel, conlist from conekta.models.api_key_response import ApiKeyResponse class GetApiKeysResponseAllOf(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. """ - data: Optional[List[ApiKeyResponse]] = None + GetApiKeysResponseAllOf + """ + data: Optional[conlist(ApiKeyResponse)] = None __properties = ["data"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -69,7 +69,7 @@ def from_dict(cls, obj: dict) -> GetApiKeysResponseAllOf: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return GetApiKeysResponseAllOf.parse_obj(obj) _obj = GetApiKeysResponseAllOf.parse_obj({ diff --git a/conekta/models/get_charges_response.py b/conekta/models/get_charges_response.py index 1714408..817d9e8 100644 --- a/conekta/models/get_charges_response.py +++ b/conekta/models/get_charges_response.py @@ -7,35 +7,35 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json from typing import List, Optional -from pydantic import BaseModel, Field, StrictBool, StrictStr +from pydantic import BaseModel, Field, StrictBool, StrictStr, conlist from conekta.models.charge_response import ChargeResponse class GetChargesResponse(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + GetChargesResponse """ has_more: StrictBool = Field(..., description="Indicates if there are more pages to be requested") object: StrictStr = Field(..., description="Object type, in this case is list") next_page_url: Optional[StrictStr] = Field(None, description="URL of the next page.") previous_page_url: Optional[StrictStr] = Field(None, description="Url of the previous page.") - data: Optional[List[ChargeResponse]] = None + data: Optional[conlist(ChargeResponse)] = None __properties = ["has_more", "object", "next_page_url", "previous_page_url", "data"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -66,11 +66,13 @@ def to_dict(self): _items.append(_item.to_dict()) _dict['data'] = _items # set to None if next_page_url (nullable) is None - if self.next_page_url is None: + # and __fields_set__ contains the field + if self.next_page_url is None and "next_page_url" in self.__fields_set__: _dict['next_page_url'] = None # set to None if previous_page_url (nullable) is None - if self.previous_page_url is None: + # and __fields_set__ contains the field + if self.previous_page_url is None and "previous_page_url" in self.__fields_set__: _dict['previous_page_url'] = None return _dict @@ -81,7 +83,7 @@ def from_dict(cls, obj: dict) -> GetChargesResponse: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return GetChargesResponse.parse_obj(obj) _obj = GetChargesResponse.parse_obj({ diff --git a/conekta/models/get_charges_response_all_of.py b/conekta/models/get_charges_response_all_of.py index de22499..54407ab 100644 --- a/conekta/models/get_charges_response_all_of.py +++ b/conekta/models/get_charges_response_all_of.py @@ -7,31 +7,31 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json from typing import List, Optional -from pydantic import BaseModel +from pydantic import BaseModel, conlist from conekta.models.charge_response import ChargeResponse class GetChargesResponseAllOf(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. """ - data: Optional[List[ChargeResponse]] = None + GetChargesResponseAllOf + """ + data: Optional[conlist(ChargeResponse)] = None __properties = ["data"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -69,7 +69,7 @@ def from_dict(cls, obj: dict) -> GetChargesResponseAllOf: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return GetChargesResponseAllOf.parse_obj(obj) _obj = GetChargesResponseAllOf.parse_obj({ diff --git a/conekta/models/get_companies_response.py b/conekta/models/get_companies_response.py index 58bf8c2..38c2ced 100644 --- a/conekta/models/get_companies_response.py +++ b/conekta/models/get_companies_response.py @@ -7,35 +7,35 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json from typing import List, Optional -from pydantic import BaseModel, Field, StrictBool, StrictStr +from pydantic import BaseModel, Field, StrictBool, StrictStr, conlist from conekta.models.company_response import CompanyResponse class GetCompaniesResponse(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + GetCompaniesResponse """ has_more: StrictBool = Field(..., description="Indicates if there are more pages to be requested") object: StrictStr = Field(..., description="Object type, in this case is list") next_page_url: Optional[StrictStr] = Field(None, description="URL of the next page.") previous_page_url: Optional[StrictStr] = Field(None, description="Url of the previous page.") - data: Optional[List[CompanyResponse]] = None + data: Optional[conlist(CompanyResponse)] = None __properties = ["has_more", "object", "next_page_url", "previous_page_url", "data"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -66,11 +66,13 @@ def to_dict(self): _items.append(_item.to_dict()) _dict['data'] = _items # set to None if next_page_url (nullable) is None - if self.next_page_url is None: + # and __fields_set__ contains the field + if self.next_page_url is None and "next_page_url" in self.__fields_set__: _dict['next_page_url'] = None # set to None if previous_page_url (nullable) is None - if self.previous_page_url is None: + # and __fields_set__ contains the field + if self.previous_page_url is None and "previous_page_url" in self.__fields_set__: _dict['previous_page_url'] = None return _dict @@ -81,7 +83,7 @@ def from_dict(cls, obj: dict) -> GetCompaniesResponse: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return GetCompaniesResponse.parse_obj(obj) _obj = GetCompaniesResponse.parse_obj({ diff --git a/conekta/models/get_companies_response_all_of.py b/conekta/models/get_companies_response_all_of.py index 663c985..5f476d5 100644 --- a/conekta/models/get_companies_response_all_of.py +++ b/conekta/models/get_companies_response_all_of.py @@ -7,31 +7,31 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json from typing import List, Optional -from pydantic import BaseModel +from pydantic import BaseModel, conlist from conekta.models.company_response import CompanyResponse class GetCompaniesResponseAllOf(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. """ - data: Optional[List[CompanyResponse]] = None + GetCompaniesResponseAllOf + """ + data: Optional[conlist(CompanyResponse)] = None __properties = ["data"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -69,7 +69,7 @@ def from_dict(cls, obj: dict) -> GetCompaniesResponseAllOf: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return GetCompaniesResponseAllOf.parse_obj(obj) _obj = GetCompaniesResponseAllOf.parse_obj({ diff --git a/conekta/models/get_customer_payment_method_data_response.py b/conekta/models/get_customer_payment_method_data_response.py index 8413ecd..445915f 100644 --- a/conekta/models/get_customer_payment_method_data_response.py +++ b/conekta/models/get_customer_payment_method_data_response.py @@ -7,7 +7,9 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ @@ -28,10 +30,8 @@ GETCUSTOMERPAYMENTMETHODDATARESPONSE_ONE_OF_SCHEMAS = ["PaymentMethodCardResponse", "PaymentMethodCashResponse", "PaymentMethodSpeiRecurrent"] class GetCustomerPaymentMethodDataResponse(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + GetCustomerPaymentMethodDataResponse """ # data type: PaymentMethodCashResponse oneof_schema_1_validator: Optional[PaymentMethodCashResponse] = None @@ -48,35 +48,42 @@ class Config: discriminator_value_class_map = { } + def __init__(self, *args, **kwargs): + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + @validator('actual_instance') def actual_instance_must_validate_oneof(cls, v): - instance = cls() + instance = GetCustomerPaymentMethodDataResponse.construct() error_messages = [] match = 0 # validate data type: PaymentMethodCashResponse - if type(v) is not PaymentMethodCashResponse: + if not isinstance(v, PaymentMethodCashResponse): error_messages.append(f"Error! Input type `{type(v)}` is not `PaymentMethodCashResponse`") else: match += 1 - # validate data type: PaymentMethodCardResponse - if type(v) is not PaymentMethodCardResponse: + if not isinstance(v, PaymentMethodCardResponse): error_messages.append(f"Error! Input type `{type(v)}` is not `PaymentMethodCardResponse`") else: match += 1 - # validate data type: PaymentMethodSpeiRecurrent - if type(v) is not PaymentMethodSpeiRecurrent: + if not isinstance(v, PaymentMethodSpeiRecurrent): error_messages.append(f"Error! Input type `{type(v)}` is not `PaymentMethodSpeiRecurrent`") else: match += 1 - if match > 1: # more than 1 match - raise ValueError("Multiple matches found when deserializing the JSON string into GetCustomerPaymentMethodDataResponse with oneOf schemas: PaymentMethodCardResponse, PaymentMethodCashResponse, PaymentMethodSpeiRecurrent. Details: " + ", ".join(error_messages)) + raise ValueError("Multiple matches found when setting `actual_instance` in GetCustomerPaymentMethodDataResponse with oneOf schemas: PaymentMethodCardResponse, PaymentMethodCashResponse, PaymentMethodSpeiRecurrent. Details: " + ", ".join(error_messages)) elif match == 0: # no match - raise ValueError("No match found when deserializing the JSON string into GetCustomerPaymentMethodDataResponse with oneOf schemas: PaymentMethodCardResponse, PaymentMethodCashResponse, PaymentMethodSpeiRecurrent. Details: " + ", ".join(error_messages)) + raise ValueError("No match found when setting `actual_instance` in GetCustomerPaymentMethodDataResponse with oneOf schemas: PaymentMethodCardResponse, PaymentMethodCashResponse, PaymentMethodSpeiRecurrent. Details: " + ", ".join(error_messages)) else: return v @@ -87,7 +94,7 @@ def from_dict(cls, obj: dict) -> GetCustomerPaymentMethodDataResponse: @classmethod def from_json(cls, json_str: str) -> GetCustomerPaymentMethodDataResponse: """Returns the object represented by the json string""" - instance = cls() + instance = GetCustomerPaymentMethodDataResponse.construct() error_messages = [] match = 0 @@ -135,19 +142,19 @@ def from_json(cls, json_str: str) -> GetCustomerPaymentMethodDataResponse: try: instance.actual_instance = PaymentMethodCashResponse.from_json(json_str) match += 1 - except ValidationError as e: + except (ValidationError, ValueError) as e: error_messages.append(str(e)) # deserialize data into PaymentMethodCardResponse try: instance.actual_instance = PaymentMethodCardResponse.from_json(json_str) match += 1 - except ValidationError as e: + except (ValidationError, ValueError) as e: error_messages.append(str(e)) # deserialize data into PaymentMethodSpeiRecurrent try: instance.actual_instance = PaymentMethodSpeiRecurrent.from_json(json_str) match += 1 - except ValidationError as e: + except (ValidationError, ValueError) as e: error_messages.append(str(e)) if match > 1: @@ -161,17 +168,26 @@ def from_json(cls, json_str: str) -> GetCustomerPaymentMethodDataResponse: def to_json(self) -> str: """Returns the JSON representation of the actual instance""" - if self.actual_instance is not None: + if self.actual_instance is None: + return "null" + + to_json = getattr(self.actual_instance, "to_json", None) + if callable(to_json): return self.actual_instance.to_json() else: - return "null" + return json.dumps(self.actual_instance) def to_dict(self) -> dict: """Returns the dict representation of the actual instance""" - if self.actual_instance is not None: + if self.actual_instance is None: + return None + + to_dict = getattr(self.actual_instance, "to_dict", None) + if callable(to_dict): return self.actual_instance.to_dict() else: - return dict() + # primitive type + return self.actual_instance def to_str(self) -> str: """Returns the string representation of the actual instance""" diff --git a/conekta/models/get_events_response.py b/conekta/models/get_events_response.py index ea5f002..0f2a0ba 100644 --- a/conekta/models/get_events_response.py +++ b/conekta/models/get_events_response.py @@ -7,35 +7,35 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json from typing import List, Optional -from pydantic import BaseModel, Field, StrictBool, StrictStr +from pydantic import BaseModel, Field, StrictBool, StrictStr, conlist from conekta.models.event_response import EventResponse class GetEventsResponse(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + GetEventsResponse """ has_more: StrictBool = Field(..., description="Indicates if there are more pages to be requested") object: StrictStr = Field(..., description="Object type, in this case is list") next_page_url: Optional[StrictStr] = Field(None, description="URL of the next page.") previous_page_url: Optional[StrictStr] = Field(None, description="Url of the previous page.") - data: Optional[List[EventResponse]] = None + data: Optional[conlist(EventResponse)] = None __properties = ["has_more", "object", "next_page_url", "previous_page_url", "data"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -66,11 +66,13 @@ def to_dict(self): _items.append(_item.to_dict()) _dict['data'] = _items # set to None if next_page_url (nullable) is None - if self.next_page_url is None: + # and __fields_set__ contains the field + if self.next_page_url is None and "next_page_url" in self.__fields_set__: _dict['next_page_url'] = None # set to None if previous_page_url (nullable) is None - if self.previous_page_url is None: + # and __fields_set__ contains the field + if self.previous_page_url is None and "previous_page_url" in self.__fields_set__: _dict['previous_page_url'] = None return _dict @@ -81,7 +83,7 @@ def from_dict(cls, obj: dict) -> GetEventsResponse: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return GetEventsResponse.parse_obj(obj) _obj = GetEventsResponse.parse_obj({ diff --git a/conekta/models/get_events_response_all_of.py b/conekta/models/get_events_response_all_of.py index 05ad465..6840913 100644 --- a/conekta/models/get_events_response_all_of.py +++ b/conekta/models/get_events_response_all_of.py @@ -7,31 +7,31 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json from typing import List, Optional -from pydantic import BaseModel +from pydantic import BaseModel, conlist from conekta.models.event_response import EventResponse class GetEventsResponseAllOf(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. """ - data: Optional[List[EventResponse]] = None + GetEventsResponseAllOf + """ + data: Optional[conlist(EventResponse)] = None __properties = ["data"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -69,7 +69,7 @@ def from_dict(cls, obj: dict) -> GetEventsResponseAllOf: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return GetEventsResponseAllOf.parse_obj(obj) _obj = GetEventsResponseAllOf.parse_obj({ diff --git a/conekta/models/get_orders_response.py b/conekta/models/get_orders_response.py index 1ec43f4..8c2696e 100644 --- a/conekta/models/get_orders_response.py +++ b/conekta/models/get_orders_response.py @@ -7,28 +7,27 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json from typing import List, Optional -from pydantic import BaseModel, Field, StrictBool, StrictStr +from pydantic import BaseModel, Field, StrictBool, StrictStr, conlist from conekta.models.order_response import OrderResponse class GetOrdersResponse(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. """ - data: List[OrderResponse] = ... + GetOrdersResponse + """ + data: conlist(OrderResponse) = Field(...) has_more: StrictBool = Field(..., description="Indicates if there are more pages to be requested") object: StrictStr = Field(..., description="Object type, in this case is list") next_page_url: Optional[StrictStr] = Field(None, description="URL of the next page.") @@ -36,6 +35,7 @@ class GetOrdersResponse(BaseModel): __properties = ["data", "has_more", "object", "next_page_url", "previous_page_url"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -66,11 +66,13 @@ def to_dict(self): _items.append(_item.to_dict()) _dict['data'] = _items # set to None if next_page_url (nullable) is None - if self.next_page_url is None: + # and __fields_set__ contains the field + if self.next_page_url is None and "next_page_url" in self.__fields_set__: _dict['next_page_url'] = None # set to None if previous_page_url (nullable) is None - if self.previous_page_url is None: + # and __fields_set__ contains the field + if self.previous_page_url is None and "previous_page_url" in self.__fields_set__: _dict['previous_page_url'] = None return _dict @@ -81,7 +83,7 @@ def from_dict(cls, obj: dict) -> GetOrdersResponse: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return GetOrdersResponse.parse_obj(obj) _obj = GetOrdersResponse.parse_obj({ diff --git a/conekta/models/get_payment_method_response.py b/conekta/models/get_payment_method_response.py index 0d05311..f51f169 100644 --- a/conekta/models/get_payment_method_response.py +++ b/conekta/models/get_payment_method_response.py @@ -7,35 +7,35 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json from typing import List, Optional -from pydantic import BaseModel, Field, StrictBool, StrictStr +from pydantic import BaseModel, Field, StrictBool, StrictStr, conlist from conekta.models.get_customer_payment_method_data_response import GetCustomerPaymentMethodDataResponse class GetPaymentMethodResponse(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + GetPaymentMethodResponse """ has_more: StrictBool = Field(..., description="Indicates if there are more pages to be requested") object: StrictStr = Field(..., description="Object type, in this case is list") next_page_url: Optional[StrictStr] = Field(None, description="URL of the next page.") previous_page_url: Optional[StrictStr] = Field(None, description="Url of the previous page.") - data: Optional[List[GetCustomerPaymentMethodDataResponse]] = None + data: Optional[conlist(GetCustomerPaymentMethodDataResponse)] = None __properties = ["has_more", "object", "next_page_url", "previous_page_url", "data"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -66,11 +66,13 @@ def to_dict(self): _items.append(_item.to_dict()) _dict['data'] = _items # set to None if next_page_url (nullable) is None - if self.next_page_url is None: + # and __fields_set__ contains the field + if self.next_page_url is None and "next_page_url" in self.__fields_set__: _dict['next_page_url'] = None # set to None if previous_page_url (nullable) is None - if self.previous_page_url is None: + # and __fields_set__ contains the field + if self.previous_page_url is None and "previous_page_url" in self.__fields_set__: _dict['previous_page_url'] = None return _dict @@ -81,7 +83,7 @@ def from_dict(cls, obj: dict) -> GetPaymentMethodResponse: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return GetPaymentMethodResponse.parse_obj(obj) _obj = GetPaymentMethodResponse.parse_obj({ diff --git a/conekta/models/get_payment_method_response_all_of.py b/conekta/models/get_payment_method_response_all_of.py index 95c41e9..fb07d54 100644 --- a/conekta/models/get_payment_method_response_all_of.py +++ b/conekta/models/get_payment_method_response_all_of.py @@ -7,31 +7,31 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json from typing import List, Optional -from pydantic import BaseModel +from pydantic import BaseModel, conlist from conekta.models.get_customer_payment_method_data_response import GetCustomerPaymentMethodDataResponse class GetPaymentMethodResponseAllOf(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. """ - data: Optional[List[GetCustomerPaymentMethodDataResponse]] = None + GetPaymentMethodResponseAllOf + """ + data: Optional[conlist(GetCustomerPaymentMethodDataResponse)] = None __properties = ["data"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -69,7 +69,7 @@ def from_dict(cls, obj: dict) -> GetPaymentMethodResponseAllOf: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return GetPaymentMethodResponseAllOf.parse_obj(obj) _obj = GetPaymentMethodResponseAllOf.parse_obj({ diff --git a/conekta/models/get_plans_response.py b/conekta/models/get_plans_response.py index 2e68b11..ad0b73c 100644 --- a/conekta/models/get_plans_response.py +++ b/conekta/models/get_plans_response.py @@ -7,35 +7,35 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json from typing import List, Optional -from pydantic import BaseModel, Field, StrictBool, StrictStr +from pydantic import BaseModel, Field, StrictBool, StrictStr, conlist from conekta.models.plan_response import PlanResponse class GetPlansResponse(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + GetPlansResponse """ has_more: StrictBool = Field(..., description="Indicates if there are more pages to be requested") object: StrictStr = Field(..., description="Object type, in this case is list") next_page_url: Optional[StrictStr] = Field(None, description="URL of the next page.") previous_page_url: Optional[StrictStr] = Field(None, description="Url of the previous page.") - data: Optional[List[PlanResponse]] = None + data: Optional[conlist(PlanResponse)] = None __properties = ["has_more", "object", "next_page_url", "previous_page_url", "data"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -66,11 +66,13 @@ def to_dict(self): _items.append(_item.to_dict()) _dict['data'] = _items # set to None if next_page_url (nullable) is None - if self.next_page_url is None: + # and __fields_set__ contains the field + if self.next_page_url is None and "next_page_url" in self.__fields_set__: _dict['next_page_url'] = None # set to None if previous_page_url (nullable) is None - if self.previous_page_url is None: + # and __fields_set__ contains the field + if self.previous_page_url is None and "previous_page_url" in self.__fields_set__: _dict['previous_page_url'] = None return _dict @@ -81,7 +83,7 @@ def from_dict(cls, obj: dict) -> GetPlansResponse: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return GetPlansResponse.parse_obj(obj) _obj = GetPlansResponse.parse_obj({ diff --git a/conekta/models/get_plans_response_all_of.py b/conekta/models/get_plans_response_all_of.py index 0805fc0..a2a26f0 100644 --- a/conekta/models/get_plans_response_all_of.py +++ b/conekta/models/get_plans_response_all_of.py @@ -7,31 +7,31 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json from typing import List, Optional -from pydantic import BaseModel +from pydantic import BaseModel, conlist from conekta.models.plan_response import PlanResponse class GetPlansResponseAllOf(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. """ - data: Optional[List[PlanResponse]] = None + GetPlansResponseAllOf + """ + data: Optional[conlist(PlanResponse)] = None __properties = ["data"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -69,7 +69,7 @@ def from_dict(cls, obj: dict) -> GetPlansResponseAllOf: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return GetPlansResponseAllOf.parse_obj(obj) _obj = GetPlansResponseAllOf.parse_obj({ diff --git a/conekta/models/get_transactions_response.py b/conekta/models/get_transactions_response.py index 4a41c63..464bab4 100644 --- a/conekta/models/get_transactions_response.py +++ b/conekta/models/get_transactions_response.py @@ -7,35 +7,35 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json from typing import List, Optional -from pydantic import BaseModel, Field, StrictBool, StrictStr +from pydantic import BaseModel, Field, StrictBool, StrictStr, conlist from conekta.models.transaction_response import TransactionResponse class GetTransactionsResponse(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + GetTransactionsResponse """ has_more: StrictBool = Field(..., description="Indicates if there are more pages to be requested") object: StrictStr = Field(..., description="Object type, in this case is list") next_page_url: Optional[StrictStr] = Field(None, description="URL of the next page.") previous_page_url: Optional[StrictStr] = Field(None, description="Url of the previous page.") - data: Optional[List[TransactionResponse]] = Field(None, description="Transactions") + data: Optional[conlist(TransactionResponse)] = Field(None, description="Transactions") __properties = ["has_more", "object", "next_page_url", "previous_page_url", "data"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -66,11 +66,13 @@ def to_dict(self): _items.append(_item.to_dict()) _dict['data'] = _items # set to None if next_page_url (nullable) is None - if self.next_page_url is None: + # and __fields_set__ contains the field + if self.next_page_url is None and "next_page_url" in self.__fields_set__: _dict['next_page_url'] = None # set to None if previous_page_url (nullable) is None - if self.previous_page_url is None: + # and __fields_set__ contains the field + if self.previous_page_url is None and "previous_page_url" in self.__fields_set__: _dict['previous_page_url'] = None return _dict @@ -81,7 +83,7 @@ def from_dict(cls, obj: dict) -> GetTransactionsResponse: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return GetTransactionsResponse.parse_obj(obj) _obj = GetTransactionsResponse.parse_obj({ diff --git a/conekta/models/get_transactions_response_all_of.py b/conekta/models/get_transactions_response_all_of.py index a677628..0922e23 100644 --- a/conekta/models/get_transactions_response_all_of.py +++ b/conekta/models/get_transactions_response_all_of.py @@ -7,31 +7,31 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json from typing import List, Optional -from pydantic import BaseModel, Field +from pydantic import BaseModel, Field, conlist from conekta.models.transaction_response import TransactionResponse class GetTransactionsResponseAllOf(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. """ - data: Optional[List[TransactionResponse]] = Field(None, description="Transactions") + GetTransactionsResponseAllOf + """ + data: Optional[conlist(TransactionResponse)] = Field(None, description="Transactions") __properties = ["data"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -69,7 +69,7 @@ def from_dict(cls, obj: dict) -> GetTransactionsResponseAllOf: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return GetTransactionsResponseAllOf.parse_obj(obj) _obj = GetTransactionsResponseAllOf.parse_obj({ diff --git a/conekta/models/get_transfers_response.py b/conekta/models/get_transfers_response.py index e5b3ef6..0ac6abb 100644 --- a/conekta/models/get_transfers_response.py +++ b/conekta/models/get_transfers_response.py @@ -7,35 +7,35 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json from typing import List, Optional -from pydantic import BaseModel, Field, StrictBool, StrictStr +from pydantic import BaseModel, Field, StrictBool, StrictStr, conlist from conekta.models.transfers_response import TransfersResponse class GetTransfersResponse(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + GetTransfersResponse """ has_more: StrictBool = Field(..., description="Indicates if there are more pages to be requested") object: StrictStr = Field(..., description="Object type, in this case is list") next_page_url: Optional[StrictStr] = Field(None, description="URL of the next page.") previous_page_url: Optional[StrictStr] = Field(None, description="Url of the previous page.") - data: Optional[List[TransfersResponse]] = Field(None, description="Transfers") + data: Optional[conlist(TransfersResponse)] = Field(None, description="Transfers") __properties = ["has_more", "object", "next_page_url", "previous_page_url", "data"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -66,11 +66,13 @@ def to_dict(self): _items.append(_item.to_dict()) _dict['data'] = _items # set to None if next_page_url (nullable) is None - if self.next_page_url is None: + # and __fields_set__ contains the field + if self.next_page_url is None and "next_page_url" in self.__fields_set__: _dict['next_page_url'] = None # set to None if previous_page_url (nullable) is None - if self.previous_page_url is None: + # and __fields_set__ contains the field + if self.previous_page_url is None and "previous_page_url" in self.__fields_set__: _dict['previous_page_url'] = None return _dict @@ -81,7 +83,7 @@ def from_dict(cls, obj: dict) -> GetTransfersResponse: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return GetTransfersResponse.parse_obj(obj) _obj = GetTransfersResponse.parse_obj({ diff --git a/conekta/models/get_transfers_response_all_of.py b/conekta/models/get_transfers_response_all_of.py index 43f5236..7799405 100644 --- a/conekta/models/get_transfers_response_all_of.py +++ b/conekta/models/get_transfers_response_all_of.py @@ -7,31 +7,31 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json from typing import List, Optional -from pydantic import BaseModel, Field +from pydantic import BaseModel, Field, conlist from conekta.models.transfers_response import TransfersResponse class GetTransfersResponseAllOf(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. """ - data: Optional[List[TransfersResponse]] = Field(None, description="Transfers") + GetTransfersResponseAllOf + """ + data: Optional[conlist(TransfersResponse)] = Field(None, description="Transfers") __properties = ["data"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -69,7 +69,7 @@ def from_dict(cls, obj: dict) -> GetTransfersResponseAllOf: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return GetTransfersResponseAllOf.parse_obj(obj) _obj = GetTransfersResponseAllOf.parse_obj({ diff --git a/conekta/models/get_webhook_keys_response.py b/conekta/models/get_webhook_keys_response.py index 976b909..043b690 100644 --- a/conekta/models/get_webhook_keys_response.py +++ b/conekta/models/get_webhook_keys_response.py @@ -7,35 +7,35 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json from typing import List, Optional -from pydantic import BaseModel, Field, StrictBool, StrictStr +from pydantic import BaseModel, Field, StrictBool, StrictStr, conlist from conekta.models.webhook_key_response import WebhookKeyResponse class GetWebhookKeysResponse(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + GetWebhookKeysResponse """ has_more: StrictBool = Field(..., description="Indicates if there are more pages to be requested") object: StrictStr = Field(..., description="Object type, in this case is list") next_page_url: Optional[StrictStr] = Field(None, description="URL of the next page.") previous_page_url: Optional[StrictStr] = Field(None, description="Url of the previous page.") - data: Optional[List[WebhookKeyResponse]] = None + data: Optional[conlist(WebhookKeyResponse)] = None __properties = ["has_more", "object", "next_page_url", "previous_page_url", "data"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -66,11 +66,13 @@ def to_dict(self): _items.append(_item.to_dict()) _dict['data'] = _items # set to None if next_page_url (nullable) is None - if self.next_page_url is None: + # and __fields_set__ contains the field + if self.next_page_url is None and "next_page_url" in self.__fields_set__: _dict['next_page_url'] = None # set to None if previous_page_url (nullable) is None - if self.previous_page_url is None: + # and __fields_set__ contains the field + if self.previous_page_url is None and "previous_page_url" in self.__fields_set__: _dict['previous_page_url'] = None return _dict @@ -81,7 +83,7 @@ def from_dict(cls, obj: dict) -> GetWebhookKeysResponse: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return GetWebhookKeysResponse.parse_obj(obj) _obj = GetWebhookKeysResponse.parse_obj({ diff --git a/conekta/models/get_webhook_keys_response_all_of.py b/conekta/models/get_webhook_keys_response_all_of.py index dae997d..6375e79 100644 --- a/conekta/models/get_webhook_keys_response_all_of.py +++ b/conekta/models/get_webhook_keys_response_all_of.py @@ -7,31 +7,31 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json from typing import List, Optional -from pydantic import BaseModel +from pydantic import BaseModel, conlist from conekta.models.webhook_key_response import WebhookKeyResponse class GetWebhookKeysResponseAllOf(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. """ - data: Optional[List[WebhookKeyResponse]] = None + GetWebhookKeysResponseAllOf + """ + data: Optional[conlist(WebhookKeyResponse)] = None __properties = ["data"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -69,7 +69,7 @@ def from_dict(cls, obj: dict) -> GetWebhookKeysResponseAllOf: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return GetWebhookKeysResponseAllOf.parse_obj(obj) _obj = GetWebhookKeysResponseAllOf.parse_obj({ diff --git a/conekta/models/get_webhooks_response.py b/conekta/models/get_webhooks_response.py index 3d0cf87..6a3add8 100644 --- a/conekta/models/get_webhooks_response.py +++ b/conekta/models/get_webhooks_response.py @@ -7,35 +7,35 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json from typing import List, Optional -from pydantic import BaseModel, Field, StrictBool, StrictStr +from pydantic import BaseModel, Field, StrictBool, StrictStr, conlist from conekta.models.webhook_response import WebhookResponse class GetWebhooksResponse(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + GetWebhooksResponse """ has_more: StrictBool = Field(..., description="Indicates if there are more pages to be requested") object: StrictStr = Field(..., description="Object type, in this case is list") next_page_url: Optional[StrictStr] = Field(None, description="URL of the next page.") previous_page_url: Optional[StrictStr] = Field(None, description="Url of the previous page.") - data: Optional[List[WebhookResponse]] = None + data: Optional[conlist(WebhookResponse)] = None __properties = ["has_more", "object", "next_page_url", "previous_page_url", "data"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -66,11 +66,13 @@ def to_dict(self): _items.append(_item.to_dict()) _dict['data'] = _items # set to None if next_page_url (nullable) is None - if self.next_page_url is None: + # and __fields_set__ contains the field + if self.next_page_url is None and "next_page_url" in self.__fields_set__: _dict['next_page_url'] = None # set to None if previous_page_url (nullable) is None - if self.previous_page_url is None: + # and __fields_set__ contains the field + if self.previous_page_url is None and "previous_page_url" in self.__fields_set__: _dict['previous_page_url'] = None return _dict @@ -81,7 +83,7 @@ def from_dict(cls, obj: dict) -> GetWebhooksResponse: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return GetWebhooksResponse.parse_obj(obj) _obj = GetWebhooksResponse.parse_obj({ diff --git a/conekta/models/get_webhooks_response_all_of.py b/conekta/models/get_webhooks_response_all_of.py index ddf3d20..81cf1a5 100644 --- a/conekta/models/get_webhooks_response_all_of.py +++ b/conekta/models/get_webhooks_response_all_of.py @@ -7,31 +7,31 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json from typing import List, Optional -from pydantic import BaseModel +from pydantic import BaseModel, conlist from conekta.models.webhook_response import WebhookResponse class GetWebhooksResponseAllOf(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. """ - data: Optional[List[WebhookResponse]] = None + GetWebhooksResponseAllOf + """ + data: Optional[conlist(WebhookResponse)] = None __properties = ["data"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -69,7 +69,7 @@ def from_dict(cls, obj: dict) -> GetWebhooksResponseAllOf: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return GetWebhooksResponseAllOf.parse_obj(obj) _obj = GetWebhooksResponseAllOf.parse_obj({ diff --git a/conekta/models/log_response.py b/conekta/models/log_response.py index ccd865c..0152456 100644 --- a/conekta/models/log_response.py +++ b/conekta/models/log_response.py @@ -7,30 +7,29 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json from typing import Any, Dict, List, Optional -from pydantic import BaseModel, StrictBool, StrictInt, StrictStr +from pydantic import BaseModel, Field, StrictBool, StrictInt, StrictStr, conlist class LogResponse(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. """ - created_at: StrictInt = ... - id: StrictStr = ... + log model + """ + created_at: StrictInt = Field(...) + id: StrictStr = Field(...) ip_address: Optional[StrictStr] = None - livemode: StrictBool = ... + livemode: StrictBool = Field(...) loggable_id: Optional[StrictStr] = None loggable_type: Optional[StrictStr] = None method: Optional[StrictStr] = None @@ -41,7 +40,7 @@ class LogResponse(BaseModel): request_headers: Optional[Dict[str, StrictStr]] = None response_body: Optional[Dict[str, Any]] = None response_headers: Optional[Dict[str, StrictStr]] = None - searchable_tags: Optional[List[StrictStr]] = None + searchable_tags: Optional[conlist(StrictStr)] = None status: Optional[StrictStr] = None updated_at: Optional[StrictStr] = None url: Optional[StrictStr] = None @@ -50,6 +49,7 @@ class LogResponse(BaseModel): __properties = ["created_at", "id", "ip_address", "livemode", "loggable_id", "loggable_type", "method", "oauth_token_id", "query_string", "related", "request_body", "request_headers", "response_body", "response_headers", "searchable_tags", "status", "updated_at", "url", "user_account_id", "version"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -73,15 +73,18 @@ def to_dict(self): }, exclude_none=True) # set to None if loggable_id (nullable) is None - if self.loggable_id is None: + # and __fields_set__ contains the field + if self.loggable_id is None and "loggable_id" in self.__fields_set__: _dict['loggable_id'] = None # set to None if loggable_type (nullable) is None - if self.loggable_type is None: + # and __fields_set__ contains the field + if self.loggable_type is None and "loggable_type" in self.__fields_set__: _dict['loggable_type'] = None # set to None if oauth_token_id (nullable) is None - if self.oauth_token_id is None: + # and __fields_set__ contains the field + if self.oauth_token_id is None and "oauth_token_id" in self.__fields_set__: _dict['oauth_token_id'] = None return _dict @@ -92,7 +95,7 @@ def from_dict(cls, obj: dict) -> LogResponse: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return LogResponse.parse_obj(obj) _obj = LogResponse.parse_obj({ diff --git a/conekta/models/logs_response.py b/conekta/models/logs_response.py index 125d905..74b0915 100644 --- a/conekta/models/logs_response.py +++ b/conekta/models/logs_response.py @@ -7,35 +7,35 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json from typing import List, Optional -from pydantic import BaseModel, Field, StrictBool, StrictStr +from pydantic import BaseModel, Field, StrictBool, StrictStr, conlist from conekta.models.logs_response_data import LogsResponseData class LogsResponse(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + logs model """ has_more: Optional[StrictBool] = Field(None, description="True, if there are more pages.") object: Optional[StrictStr] = Field(None, description="The object type") next_page_url: Optional[StrictStr] = Field(None, description="URL of the next page.") previous_page_url: Optional[StrictStr] = Field(None, description="Url of the previous page.") - data: Optional[List[LogsResponseData]] = Field(None, description="set to page results.") + data: Optional[conlist(LogsResponseData)] = Field(None, description="set to page results.") __properties = ["has_more", "object", "next_page_url", "previous_page_url", "data"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -68,15 +68,18 @@ def to_dict(self): _items.append(_item.to_dict()) _dict['data'] = _items # set to None if next_page_url (nullable) is None - if self.next_page_url is None: + # and __fields_set__ contains the field + if self.next_page_url is None and "next_page_url" in self.__fields_set__: _dict['next_page_url'] = None # set to None if previous_page_url (nullable) is None - if self.previous_page_url is None: + # and __fields_set__ contains the field + if self.previous_page_url is None and "previous_page_url" in self.__fields_set__: _dict['previous_page_url'] = None # set to None if data (nullable) is None - if self.data is None: + # and __fields_set__ contains the field + if self.data is None and "data" in self.__fields_set__: _dict['data'] = None return _dict @@ -87,7 +90,7 @@ def from_dict(cls, obj: dict) -> LogsResponse: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return LogsResponse.parse_obj(obj) _obj = LogsResponse.parse_obj({ diff --git a/conekta/models/logs_response_data.py b/conekta/models/logs_response_data.py index 772c477..28b2276 100644 --- a/conekta/models/logs_response_data.py +++ b/conekta/models/logs_response_data.py @@ -7,25 +7,24 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json from typing import Any, Dict, List, Optional -from pydantic import BaseModel, StrictBool, StrictInt, StrictStr +from pydantic import BaseModel, StrictBool, StrictInt, StrictStr, conlist class LogsResponseData(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + LogsResponseData """ created_at: Optional[StrictInt] = None id: Optional[StrictStr] = None @@ -41,7 +40,7 @@ class LogsResponseData(BaseModel): request_headers: Optional[Dict[str, StrictStr]] = None response_body: Optional[Dict[str, Any]] = None response_headers: Optional[Dict[str, StrictStr]] = None - searchable_tags: Optional[List[StrictStr]] = None + searchable_tags: Optional[conlist(StrictStr)] = None status: Optional[StrictStr] = None updated_at: Optional[StrictStr] = None url: Optional[StrictStr] = None @@ -50,6 +49,7 @@ class LogsResponseData(BaseModel): __properties = ["created_at", "id", "ip_address", "livemode", "loggable_id", "loggable_type", "method", "oauth_token_id", "query_string", "related", "request_body", "request_headers", "response_body", "response_headers", "searchable_tags", "status", "updated_at", "url", "user_account_id", "version"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -73,15 +73,18 @@ def to_dict(self): }, exclude_none=True) # set to None if loggable_id (nullable) is None - if self.loggable_id is None: + # and __fields_set__ contains the field + if self.loggable_id is None and "loggable_id" in self.__fields_set__: _dict['loggable_id'] = None # set to None if loggable_type (nullable) is None - if self.loggable_type is None: + # and __fields_set__ contains the field + if self.loggable_type is None and "loggable_type" in self.__fields_set__: _dict['loggable_type'] = None # set to None if oauth_token_id (nullable) is None - if self.oauth_token_id is None: + # and __fields_set__ contains the field + if self.oauth_token_id is None and "oauth_token_id" in self.__fields_set__: _dict['oauth_token_id'] = None return _dict @@ -92,7 +95,7 @@ def from_dict(cls, obj: dict) -> LogsResponseData: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return LogsResponseData.parse_obj(obj) _obj = LogsResponseData.parse_obj({ diff --git a/conekta/models/order_capture_request.py b/conekta/models/order_capture_request.py index 1f1f8d1..bc753b2 100644 --- a/conekta/models/order_capture_request.py +++ b/conekta/models/order_capture_request.py @@ -7,12 +7,13 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -22,15 +23,14 @@ from pydantic import BaseModel, Field, conint class OrderCaptureRequest(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + OrderCaptureRequest """ amount: conint(strict=True, ge=1) = Field(..., description="Amount to capture") __properties = ["amount"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -61,7 +61,7 @@ def from_dict(cls, obj: dict) -> OrderCaptureRequest: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return OrderCaptureRequest.parse_obj(obj) _obj = OrderCaptureRequest.parse_obj({ diff --git a/conekta/models/order_discount_lines_request.py b/conekta/models/order_discount_lines_request.py index cc28dde..bf3d71f 100644 --- a/conekta/models/order_discount_lines_request.py +++ b/conekta/models/order_discount_lines_request.py @@ -7,12 +7,13 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -22,10 +23,8 @@ from pydantic import BaseModel, Field, StrictStr, conint class OrderDiscountLinesRequest(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + List of discounts that apply to the order. """ amount: conint(strict=True, ge=0) = Field(..., description="The amount to be deducted from the total sum of all payments, in cents.") code: StrictStr = Field(..., description="Discount code.") @@ -33,6 +32,7 @@ class OrderDiscountLinesRequest(BaseModel): __properties = ["amount", "code", "type"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -63,7 +63,7 @@ def from_dict(cls, obj: dict) -> OrderDiscountLinesRequest: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return OrderDiscountLinesRequest.parse_obj(obj) _obj = OrderDiscountLinesRequest.parse_obj({ diff --git a/conekta/models/order_refund_request.py b/conekta/models/order_refund_request.py index 09a4ef5..76d4320 100644 --- a/conekta/models/order_refund_request.py +++ b/conekta/models/order_refund_request.py @@ -7,32 +7,32 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json from typing import Optional -from pydantic import BaseModel, StrictInt, StrictStr +from pydantic import BaseModel, Field, StrictInt, StrictStr class OrderRefundRequest(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. """ - amount: StrictInt = ... + OrderRefundRequest + """ + amount: StrictInt = Field(...) expires_at: Optional[StrictInt] = None - reason: StrictStr = ... + reason: StrictStr = Field(...) __properties = ["amount", "expires_at", "reason"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -56,7 +56,8 @@ def to_dict(self): }, exclude_none=True) # set to None if expires_at (nullable) is None - if self.expires_at is None: + # and __fields_set__ contains the field + if self.expires_at is None and "expires_at" in self.__fields_set__: _dict['expires_at'] = None return _dict @@ -67,7 +68,7 @@ def from_dict(cls, obj: dict) -> OrderRefundRequest: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return OrderRefundRequest.parse_obj(obj) _obj = OrderRefundRequest.parse_obj({ diff --git a/conekta/models/order_request.py b/conekta/models/order_request.py index e02ea81..227b39d 100644 --- a/conekta/models/order_request.py +++ b/conekta/models/order_request.py @@ -7,19 +7,20 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json from typing import Any, Dict, List, Optional -from pydantic import BaseModel, Field, StrictBool, constr +from pydantic import BaseModel, Field, StrictBool, conlist, constr from conekta.models.charge_request import ChargeRequest from conekta.models.checkout_request import CheckoutRequest from conekta.models.customer_shipping_contacts import CustomerShippingContacts @@ -30,26 +31,25 @@ from conekta.models.shipping_request import ShippingRequest class OrderRequest(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. """ - charges: Optional[List[ChargeRequest]] = Field(None, description="List of [charges](https://developers.conekta.com/v2.1.0/reference/orderscreatecharge) that are applied to the order") + a order + """ + charges: Optional[conlist(ChargeRequest)] = Field(None, description="List of [charges](https://developers.conekta.com/v2.1.0/reference/orderscreatecharge) that are applied to the order") checkout: Optional[CheckoutRequest] = None currency: constr(strict=True, max_length=3) = Field(..., description="Currency with which the payment will be made. It uses the 3-letter code of the [International Standard ISO 4217.](https://es.wikipedia.org/wiki/ISO_4217)") - customer_info: OrderRequestCustomerInfo = ... - discount_lines: Optional[List[OrderDiscountLinesRequest]] = Field(None, description="List of [discounts](https://developers.conekta.com/v2.1.0/reference/orderscreatediscountline) that are applied to the order. You must have at least one discount.") - line_items: List[Product] = Field(..., description="List of [products](https://developers.conekta.com/v2.1.0/reference/orderscreateproduct) that are sold in the order. You must have at least one product.") + customer_info: OrderRequestCustomerInfo = Field(...) + discount_lines: Optional[conlist(OrderDiscountLinesRequest)] = Field(None, description="List of [discounts](https://developers.conekta.com/v2.1.0/reference/orderscreatediscountline) that are applied to the order. You must have at least one discount.") + line_items: conlist(Product) = Field(..., description="List of [products](https://developers.conekta.com/v2.1.0/reference/orderscreateproduct) that are sold in the order. You must have at least one product.") metadata: Optional[Dict[str, Any]] = None needs_shipping_contact: Optional[StrictBool] = Field(None, description="Allows you to fill out the shipping information at checkout") pre_authorize: Optional[StrictBool] = Field(False, description="Indicates whether the order charges must be preauthorized") shipping_contact: Optional[CustomerShippingContacts] = None - shipping_lines: Optional[List[ShippingRequest]] = Field(None, description="List of [shipping costs](https://developers.conekta.com/v2.1.0/reference/orderscreateshipping). If the online store offers digital products.") - tax_lines: Optional[List[OrderTaxRequest]] = Field(None, description="List of [taxes](https://developers.conekta.com/v2.1.0/reference/orderscreatetaxes) that are applied to the order.") + shipping_lines: Optional[conlist(ShippingRequest)] = Field(None, description="List of [shipping costs](https://developers.conekta.com/v2.1.0/reference/orderscreateshipping). If the online store offers digital products.") + tax_lines: Optional[conlist(OrderTaxRequest)] = Field(None, description="List of [taxes](https://developers.conekta.com/v2.1.0/reference/orderscreatetaxes) that are applied to the order.") __properties = ["charges", "checkout", "currency", "customer_info", "discount_lines", "line_items", "metadata", "needs_shipping_contact", "pre_authorize", "shipping_contact", "shipping_lines", "tax_lines"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -124,7 +124,7 @@ def from_dict(cls, obj: dict) -> OrderRequest: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return OrderRequest.parse_obj(obj) _obj = OrderRequest.parse_obj({ diff --git a/conekta/models/order_request_customer_info.py b/conekta/models/order_request_customer_info.py index bf98d34..3d5f251 100644 --- a/conekta/models/order_request_customer_info.py +++ b/conekta/models/order_request_customer_info.py @@ -7,7 +7,9 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ @@ -27,10 +29,8 @@ ORDERREQUESTCUSTOMERINFO_ONE_OF_SCHEMAS = ["CustomerInfo", "CustomerInfoJustCustomerId"] class OrderRequestCustomerInfo(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + OrderRequestCustomerInfo """ # data type: CustomerInfo oneof_schema_1_validator: Optional[CustomerInfo] = None @@ -42,29 +42,37 @@ class OrderRequestCustomerInfo(BaseModel): class Config: validate_assignment = True + def __init__(self, *args, **kwargs): + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + @validator('actual_instance') def actual_instance_must_validate_oneof(cls, v): - instance = cls() + instance = OrderRequestCustomerInfo.construct() error_messages = [] match = 0 # validate data type: CustomerInfo - if type(v) is not CustomerInfo: + if not isinstance(v, CustomerInfo): error_messages.append(f"Error! Input type `{type(v)}` is not `CustomerInfo`") else: match += 1 - # validate data type: CustomerInfoJustCustomerId - if type(v) is not CustomerInfoJustCustomerId: + if not isinstance(v, CustomerInfoJustCustomerId): error_messages.append(f"Error! Input type `{type(v)}` is not `CustomerInfoJustCustomerId`") else: match += 1 - if match > 1: # more than 1 match - raise ValueError("Multiple matches found when deserializing the JSON string into OrderRequestCustomerInfo with oneOf schemas: CustomerInfo, CustomerInfoJustCustomerId. Details: " + ", ".join(error_messages)) + raise ValueError("Multiple matches found when setting `actual_instance` in OrderRequestCustomerInfo with oneOf schemas: CustomerInfo, CustomerInfoJustCustomerId. Details: " + ", ".join(error_messages)) elif match == 0: # no match - raise ValueError("No match found when deserializing the JSON string into OrderRequestCustomerInfo with oneOf schemas: CustomerInfo, CustomerInfoJustCustomerId. Details: " + ", ".join(error_messages)) + raise ValueError("No match found when setting `actual_instance` in OrderRequestCustomerInfo with oneOf schemas: CustomerInfo, CustomerInfoJustCustomerId. Details: " + ", ".join(error_messages)) else: return v @@ -75,7 +83,7 @@ def from_dict(cls, obj: dict) -> OrderRequestCustomerInfo: @classmethod def from_json(cls, json_str: str) -> OrderRequestCustomerInfo: """Returns the object represented by the json string""" - instance = cls() + instance = OrderRequestCustomerInfo.construct() error_messages = [] match = 0 @@ -83,13 +91,13 @@ def from_json(cls, json_str: str) -> OrderRequestCustomerInfo: try: instance.actual_instance = CustomerInfo.from_json(json_str) match += 1 - except ValidationError as e: + except (ValidationError, ValueError) as e: error_messages.append(str(e)) # deserialize data into CustomerInfoJustCustomerId try: instance.actual_instance = CustomerInfoJustCustomerId.from_json(json_str) match += 1 - except ValidationError as e: + except (ValidationError, ValueError) as e: error_messages.append(str(e)) if match > 1: @@ -103,17 +111,26 @@ def from_json(cls, json_str: str) -> OrderRequestCustomerInfo: def to_json(self) -> str: """Returns the JSON representation of the actual instance""" - if self.actual_instance is not None: + if self.actual_instance is None: + return "null" + + to_json = getattr(self.actual_instance, "to_json", None) + if callable(to_json): return self.actual_instance.to_json() else: - return "null" + return json.dumps(self.actual_instance) def to_dict(self) -> dict: """Returns the dict representation of the actual instance""" - if self.actual_instance is not None: + if self.actual_instance is None: + return None + + to_dict = getattr(self.actual_instance, "to_dict", None) + if callable(to_dict): return self.actual_instance.to_dict() else: - return dict() + # primitive type + return self.actual_instance def to_str(self) -> str: """Returns the string representation of the actual instance""" diff --git a/conekta/models/order_response.py b/conekta/models/order_response.py index 8476fdf..16922a7 100644 --- a/conekta/models/order_response.py +++ b/conekta/models/order_response.py @@ -7,12 +7,13 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -30,10 +31,8 @@ from conekta.models.order_response_shipping_contact import OrderResponseShippingContact class OrderResponse(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + order response """ amount: Optional[StrictInt] = Field(None, description="The total amount to be collected in cents") amount_refunded: Optional[StrictInt] = Field(None, description="The total amount refunded in cents") @@ -57,6 +56,7 @@ class OrderResponse(BaseModel): __properties = ["amount", "amount_refunded", "channel", "charges", "checkout", "created_at", "currency", "customer_info", "discount_lines", "fiscal_entity", "id", "is_refundable", "line_items", "livemode", "metadata", "object", "payment_status", "shipping_contact", "updated_at"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -111,7 +111,7 @@ def from_dict(cls, obj: dict) -> OrderResponse: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return OrderResponse.parse_obj(obj) _obj = OrderResponse.parse_obj({ diff --git a/conekta/models/order_response_charges.py b/conekta/models/order_response_charges.py index cba168d..f140634 100644 --- a/conekta/models/order_response_charges.py +++ b/conekta/models/order_response_charges.py @@ -7,33 +7,33 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json from typing import List, Optional -from pydantic import BaseModel, Field, StrictBool, StrictStr +from pydantic import BaseModel, Field, StrictBool, StrictStr, conlist from conekta.models.charges_data_response import ChargesDataResponse class OrderResponseCharges(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + The charges associated with the order """ has_more: StrictBool = Field(..., description="Indicates if there are more pages to be requested") object: StrictStr = Field(..., description="Object type, in this case is list") - data: Optional[List[ChargesDataResponse]] = None + data: Optional[conlist(ChargesDataResponse)] = None __properties = ["has_more", "object", "data"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -71,7 +71,7 @@ def from_dict(cls, obj: dict) -> OrderResponseCharges: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return OrderResponseCharges.parse_obj(obj) _obj = OrderResponseCharges.parse_obj({ diff --git a/conekta/models/order_response_charges_all_of.py b/conekta/models/order_response_charges_all_of.py index 17db082..a65c1e8 100644 --- a/conekta/models/order_response_charges_all_of.py +++ b/conekta/models/order_response_charges_all_of.py @@ -7,31 +7,31 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json from typing import List, Optional -from pydantic import BaseModel +from pydantic import BaseModel, conlist from conekta.models.charges_data_response import ChargesDataResponse class OrderResponseChargesAllOf(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. """ - data: Optional[List[ChargesDataResponse]] = None + OrderResponseChargesAllOf + """ + data: Optional[conlist(ChargesDataResponse)] = None __properties = ["data"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -69,7 +69,7 @@ def from_dict(cls, obj: dict) -> OrderResponseChargesAllOf: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return OrderResponseChargesAllOf.parse_obj(obj) _obj = OrderResponseChargesAllOf.parse_obj({ diff --git a/conekta/models/order_response_checkout.py b/conekta/models/order_response_checkout.py index 2bf83cc..52e3587 100644 --- a/conekta/models/order_response_checkout.py +++ b/conekta/models/order_response_checkout.py @@ -7,30 +7,29 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json from typing import Any, Dict, List, Optional -from pydantic import BaseModel, StrictBool, StrictInt, StrictStr +from pydantic import BaseModel, StrictBool, StrictInt, StrictStr, conlist class OrderResponseCheckout(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. """ - allowed_payment_methods: Optional[List[StrictStr]] = None + OrderResponseCheckout + """ + allowed_payment_methods: Optional[conlist(StrictStr)] = None can_not_expire: Optional[StrictBool] = None emails_sent: Optional[StrictInt] = None - exclude_card_networks: Optional[List[Dict[str, Any]]] = None + exclude_card_networks: Optional[conlist(Dict[str, Any])] = None expires_at: Optional[StrictInt] = None failure_url: Optional[StrictStr] = None force_3ds_flow: Optional[StrictBool] = None @@ -39,7 +38,7 @@ class OrderResponseCheckout(BaseModel): livemode: Optional[StrictBool] = None metadata: Optional[Dict[str, Any]] = None monthly_installments_enabled: Optional[StrictBool] = None - monthly_installments_options: Optional[List[StrictInt]] = None + monthly_installments_options: Optional[conlist(StrictInt)] = None name: Optional[StrictStr] = None needs_shipping_contact: Optional[StrictBool] = None object: Optional[StrictStr] = None @@ -56,6 +55,7 @@ class OrderResponseCheckout(BaseModel): __properties = ["allowed_payment_methods", "can_not_expire", "emails_sent", "exclude_card_networks", "expires_at", "failure_url", "force_3ds_flow", "id", "is_redirect_on_failure", "livemode", "metadata", "monthly_installments_enabled", "monthly_installments_options", "name", "needs_shipping_contact", "object", "on_demand_enabled", "paid_payments_count", "recurrent", "slug", "sms_sent", "success_url", "starts_at", "status", "type", "url"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -79,7 +79,8 @@ def to_dict(self): }, exclude_none=True) # set to None if on_demand_enabled (nullable) is None - if self.on_demand_enabled is None: + # and __fields_set__ contains the field + if self.on_demand_enabled is None and "on_demand_enabled" in self.__fields_set__: _dict['on_demand_enabled'] = None return _dict @@ -90,7 +91,7 @@ def from_dict(cls, obj: dict) -> OrderResponseCheckout: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return OrderResponseCheckout.parse_obj(obj) _obj = OrderResponseCheckout.parse_obj({ diff --git a/conekta/models/order_response_customer_info.py b/conekta/models/order_response_customer_info.py index fd000a2..c71b5ea 100644 --- a/conekta/models/order_response_customer_info.py +++ b/conekta/models/order_response_customer_info.py @@ -7,12 +7,13 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -22,10 +23,8 @@ from pydantic import BaseModel, StrictBool, StrictStr class OrderResponseCustomerInfo(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + OrderResponseCustomerInfo """ object: Optional[StrictStr] = None name: Optional[StrictStr] = None @@ -36,6 +35,7 @@ class OrderResponseCustomerInfo(BaseModel): __properties = ["object", "name", "email", "phone", "corporate", "customer_id"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -66,7 +66,7 @@ def from_dict(cls, obj: dict) -> OrderResponseCustomerInfo: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return OrderResponseCustomerInfo.parse_obj(obj) _obj = OrderResponseCustomerInfo.parse_obj({ diff --git a/conekta/models/order_response_customer_info_all_of.py b/conekta/models/order_response_customer_info_all_of.py index 7a2d4d5..213e35c 100644 --- a/conekta/models/order_response_customer_info_all_of.py +++ b/conekta/models/order_response_customer_info_all_of.py @@ -7,12 +7,13 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -22,15 +23,14 @@ from pydantic import BaseModel, StrictStr class OrderResponseCustomerInfoAllOf(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + OrderResponseCustomerInfoAllOf """ object: Optional[StrictStr] = None __properties = ["object"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -61,7 +61,7 @@ def from_dict(cls, obj: dict) -> OrderResponseCustomerInfoAllOf: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return OrderResponseCustomerInfoAllOf.parse_obj(obj) _obj = OrderResponseCustomerInfoAllOf.parse_obj({ diff --git a/conekta/models/order_response_discount_lines.py b/conekta/models/order_response_discount_lines.py index 48f7a7d..0269ae4 100644 --- a/conekta/models/order_response_discount_lines.py +++ b/conekta/models/order_response_discount_lines.py @@ -7,33 +7,33 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json from typing import List, Optional -from pydantic import BaseModel, Field, StrictBool, StrictStr +from pydantic import BaseModel, Field, StrictBool, StrictStr, conlist from conekta.models.discount_lines_data_response import DiscountLinesDataResponse class OrderResponseDiscountLines(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + OrderResponseDiscountLines """ has_more: StrictBool = Field(..., description="Indicates if there are more pages to be requested") object: StrictStr = Field(..., description="Object type, in this case is list") - data: Optional[List[DiscountLinesDataResponse]] = None + data: Optional[conlist(DiscountLinesDataResponse)] = None __properties = ["has_more", "object", "data"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -71,7 +71,7 @@ def from_dict(cls, obj: dict) -> OrderResponseDiscountLines: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return OrderResponseDiscountLines.parse_obj(obj) _obj = OrderResponseDiscountLines.parse_obj({ diff --git a/conekta/models/order_response_discount_lines_all_of.py b/conekta/models/order_response_discount_lines_all_of.py index 96a1443..0f54467 100644 --- a/conekta/models/order_response_discount_lines_all_of.py +++ b/conekta/models/order_response_discount_lines_all_of.py @@ -7,31 +7,31 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json from typing import List, Optional -from pydantic import BaseModel +from pydantic import BaseModel, conlist from conekta.models.discount_lines_data_response import DiscountLinesDataResponse class OrderResponseDiscountLinesAllOf(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. """ - data: Optional[List[DiscountLinesDataResponse]] = None + OrderResponseDiscountLinesAllOf + """ + data: Optional[conlist(DiscountLinesDataResponse)] = None __properties = ["data"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -69,7 +69,7 @@ def from_dict(cls, obj: dict) -> OrderResponseDiscountLinesAllOf: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return OrderResponseDiscountLinesAllOf.parse_obj(obj) _obj = OrderResponseDiscountLinesAllOf.parse_obj({ diff --git a/conekta/models/order_response_fiscal_entity.py b/conekta/models/order_response_fiscal_entity.py index b5183cf..f1832b1 100644 --- a/conekta/models/order_response_fiscal_entity.py +++ b/conekta/models/order_response_fiscal_entity.py @@ -7,12 +7,13 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -23,10 +24,8 @@ from conekta.models.order_response_fiscal_entity_address import OrderResponseFiscalEntityAddress class OrderResponseFiscalEntity(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + OrderResponseFiscalEntity """ address: Optional[OrderResponseFiscalEntityAddress] = None tax_id: Optional[StrictStr] = None @@ -35,6 +34,7 @@ class OrderResponseFiscalEntity(BaseModel): __properties = ["address", "tax_id", "id", "object"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -68,7 +68,7 @@ def from_dict(cls, obj: dict) -> OrderResponseFiscalEntity: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return OrderResponseFiscalEntity.parse_obj(obj) _obj = OrderResponseFiscalEntity.parse_obj({ diff --git a/conekta/models/order_response_fiscal_entity_address.py b/conekta/models/order_response_fiscal_entity_address.py index 15e6d99..a1faaf1 100644 --- a/conekta/models/order_response_fiscal_entity_address.py +++ b/conekta/models/order_response_fiscal_entity_address.py @@ -7,12 +7,13 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -22,15 +23,13 @@ from pydantic import BaseModel, Field, StrictBool, StrictStr class OrderResponseFiscalEntityAddress(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. """ - street1: StrictStr = ... + OrderResponseFiscalEntityAddress + """ + street1: StrictStr = Field(...) street2: Optional[StrictStr] = None - postal_code: StrictStr = ... - city: StrictStr = ... + postal_code: StrictStr = Field(...) + city: StrictStr = Field(...) state: Optional[StrictStr] = None country: Optional[StrictStr] = Field(None, description="this field follows the [ISO 3166-1 alpha-2 standard](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)") residential: Optional[StrictBool] = None @@ -39,6 +38,7 @@ class OrderResponseFiscalEntityAddress(BaseModel): __properties = ["street1", "street2", "postal_code", "city", "state", "country", "residential", "external_number", "object"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -69,7 +69,7 @@ def from_dict(cls, obj: dict) -> OrderResponseFiscalEntityAddress: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return OrderResponseFiscalEntityAddress.parse_obj(obj) _obj = OrderResponseFiscalEntityAddress.parse_obj({ diff --git a/conekta/models/order_response_fiscal_entity_address_all_of.py b/conekta/models/order_response_fiscal_entity_address_all_of.py index cc140a9..387742d 100644 --- a/conekta/models/order_response_fiscal_entity_address_all_of.py +++ b/conekta/models/order_response_fiscal_entity_address_all_of.py @@ -7,12 +7,13 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -22,15 +23,14 @@ from pydantic import BaseModel, StrictStr class OrderResponseFiscalEntityAddressAllOf(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + OrderResponseFiscalEntityAddressAllOf """ object: Optional[StrictStr] = None __properties = ["object"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -61,7 +61,7 @@ def from_dict(cls, obj: dict) -> OrderResponseFiscalEntityAddressAllOf: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return OrderResponseFiscalEntityAddressAllOf.parse_obj(obj) _obj = OrderResponseFiscalEntityAddressAllOf.parse_obj({ diff --git a/conekta/models/order_response_products.py b/conekta/models/order_response_products.py index 895e73e..9be6e5f 100644 --- a/conekta/models/order_response_products.py +++ b/conekta/models/order_response_products.py @@ -7,35 +7,35 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json from typing import List, Optional -from pydantic import BaseModel, Field, StrictBool, StrictStr +from pydantic import BaseModel, Field, StrictBool, StrictStr, conlist from conekta.models.product_data_response import ProductDataResponse class OrderResponseProducts(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + OrderResponseProducts """ has_more: StrictBool = Field(..., description="Indicates if there are more pages to be requested") object: StrictStr = Field(..., description="Object type, in this case is list") next_page_url: Optional[StrictStr] = Field(None, description="URL of the next page.") previous_page_url: Optional[StrictStr] = Field(None, description="Url of the previous page.") - data: Optional[List[ProductDataResponse]] = None + data: Optional[conlist(ProductDataResponse)] = None __properties = ["has_more", "object", "next_page_url", "previous_page_url", "data"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -66,11 +66,13 @@ def to_dict(self): _items.append(_item.to_dict()) _dict['data'] = _items # set to None if next_page_url (nullable) is None - if self.next_page_url is None: + # and __fields_set__ contains the field + if self.next_page_url is None and "next_page_url" in self.__fields_set__: _dict['next_page_url'] = None # set to None if previous_page_url (nullable) is None - if self.previous_page_url is None: + # and __fields_set__ contains the field + if self.previous_page_url is None and "previous_page_url" in self.__fields_set__: _dict['previous_page_url'] = None return _dict @@ -81,7 +83,7 @@ def from_dict(cls, obj: dict) -> OrderResponseProducts: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return OrderResponseProducts.parse_obj(obj) _obj = OrderResponseProducts.parse_obj({ diff --git a/conekta/models/order_response_products_all_of.py b/conekta/models/order_response_products_all_of.py index 4075401..67d393e 100644 --- a/conekta/models/order_response_products_all_of.py +++ b/conekta/models/order_response_products_all_of.py @@ -7,31 +7,31 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json from typing import List, Optional -from pydantic import BaseModel +from pydantic import BaseModel, conlist from conekta.models.product_data_response import ProductDataResponse class OrderResponseProductsAllOf(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. """ - data: Optional[List[ProductDataResponse]] = None + OrderResponseProductsAllOf + """ + data: Optional[conlist(ProductDataResponse)] = None __properties = ["data"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -69,7 +69,7 @@ def from_dict(cls, obj: dict) -> OrderResponseProductsAllOf: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return OrderResponseProductsAllOf.parse_obj(obj) _obj = OrderResponseProductsAllOf.parse_obj({ diff --git a/conekta/models/order_response_shipping_contact.py b/conekta/models/order_response_shipping_contact.py index fca693c..8ab094a 100644 --- a/conekta/models/order_response_shipping_contact.py +++ b/conekta/models/order_response_shipping_contact.py @@ -7,12 +7,13 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -23,10 +24,8 @@ from conekta.models.customer_shipping_contacts_response_address import CustomerShippingContactsResponseAddress class OrderResponseShippingContact(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + OrderResponseShippingContact """ created_at: Optional[StrictInt] = None id: Optional[StrictStr] = None @@ -41,6 +40,7 @@ class OrderResponseShippingContact(BaseModel): __properties = ["created_at", "id", "object", "phone", "receiver", "between_streets", "address", "parent_id", "default", "deleted"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -67,7 +67,8 @@ def to_dict(self): if self.address: _dict['address'] = self.address.to_dict() # set to None if between_streets (nullable) is None - if self.between_streets is None: + # and __fields_set__ contains the field + if self.between_streets is None and "between_streets" in self.__fields_set__: _dict['between_streets'] = None return _dict @@ -78,7 +79,7 @@ def from_dict(cls, obj: dict) -> OrderResponseShippingContact: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return OrderResponseShippingContact.parse_obj(obj) _obj = OrderResponseShippingContact.parse_obj({ diff --git a/conekta/models/order_response_shipping_contact_all_of.py b/conekta/models/order_response_shipping_contact_all_of.py index 3f92246..7b4fe85 100644 --- a/conekta/models/order_response_shipping_contact_all_of.py +++ b/conekta/models/order_response_shipping_contact_all_of.py @@ -7,12 +7,13 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -22,10 +23,8 @@ from pydantic import BaseModel, StrictInt, StrictStr class OrderResponseShippingContactAllOf(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + OrderResponseShippingContactAllOf """ created_at: Optional[StrictInt] = None id: Optional[StrictStr] = None @@ -33,6 +32,7 @@ class OrderResponseShippingContactAllOf(BaseModel): __properties = ["created_at", "id", "object"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -63,7 +63,7 @@ def from_dict(cls, obj: dict) -> OrderResponseShippingContactAllOf: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return OrderResponseShippingContactAllOf.parse_obj(obj) _obj = OrderResponseShippingContactAllOf.parse_obj({ diff --git a/conekta/models/order_tax_request.py b/conekta/models/order_tax_request.py index 28a804a..d138eab 100644 --- a/conekta/models/order_tax_request.py +++ b/conekta/models/order_tax_request.py @@ -7,12 +7,13 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -22,10 +23,8 @@ from pydantic import BaseModel, Field, conint, constr class OrderTaxRequest(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + create new taxes for an existing order """ amount: conint(strict=True, ge=0) = Field(..., description="The amount to be collected for tax in cents") description: constr(strict=True, min_length=2) = Field(..., description="description or tax's name") @@ -33,6 +32,7 @@ class OrderTaxRequest(BaseModel): __properties = ["amount", "description", "metadata"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -63,7 +63,7 @@ def from_dict(cls, obj: dict) -> OrderTaxRequest: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return OrderTaxRequest.parse_obj(obj) _obj = OrderTaxRequest.parse_obj({ diff --git a/conekta/models/order_update_request.py b/conekta/models/order_update_request.py index 80ba3e3..4c225fd 100644 --- a/conekta/models/order_update_request.py +++ b/conekta/models/order_update_request.py @@ -7,19 +7,20 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json from typing import Dict, List, Optional -from pydantic import BaseModel, Field, StrictBool, StrictStr, constr +from pydantic import BaseModel, Field, StrictBool, StrictStr, conlist, constr from conekta.models.charge_request import ChargeRequest from conekta.models.checkout_request import CheckoutRequest from conekta.models.customer_shipping_contacts import CustomerShippingContacts @@ -30,25 +31,24 @@ from conekta.models.shipping_request import ShippingRequest class OrderUpdateRequest(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. """ - charges: Optional[List[ChargeRequest]] = None + a order + """ + charges: Optional[conlist(ChargeRequest)] = None checkout: Optional[CheckoutRequest] = None currency: Optional[constr(strict=True, max_length=3)] = Field(None, description="Currency with which the payment will be made. It uses the 3-letter code of the [International Standard ISO 4217.](https://es.wikipedia.org/wiki/ISO_4217)") customer_info: Optional[OrderRequestCustomerInfo] = None - discount_lines: Optional[List[OrderDiscountLinesRequest]] = Field(None, description="List of [discounts](https://developers.conekta.com/v2.1.0/reference/orderscreatediscountline) that are applied to the order. You must have at least one discount.") - line_items: Optional[List[Product]] = Field(None, description="List of [products](https://developers.conekta.com/v2.1.0/reference/orderscreateproduct) that are sold in the order. You must have at least one product.") + discount_lines: Optional[conlist(OrderDiscountLinesRequest)] = Field(None, description="List of [discounts](https://developers.conekta.com/v2.1.0/reference/orderscreatediscountline) that are applied to the order. You must have at least one discount.") + line_items: Optional[conlist(Product)] = Field(None, description="List of [products](https://developers.conekta.com/v2.1.0/reference/orderscreateproduct) that are sold in the order. You must have at least one product.") metadata: Optional[Dict[str, StrictStr]] = None pre_authorize: Optional[StrictBool] = Field(False, description="Indicates whether the order charges must be preauthorized") shipping_contact: Optional[CustomerShippingContacts] = None - shipping_lines: Optional[List[ShippingRequest]] = Field(None, description="List of [shipping costs](https://developers.conekta.com/v2.1.0/reference/orderscreateshipping). If the online store offers digital products.") - tax_lines: Optional[List[OrderTaxRequest]] = None + shipping_lines: Optional[conlist(ShippingRequest)] = Field(None, description="List of [shipping costs](https://developers.conekta.com/v2.1.0/reference/orderscreateshipping). If the online store offers digital products.") + tax_lines: Optional[conlist(OrderTaxRequest)] = None __properties = ["charges", "checkout", "currency", "customer_info", "discount_lines", "line_items", "metadata", "pre_authorize", "shipping_contact", "shipping_lines", "tax_lines"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -123,7 +123,7 @@ def from_dict(cls, obj: dict) -> OrderUpdateRequest: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return OrderUpdateRequest.parse_obj(obj) _obj = OrderUpdateRequest.parse_obj({ diff --git a/conekta/models/orders_response.py b/conekta/models/orders_response.py index 679429d..ad940fd 100644 --- a/conekta/models/orders_response.py +++ b/conekta/models/orders_response.py @@ -7,31 +7,31 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json from typing import List -from pydantic import BaseModel +from pydantic import BaseModel, Field, conlist from conekta.models.order_response import OrderResponse class OrdersResponse(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. """ - data: List[OrderResponse] = ... + OrdersResponse + """ + data: conlist(OrderResponse) = Field(...) __properties = ["data"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -69,7 +69,7 @@ def from_dict(cls, obj: dict) -> OrdersResponse: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return OrdersResponse.parse_obj(obj) _obj = OrdersResponse.parse_obj({ diff --git a/conekta/models/page.py b/conekta/models/page.py index 4ec3689..7ef3149 100644 --- a/conekta/models/page.py +++ b/conekta/models/page.py @@ -7,12 +7,13 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -22,16 +23,15 @@ from pydantic import BaseModel, Field, StrictStr class Page(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + page metadata """ next_page_url: Optional[StrictStr] = Field(None, description="URL of the next page.") previous_page_url: Optional[StrictStr] = Field(None, description="Url of the previous page.") __properties = ["next_page_url", "previous_page_url"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -55,11 +55,13 @@ def to_dict(self): }, exclude_none=True) # set to None if next_page_url (nullable) is None - if self.next_page_url is None: + # and __fields_set__ contains the field + if self.next_page_url is None and "next_page_url" in self.__fields_set__: _dict['next_page_url'] = None # set to None if previous_page_url (nullable) is None - if self.previous_page_url is None: + # and __fields_set__ contains the field + if self.previous_page_url is None and "previous_page_url" in self.__fields_set__: _dict['previous_page_url'] = None return _dict @@ -70,7 +72,7 @@ def from_dict(cls, obj: dict) -> Page: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return Page.parse_obj(obj) _obj = Page.parse_obj({ diff --git a/conekta/models/pagination.py b/conekta/models/pagination.py index da10349..bd59b0d 100644 --- a/conekta/models/pagination.py +++ b/conekta/models/pagination.py @@ -7,12 +7,13 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -22,16 +23,15 @@ from pydantic import BaseModel, Field, StrictBool, StrictStr class Pagination(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + pagination metadata """ has_more: StrictBool = Field(..., description="Indicates if there are more pages to be requested") object: StrictStr = Field(..., description="Object type, in this case is list") __properties = ["has_more", "object"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -62,7 +62,7 @@ def from_dict(cls, obj: dict) -> Pagination: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return Pagination.parse_obj(obj) _obj = Pagination.parse_obj({ diff --git a/conekta/models/payment_method.py b/conekta/models/payment_method.py index b664392..73bf5d0 100644 --- a/conekta/models/payment_method.py +++ b/conekta/models/payment_method.py @@ -7,31 +7,31 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json from typing import Optional -from pydantic import BaseModel, StrictStr +from pydantic import BaseModel, Field, StrictStr class PaymentMethod(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + PaymentMethod """ type: Optional[StrictStr] = None - object: StrictStr = ... + object: StrictStr = Field(...) __properties = ["type", "object"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -62,7 +62,7 @@ def from_dict(cls, obj: dict) -> PaymentMethod: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return PaymentMethod.parse_obj(obj) _obj = PaymentMethod.parse_obj({ diff --git a/conekta/models/payment_method_bank_transfer.py b/conekta/models/payment_method_bank_transfer.py index 5fe265b..3ccbae9 100644 --- a/conekta/models/payment_method_bank_transfer.py +++ b/conekta/models/payment_method_bank_transfer.py @@ -7,28 +7,27 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json from typing import Any, List, Optional -from pydantic import BaseModel, StrictInt, StrictStr +from pydantic import BaseModel, Field, StrictInt, StrictStr, conlist class PaymentMethodBankTransfer(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + PaymentMethodBankTransfer """ type: Optional[StrictStr] = None - object: StrictStr = ... + object: StrictStr = Field(...) bank: Optional[StrictStr] = None clabe: Optional[StrictStr] = None description: Optional[StrictStr] = None @@ -38,7 +37,7 @@ class PaymentMethodBankTransfer(BaseModel): issuing_account_number: Optional[StrictStr] = None issuing_account_holder_name: Optional[StrictStr] = None issuing_account_tax_id: Optional[StrictStr] = None - payment_attempts: Optional[List[Any]] = None + payment_attempts: Optional[conlist(Any)] = None receiving_account_holder_name: Optional[StrictStr] = None receiving_account_number: Optional[StrictStr] = None receiving_account_bank: Optional[StrictStr] = None @@ -48,6 +47,7 @@ class PaymentMethodBankTransfer(BaseModel): __properties = ["type", "object", "bank", "clabe", "description", "executed_at", "expires_at", "issuing_account_bank", "issuing_account_number", "issuing_account_holder_name", "issuing_account_tax_id", "payment_attempts", "receiving_account_holder_name", "receiving_account_number", "receiving_account_bank", "receiving_account_tax_id", "reference_number", "tracking_code"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -71,43 +71,53 @@ def to_dict(self): }, exclude_none=True) # set to None if description (nullable) is None - if self.description is None: + # and __fields_set__ contains the field + if self.description is None and "description" in self.__fields_set__: _dict['description'] = None # set to None if executed_at (nullable) is None - if self.executed_at is None: + # and __fields_set__ contains the field + if self.executed_at is None and "executed_at" in self.__fields_set__: _dict['executed_at'] = None # set to None if issuing_account_bank (nullable) is None - if self.issuing_account_bank is None: + # and __fields_set__ contains the field + if self.issuing_account_bank is None and "issuing_account_bank" in self.__fields_set__: _dict['issuing_account_bank'] = None # set to None if issuing_account_number (nullable) is None - if self.issuing_account_number is None: + # and __fields_set__ contains the field + if self.issuing_account_number is None and "issuing_account_number" in self.__fields_set__: _dict['issuing_account_number'] = None # set to None if issuing_account_holder_name (nullable) is None - if self.issuing_account_holder_name is None: + # and __fields_set__ contains the field + if self.issuing_account_holder_name is None and "issuing_account_holder_name" in self.__fields_set__: _dict['issuing_account_holder_name'] = None # set to None if issuing_account_tax_id (nullable) is None - if self.issuing_account_tax_id is None: + # and __fields_set__ contains the field + if self.issuing_account_tax_id is None and "issuing_account_tax_id" in self.__fields_set__: _dict['issuing_account_tax_id'] = None # set to None if receiving_account_holder_name (nullable) is None - if self.receiving_account_holder_name is None: + # and __fields_set__ contains the field + if self.receiving_account_holder_name is None and "receiving_account_holder_name" in self.__fields_set__: _dict['receiving_account_holder_name'] = None # set to None if receiving_account_tax_id (nullable) is None - if self.receiving_account_tax_id is None: + # and __fields_set__ contains the field + if self.receiving_account_tax_id is None and "receiving_account_tax_id" in self.__fields_set__: _dict['receiving_account_tax_id'] = None # set to None if reference_number (nullable) is None - if self.reference_number is None: + # and __fields_set__ contains the field + if self.reference_number is None and "reference_number" in self.__fields_set__: _dict['reference_number'] = None # set to None if tracking_code (nullable) is None - if self.tracking_code is None: + # and __fields_set__ contains the field + if self.tracking_code is None and "tracking_code" in self.__fields_set__: _dict['tracking_code'] = None return _dict @@ -118,7 +128,7 @@ def from_dict(cls, obj: dict) -> PaymentMethodBankTransfer: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return PaymentMethodBankTransfer.parse_obj(obj) _obj = PaymentMethodBankTransfer.parse_obj({ diff --git a/conekta/models/payment_method_card.py b/conekta/models/payment_method_card.py index 6dc5102..94a7659 100644 --- a/conekta/models/payment_method_card.py +++ b/conekta/models/payment_method_card.py @@ -7,41 +7,41 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json from typing import Any, List, Optional -from pydantic import BaseModel, StrictStr +from pydantic import BaseModel, Field, StrictStr, conlist class PaymentMethodCard(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + PaymentMethodCard """ type: Optional[StrictStr] = None - object: StrictStr = ... + object: StrictStr = Field(...) account_type: Optional[StrictStr] = None auth_code: Optional[StrictStr] = None brand: Optional[StrictStr] = None country: Optional[StrictStr] = None exp_month: Optional[StrictStr] = None exp_year: Optional[StrictStr] = None - fraud_indicators: Optional[List[Any]] = None + fraud_indicators: Optional[conlist(Any)] = None issuer: Optional[StrictStr] = None last4: Optional[StrictStr] = None name: Optional[StrictStr] = None __properties = ["type", "object", "account_type", "auth_code", "brand", "country", "exp_month", "exp_year", "fraud_indicators", "issuer", "last4", "name"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -72,7 +72,7 @@ def from_dict(cls, obj: dict) -> PaymentMethodCard: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return PaymentMethodCard.parse_obj(obj) _obj = PaymentMethodCard.parse_obj({ diff --git a/conekta/models/payment_method_card_request.py b/conekta/models/payment_method_card_request.py index 3d30ff9..fb189f2 100644 --- a/conekta/models/payment_method_card_request.py +++ b/conekta/models/payment_method_card_request.py @@ -7,12 +7,13 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -22,16 +23,15 @@ from pydantic import BaseModel, Field, StrictStr class PaymentMethodCardRequest(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + PaymentMethodCardRequest """ type: StrictStr = Field(..., description="Type of payment method") token_id: StrictStr = Field(..., description="Token id that will be used to create a \"card\" type payment method. See the (subscriptions)[https://developers.conekta.com/v2.1.0/reference/createsubscription] tutorial for more information on how to tokenize cards.") __properties = ["type", "token_id"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -62,7 +62,7 @@ def from_dict(cls, obj: dict) -> PaymentMethodCardRequest: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return PaymentMethodCardRequest.parse_obj(obj) _obj = PaymentMethodCardRequest.parse_obj({ diff --git a/conekta/models/payment_method_card_request_all_of.py b/conekta/models/payment_method_card_request_all_of.py index 02e5816..6ea72f6 100644 --- a/conekta/models/payment_method_card_request_all_of.py +++ b/conekta/models/payment_method_card_request_all_of.py @@ -7,12 +7,13 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -22,15 +23,14 @@ from pydantic import BaseModel, Field, StrictStr class PaymentMethodCardRequestAllOf(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + PaymentMethodCardRequestAllOf """ token_id: Optional[StrictStr] = Field(None, description="Token id that will be used to create a \"card\" type payment method. See the (subscriptions)[https://developers.conekta.com/v2.1.0/reference/createsubscription] tutorial for more information on how to tokenize cards.") __properties = ["token_id"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -61,7 +61,7 @@ def from_dict(cls, obj: dict) -> PaymentMethodCardRequestAllOf: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return PaymentMethodCardRequestAllOf.parse_obj(obj) _obj = PaymentMethodCardRequestAllOf.parse_obj({ diff --git a/conekta/models/payment_method_card_response.py b/conekta/models/payment_method_card_response.py index 315d427..f664cec 100644 --- a/conekta/models/payment_method_card_response.py +++ b/conekta/models/payment_method_card_response.py @@ -7,30 +7,29 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json from typing import Optional -from pydantic import BaseModel, StrictBool, StrictInt, StrictStr +from pydantic import BaseModel, Field, StrictBool, StrictInt, StrictStr class PaymentMethodCardResponse(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. """ - type: StrictStr = ... - id: StrictStr = ... - object: StrictStr = ... - created_at: StrictInt = ... + PaymentMethodCardResponse + """ + type: StrictStr = Field(...) + id: StrictStr = Field(...) + object: StrictStr = Field(...) + created_at: StrictInt = Field(...) parent_id: Optional[StrictStr] = None last4: Optional[StrictStr] = None bin: Optional[StrictStr] = None @@ -45,6 +44,7 @@ class PaymentMethodCardResponse(BaseModel): __properties = ["type", "id", "object", "created_at", "parent_id", "last4", "bin", "card_type", "exp_month", "exp_year", "brand", "name", "default", "visible_on_checkout", "payment_source_status"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -75,7 +75,7 @@ def from_dict(cls, obj: dict) -> PaymentMethodCardResponse: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return PaymentMethodCardResponse.parse_obj(obj) _obj = PaymentMethodCardResponse.parse_obj({ diff --git a/conekta/models/payment_method_card_response_all_of.py b/conekta/models/payment_method_card_response_all_of.py index 2988b28..fc6c9c5 100644 --- a/conekta/models/payment_method_card_response_all_of.py +++ b/conekta/models/payment_method_card_response_all_of.py @@ -7,12 +7,13 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -22,10 +23,8 @@ from pydantic import BaseModel, StrictBool, StrictStr class PaymentMethodCardResponseAllOf(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + use for card responses """ last4: Optional[StrictStr] = None bin: Optional[StrictStr] = None @@ -40,6 +39,7 @@ class PaymentMethodCardResponseAllOf(BaseModel): __properties = ["last4", "bin", "card_type", "exp_month", "exp_year", "brand", "name", "default", "visible_on_checkout", "payment_source_status"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -70,7 +70,7 @@ def from_dict(cls, obj: dict) -> PaymentMethodCardResponseAllOf: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return PaymentMethodCardResponseAllOf.parse_obj(obj) _obj = PaymentMethodCardResponseAllOf.parse_obj({ diff --git a/conekta/models/payment_method_cash.py b/conekta/models/payment_method_cash.py index 9ae5981..d14e4d6 100644 --- a/conekta/models/payment_method_cash.py +++ b/conekta/models/payment_method_cash.py @@ -7,28 +7,27 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json from typing import Optional -from pydantic import BaseModel, StrictInt, StrictStr +from pydantic import BaseModel, Field, StrictInt, StrictStr class PaymentMethodCash(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + PaymentMethodCash """ type: Optional[StrictStr] = None - object: StrictStr = ... + object: StrictStr = Field(...) auth_code: Optional[StrictInt] = None cashier_id: Optional[StrictStr] = None reference: Optional[StrictStr] = None @@ -40,6 +39,7 @@ class PaymentMethodCash(BaseModel): __properties = ["type", "object", "auth_code", "cashier_id", "reference", "barcode_url", "expires_at", "service_name", "store", "store_name"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -63,15 +63,18 @@ def to_dict(self): }, exclude_none=True) # set to None if auth_code (nullable) is None - if self.auth_code is None: + # and __fields_set__ contains the field + if self.auth_code is None and "auth_code" in self.__fields_set__: _dict['auth_code'] = None # set to None if cashier_id (nullable) is None - if self.cashier_id is None: + # and __fields_set__ contains the field + if self.cashier_id is None and "cashier_id" in self.__fields_set__: _dict['cashier_id'] = None # set to None if store (nullable) is None - if self.store is None: + # and __fields_set__ contains the field + if self.store is None and "store" in self.__fields_set__: _dict['store'] = None return _dict @@ -82,7 +85,7 @@ def from_dict(cls, obj: dict) -> PaymentMethodCash: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return PaymentMethodCash.parse_obj(obj) _obj = PaymentMethodCash.parse_obj({ diff --git a/conekta/models/payment_method_cash_request.py b/conekta/models/payment_method_cash_request.py index 0bf4efd..385a3bf 100644 --- a/conekta/models/payment_method_cash_request.py +++ b/conekta/models/payment_method_cash_request.py @@ -7,12 +7,13 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -22,16 +23,15 @@ from pydantic import BaseModel, Field, StrictInt, StrictStr class PaymentMethodCashRequest(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + PaymentMethodCashRequest """ type: StrictStr = Field(..., description="Type of payment method") expires_at: Optional[StrictInt] = None __properties = ["type", "expires_at"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -62,7 +62,7 @@ def from_dict(cls, obj: dict) -> PaymentMethodCashRequest: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return PaymentMethodCashRequest.parse_obj(obj) _obj = PaymentMethodCashRequest.parse_obj({ diff --git a/conekta/models/payment_method_cash_request_all_of.py b/conekta/models/payment_method_cash_request_all_of.py index 5e724df..5214698 100644 --- a/conekta/models/payment_method_cash_request_all_of.py +++ b/conekta/models/payment_method_cash_request_all_of.py @@ -7,12 +7,13 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -22,15 +23,14 @@ from pydantic import BaseModel, StrictInt class PaymentMethodCashRequestAllOf(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + PaymentMethodCashRequestAllOf """ expires_at: Optional[StrictInt] = None __properties = ["expires_at"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -61,7 +61,7 @@ def from_dict(cls, obj: dict) -> PaymentMethodCashRequestAllOf: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return PaymentMethodCashRequestAllOf.parse_obj(obj) _obj = PaymentMethodCashRequestAllOf.parse_obj({ diff --git a/conekta/models/payment_method_cash_response.py b/conekta/models/payment_method_cash_response.py index f859dfc..26d77c7 100644 --- a/conekta/models/payment_method_cash_response.py +++ b/conekta/models/payment_method_cash_response.py @@ -7,30 +7,29 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json from typing import Optional -from pydantic import BaseModel, StrictInt, StrictStr +from pydantic import BaseModel, Field, StrictInt, StrictStr class PaymentMethodCashResponse(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. """ - type: StrictStr = ... - id: StrictStr = ... - object: StrictStr = ... - created_at: StrictInt = ... + PaymentMethodCashResponse + """ + type: StrictStr = Field(...) + id: StrictStr = Field(...) + object: StrictStr = Field(...) + created_at: StrictInt = Field(...) parent_id: Optional[StrictStr] = None reference: Optional[StrictStr] = None barcode: Optional[StrictStr] = None @@ -40,6 +39,7 @@ class PaymentMethodCashResponse(BaseModel): __properties = ["type", "id", "object", "created_at", "parent_id", "reference", "barcode", "barcode_url", "expires_at", "provider"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -70,7 +70,7 @@ def from_dict(cls, obj: dict) -> PaymentMethodCashResponse: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return PaymentMethodCashResponse.parse_obj(obj) _obj = PaymentMethodCashResponse.parse_obj({ diff --git a/conekta/models/payment_method_cash_response_all_of.py b/conekta/models/payment_method_cash_response_all_of.py index 85ef30c..bc4bba1 100644 --- a/conekta/models/payment_method_cash_response_all_of.py +++ b/conekta/models/payment_method_cash_response_all_of.py @@ -7,12 +7,13 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -22,10 +23,8 @@ from pydantic import BaseModel, StrictInt, StrictStr class PaymentMethodCashResponseAllOf(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + use for cash responses """ reference: Optional[StrictStr] = None barcode: Optional[StrictStr] = None @@ -35,6 +34,7 @@ class PaymentMethodCashResponseAllOf(BaseModel): __properties = ["reference", "barcode", "barcode_url", "expires_at", "provider"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -65,7 +65,7 @@ def from_dict(cls, obj: dict) -> PaymentMethodCashResponseAllOf: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return PaymentMethodCashResponseAllOf.parse_obj(obj) _obj = PaymentMethodCashResponseAllOf.parse_obj({ diff --git a/conekta/models/payment_method_response.py b/conekta/models/payment_method_response.py index 36b656d..f652e7c 100644 --- a/conekta/models/payment_method_response.py +++ b/conekta/models/payment_method_response.py @@ -7,34 +7,34 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json from typing import Optional -from pydantic import BaseModel, StrictInt, StrictStr +from pydantic import BaseModel, Field, StrictInt, StrictStr class PaymentMethodResponse(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. """ - type: StrictStr = ... - id: StrictStr = ... - object: StrictStr = ... - created_at: StrictInt = ... + PaymentMethodResponse + """ + type: StrictStr = Field(...) + id: StrictStr = Field(...) + object: StrictStr = Field(...) + created_at: StrictInt = Field(...) parent_id: Optional[StrictStr] = None __properties = ["type", "id", "object", "created_at", "parent_id"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -65,7 +65,7 @@ def from_dict(cls, obj: dict) -> PaymentMethodResponse: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return PaymentMethodResponse.parse_obj(obj) _obj = PaymentMethodResponse.parse_obj({ diff --git a/conekta/models/payment_method_spei_recurrent.py b/conekta/models/payment_method_spei_recurrent.py index 3390dd8..aa4912d 100644 --- a/conekta/models/payment_method_spei_recurrent.py +++ b/conekta/models/payment_method_spei_recurrent.py @@ -7,36 +7,36 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json from typing import Optional -from pydantic import BaseModel, StrictInt, StrictStr +from pydantic import BaseModel, Field, StrictInt, StrictStr class PaymentMethodSpeiRecurrent(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. """ - type: StrictStr = ... - id: StrictStr = ... - object: StrictStr = ... - created_at: StrictInt = ... + PaymentMethodSpeiRecurrent + """ + type: StrictStr = Field(...) + id: StrictStr = Field(...) + object: StrictStr = Field(...) + created_at: StrictInt = Field(...) parent_id: Optional[StrictStr] = None reference: Optional[StrictStr] = None expires_at: Optional[StrictStr] = None __properties = ["type", "id", "object", "created_at", "parent_id", "reference", "expires_at"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -67,7 +67,7 @@ def from_dict(cls, obj: dict) -> PaymentMethodSpeiRecurrent: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return PaymentMethodSpeiRecurrent.parse_obj(obj) _obj = PaymentMethodSpeiRecurrent.parse_obj({ diff --git a/conekta/models/payment_method_spei_recurrent_all_of.py b/conekta/models/payment_method_spei_recurrent_all_of.py index eaaea98..4e622a4 100644 --- a/conekta/models/payment_method_spei_recurrent_all_of.py +++ b/conekta/models/payment_method_spei_recurrent_all_of.py @@ -7,12 +7,13 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -22,16 +23,15 @@ from pydantic import BaseModel, StrictStr class PaymentMethodSpeiRecurrentAllOf(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + use for spei responses """ reference: Optional[StrictStr] = None expires_at: Optional[StrictStr] = None __properties = ["reference", "expires_at"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -62,7 +62,7 @@ def from_dict(cls, obj: dict) -> PaymentMethodSpeiRecurrentAllOf: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return PaymentMethodSpeiRecurrentAllOf.parse_obj(obj) _obj = PaymentMethodSpeiRecurrentAllOf.parse_obj({ diff --git a/conekta/models/payment_method_spei_request.py b/conekta/models/payment_method_spei_request.py index 48b7329..a490442 100644 --- a/conekta/models/payment_method_spei_request.py +++ b/conekta/models/payment_method_spei_request.py @@ -7,12 +7,13 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -22,16 +23,15 @@ from pydantic import BaseModel, Field, StrictInt, StrictStr class PaymentMethodSpeiRequest(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + PaymentMethodSpeiRequest """ type: StrictStr = Field(..., description="Type of payment method") expires_at: Optional[StrictInt] = None __properties = ["type", "expires_at"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -62,7 +62,7 @@ def from_dict(cls, obj: dict) -> PaymentMethodSpeiRequest: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return PaymentMethodSpeiRequest.parse_obj(obj) _obj = PaymentMethodSpeiRequest.parse_obj({ diff --git a/conekta/models/plan_request.py b/conekta/models/plan_request.py index 7169a6d..515c591 100644 --- a/conekta/models/plan_request.py +++ b/conekta/models/plan_request.py @@ -7,12 +7,13 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -22,10 +23,8 @@ from pydantic import BaseModel, Field, StrictInt, StrictStr, conint, constr, validator class PlanRequest(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + a plan """ amount: conint(strict=True, ge=1) = Field(..., description="The amount in cents that will be charged on the interval specified.") currency: Optional[constr(strict=True, max_length=3)] = Field(None, description="ISO 4217 for currencies, for the Mexican peso it is MXN/USD") @@ -38,12 +37,14 @@ class PlanRequest(BaseModel): __properties = ["amount", "currency", "expiry_count", "frequency", "id", "interval", "name", "trial_period_days"] @validator('interval') - def interval_validate_enum(cls, v): - if v not in ('week', 'half_month', 'month', 'year'): - raise ValueError("must validate the enum values ('week', 'half_month', 'month', 'year')") - return v + def interval_validate_enum(cls, value): + """Validates the enum""" + if value not in ('week', 'half_month', 'month', 'year'): + raise ValueError("must be one of enum values ('week', 'half_month', 'month', 'year')") + return value class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -74,7 +75,7 @@ def from_dict(cls, obj: dict) -> PlanRequest: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return PlanRequest.parse_obj(obj) _obj = PlanRequest.parse_obj({ diff --git a/conekta/models/plan_response.py b/conekta/models/plan_response.py index 41a90b0..5c91145 100644 --- a/conekta/models/plan_response.py +++ b/conekta/models/plan_response.py @@ -7,12 +7,13 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -22,10 +23,8 @@ from pydantic import BaseModel, StrictBool, StrictInt, StrictStr, constr class PlanResponse(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + plans model """ amount: Optional[StrictInt] = None created_at: Optional[StrictInt] = None @@ -41,6 +40,7 @@ class PlanResponse(BaseModel): __properties = ["amount", "created_at", "currency", "expiry_count", "frequency", "id", "interval", "livemode", "name", "object", "trial_period_days"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -64,11 +64,13 @@ def to_dict(self): }, exclude_none=True) # set to None if expiry_count (nullable) is None - if self.expiry_count is None: + # and __fields_set__ contains the field + if self.expiry_count is None and "expiry_count" in self.__fields_set__: _dict['expiry_count'] = None # set to None if trial_period_days (nullable) is None - if self.trial_period_days is None: + # and __fields_set__ contains the field + if self.trial_period_days is None and "trial_period_days" in self.__fields_set__: _dict['trial_period_days'] = None return _dict @@ -79,7 +81,7 @@ def from_dict(cls, obj: dict) -> PlanResponse: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return PlanResponse.parse_obj(obj) _obj = PlanResponse.parse_obj({ diff --git a/conekta/models/plan_update_request.py b/conekta/models/plan_update_request.py index a254b15..e1d48b7 100644 --- a/conekta/models/plan_update_request.py +++ b/conekta/models/plan_update_request.py @@ -7,12 +7,13 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -22,10 +23,8 @@ from pydantic import BaseModel, Field, StrictInt, StrictStr, conint, constr class PlanUpdateRequest(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + a plan """ amount: Optional[conint(strict=True, ge=1)] = Field(None, description="The amount in cents that will be charged on the interval specified.") currency: Optional[constr(strict=True, max_length=3)] = Field(None, description="ISO 4217 for currencies, for the Mexican peso it is MXN/USD") @@ -34,6 +33,7 @@ class PlanUpdateRequest(BaseModel): __properties = ["amount", "currency", "expiry_count", "name"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -64,7 +64,7 @@ def from_dict(cls, obj: dict) -> PlanUpdateRequest: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return PlanUpdateRequest.parse_obj(obj) _obj = PlanUpdateRequest.parse_obj({ diff --git a/conekta/models/product.py b/conekta/models/product.py index 7d6933f..bf71aaa 100644 --- a/conekta/models/product.py +++ b/conekta/models/product.py @@ -7,25 +7,24 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json from typing import Any, Dict, List, Optional -from pydantic import BaseModel, Field, StrictStr, conint, constr +from pydantic import BaseModel, Field, StrictStr, conint, conlist, constr class Product(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + Product """ antifraud_info: Optional[Dict[str, Any]] = None brand: Optional[StrictStr] = Field(None, description="The brand of the item.") @@ -34,11 +33,12 @@ class Product(BaseModel): name: StrictStr = Field(..., description="The name of the item. It will be displayed in the order.") quantity: conint(strict=True, ge=1) = Field(..., description="The quantity of the item in the order.") sku: Optional[StrictStr] = Field(None, description="The stock keeping unit for the item. It is used to identify the item in the order.") - tags: Optional[List[StrictStr]] = Field(None, description="List of tags for the item. It is used to identify the item in the order.") + tags: Optional[conlist(StrictStr)] = Field(None, description="List of tags for the item. It is used to identify the item in the order.") unit_price: conint(strict=True, ge=0) = Field(..., description="The price of the item in cents.") __properties = ["antifraud_info", "brand", "description", "metadata", "name", "quantity", "sku", "tags", "unit_price"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -69,7 +69,7 @@ def from_dict(cls, obj: dict) -> Product: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return Product.parse_obj(obj) _obj = Product.parse_obj({ diff --git a/conekta/models/product_data_response.py b/conekta/models/product_data_response.py index 778f108..bedd9c4 100644 --- a/conekta/models/product_data_response.py +++ b/conekta/models/product_data_response.py @@ -7,25 +7,24 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json from typing import Any, Dict, List, Optional -from pydantic import BaseModel, Field, StrictStr, conint, constr +from pydantic import BaseModel, Field, StrictStr, conint, conlist, constr class ProductDataResponse(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + ProductDataResponse """ antifraud_info: Optional[Dict[str, Any]] = None brand: Optional[StrictStr] = Field(None, description="The brand of the item.") @@ -34,7 +33,7 @@ class ProductDataResponse(BaseModel): name: StrictStr = Field(..., description="The name of the item. It will be displayed in the order.") quantity: conint(strict=True, ge=1) = Field(..., description="The quantity of the item in the order.") sku: Optional[StrictStr] = Field(None, description="The stock keeping unit for the item. It is used to identify the item in the order.") - tags: Optional[List[StrictStr]] = Field(None, description="List of tags for the item. It is used to identify the item in the order.") + tags: Optional[conlist(StrictStr)] = Field(None, description="List of tags for the item. It is used to identify the item in the order.") unit_price: conint(strict=True, ge=0) = Field(..., description="The price of the item in cents.") id: Optional[StrictStr] = None object: Optional[StrictStr] = None @@ -42,6 +41,7 @@ class ProductDataResponse(BaseModel): __properties = ["antifraud_info", "brand", "description", "metadata", "name", "quantity", "sku", "tags", "unit_price", "id", "object", "parent_id"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -72,7 +72,7 @@ def from_dict(cls, obj: dict) -> ProductDataResponse: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return ProductDataResponse.parse_obj(obj) _obj = ProductDataResponse.parse_obj({ diff --git a/conekta/models/product_data_response_all_of.py b/conekta/models/product_data_response_all_of.py index 3a3c6d9..38be22c 100644 --- a/conekta/models/product_data_response_all_of.py +++ b/conekta/models/product_data_response_all_of.py @@ -7,12 +7,13 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -22,10 +23,8 @@ from pydantic import BaseModel, StrictStr class ProductDataResponseAllOf(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + ProductDataResponseAllOf """ id: Optional[StrictStr] = None object: Optional[StrictStr] = None @@ -33,6 +32,7 @@ class ProductDataResponseAllOf(BaseModel): __properties = ["id", "object", "parent_id"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -63,7 +63,7 @@ def from_dict(cls, obj: dict) -> ProductDataResponseAllOf: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return ProductDataResponseAllOf.parse_obj(obj) _obj = ProductDataResponseAllOf.parse_obj({ diff --git a/conekta/models/product_order_response.py b/conekta/models/product_order_response.py index 272086a..a711a8e 100644 --- a/conekta/models/product_order_response.py +++ b/conekta/models/product_order_response.py @@ -7,25 +7,24 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json from typing import Any, Dict, List, Optional -from pydantic import BaseModel, Field, StrictStr, conint, constr +from pydantic import BaseModel, Field, StrictStr, conint, conlist, constr class ProductOrderResponse(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + ProductOrderResponse """ antifraud_info: Optional[Dict[str, Any]] = None brand: Optional[StrictStr] = Field(None, description="The brand of the item.") @@ -34,7 +33,7 @@ class ProductOrderResponse(BaseModel): name: StrictStr = Field(..., description="The name of the item. It will be displayed in the order.") quantity: conint(strict=True, ge=1) = Field(..., description="The quantity of the item in the order.") sku: Optional[StrictStr] = Field(None, description="The stock keeping unit for the item. It is used to identify the item in the order.") - tags: Optional[List[StrictStr]] = Field(None, description="List of tags for the item. It is used to identify the item in the order.") + tags: Optional[conlist(StrictStr)] = Field(None, description="List of tags for the item. It is used to identify the item in the order.") unit_price: conint(strict=True, ge=0) = Field(..., description="The price of the item in cents.") id: Optional[StrictStr] = None object: Optional[StrictStr] = None @@ -42,6 +41,7 @@ class ProductOrderResponse(BaseModel): __properties = ["antifraud_info", "brand", "description", "metadata", "name", "quantity", "sku", "tags", "unit_price", "id", "object", "parent_id"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -72,7 +72,7 @@ def from_dict(cls, obj: dict) -> ProductOrderResponse: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return ProductOrderResponse.parse_obj(obj) _obj = ProductOrderResponse.parse_obj({ diff --git a/conekta/models/product_order_response_all_of.py b/conekta/models/product_order_response_all_of.py index a6d58b0..f2b6950 100644 --- a/conekta/models/product_order_response_all_of.py +++ b/conekta/models/product_order_response_all_of.py @@ -7,12 +7,13 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -22,10 +23,8 @@ from pydantic import BaseModel, StrictStr class ProductOrderResponseAllOf(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + ProductOrderResponseAllOf """ id: Optional[StrictStr] = None object: Optional[StrictStr] = None @@ -33,6 +32,7 @@ class ProductOrderResponseAllOf(BaseModel): __properties = ["id", "object", "parent_id"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -63,7 +63,7 @@ def from_dict(cls, obj: dict) -> ProductOrderResponseAllOf: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return ProductOrderResponseAllOf.parse_obj(obj) _obj = ProductOrderResponseAllOf.parse_obj({ diff --git a/conekta/models/risk_rules.py b/conekta/models/risk_rules.py index b418e17..da14b80 100644 --- a/conekta/models/risk_rules.py +++ b/conekta/models/risk_rules.py @@ -7,31 +7,31 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json from typing import List, Optional -from pydantic import BaseModel +from pydantic import BaseModel, conlist from conekta.models.risk_rules_data import RiskRulesData class RiskRules(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. """ - data: Optional[List[RiskRulesData]] = None + RiskRules + """ + data: Optional[conlist(RiskRulesData)] = None __properties = ["data"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -69,7 +69,7 @@ def from_dict(cls, obj: dict) -> RiskRules: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return RiskRules.parse_obj(obj) _obj = RiskRules.parse_obj({ diff --git a/conekta/models/risk_rules_data.py b/conekta/models/risk_rules_data.py index 7f1e7fa..5c78bb5 100644 --- a/conekta/models/risk_rules_data.py +++ b/conekta/models/risk_rules_data.py @@ -7,12 +7,13 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -22,10 +23,8 @@ from pydantic import BaseModel, Field, StrictBool, StrictStr class RiskRulesData(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + RiskRulesData """ id: Optional[StrictStr] = Field(None, description="rule id") field: Optional[StrictStr] = Field(None, description="field to be used for the rule") @@ -37,6 +36,7 @@ class RiskRulesData(BaseModel): __properties = ["id", "field", "created_at", "value", "is_global", "is_test", "description"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -67,7 +67,7 @@ def from_dict(cls, obj: dict) -> RiskRulesData: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return RiskRulesData.parse_obj(obj) _obj = RiskRulesData.parse_obj({ diff --git a/conekta/models/risk_rules_list.py b/conekta/models/risk_rules_list.py index 4242f2f..24c0096 100644 --- a/conekta/models/risk_rules_list.py +++ b/conekta/models/risk_rules_list.py @@ -7,35 +7,35 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json from typing import List, Optional -from pydantic import BaseModel, Field, StrictBool, StrictStr +from pydantic import BaseModel, Field, StrictBool, StrictStr, conlist from conekta.models.risk_rules_data import RiskRulesData class RiskRulesList(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + RiskRulesList """ has_more: StrictBool = Field(..., description="Indicates if there are more pages to be requested") object: StrictStr = Field(..., description="Object type, in this case is list") next_page_url: Optional[StrictStr] = Field(None, description="URL of the next page.") previous_page_url: Optional[StrictStr] = Field(None, description="Url of the previous page.") - data: Optional[List[RiskRulesData]] = None + data: Optional[conlist(RiskRulesData)] = None __properties = ["has_more", "object", "next_page_url", "previous_page_url", "data"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -66,11 +66,13 @@ def to_dict(self): _items.append(_item.to_dict()) _dict['data'] = _items # set to None if next_page_url (nullable) is None - if self.next_page_url is None: + # and __fields_set__ contains the field + if self.next_page_url is None and "next_page_url" in self.__fields_set__: _dict['next_page_url'] = None # set to None if previous_page_url (nullable) is None - if self.previous_page_url is None: + # and __fields_set__ contains the field + if self.previous_page_url is None and "previous_page_url" in self.__fields_set__: _dict['previous_page_url'] = None return _dict @@ -81,7 +83,7 @@ def from_dict(cls, obj: dict) -> RiskRulesList: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return RiskRulesList.parse_obj(obj) _obj = RiskRulesList.parse_obj({ diff --git a/conekta/models/shipping_order_response.py b/conekta/models/shipping_order_response.py index e50dcfc..f82514c 100644 --- a/conekta/models/shipping_order_response.py +++ b/conekta/models/shipping_order_response.py @@ -7,12 +7,13 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -22,10 +23,8 @@ from pydantic import BaseModel, Field, StrictStr, conint class ShippingOrderResponse(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + ShippingOrderResponse """ amount: conint(strict=True, ge=0) = Field(..., description="Shipping amount in cents") carrier: Optional[StrictStr] = Field(None, description="Carrier name for the shipment") @@ -38,6 +37,7 @@ class ShippingOrderResponse(BaseModel): __properties = ["amount", "carrier", "tracking_number", "method", "metadata", "id", "object", "parent_id"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -68,7 +68,7 @@ def from_dict(cls, obj: dict) -> ShippingOrderResponse: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return ShippingOrderResponse.parse_obj(obj) _obj = ShippingOrderResponse.parse_obj({ diff --git a/conekta/models/shipping_request.py b/conekta/models/shipping_request.py index 010e181..27648a7 100644 --- a/conekta/models/shipping_request.py +++ b/conekta/models/shipping_request.py @@ -7,12 +7,13 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -22,10 +23,8 @@ from pydantic import BaseModel, Field, StrictStr, conint class ShippingRequest(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + ShippingRequest """ amount: conint(strict=True, ge=0) = Field(..., description="Shipping amount in cents") carrier: Optional[StrictStr] = Field(None, description="Carrier name for the shipment") @@ -35,6 +34,7 @@ class ShippingRequest(BaseModel): __properties = ["amount", "carrier", "tracking_number", "method", "metadata"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -65,7 +65,7 @@ def from_dict(cls, obj: dict) -> ShippingRequest: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return ShippingRequest.parse_obj(obj) _obj = ShippingRequest.parse_obj({ diff --git a/conekta/models/sms_checkout_request.py b/conekta/models/sms_checkout_request.py index 4922439..46ca76b 100644 --- a/conekta/models/sms_checkout_request.py +++ b/conekta/models/sms_checkout_request.py @@ -7,30 +7,30 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json -from pydantic import BaseModel, StrictStr +from pydantic import BaseModel, Field, StrictStr class SmsCheckoutRequest(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. """ - phonenumber: StrictStr = ... + SmsCheckoutRequest + """ + phonenumber: StrictStr = Field(...) __properties = ["phonenumber"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -61,7 +61,7 @@ def from_dict(cls, obj: dict) -> SmsCheckoutRequest: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return SmsCheckoutRequest.parse_obj(obj) _obj = SmsCheckoutRequest.parse_obj({ diff --git a/conekta/models/subscription_events_response.py b/conekta/models/subscription_events_response.py index c240119..29a02b0 100644 --- a/conekta/models/subscription_events_response.py +++ b/conekta/models/subscription_events_response.py @@ -7,35 +7,35 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json from typing import List, Optional -from pydantic import BaseModel, Field, StrictBool, StrictStr +from pydantic import BaseModel, Field, StrictBool, StrictStr, conlist from conekta.models.event_response import EventResponse class SubscriptionEventsResponse(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + SubscriptionEventsResponse """ has_more: StrictBool = Field(..., description="Indicates if there are more pages to be requested") object: StrictStr = Field(..., description="Object type, in this case is list") next_page_url: Optional[StrictStr] = Field(None, description="URL of the next page.") previous_page_url: Optional[StrictStr] = Field(None, description="Url of the previous page.") - data: Optional[List[EventResponse]] = None + data: Optional[conlist(EventResponse)] = None __properties = ["has_more", "object", "next_page_url", "previous_page_url", "data"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -66,11 +66,13 @@ def to_dict(self): _items.append(_item.to_dict()) _dict['data'] = _items # set to None if next_page_url (nullable) is None - if self.next_page_url is None: + # and __fields_set__ contains the field + if self.next_page_url is None and "next_page_url" in self.__fields_set__: _dict['next_page_url'] = None # set to None if previous_page_url (nullable) is None - if self.previous_page_url is None: + # and __fields_set__ contains the field + if self.previous_page_url is None and "previous_page_url" in self.__fields_set__: _dict['previous_page_url'] = None return _dict @@ -81,7 +83,7 @@ def from_dict(cls, obj: dict) -> SubscriptionEventsResponse: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return SubscriptionEventsResponse.parse_obj(obj) _obj = SubscriptionEventsResponse.parse_obj({ diff --git a/conekta/models/subscription_request.py b/conekta/models/subscription_request.py index 0a89be6..9af013a 100644 --- a/conekta/models/subscription_request.py +++ b/conekta/models/subscription_request.py @@ -7,32 +7,32 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json from typing import Optional -from pydantic import BaseModel, StrictInt, StrictStr +from pydantic import BaseModel, Field, StrictInt, StrictStr class SubscriptionRequest(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. """ - plan_id: StrictStr = ... + It is a parameter that allows to identify in the response, the detailed content of the plans to which the client has subscribed + """ + plan_id: StrictStr = Field(...) card_id: Optional[StrictStr] = None trial_end: Optional[StrictInt] = None __properties = ["plan_id", "card_id", "trial_end"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -63,7 +63,7 @@ def from_dict(cls, obj: dict) -> SubscriptionRequest: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return SubscriptionRequest.parse_obj(obj) _obj = SubscriptionRequest.parse_obj({ diff --git a/conekta/models/subscription_response.py b/conekta/models/subscription_response.py index 101c94d..5b4a32f 100644 --- a/conekta/models/subscription_response.py +++ b/conekta/models/subscription_response.py @@ -7,12 +7,13 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -22,10 +23,8 @@ from pydantic import BaseModel, StrictInt, StrictStr class SubscriptionResponse(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + subscription model """ billing_cycle_start: Optional[StrictInt] = None billing_cycle_end: Optional[StrictInt] = None @@ -47,6 +46,7 @@ class SubscriptionResponse(BaseModel): __properties = ["billing_cycle_start", "billing_cycle_end", "canceled_at", "card_id", "charge_id", "created_at", "customer_custom_reference", "customer_id", "id", "last_billing_cycle_order_id", "object", "paused_at", "plan_id", "status", "subscription_start", "trial_start", "trial_end"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -70,31 +70,38 @@ def to_dict(self): }, exclude_none=True) # set to None if billing_cycle_start (nullable) is None - if self.billing_cycle_start is None: + # and __fields_set__ contains the field + if self.billing_cycle_start is None and "billing_cycle_start" in self.__fields_set__: _dict['billing_cycle_start'] = None # set to None if billing_cycle_end (nullable) is None - if self.billing_cycle_end is None: + # and __fields_set__ contains the field + if self.billing_cycle_end is None and "billing_cycle_end" in self.__fields_set__: _dict['billing_cycle_end'] = None # set to None if canceled_at (nullable) is None - if self.canceled_at is None: + # and __fields_set__ contains the field + if self.canceled_at is None and "canceled_at" in self.__fields_set__: _dict['canceled_at'] = None # set to None if charge_id (nullable) is None - if self.charge_id is None: + # and __fields_set__ contains the field + if self.charge_id is None and "charge_id" in self.__fields_set__: _dict['charge_id'] = None # set to None if paused_at (nullable) is None - if self.paused_at is None: + # and __fields_set__ contains the field + if self.paused_at is None and "paused_at" in self.__fields_set__: _dict['paused_at'] = None # set to None if trial_start (nullable) is None - if self.trial_start is None: + # and __fields_set__ contains the field + if self.trial_start is None and "trial_start" in self.__fields_set__: _dict['trial_start'] = None # set to None if trial_end (nullable) is None - if self.trial_end is None: + # and __fields_set__ contains the field + if self.trial_end is None and "trial_end" in self.__fields_set__: _dict['trial_end'] = None return _dict @@ -105,7 +112,7 @@ def from_dict(cls, obj: dict) -> SubscriptionResponse: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return SubscriptionResponse.parse_obj(obj) _obj = SubscriptionResponse.parse_obj({ diff --git a/conekta/models/subscription_update_request.py b/conekta/models/subscription_update_request.py index 6e27c15..d15021a 100644 --- a/conekta/models/subscription_update_request.py +++ b/conekta/models/subscription_update_request.py @@ -7,12 +7,13 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -22,10 +23,8 @@ from pydantic import BaseModel, StrictInt, StrictStr class SubscriptionUpdateRequest(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + You can modify the subscription to change the plan used by your customers. """ plan_id: Optional[StrictStr] = None card_id: Optional[StrictStr] = None @@ -33,6 +32,7 @@ class SubscriptionUpdateRequest(BaseModel): __properties = ["plan_id", "card_id", "trial_end"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -63,7 +63,7 @@ def from_dict(cls, obj: dict) -> SubscriptionUpdateRequest: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return SubscriptionUpdateRequest.parse_obj(obj) _obj = SubscriptionUpdateRequest.parse_obj({ diff --git a/conekta/models/token.py b/conekta/models/token.py index d96e2b4..56ca407 100644 --- a/conekta/models/token.py +++ b/conekta/models/token.py @@ -7,12 +7,13 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -24,16 +25,15 @@ from conekta.models.token_checkout import TokenCheckout class Token(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + a token """ card: Optional[TokenCard] = None checkout: Optional[TokenCheckout] = None __properties = ["card", "checkout"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -63,11 +63,13 @@ def to_dict(self): if self.checkout: _dict['checkout'] = self.checkout.to_dict() # set to None if card (nullable) is None - if self.card is None: + # and __fields_set__ contains the field + if self.card is None and "card" in self.__fields_set__: _dict['card'] = None # set to None if checkout (nullable) is None - if self.checkout is None: + # and __fields_set__ contains the field + if self.checkout is None and "checkout" in self.__fields_set__: _dict['checkout'] = None return _dict @@ -78,7 +80,7 @@ def from_dict(cls, obj: dict) -> Token: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return Token.parse_obj(obj) _obj = Token.parse_obj({ diff --git a/conekta/models/token_card.py b/conekta/models/token_card.py index f664705..377b0a0 100644 --- a/conekta/models/token_card.py +++ b/conekta/models/token_card.py @@ -7,12 +7,13 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -22,10 +23,8 @@ from pydantic import BaseModel, Field, StrictStr, constr class TokenCard(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + TokenCard """ cvc: constr(strict=True, max_length=4) = Field(..., description="It is a value that allows identifying the security code of the card.") device_fingerprint: Optional[StrictStr] = Field(None, description="It is a value that allows identifying the device fingerprint.") @@ -36,6 +35,7 @@ class TokenCard(BaseModel): __properties = ["cvc", "device_fingerprint", "exp_month", "exp_year", "name", "number"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -66,7 +66,7 @@ def from_dict(cls, obj: dict) -> TokenCard: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return TokenCard.parse_obj(obj) _obj = TokenCard.parse_obj({ diff --git a/conekta/models/token_checkout.py b/conekta/models/token_checkout.py index 0153733..e449cd0 100644 --- a/conekta/models/token_checkout.py +++ b/conekta/models/token_checkout.py @@ -7,12 +7,13 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -22,15 +23,14 @@ from pydantic import BaseModel, Field, StrictStr class TokenCheckout(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + TokenCheckout """ returns_control_on: Optional[StrictStr] = Field(None, description="It is a value that allows identifying the returns control on.") __properties = ["returns_control_on"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -61,7 +61,7 @@ def from_dict(cls, obj: dict) -> TokenCheckout: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return TokenCheckout.parse_obj(obj) _obj = TokenCheckout.parse_obj({ diff --git a/conekta/models/token_response.py b/conekta/models/token_response.py index f2f6c3c..5e431b8 100644 --- a/conekta/models/token_response.py +++ b/conekta/models/token_response.py @@ -7,12 +7,13 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -23,10 +24,8 @@ from conekta.models.token_response_checkout import TokenResponseCheckout class TokenResponse(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + token response """ checkout: Optional[TokenResponseCheckout] = None id: StrictStr = Field(..., description="Unique identifier for the token generated by Conekta.") @@ -36,6 +35,7 @@ class TokenResponse(BaseModel): __properties = ["checkout", "id", "livemode", "object", "used"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -62,7 +62,8 @@ def to_dict(self): if self.checkout: _dict['checkout'] = self.checkout.to_dict() # set to None if checkout (nullable) is None - if self.checkout is None: + # and __fields_set__ contains the field + if self.checkout is None and "checkout" in self.__fields_set__: _dict['checkout'] = None return _dict @@ -73,7 +74,7 @@ def from_dict(cls, obj: dict) -> TokenResponse: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return TokenResponse.parse_obj(obj) _obj = TokenResponse.parse_obj({ diff --git a/conekta/models/token_response_checkout.py b/conekta/models/token_response_checkout.py index be04380..4421edd 100644 --- a/conekta/models/token_response_checkout.py +++ b/conekta/models/token_response_checkout.py @@ -7,30 +7,29 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json from typing import Any, Dict, List, Optional -from pydantic import BaseModel, Field, StrictBool, StrictInt, StrictStr +from pydantic import BaseModel, Field, StrictBool, StrictInt, StrictStr, conlist class TokenResponseCheckout(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. """ - allowed_payment_methods: Optional[List[StrictStr]] = None + TokenResponseCheckout + """ + allowed_payment_methods: Optional[conlist(StrictStr)] = None can_not_expire: Optional[StrictBool] = Field(None, description="Indicates if the checkout can not expire.") emails_sent: Optional[StrictInt] = None - exclude_card_networks: Optional[List[StrictStr]] = None + exclude_card_networks: Optional[conlist(StrictStr)] = None expires_at: Optional[StrictInt] = Field(None, description="Date and time when the checkout expires.") failure_url: Optional[StrictStr] = Field(None, description="URL to redirect the customer to if the payment process fails.") force_3ds_flow: Optional[StrictBool] = Field(None, description="Indicates if the checkout forces the 3DS flow.") @@ -38,7 +37,7 @@ class TokenResponseCheckout(BaseModel): livemode: Optional[StrictBool] = None metadata: Optional[Dict[str, Any]] = None monthly_installments_enabled: Optional[StrictBool] = Field(None, description="Indicates if the checkout allows monthly installments.") - monthly_installments_options: Optional[List[StrictInt]] = Field(None, description="List of monthly installments options.") + monthly_installments_options: Optional[conlist(StrictInt)] = Field(None, description="List of monthly installments options.") name: Optional[StrictStr] = None needs_shipping_contact: Optional[StrictBool] = None object: Optional[StrictStr] = Field(None, description="Indicates the type of object, in this case checkout.") @@ -53,6 +52,7 @@ class TokenResponseCheckout(BaseModel): __properties = ["allowed_payment_methods", "can_not_expire", "emails_sent", "exclude_card_networks", "expires_at", "failure_url", "force_3ds_flow", "id", "livemode", "metadata", "monthly_installments_enabled", "monthly_installments_options", "name", "needs_shipping_contact", "object", "on_demand_enabled", "paid_payments_count", "recurrent", "sms_sent", "starts_at", "status", "success_url", "type"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -83,7 +83,7 @@ def from_dict(cls, obj: dict) -> TokenResponseCheckout: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return TokenResponseCheckout.parse_obj(obj) _obj = TokenResponseCheckout.parse_obj({ diff --git a/conekta/models/transaction_response.py b/conekta/models/transaction_response.py index bd4eb03..cca89e2 100644 --- a/conekta/models/transaction_response.py +++ b/conekta/models/transaction_response.py @@ -7,12 +7,13 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -22,10 +23,8 @@ from pydantic import BaseModel, Field, StrictBool, StrictInt, StrictStr, constr class TransactionResponse(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + The Transaction object represents the actions or steps of an order. Statuses can be: unprocessed, pending, available, owen, paid_out, voided, capture, capture_reversal, liquidation, liquidation_reversal, payout, payout_reversal, refund, refund_reversal, chargeback, chargeback_reversal, rounding_adjustment, won_chargeback, transferred, and transferred. """ amount: StrictInt = Field(..., description="The amount of the transaction.") charge: StrictStr = Field(..., description="Randomly assigned unique order identifier associated with the charge.") @@ -41,6 +40,7 @@ class TransactionResponse(BaseModel): __properties = ["amount", "charge", "created_at", "currency", "fee", "id", "livemode", "net", "object", "status", "type"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -71,7 +71,7 @@ def from_dict(cls, obj: dict) -> TransactionResponse: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return TransactionResponse.parse_obj(obj) _obj = TransactionResponse.parse_obj({ diff --git a/conekta/models/transfer_destination_response.py b/conekta/models/transfer_destination_response.py index 2111ffa..3593bef 100644 --- a/conekta/models/transfer_destination_response.py +++ b/conekta/models/transfer_destination_response.py @@ -7,12 +7,13 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -22,10 +23,8 @@ from pydantic import BaseModel, Field, StrictInt, StrictStr class TransferDestinationResponse(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + Method used to make the transfer. """ account_holder: Optional[StrictStr] = Field(None, description="Name of the account holder.") account_number: Optional[StrictStr] = Field(None, description="Account number of the bank account.") @@ -38,6 +37,7 @@ class TransferDestinationResponse(BaseModel): __properties = ["account_holder", "account_number", "bank", "created_at", "id", "object", "payee_id", "type"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -68,7 +68,7 @@ def from_dict(cls, obj: dict) -> TransferDestinationResponse: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return TransferDestinationResponse.parse_obj(obj) _obj = TransferDestinationResponse.parse_obj({ diff --git a/conekta/models/transfer_method_response.py b/conekta/models/transfer_method_response.py index 534fb2e..6a14d38 100644 --- a/conekta/models/transfer_method_response.py +++ b/conekta/models/transfer_method_response.py @@ -7,12 +7,13 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -22,10 +23,8 @@ from pydantic import BaseModel, Field, StrictInt, StrictStr class TransferMethodResponse(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + Method used to make the transfer. """ account_holder: Optional[StrictStr] = Field(None, description="Name of the account holder.") account_number: Optional[StrictStr] = Field(None, description="Account number of the bank account.") @@ -38,6 +37,7 @@ class TransferMethodResponse(BaseModel): __properties = ["account_holder", "account_number", "bank", "created_at", "id", "object", "payee_id", "type"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -68,7 +68,7 @@ def from_dict(cls, obj: dict) -> TransferMethodResponse: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return TransferMethodResponse.parse_obj(obj) _obj = TransferMethodResponse.parse_obj({ diff --git a/conekta/models/transfer_response.py b/conekta/models/transfer_response.py index e62cee3..30e40aa 100644 --- a/conekta/models/transfer_response.py +++ b/conekta/models/transfer_response.py @@ -7,12 +7,13 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -23,10 +24,8 @@ from conekta.models.transfer_destination_response import TransferDestinationResponse class TransferResponse(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + A transfer represents the action of sending an amount to a business bank account including the status, amount and method used to make the transfer. """ amount: Optional[StrictInt] = Field(None, description="Amount in cents of the transfer.") created_at: Optional[StrictInt] = Field(None, description="Date and time of creation of the transfer in Unix format.") @@ -41,6 +40,7 @@ class TransferResponse(BaseModel): __properties = ["amount", "created_at", "currency", "id", "livemode", "destination", "object", "statement_description", "statement_reference", "status"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -74,7 +74,7 @@ def from_dict(cls, obj: dict) -> TransferResponse: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return TransferResponse.parse_obj(obj) _obj = TransferResponse.parse_obj({ diff --git a/conekta/models/transfers_response.py b/conekta/models/transfers_response.py index 9219ace..4915dd3 100644 --- a/conekta/models/transfers_response.py +++ b/conekta/models/transfers_response.py @@ -7,12 +7,13 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -23,10 +24,8 @@ from conekta.models.transfer_method_response import TransferMethodResponse class TransfersResponse(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + A transfer represents the action of sending an amount to a business bank account including the status, amount and method used to make the transfer. """ amount: Optional[StrictInt] = Field(None, description="Amount in cents of the transfer.") created_at: Optional[StrictInt] = Field(None, description="Date and time of creation of the transfer.") @@ -41,6 +40,7 @@ class TransfersResponse(BaseModel): __properties = ["amount", "created_at", "currency", "id", "livemode", "method", "object", "statement_description", "statement_reference", "status"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -74,7 +74,7 @@ def from_dict(cls, obj: dict) -> TransfersResponse: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return TransfersResponse.parse_obj(obj) _obj = TransfersResponse.parse_obj({ diff --git a/conekta/models/update_customer.py b/conekta/models/update_customer.py index f9371b2..44ea07c 100644 --- a/conekta/models/update_customer.py +++ b/conekta/models/update_customer.py @@ -7,19 +7,20 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json from typing import Any, Dict, List, Optional -from pydantic import BaseModel, Field, StrictBool, StrictStr +from pydantic import BaseModel, Field, StrictBool, StrictStr, conlist from conekta.models.customer_fiscal_entities_request import CustomerFiscalEntitiesRequest from conekta.models.customer_payment_methods_request import CustomerPaymentMethodsRequest from conekta.models.customer_shipping_contacts import CustomerShippingContacts @@ -27,10 +28,8 @@ from conekta.models.update_customer_antifraud_info import UpdateCustomerAntifraudInfo class UpdateCustomer(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + update customer """ antifraud_info: Optional[UpdateCustomerAntifraudInfo] = None default_payment_source_id: Optional[StrictStr] = Field(None, description="It is a parameter that allows to identify in the response, the Conekta ID of a payment method (payment_id)") @@ -41,14 +40,15 @@ class UpdateCustomer(BaseModel): default_shipping_contact_id: Optional[StrictStr] = Field(None, description="It is a parameter that allows to identify in the response, the Conekta ID of the shipping address (shipping_contact)") corporate: Optional[StrictBool] = Field(False, description="It is a value that allows identifying if the email is corporate or not.") custom_reference: Optional[StrictStr] = Field(None, description="It is an undefined value.") - fiscal_entities: Optional[List[CustomerFiscalEntitiesRequest]] = None + fiscal_entities: Optional[conlist(CustomerFiscalEntitiesRequest)] = None metadata: Optional[Dict[str, Any]] = None - payment_sources: Optional[List[CustomerPaymentMethodsRequest]] = Field(None, description="Contains details of the payment methods that the customer has active or has used in Conekta") - shipping_contacts: Optional[List[CustomerShippingContacts]] = Field(None, description="Contains the detail of the shipping addresses that the client has active or has used in Conekta") + payment_sources: Optional[conlist(CustomerPaymentMethodsRequest)] = Field(None, description="Contains details of the payment methods that the customer has active or has used in Conekta") + shipping_contacts: Optional[conlist(CustomerShippingContacts)] = Field(None, description="Contains the detail of the shipping addresses that the client has active or has used in Conekta") subscription: Optional[SubscriptionRequest] = None __properties = ["antifraud_info", "default_payment_source_id", "email", "name", "phone", "plan_id", "default_shipping_contact_id", "corporate", "custom_reference", "fiscal_entities", "metadata", "payment_sources", "shipping_contacts", "subscription"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -99,7 +99,8 @@ def to_dict(self): if self.subscription: _dict['subscription'] = self.subscription.to_dict() # set to None if antifraud_info (nullable) is None - if self.antifraud_info is None: + # and __fields_set__ contains the field + if self.antifraud_info is None and "antifraud_info" in self.__fields_set__: _dict['antifraud_info'] = None return _dict @@ -110,7 +111,7 @@ def from_dict(cls, obj: dict) -> UpdateCustomer: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return UpdateCustomer.parse_obj(obj) _obj = UpdateCustomer.parse_obj({ diff --git a/conekta/models/update_customer_antifraud_info.py b/conekta/models/update_customer_antifraud_info.py index 04898a2..819a7cd 100644 --- a/conekta/models/update_customer_antifraud_info.py +++ b/conekta/models/update_customer_antifraud_info.py @@ -7,12 +7,13 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -22,16 +23,15 @@ from pydantic import BaseModel, StrictInt class UpdateCustomerAntifraudInfo(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + UpdateCustomerAntifraudInfo """ account_created_at: Optional[StrictInt] = None first_paid_at: Optional[StrictInt] = None __properties = ["account_created_at", "first_paid_at"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -62,7 +62,7 @@ def from_dict(cls, obj: dict) -> UpdateCustomerAntifraudInfo: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return UpdateCustomerAntifraudInfo.parse_obj(obj) _obj = UpdateCustomerAntifraudInfo.parse_obj({ diff --git a/conekta/models/update_customer_fiscal_entities_response.py b/conekta/models/update_customer_fiscal_entities_response.py index 3d6e07e..772c6e4 100644 --- a/conekta/models/update_customer_fiscal_entities_response.py +++ b/conekta/models/update_customer_fiscal_entities_response.py @@ -7,41 +7,41 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json from typing import Any, Dict, Optional -from pydantic import BaseModel, StrictBool, StrictInt, StrictStr +from pydantic import BaseModel, Field, StrictBool, StrictInt, StrictStr from conekta.models.customer_fiscal_entities_request_address import CustomerFiscalEntitiesRequestAddress class UpdateCustomerFiscalEntitiesResponse(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. """ - address: CustomerFiscalEntitiesRequestAddress = ... + UpdateCustomerFiscalEntitiesResponse + """ + address: CustomerFiscalEntitiesRequestAddress = Field(...) tax_id: Optional[StrictStr] = None email: Optional[StrictStr] = None phone: Optional[StrictStr] = None metadata: Optional[Dict[str, Dict[str, Any]]] = None company_name: Optional[StrictStr] = None - id: StrictStr = ... - object: StrictStr = ... - created_at: StrictInt = ... + id: StrictStr = Field(...) + object: StrictStr = Field(...) + created_at: StrictInt = Field(...) parent_id: Optional[StrictStr] = None default: Optional[StrictBool] = None __properties = ["address", "tax_id", "email", "phone", "metadata", "company_name", "id", "object", "created_at", "parent_id", "default"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -75,7 +75,7 @@ def from_dict(cls, obj: dict) -> UpdateCustomerFiscalEntitiesResponse: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return UpdateCustomerFiscalEntitiesResponse.parse_obj(obj) _obj = UpdateCustomerFiscalEntitiesResponse.parse_obj({ diff --git a/conekta/models/update_customer_fiscal_entities_response_all_of.py b/conekta/models/update_customer_fiscal_entities_response_all_of.py index b66b0fc..f51b6e9 100644 --- a/conekta/models/update_customer_fiscal_entities_response_all_of.py +++ b/conekta/models/update_customer_fiscal_entities_response_all_of.py @@ -7,34 +7,34 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json from typing import Optional -from pydantic import BaseModel, StrictBool, StrictInt, StrictStr +from pydantic import BaseModel, Field, StrictBool, StrictInt, StrictStr class UpdateCustomerFiscalEntitiesResponseAllOf(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. """ - id: StrictStr = ... - object: StrictStr = ... - created_at: StrictInt = ... + UpdateCustomerFiscalEntitiesResponseAllOf + """ + id: StrictStr = Field(...) + object: StrictStr = Field(...) + created_at: StrictInt = Field(...) parent_id: Optional[StrictStr] = None default: Optional[StrictBool] = None __properties = ["id", "object", "created_at", "parent_id", "default"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -65,7 +65,7 @@ def from_dict(cls, obj: dict) -> UpdateCustomerFiscalEntitiesResponseAllOf: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return UpdateCustomerFiscalEntitiesResponseAllOf.parse_obj(obj) _obj = UpdateCustomerFiscalEntitiesResponseAllOf.parse_obj({ diff --git a/conekta/models/update_customer_payment_methods_response.py b/conekta/models/update_customer_payment_methods_response.py index bb4bba7..ef25a78 100644 --- a/conekta/models/update_customer_payment_methods_response.py +++ b/conekta/models/update_customer_payment_methods_response.py @@ -7,7 +7,9 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ @@ -28,10 +30,8 @@ UPDATECUSTOMERPAYMENTMETHODSRESPONSE_ONE_OF_SCHEMAS = ["PaymentMethodCardResponse", "PaymentMethodCashResponse", "PaymentMethodSpeiRecurrent"] class UpdateCustomerPaymentMethodsResponse(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + UpdateCustomerPaymentMethodsResponse """ # data type: PaymentMethodCashResponse oneof_schema_1_validator: Optional[PaymentMethodCashResponse] = None @@ -48,35 +48,42 @@ class Config: discriminator_value_class_map = { } + def __init__(self, *args, **kwargs): + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + @validator('actual_instance') def actual_instance_must_validate_oneof(cls, v): - instance = cls() + instance = UpdateCustomerPaymentMethodsResponse.construct() error_messages = [] match = 0 # validate data type: PaymentMethodCashResponse - if type(v) is not PaymentMethodCashResponse: + if not isinstance(v, PaymentMethodCashResponse): error_messages.append(f"Error! Input type `{type(v)}` is not `PaymentMethodCashResponse`") else: match += 1 - # validate data type: PaymentMethodCardResponse - if type(v) is not PaymentMethodCardResponse: + if not isinstance(v, PaymentMethodCardResponse): error_messages.append(f"Error! Input type `{type(v)}` is not `PaymentMethodCardResponse`") else: match += 1 - # validate data type: PaymentMethodSpeiRecurrent - if type(v) is not PaymentMethodSpeiRecurrent: + if not isinstance(v, PaymentMethodSpeiRecurrent): error_messages.append(f"Error! Input type `{type(v)}` is not `PaymentMethodSpeiRecurrent`") else: match += 1 - if match > 1: # more than 1 match - raise ValueError("Multiple matches found when deserializing the JSON string into UpdateCustomerPaymentMethodsResponse with oneOf schemas: PaymentMethodCardResponse, PaymentMethodCashResponse, PaymentMethodSpeiRecurrent. Details: " + ", ".join(error_messages)) + raise ValueError("Multiple matches found when setting `actual_instance` in UpdateCustomerPaymentMethodsResponse with oneOf schemas: PaymentMethodCardResponse, PaymentMethodCashResponse, PaymentMethodSpeiRecurrent. Details: " + ", ".join(error_messages)) elif match == 0: # no match - raise ValueError("No match found when deserializing the JSON string into UpdateCustomerPaymentMethodsResponse with oneOf schemas: PaymentMethodCardResponse, PaymentMethodCashResponse, PaymentMethodSpeiRecurrent. Details: " + ", ".join(error_messages)) + raise ValueError("No match found when setting `actual_instance` in UpdateCustomerPaymentMethodsResponse with oneOf schemas: PaymentMethodCardResponse, PaymentMethodCashResponse, PaymentMethodSpeiRecurrent. Details: " + ", ".join(error_messages)) else: return v @@ -87,7 +94,7 @@ def from_dict(cls, obj: dict) -> UpdateCustomerPaymentMethodsResponse: @classmethod def from_json(cls, json_str: str) -> UpdateCustomerPaymentMethodsResponse: """Returns the object represented by the json string""" - instance = cls() + instance = UpdateCustomerPaymentMethodsResponse.construct() error_messages = [] match = 0 @@ -135,19 +142,19 @@ def from_json(cls, json_str: str) -> UpdateCustomerPaymentMethodsResponse: try: instance.actual_instance = PaymentMethodCashResponse.from_json(json_str) match += 1 - except ValidationError as e: + except (ValidationError, ValueError) as e: error_messages.append(str(e)) # deserialize data into PaymentMethodCardResponse try: instance.actual_instance = PaymentMethodCardResponse.from_json(json_str) match += 1 - except ValidationError as e: + except (ValidationError, ValueError) as e: error_messages.append(str(e)) # deserialize data into PaymentMethodSpeiRecurrent try: instance.actual_instance = PaymentMethodSpeiRecurrent.from_json(json_str) match += 1 - except ValidationError as e: + except (ValidationError, ValueError) as e: error_messages.append(str(e)) if match > 1: @@ -161,17 +168,26 @@ def from_json(cls, json_str: str) -> UpdateCustomerPaymentMethodsResponse: def to_json(self) -> str: """Returns the JSON representation of the actual instance""" - if self.actual_instance is not None: + if self.actual_instance is None: + return "null" + + to_json = getattr(self.actual_instance, "to_json", None) + if callable(to_json): return self.actual_instance.to_json() else: - return "null" + return json.dumps(self.actual_instance) def to_dict(self) -> dict: """Returns the dict representation of the actual instance""" - if self.actual_instance is not None: + if self.actual_instance is None: + return None + + to_dict = getattr(self.actual_instance, "to_dict", None) + if callable(to_dict): return self.actual_instance.to_dict() else: - return dict() + # primitive type + return self.actual_instance def to_str(self) -> str: """Returns the string representation of the actual instance""" diff --git a/conekta/models/update_order_discount_lines_request.py b/conekta/models/update_order_discount_lines_request.py index 559ee57..5c16152 100644 --- a/conekta/models/update_order_discount_lines_request.py +++ b/conekta/models/update_order_discount_lines_request.py @@ -7,12 +7,13 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -22,10 +23,8 @@ from pydantic import BaseModel, Field, StrictStr, conint class UpdateOrderDiscountLinesRequest(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + List of discounts that apply to the order. """ amount: Optional[conint(strict=True, ge=0)] = None code: Optional[StrictStr] = Field(None, description="Discount code.") @@ -33,6 +32,7 @@ class UpdateOrderDiscountLinesRequest(BaseModel): __properties = ["amount", "code", "type"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -63,7 +63,7 @@ def from_dict(cls, obj: dict) -> UpdateOrderDiscountLinesRequest: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return UpdateOrderDiscountLinesRequest.parse_obj(obj) _obj = UpdateOrderDiscountLinesRequest.parse_obj({ diff --git a/conekta/models/update_order_tax_request.py b/conekta/models/update_order_tax_request.py index 41b3866..b509f1f 100644 --- a/conekta/models/update_order_tax_request.py +++ b/conekta/models/update_order_tax_request.py @@ -7,12 +7,13 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -22,10 +23,8 @@ from pydantic import BaseModel, Field, conint, constr class UpdateOrderTaxRequest(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + create new taxes for an existing order """ amount: Optional[conint(strict=True, ge=0)] = Field(None, description="The amount to be collected for tax in cents") description: Optional[constr(strict=True, min_length=2)] = Field(None, description="description or tax's name") @@ -33,6 +32,7 @@ class UpdateOrderTaxRequest(BaseModel): __properties = ["amount", "description", "metadata"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -63,7 +63,7 @@ def from_dict(cls, obj: dict) -> UpdateOrderTaxRequest: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return UpdateOrderTaxRequest.parse_obj(obj) _obj = UpdateOrderTaxRequest.parse_obj({ diff --git a/conekta/models/update_order_tax_response.py b/conekta/models/update_order_tax_response.py index b95389d..567e90c 100644 --- a/conekta/models/update_order_tax_response.py +++ b/conekta/models/update_order_tax_response.py @@ -7,12 +7,13 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -22,20 +23,19 @@ from pydantic import BaseModel, Field, StrictStr, conint, constr class UpdateOrderTaxResponse(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + create new taxes for an existing order response """ amount: conint(strict=True, ge=0) = Field(..., description="The amount to be collected for tax in cents") description: constr(strict=True, min_length=2) = Field(..., description="description or tax's name") metadata: Optional[Dict[str, Any]] = None - id: StrictStr = ... + id: StrictStr = Field(...) object: Optional[StrictStr] = None parent_id: Optional[StrictStr] = None __properties = ["amount", "description", "metadata", "id", "object", "parent_id"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -66,7 +66,7 @@ def from_dict(cls, obj: dict) -> UpdateOrderTaxResponse: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return UpdateOrderTaxResponse.parse_obj(obj) _obj = UpdateOrderTaxResponse.parse_obj({ diff --git a/conekta/models/update_order_tax_response_all_of.py b/conekta/models/update_order_tax_response_all_of.py index 473fc17..b4eee19 100644 --- a/conekta/models/update_order_tax_response_all_of.py +++ b/conekta/models/update_order_tax_response_all_of.py @@ -7,12 +7,13 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -22,10 +23,8 @@ from pydantic import BaseModel, StrictStr class UpdateOrderTaxResponseAllOf(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + UpdateOrderTaxResponseAllOf """ id: Optional[StrictStr] = None object: Optional[StrictStr] = None @@ -33,6 +32,7 @@ class UpdateOrderTaxResponseAllOf(BaseModel): __properties = ["id", "object", "parent_id"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -63,7 +63,7 @@ def from_dict(cls, obj: dict) -> UpdateOrderTaxResponseAllOf: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return UpdateOrderTaxResponseAllOf.parse_obj(obj) _obj = UpdateOrderTaxResponseAllOf.parse_obj({ diff --git a/conekta/models/update_payment_methods.py b/conekta/models/update_payment_methods.py index a979608..0264034 100644 --- a/conekta/models/update_payment_methods.py +++ b/conekta/models/update_payment_methods.py @@ -7,12 +7,13 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -22,15 +23,14 @@ from pydantic import BaseModel, StrictStr class UpdatePaymentMethods(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + UpdatePaymentMethods """ name: Optional[StrictStr] = None __properties = ["name"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -61,7 +61,7 @@ def from_dict(cls, obj: dict) -> UpdatePaymentMethods: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return UpdatePaymentMethods.parse_obj(obj) _obj = UpdatePaymentMethods.parse_obj({ diff --git a/conekta/models/update_product.py b/conekta/models/update_product.py index e1f049b..0058d2e 100644 --- a/conekta/models/update_product.py +++ b/conekta/models/update_product.py @@ -7,25 +7,24 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json from typing import Any, Dict, List, Optional -from pydantic import BaseModel, StrictStr, conint, constr +from pydantic import BaseModel, StrictStr, conint, conlist, constr class UpdateProduct(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + UpdateProduct """ antifraud_info: Optional[Dict[str, Dict[str, Any]]] = None description: Optional[constr(strict=True, max_length=250)] = None @@ -33,12 +32,13 @@ class UpdateProduct(BaseModel): name: Optional[StrictStr] = None unit_price: Optional[conint(strict=True, ge=0)] = None quantity: Optional[conint(strict=True, ge=1)] = None - tags: Optional[List[StrictStr]] = None + tags: Optional[conlist(StrictStr)] = None brand: Optional[StrictStr] = None metadata: Optional[Dict[str, StrictStr]] = None __properties = ["antifraud_info", "description", "sku", "name", "unit_price", "quantity", "tags", "brand", "metadata"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -69,7 +69,7 @@ def from_dict(cls, obj: dict) -> UpdateProduct: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return UpdateProduct.parse_obj(obj) _obj = UpdateProduct.parse_obj({ diff --git a/conekta/models/webhook_key_create_response.py b/conekta/models/webhook_key_create_response.py index 31a0a2c..e818f5f 100644 --- a/conekta/models/webhook_key_create_response.py +++ b/conekta/models/webhook_key_create_response.py @@ -7,12 +7,13 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -22,10 +23,8 @@ from pydantic import BaseModel, Field, StrictBool, StrictInt, StrictStr class WebhookKeyCreateResponse(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + webhook keys model """ active: Optional[StrictBool] = Field(None, description="Indicates if the webhook key is active") created_at: Optional[StrictInt] = Field(None, description="Unix timestamp in seconds with the creation date of the webhook key") @@ -36,6 +35,7 @@ class WebhookKeyCreateResponse(BaseModel): __properties = ["active", "created_at", "id", "livemode", "object", "public_key"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -66,7 +66,7 @@ def from_dict(cls, obj: dict) -> WebhookKeyCreateResponse: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return WebhookKeyCreateResponse.parse_obj(obj) _obj = WebhookKeyCreateResponse.parse_obj({ diff --git a/conekta/models/webhook_key_delete_response.py b/conekta/models/webhook_key_delete_response.py index 033d5a8..17a6f60 100644 --- a/conekta/models/webhook_key_delete_response.py +++ b/conekta/models/webhook_key_delete_response.py @@ -7,12 +7,13 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -22,10 +23,8 @@ from pydantic import BaseModel, Field, StrictBool, StrictInt, StrictStr class WebhookKeyDeleteResponse(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + webhook keys model """ active: Optional[StrictBool] = Field(None, description="Indicates if the webhook key is active") created_at: Optional[StrictInt] = Field(None, description="Unix timestamp in seconds with the creation date of the webhook key") @@ -36,6 +35,7 @@ class WebhookKeyDeleteResponse(BaseModel): __properties = ["active", "created_at", "deleted", "id", "livemode", "object"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -66,7 +66,7 @@ def from_dict(cls, obj: dict) -> WebhookKeyDeleteResponse: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return WebhookKeyDeleteResponse.parse_obj(obj) _obj = WebhookKeyDeleteResponse.parse_obj({ diff --git a/conekta/models/webhook_key_request.py b/conekta/models/webhook_key_request.py index b9394da..442c4e9 100644 --- a/conekta/models/webhook_key_request.py +++ b/conekta/models/webhook_key_request.py @@ -7,12 +7,13 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -22,15 +23,14 @@ from pydantic import BaseModel, Field, StrictBool class WebhookKeyRequest(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + WebhookKeyRequest """ active: Optional[StrictBool] = Field(True, description="Indicates if the webhook key is active") __properties = ["active"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -61,7 +61,7 @@ def from_dict(cls, obj: dict) -> WebhookKeyRequest: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return WebhookKeyRequest.parse_obj(obj) _obj = WebhookKeyRequest.parse_obj({ diff --git a/conekta/models/webhook_key_response.py b/conekta/models/webhook_key_response.py index 1982f6c..be25522 100644 --- a/conekta/models/webhook_key_response.py +++ b/conekta/models/webhook_key_response.py @@ -7,12 +7,13 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -22,10 +23,8 @@ from pydantic import BaseModel, Field, StrictBool, StrictInt, StrictStr class WebhookKeyResponse(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + webhook keys model """ id: Optional[StrictStr] = Field(None, description="Unique identifier of the webhook key") active: Optional[StrictBool] = Field(None, description="Indicates if the webhook key is active") @@ -37,6 +36,7 @@ class WebhookKeyResponse(BaseModel): __properties = ["id", "active", "created_at", "deactivated_at", "public_key", "livemode", "object"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -60,7 +60,8 @@ def to_dict(self): }, exclude_none=True) # set to None if deactivated_at (nullable) is None - if self.deactivated_at is None: + # and __fields_set__ contains the field + if self.deactivated_at is None and "deactivated_at" in self.__fields_set__: _dict['deactivated_at'] = None return _dict @@ -71,7 +72,7 @@ def from_dict(cls, obj: dict) -> WebhookKeyResponse: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return WebhookKeyResponse.parse_obj(obj) _obj = WebhookKeyResponse.parse_obj({ diff --git a/conekta/models/webhook_key_update_request.py b/conekta/models/webhook_key_update_request.py index 46fe67d..e216f05 100644 --- a/conekta/models/webhook_key_update_request.py +++ b/conekta/models/webhook_key_update_request.py @@ -7,12 +7,13 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -22,15 +23,14 @@ from pydantic import BaseModel, Field, StrictBool class WebhookKeyUpdateRequest(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + WebhookKeyUpdateRequest """ active: Optional[StrictBool] = Field(False, description="Indicates if the webhook key is active") __properties = ["active"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -61,7 +61,7 @@ def from_dict(cls, obj: dict) -> WebhookKeyUpdateRequest: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return WebhookKeyUpdateRequest.parse_obj(obj) _obj = WebhookKeyUpdateRequest.parse_obj({ diff --git a/conekta/models/webhook_log.py b/conekta/models/webhook_log.py index d79094d..f06b200 100644 --- a/conekta/models/webhook_log.py +++ b/conekta/models/webhook_log.py @@ -7,12 +7,13 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -22,10 +23,8 @@ from pydantic import BaseModel, StrictInt, StrictStr class WebhookLog(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + WebhookLog """ failed_attempts: Optional[StrictInt] = None id: Optional[StrictStr] = None @@ -37,6 +36,7 @@ class WebhookLog(BaseModel): __properties = ["failed_attempts", "id", "last_attempted_at", "last_http_response_status", "object", "response_data", "url"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -67,7 +67,7 @@ def from_dict(cls, obj: dict) -> WebhookLog: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return WebhookLog.parse_obj(obj) _obj = WebhookLog.parse_obj({ diff --git a/conekta/models/webhook_request.py b/conekta/models/webhook_request.py index f5ba682..dc872b7 100644 --- a/conekta/models/webhook_request.py +++ b/conekta/models/webhook_request.py @@ -7,12 +7,13 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -22,22 +23,22 @@ from pydantic import BaseModel, Field, StrictBool, constr, validator class WebhookRequest(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + a webhook """ url: constr(strict=True) = Field(..., description="Here you must place the URL of your Webhook remember that you must program what you will do with the events received. Also do not forget to handle the HTTPS protocol for greater security.") synchronous: StrictBool = Field(..., description="It is a value that allows to decide if the events will be synchronous or asynchronous. We recommend asynchronous = false") __properties = ["url", "synchronous"] @validator('url') - def url_validate_regular_expression(cls, v): - if not re.match(r"^(?!.*(localhost|127\.0\.0\.1)).*$", v): + def url_validate_regular_expression(cls, value): + """Validates the regular expression""" + if not re.match(r"^(?!.*(localhost|127\.0\.0\.1)).*$", value): raise ValueError(r"must validate the regular expression /^(?!.*(localhost|127\.0\.0\.1)).*$/") - return v + return value class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -68,7 +69,7 @@ def from_dict(cls, obj: dict) -> WebhookRequest: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return WebhookRequest.parse_obj(obj) _obj = WebhookRequest.parse_obj({ diff --git a/conekta/models/webhook_response.py b/conekta/models/webhook_response.py index 3b5afd1..6c3f576 100644 --- a/conekta/models/webhook_response.py +++ b/conekta/models/webhook_response.py @@ -7,25 +7,24 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json from typing import List, Optional -from pydantic import BaseModel, StrictBool, StrictStr +from pydantic import BaseModel, StrictBool, StrictStr, conlist class WebhookResponse(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + webhooks model """ deleted: Optional[StrictBool] = None development_enabled: Optional[StrictBool] = None @@ -34,12 +33,13 @@ class WebhookResponse(BaseModel): object: Optional[StrictStr] = None production_enabled: Optional[StrictBool] = None status: Optional[StrictStr] = None - subscribed_events: Optional[List[StrictStr]] = None + subscribed_events: Optional[conlist(StrictStr)] = None synchronous: Optional[StrictBool] = None url: Optional[StrictStr] = None __properties = ["deleted", "development_enabled", "id", "livemode", "object", "production_enabled", "status", "subscribed_events", "synchronous", "url"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -63,7 +63,8 @@ def to_dict(self): }, exclude_none=True) # set to None if deleted (nullable) is None - if self.deleted is None: + # and __fields_set__ contains the field + if self.deleted is None and "deleted" in self.__fields_set__: _dict['deleted'] = None return _dict @@ -74,7 +75,7 @@ def from_dict(cls, obj: dict) -> WebhookResponse: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return WebhookResponse.parse_obj(obj) _obj = WebhookResponse.parse_obj({ diff --git a/conekta/models/webhook_update_request.py b/conekta/models/webhook_update_request.py index 799dcdd..178ea2d 100644 --- a/conekta/models/webhook_update_request.py +++ b/conekta/models/webhook_update_request.py @@ -7,38 +7,39 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json from typing import List, Optional -from pydantic import BaseModel, Field, StrictBool, StrictStr, constr, validator +from pydantic import BaseModel, Field, StrictBool, StrictStr, conlist, constr, validator class WebhookUpdateRequest(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + an updated webhook """ url: constr(strict=True) = Field(..., description="Here you must place the URL of your Webhook remember that you must program what you will do with the events received. Also do not forget to handle the HTTPS protocol for greater security.") synchronous: Optional[StrictBool] = Field(False, description="It is a value that allows to decide if the events will be synchronous or asynchronous. We recommend asynchronous = false") - subscribed_events: Optional[List[StrictStr]] = None + subscribed_events: Optional[conlist(StrictStr)] = None __properties = ["url", "synchronous", "subscribed_events"] @validator('url') - def url_validate_regular_expression(cls, v): - if not re.match(r"^(?!.*(localhost|127\.0\.0\.1)).*$", v): + def url_validate_regular_expression(cls, value): + """Validates the regular expression""" + if not re.match(r"^(?!.*(localhost|127\.0\.0\.1)).*$", value): raise ValueError(r"must validate the regular expression /^(?!.*(localhost|127\.0\.0\.1)).*$/") - return v + return value class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -69,7 +70,7 @@ def from_dict(cls, obj: dict) -> WebhookUpdateRequest: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return WebhookUpdateRequest.parse_obj(obj) _obj = WebhookUpdateRequest.parse_obj({ diff --git a/conekta/models/whitelistlist_rule_response.py b/conekta/models/whitelistlist_rule_response.py index 50d5364..41c9912 100644 --- a/conekta/models/whitelistlist_rule_response.py +++ b/conekta/models/whitelistlist_rule_response.py @@ -7,12 +7,13 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -22,10 +23,8 @@ from pydantic import BaseModel, Field, StrictStr class WhitelistlistRuleResponse(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + WhitelistlistRuleResponse """ id: Optional[StrictStr] = Field(None, description="Whitelist rule id") field: Optional[StrictStr] = Field(None, description="field used for whitelists rule") @@ -34,6 +33,7 @@ class WhitelistlistRuleResponse(BaseModel): __properties = ["id", "field", "value", "description"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -64,7 +64,7 @@ def from_dict(cls, obj: dict) -> WhitelistlistRuleResponse: if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return WhitelistlistRuleResponse.parse_obj(obj) _obj = WhitelistlistRuleResponse.parse_obj({ diff --git a/conekta/rest.py b/conekta/rest.py index 50193cd..712b770 100644 --- a/conekta/rest.py +++ b/conekta/rest.py @@ -7,11 +7,11 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" -from __future__ import absolute_import import io import json @@ -67,6 +67,10 @@ def __init__(self, configuration, pools_size=4, maxsize=None): if configuration.retries is not None: addition_pool_args['retries'] = configuration.retries + if configuration.tls_server_name: + addition_pool_args['server_hostname'] = configuration.tls_server_name + + if configuration.socket_options is not None: addition_pool_args['socket_options'] = configuration.socket_options diff --git a/docs/AntifraudApi.md b/docs/AntifraudApi.md index 8dc20df..80cf390 100644 --- a/docs/AntifraudApi.md +++ b/docs/AntifraudApi.md @@ -21,12 +21,14 @@ Create blacklisted rule * Bearer Authentication (bearerAuth): ```python -from __future__ import print_function import time import os import conekta +from conekta.models.blacklist_rule_response import BlacklistRuleResponse +from conekta.models.create_risk_rules_data import CreateRiskRulesData from conekta.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.conekta.io # See configuration.py for a list of all supported configuration parameters. configuration = conekta.Configuration( @@ -59,6 +61,7 @@ with conekta.ApiClient(configuration) as api_client: print("Exception when calling AntifraudApi->create_rule_blacklist: %s\n" % e) ``` + ### Parameters Name | Type | Description | Notes @@ -97,12 +100,14 @@ Create whitelisted rule * Bearer Authentication (bearerAuth): ```python -from __future__ import print_function import time import os import conekta +from conekta.models.create_risk_rules_data import CreateRiskRulesData +from conekta.models.whitelistlist_rule_response import WhitelistlistRuleResponse from conekta.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.conekta.io # See configuration.py for a list of all supported configuration parameters. configuration = conekta.Configuration( @@ -135,6 +140,7 @@ with conekta.ApiClient(configuration) as api_client: print("Exception when calling AntifraudApi->create_rule_whitelist: %s\n" % e) ``` + ### Parameters Name | Type | Description | Notes @@ -174,12 +180,13 @@ Delete blacklisted rule * Bearer Authentication (bearerAuth): ```python -from __future__ import print_function import time import os import conekta +from conekta.models.deleted_blacklist_rule_response import DeletedBlacklistRuleResponse from conekta.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.conekta.io # See configuration.py for a list of all supported configuration parameters. configuration = conekta.Configuration( @@ -213,6 +220,7 @@ with conekta.ApiClient(configuration) as api_client: print("Exception when calling AntifraudApi->delete_rule_blacklist: %s\n" % e) ``` + ### Parameters Name | Type | Description | Notes @@ -253,12 +261,13 @@ Delete whitelisted rule * Bearer Authentication (bearerAuth): ```python -from __future__ import print_function import time import os import conekta +from conekta.models.deleted_whitelist_rule_response import DeletedWhitelistRuleResponse from conekta.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.conekta.io # See configuration.py for a list of all supported configuration parameters. configuration = conekta.Configuration( @@ -292,6 +301,7 @@ with conekta.ApiClient(configuration) as api_client: print("Exception when calling AntifraudApi->delete_rule_whitelist: %s\n" % e) ``` + ### Parameters Name | Type | Description | Notes @@ -335,12 +345,13 @@ Return all rules * Bearer Authentication (bearerAuth): ```python -from __future__ import print_function import time import os import conekta +from conekta.models.risk_rules_list import RiskRulesList from conekta.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.conekta.io # See configuration.py for a list of all supported configuration parameters. configuration = conekta.Configuration( @@ -372,6 +383,7 @@ with conekta.ApiClient(configuration) as api_client: print("Exception when calling AntifraudApi->get_rule_blacklist: %s\n" % e) ``` + ### Parameters Name | Type | Description | Notes @@ -411,12 +423,13 @@ Return all rules * Bearer Authentication (bearerAuth): ```python -from __future__ import print_function import time import os import conekta +from conekta.models.risk_rules_list import RiskRulesList from conekta.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.conekta.io # See configuration.py for a list of all supported configuration parameters. configuration = conekta.Configuration( @@ -448,6 +461,7 @@ with conekta.ApiClient(configuration) as api_client: print("Exception when calling AntifraudApi->get_rule_whitelist: %s\n" % e) ``` + ### Parameters Name | Type | Description | Notes diff --git a/docs/ApiKeysApi.md b/docs/ApiKeysApi.md index e7fb887..8d64bbf 100644 --- a/docs/ApiKeysApi.md +++ b/docs/ApiKeysApi.md @@ -22,12 +22,14 @@ Create a api key * Bearer Authentication (bearerAuth): ```python -from __future__ import print_function import time import os import conekta +from conekta.models.api_key_create_response import ApiKeyCreateResponse +from conekta.models.api_key_request import ApiKeyRequest from conekta.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.conekta.io # See configuration.py for a list of all supported configuration parameters. configuration = conekta.Configuration( @@ -61,6 +63,7 @@ with conekta.ApiClient(configuration) as api_client: print("Exception when calling ApiKeysApi->create_api_key: %s\n" % e) ``` + ### Parameters Name | Type | Description | Notes @@ -103,12 +106,13 @@ Deletes a api key that corresponds to a api key ID * Bearer Authentication (bearerAuth): ```python -from __future__ import print_function import time import os import conekta +from conekta.models.delete_api_keys_response import DeleteApiKeysResponse from conekta.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.conekta.io # See configuration.py for a list of all supported configuration parameters. configuration = conekta.Configuration( @@ -141,6 +145,7 @@ with conekta.ApiClient(configuration) as api_client: print("Exception when calling ApiKeysApi->delete_api_key: %s\n" % e) ``` + ### Parameters Name | Type | Description | Notes @@ -182,12 +187,13 @@ Gets a api key that corresponds to a api key ID * Bearer Authentication (bearerAuth): ```python -from __future__ import print_function import time import os import conekta +from conekta.models.api_key_response import ApiKeyResponse from conekta.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.conekta.io # See configuration.py for a list of all supported configuration parameters. configuration = conekta.Configuration( @@ -221,6 +227,7 @@ with conekta.ApiClient(configuration) as api_client: print("Exception when calling ApiKeysApi->get_api_key: %s\n" % e) ``` + ### Parameters Name | Type | Description | Notes @@ -263,12 +270,13 @@ Consume the list of api keys you have * Bearer Authentication (bearerAuth): ```python -from __future__ import print_function import time import os import conekta +from conekta.models.get_api_keys_response import GetApiKeysResponse from conekta.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.conekta.io # See configuration.py for a list of all supported configuration parameters. configuration = conekta.Configuration( @@ -305,6 +313,7 @@ with conekta.ApiClient(configuration) as api_client: print("Exception when calling ApiKeysApi->get_api_keys: %s\n" % e) ``` + ### Parameters Name | Type | Description | Notes @@ -349,12 +358,14 @@ Update an existing api key * Bearer Authentication (bearerAuth): ```python -from __future__ import print_function import time import os import conekta +from conekta.models.api_key_response import ApiKeyResponse +from conekta.models.api_key_update_request import ApiKeyUpdateRequest from conekta.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.conekta.io # See configuration.py for a list of all supported configuration parameters. configuration = conekta.Configuration( @@ -388,6 +399,7 @@ with conekta.ApiClient(configuration) as api_client: print("Exception when calling ApiKeysApi->update_api_key: %s\n" % e) ``` + ### Parameters Name | Type | Description | Notes diff --git a/docs/ChargesApi.md b/docs/ChargesApi.md index 116c871..2190224 100644 --- a/docs/ChargesApi.md +++ b/docs/ChargesApi.md @@ -17,12 +17,13 @@ Get A List of Charges * Bearer Authentication (bearerAuth): ```python -from __future__ import print_function import time import os import conekta +from conekta.models.get_charges_response import GetChargesResponse from conekta.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.conekta.io # See configuration.py for a list of all supported configuration parameters. configuration = conekta.Configuration( @@ -59,6 +60,7 @@ with conekta.ApiClient(configuration) as api_client: print("Exception when calling ChargesApi->get_charges: %s\n" % e) ``` + ### Parameters Name | Type | Description | Notes @@ -103,12 +105,14 @@ Create charge for an existing orden * Bearer Authentication (bearerAuth): ```python -from __future__ import print_function import time import os import conekta +from conekta.models.charge_order_response import ChargeOrderResponse +from conekta.models.charge_request import ChargeRequest from conekta.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.conekta.io # See configuration.py for a list of all supported configuration parameters. configuration = conekta.Configuration( @@ -143,6 +147,7 @@ with conekta.ApiClient(configuration) as api_client: print("Exception when calling ChargesApi->orders_create_charge: %s\n" % e) ``` + ### Parameters Name | Type | Description | Notes diff --git a/docs/CompaniesApi.md b/docs/CompaniesApi.md index 4e9fff4..00f1070 100644 --- a/docs/CompaniesApi.md +++ b/docs/CompaniesApi.md @@ -19,12 +19,13 @@ Consume the list of child companies. This is used for holding companies with se * Bearer Authentication (bearerAuth): ```python -from __future__ import print_function import time import os import conekta +from conekta.models.get_companies_response import GetCompaniesResponse from conekta.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.conekta.io # See configuration.py for a list of all supported configuration parameters. configuration = conekta.Configuration( @@ -60,6 +61,7 @@ with conekta.ApiClient(configuration) as api_client: print("Exception when calling CompaniesApi->get_companies: %s\n" % e) ``` + ### Parameters Name | Type | Description | Notes @@ -101,12 +103,13 @@ Get Company * Bearer Authentication (bearerAuth): ```python -from __future__ import print_function import time import os import conekta +from conekta.models.company_response import CompanyResponse from conekta.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.conekta.io # See configuration.py for a list of all supported configuration parameters. configuration = conekta.Configuration( @@ -139,6 +142,7 @@ with conekta.ApiClient(configuration) as api_client: print("Exception when calling CompaniesApi->get_company: %s\n" % e) ``` + ### Parameters Name | Type | Description | Notes diff --git a/docs/CustomersApi.md b/docs/CustomersApi.md index 820516c..f794b54 100644 --- a/docs/CustomersApi.md +++ b/docs/CustomersApi.md @@ -24,12 +24,14 @@ The purpose of business is to create and keep a customer, you will learn what el * Bearer Authentication (bearerAuth): ```python -from __future__ import print_function import time import os import conekta +from conekta.models.customer import Customer +from conekta.models.customer_response import CustomerResponse from conekta.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.conekta.io # See configuration.py for a list of all supported configuration parameters. configuration = conekta.Configuration( @@ -63,6 +65,7 @@ with conekta.ApiClient(configuration) as api_client: print("Exception when calling CustomersApi->create_customer: %s\n" % e) ``` + ### Parameters Name | Type | Description | Notes @@ -106,12 +109,14 @@ Create Fiscal entity resource that corresponds to a customer ID. * Bearer Authentication (bearerAuth): ```python -from __future__ import print_function import time import os import conekta +from conekta.models.create_customer_fiscal_entities_response import CreateCustomerFiscalEntitiesResponse +from conekta.models.customer_fiscal_entities_request import CustomerFiscalEntitiesRequest from conekta.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.conekta.io # See configuration.py for a list of all supported configuration parameters. configuration = conekta.Configuration( @@ -146,6 +151,7 @@ with conekta.ApiClient(configuration) as api_client: print("Exception when calling CustomersApi->create_customer_fiscal_entities: %s\n" % e) ``` + ### Parameters Name | Type | Description | Notes @@ -190,12 +196,13 @@ Deleted a customer resource that corresponds to a customer ID. * Bearer Authentication (bearerAuth): ```python -from __future__ import print_function import time import os import conekta +from conekta.models.customer_response import CustomerResponse from conekta.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.conekta.io # See configuration.py for a list of all supported configuration parameters. configuration = conekta.Configuration( @@ -229,6 +236,7 @@ with conekta.ApiClient(configuration) as api_client: print("Exception when calling CustomersApi->delete_customer_by_id: %s\n" % e) ``` + ### Parameters Name | Type | Description | Notes @@ -272,12 +280,13 @@ Gets a customer resource that corresponds to a customer ID. * Bearer Authentication (bearerAuth): ```python -from __future__ import print_function import time import os import conekta +from conekta.models.customer_response import CustomerResponse from conekta.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.conekta.io # See configuration.py for a list of all supported configuration parameters. configuration = conekta.Configuration( @@ -311,6 +320,7 @@ with conekta.ApiClient(configuration) as api_client: print("Exception when calling CustomersApi->get_customer_by_id: %s\n" % e) ``` + ### Parameters Name | Type | Description | Notes @@ -353,12 +363,13 @@ The purpose of business is to create and maintain a client, you will learn what * Bearer Authentication (bearerAuth): ```python -from __future__ import print_function import time import os import conekta +from conekta.models.customers_response import CustomersResponse from conekta.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.conekta.io # See configuration.py for a list of all supported configuration parameters. configuration = conekta.Configuration( @@ -395,6 +406,7 @@ with conekta.ApiClient(configuration) as api_client: print("Exception when calling CustomersApi->get_customers: %s\n" % e) ``` + ### Parameters Name | Type | Description | Notes @@ -439,12 +451,14 @@ You can update customer-related data * Bearer Authentication (bearerAuth): ```python -from __future__ import print_function import time import os import conekta +from conekta.models.customer_response import CustomerResponse +from conekta.models.update_customer import UpdateCustomer from conekta.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.conekta.io # See configuration.py for a list of all supported configuration parameters. configuration = conekta.Configuration( @@ -479,6 +493,7 @@ with conekta.ApiClient(configuration) as api_client: print("Exception when calling CustomersApi->update_customer: %s\n" % e) ``` + ### Parameters Name | Type | Description | Notes @@ -523,12 +538,14 @@ Update Fiscal Entity resource that corresponds to a customer ID. * Bearer Authentication (bearerAuth): ```python -from __future__ import print_function import time import os import conekta +from conekta.models.customer_update_fiscal_entities_request import CustomerUpdateFiscalEntitiesRequest +from conekta.models.update_customer_fiscal_entities_response import UpdateCustomerFiscalEntitiesResponse from conekta.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.conekta.io # See configuration.py for a list of all supported configuration parameters. configuration = conekta.Configuration( @@ -564,6 +581,7 @@ with conekta.ApiClient(configuration) as api_client: print("Exception when calling CustomersApi->update_customer_fiscal_entities: %s\n" % e) ``` + ### Parameters Name | Type | Description | Notes diff --git a/docs/DiscountsApi.md b/docs/DiscountsApi.md index 7bc70ed..68c1dfd 100644 --- a/docs/DiscountsApi.md +++ b/docs/DiscountsApi.md @@ -20,12 +20,14 @@ Create discount lines for an existing orden * Bearer Authentication (bearerAuth): ```python -from __future__ import print_function import time import os import conekta +from conekta.models.discount_lines_response import DiscountLinesResponse +from conekta.models.order_discount_lines_request import OrderDiscountLinesRequest from conekta.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.conekta.io # See configuration.py for a list of all supported configuration parameters. configuration = conekta.Configuration( @@ -60,6 +62,7 @@ with conekta.ApiClient(configuration) as api_client: print("Exception when calling DiscountsApi->orders_create_discount_line: %s\n" % e) ``` + ### Parameters Name | Type | Description | Notes @@ -103,12 +106,13 @@ Delete an existing discount lines for an existing orden * Bearer Authentication (bearerAuth): ```python -from __future__ import print_function import time import os import conekta +from conekta.models.discount_lines_response import DiscountLinesResponse from conekta.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.conekta.io # See configuration.py for a list of all supported configuration parameters. configuration = conekta.Configuration( @@ -143,6 +147,7 @@ with conekta.ApiClient(configuration) as api_client: print("Exception when calling DiscountsApi->orders_delete_discount_lines: %s\n" % e) ``` + ### Parameters Name | Type | Description | Notes @@ -187,12 +192,14 @@ Update an existing discount lines for an existing orden * Bearer Authentication (bearerAuth): ```python -from __future__ import print_function import time import os import conekta +from conekta.models.discount_lines_response import DiscountLinesResponse +from conekta.models.update_order_discount_lines_request import UpdateOrderDiscountLinesRequest from conekta.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.conekta.io # See configuration.py for a list of all supported configuration parameters. configuration = conekta.Configuration( @@ -228,6 +235,7 @@ with conekta.ApiClient(configuration) as api_client: print("Exception when calling DiscountsApi->orders_update_discount_lines: %s\n" % e) ``` + ### Parameters Name | Type | Description | Notes diff --git a/docs/EventsApi.md b/docs/EventsApi.md index e3ed8b9..69e1b1b 100644 --- a/docs/EventsApi.md +++ b/docs/EventsApi.md @@ -20,12 +20,13 @@ Returns a single event * Bearer Authentication (bearerAuth): ```python -from __future__ import print_function import time import os import conekta +from conekta.models.event_response import EventResponse from conekta.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.conekta.io # See configuration.py for a list of all supported configuration parameters. configuration = conekta.Configuration( @@ -59,6 +60,7 @@ with conekta.ApiClient(configuration) as api_client: print("Exception when calling EventsApi->get_event: %s\n" % e) ``` + ### Parameters Name | Type | Description | Notes @@ -99,12 +101,13 @@ Get list of Events * Bearer Authentication (bearerAuth): ```python -from __future__ import print_function import time import os import conekta +from conekta.models.get_events_response import GetEventsResponse from conekta.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.conekta.io # See configuration.py for a list of all supported configuration parameters. configuration = conekta.Configuration( @@ -141,6 +144,7 @@ with conekta.ApiClient(configuration) as api_client: print("Exception when calling EventsApi->get_events: %s\n" % e) ``` + ### Parameters Name | Type | Description | Notes @@ -185,12 +189,13 @@ Try to send an event * Bearer Authentication (bearerAuth): ```python -from __future__ import print_function import time import os import conekta +from conekta.models.events_resend_response import EventsResendResponse from conekta.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.conekta.io # See configuration.py for a list of all supported configuration parameters. configuration = conekta.Configuration( @@ -224,6 +229,7 @@ with conekta.ApiClient(configuration) as api_client: print("Exception when calling EventsApi->resend_event: %s\n" % e) ``` + ### Parameters Name | Type | Description | Notes diff --git a/docs/LogsApi.md b/docs/LogsApi.md index 1a6d360..b421749 100644 --- a/docs/LogsApi.md +++ b/docs/LogsApi.md @@ -19,12 +19,13 @@ Get the details of a specific log * Bearer Authentication (bearerAuth): ```python -from __future__ import print_function import time import os import conekta +from conekta.models.log_response import LogResponse from conekta.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.conekta.io # See configuration.py for a list of all supported configuration parameters. configuration = conekta.Configuration( @@ -58,6 +59,7 @@ with conekta.ApiClient(configuration) as api_client: print("Exception when calling LogsApi->get_log_by_id: %s\n" % e) ``` + ### Parameters Name | Type | Description | Notes @@ -100,12 +102,13 @@ Get log details in the form of a list * Bearer Authentication (bearerAuth): ```python -from __future__ import print_function import time import os import conekta +from conekta.models.logs_response import LogsResponse from conekta.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.conekta.io # See configuration.py for a list of all supported configuration parameters. configuration = conekta.Configuration( @@ -142,6 +145,7 @@ with conekta.ApiClient(configuration) as api_client: print("Exception when calling LogsApi->get_logs: %s\n" % e) ``` + ### Parameters Name | Type | Description | Notes diff --git a/docs/OrdersApi.md b/docs/OrdersApi.md index 061d9db..c4359df 100644 --- a/docs/OrdersApi.md +++ b/docs/OrdersApi.md @@ -25,12 +25,13 @@ Cancel an order that has been previously created. * Bearer Authentication (bearerAuth): ```python -from __future__ import print_function import time import os import conekta +from conekta.models.order_response import OrderResponse from conekta.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.conekta.io # See configuration.py for a list of all supported configuration parameters. configuration = conekta.Configuration( @@ -64,6 +65,7 @@ with conekta.ApiClient(configuration) as api_client: print("Exception when calling OrdersApi->cancel_order: %s\n" % e) ``` + ### Parameters Name | Type | Description | Notes @@ -108,12 +110,14 @@ Create a new order. * Bearer Authentication (bearerAuth): ```python -from __future__ import print_function import time import os import conekta +from conekta.models.order_request import OrderRequest +from conekta.models.order_response import OrderResponse from conekta.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.conekta.io # See configuration.py for a list of all supported configuration parameters. configuration = conekta.Configuration( @@ -147,6 +151,7 @@ with conekta.ApiClient(configuration) as api_client: print("Exception when calling OrdersApi->create_order: %s\n" % e) ``` + ### Parameters Name | Type | Description | Notes @@ -190,12 +195,13 @@ Info for a specific order * Bearer Authentication (bearerAuth): ```python -from __future__ import print_function import time import os import conekta +from conekta.models.order_response import OrderResponse from conekta.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.conekta.io # See configuration.py for a list of all supported configuration parameters. configuration = conekta.Configuration( @@ -229,6 +235,7 @@ with conekta.ApiClient(configuration) as api_client: print("Exception when calling OrdersApi->get_order_by_id: %s\n" % e) ``` + ### Parameters Name | Type | Description | Notes @@ -271,12 +278,13 @@ Get order details in the form of a list * Bearer Authentication (bearerAuth): ```python -from __future__ import print_function import time import os import conekta +from conekta.models.get_orders_response import GetOrdersResponse from conekta.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.conekta.io # See configuration.py for a list of all supported configuration parameters. configuration = conekta.Configuration( @@ -313,6 +321,7 @@ with conekta.ApiClient(configuration) as api_client: print("Exception when calling OrdersApi->get_orders: %s\n" % e) ``` + ### Parameters Name | Type | Description | Notes @@ -357,12 +366,13 @@ A refunded order describes the items, amount, and reason an order is being refun * Bearer Authentication (bearerAuth): ```python -from __future__ import print_function import time import os import conekta +from conekta.models.order_response import OrderResponse from conekta.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.conekta.io # See configuration.py for a list of all supported configuration parameters. configuration = conekta.Configuration( @@ -397,6 +407,7 @@ with conekta.ApiClient(configuration) as api_client: print("Exception when calling OrdersApi->order_cancel_refund: %s\n" % e) ``` + ### Parameters Name | Type | Description | Notes @@ -442,12 +453,14 @@ A refunded order describes the items, amount, and reason an order is being refun * Bearer Authentication (bearerAuth): ```python -from __future__ import print_function import time import os import conekta +from conekta.models.order_refund_request import OrderRefundRequest +from conekta.models.order_response import OrderResponse from conekta.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.conekta.io # See configuration.py for a list of all supported configuration parameters. configuration = conekta.Configuration( @@ -482,6 +495,7 @@ with conekta.ApiClient(configuration) as api_client: print("Exception when calling OrdersApi->order_refund: %s\n" % e) ``` + ### Parameters Name | Type | Description | Notes @@ -527,12 +541,14 @@ Processes an order that has been previously authorized. * Bearer Authentication (bearerAuth): ```python -from __future__ import print_function import time import os import conekta +from conekta.models.order_capture_request import OrderCaptureRequest +from conekta.models.order_response import OrderResponse from conekta.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.conekta.io # See configuration.py for a list of all supported configuration parameters. configuration = conekta.Configuration( @@ -567,6 +583,7 @@ with conekta.ApiClient(configuration) as api_client: print("Exception when calling OrdersApi->orders_create_capture: %s\n" % e) ``` + ### Parameters Name | Type | Description | Notes @@ -611,12 +628,14 @@ Update an existing Order. * Bearer Authentication (bearerAuth): ```python -from __future__ import print_function import time import os import conekta +from conekta.models.order_response import OrderResponse +from conekta.models.order_update_request import OrderUpdateRequest from conekta.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.conekta.io # See configuration.py for a list of all supported configuration parameters. configuration = conekta.Configuration( @@ -650,6 +669,7 @@ with conekta.ApiClient(configuration) as api_client: print("Exception when calling OrdersApi->update_order: %s\n" % e) ``` + ### Parameters Name | Type | Description | Notes diff --git a/docs/PaymentLinkApi.md b/docs/PaymentLinkApi.md index cc8c468..e9382f2 100644 --- a/docs/PaymentLinkApi.md +++ b/docs/PaymentLinkApi.md @@ -21,12 +21,13 @@ Cancel Payment Link * Bearer Authentication (bearerAuth): ```python -from __future__ import print_function import time import os import conekta +from conekta.models.checkout_response import CheckoutResponse from conekta.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.conekta.io # See configuration.py for a list of all supported configuration parameters. configuration = conekta.Configuration( @@ -60,6 +61,7 @@ with conekta.ApiClient(configuration) as api_client: print("Exception when calling PaymentLinkApi->cancel_checkout: %s\n" % e) ``` + ### Parameters Name | Type | Description | Notes @@ -102,12 +104,14 @@ Create Unique Payment Link * Bearer Authentication (bearerAuth): ```python -from __future__ import print_function import time import os import conekta +from conekta.models.checkout import Checkout +from conekta.models.checkout_response import CheckoutResponse from conekta.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.conekta.io # See configuration.py for a list of all supported configuration parameters. configuration = conekta.Configuration( @@ -141,6 +145,7 @@ with conekta.ApiClient(configuration) as api_client: print("Exception when calling PaymentLinkApi->create_checkout: %s\n" % e) ``` + ### Parameters Name | Type | Description | Notes @@ -182,12 +187,14 @@ Send an email * Bearer Authentication (bearerAuth): ```python -from __future__ import print_function import time import os import conekta +from conekta.models.checkout_response import CheckoutResponse +from conekta.models.email_checkout_request import EmailCheckoutRequest from conekta.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.conekta.io # See configuration.py for a list of all supported configuration parameters. configuration = conekta.Configuration( @@ -222,6 +229,7 @@ with conekta.ApiClient(configuration) as api_client: print("Exception when calling PaymentLinkApi->email_checkout: %s\n" % e) ``` + ### Parameters Name | Type | Description | Notes @@ -265,12 +273,13 @@ Get a payment link by ID * Bearer Authentication (bearerAuth): ```python -from __future__ import print_function import time import os import conekta +from conekta.models.checkout_response import CheckoutResponse from conekta.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.conekta.io # See configuration.py for a list of all supported configuration parameters. configuration = conekta.Configuration( @@ -304,6 +313,7 @@ with conekta.ApiClient(configuration) as api_client: print("Exception when calling PaymentLinkApi->get_checkout: %s\n" % e) ``` + ### Parameters Name | Type | Description | Notes @@ -348,12 +358,13 @@ Returns a list of links generated by the merchant * Bearer Authentication (bearerAuth): ```python -from __future__ import print_function import time import os import conekta +from conekta.models.checkouts_response import CheckoutsResponse from conekta.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.conekta.io # See configuration.py for a list of all supported configuration parameters. configuration = conekta.Configuration( @@ -390,6 +401,7 @@ with conekta.ApiClient(configuration) as api_client: print("Exception when calling PaymentLinkApi->get_checkouts: %s\n" % e) ``` + ### Parameters Name | Type | Description | Notes @@ -434,12 +446,14 @@ Send an sms * Bearer Authentication (bearerAuth): ```python -from __future__ import print_function import time import os import conekta +from conekta.models.checkout_response import CheckoutResponse +from conekta.models.sms_checkout_request import SmsCheckoutRequest from conekta.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.conekta.io # See configuration.py for a list of all supported configuration parameters. configuration = conekta.Configuration( @@ -474,6 +488,7 @@ with conekta.ApiClient(configuration) as api_client: print("Exception when calling PaymentLinkApi->sms_checkout: %s\n" % e) ``` + ### Parameters Name | Type | Description | Notes diff --git a/docs/PaymentMethodsApi.md b/docs/PaymentMethodsApi.md index 3d5b959..14f9d43 100644 --- a/docs/PaymentMethodsApi.md +++ b/docs/PaymentMethodsApi.md @@ -21,12 +21,14 @@ Create a payment method for a customer. * Bearer Authentication (bearerAuth): ```python -from __future__ import print_function import time import os import conekta +from conekta.models.create_customer_payment_methods_request import CreateCustomerPaymentMethodsRequest +from conekta.models.create_customer_payment_methods_response import CreateCustomerPaymentMethodsResponse from conekta.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.conekta.io # See configuration.py for a list of all supported configuration parameters. configuration = conekta.Configuration( @@ -61,6 +63,7 @@ with conekta.ApiClient(configuration) as api_client: print("Exception when calling PaymentMethodsApi->create_customer_payment_methods: %s\n" % e) ``` + ### Parameters Name | Type | Description | Notes @@ -105,12 +108,13 @@ Delete an existing payment method * Bearer Authentication (bearerAuth): ```python -from __future__ import print_function import time import os import conekta +from conekta.models.update_customer_payment_methods_response import UpdateCustomerPaymentMethodsResponse from conekta.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.conekta.io # See configuration.py for a list of all supported configuration parameters. configuration = conekta.Configuration( @@ -145,6 +149,7 @@ with conekta.ApiClient(configuration) as api_client: print("Exception when calling PaymentMethodsApi->delete_customer_payment_methods: %s\n" % e) ``` + ### Parameters Name | Type | Description | Notes @@ -189,12 +194,13 @@ Get a list of Payment Methods * Bearer Authentication (bearerAuth): ```python -from __future__ import print_function import time import os import conekta +from conekta.models.get_payment_method_response import GetPaymentMethodResponse from conekta.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.conekta.io # See configuration.py for a list of all supported configuration parameters. configuration = conekta.Configuration( @@ -232,6 +238,7 @@ with conekta.ApiClient(configuration) as api_client: print("Exception when calling PaymentMethodsApi->get_customer_payment_methods: %s\n" % e) ``` + ### Parameters Name | Type | Description | Notes @@ -278,12 +285,14 @@ Gets a payment Method that corresponds to a customer ID. * Bearer Authentication (bearerAuth): ```python -from __future__ import print_function import time import os import conekta +from conekta.models.update_customer_payment_methods_response import UpdateCustomerPaymentMethodsResponse +from conekta.models.update_payment_methods import UpdatePaymentMethods from conekta.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.conekta.io # See configuration.py for a list of all supported configuration parameters. configuration = conekta.Configuration( @@ -319,6 +328,7 @@ with conekta.ApiClient(configuration) as api_client: print("Exception when calling PaymentMethodsApi->update_customer_payment_methods: %s\n" % e) ``` + ### Parameters Name | Type | Description | Notes diff --git a/docs/PlansApi.md b/docs/PlansApi.md index 38ff754..87233d6 100644 --- a/docs/PlansApi.md +++ b/docs/PlansApi.md @@ -22,12 +22,14 @@ Create a new plan for an existing order * Bearer Authentication (bearerAuth): ```python -from __future__ import print_function import time import os import conekta +from conekta.models.plan_request import PlanRequest +from conekta.models.plan_response import PlanResponse from conekta.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.conekta.io # See configuration.py for a list of all supported configuration parameters. configuration = conekta.Configuration( @@ -61,6 +63,7 @@ with conekta.ApiClient(configuration) as api_client: print("Exception when calling PlansApi->create_plan: %s\n" % e) ``` + ### Parameters Name | Type | Description | Notes @@ -101,12 +104,13 @@ Delete Plan * Bearer Authentication (bearerAuth): ```python -from __future__ import print_function import time import os import conekta +from conekta.models.plan_response import PlanResponse from conekta.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.conekta.io # See configuration.py for a list of all supported configuration parameters. configuration = conekta.Configuration( @@ -139,6 +143,7 @@ with conekta.ApiClient(configuration) as api_client: print("Exception when calling PlansApi->delete_plan: %s\n" % e) ``` + ### Parameters Name | Type | Description | Notes @@ -179,12 +184,13 @@ Get Plan * Bearer Authentication (bearerAuth): ```python -from __future__ import print_function import time import os import conekta +from conekta.models.plan_response import PlanResponse from conekta.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.conekta.io # See configuration.py for a list of all supported configuration parameters. configuration = conekta.Configuration( @@ -218,6 +224,7 @@ with conekta.ApiClient(configuration) as api_client: print("Exception when calling PlansApi->get_plan: %s\n" % e) ``` + ### Parameters Name | Type | Description | Notes @@ -259,12 +266,13 @@ Get A List of Plans * Bearer Authentication (bearerAuth): ```python -from __future__ import print_function import time import os import conekta +from conekta.models.get_plans_response import GetPlansResponse from conekta.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.conekta.io # See configuration.py for a list of all supported configuration parameters. configuration = conekta.Configuration( @@ -301,6 +309,7 @@ with conekta.ApiClient(configuration) as api_client: print("Exception when calling PlansApi->get_plans: %s\n" % e) ``` + ### Parameters Name | Type | Description | Notes @@ -344,12 +353,14 @@ Update Plan * Bearer Authentication (bearerAuth): ```python -from __future__ import print_function import time import os import conekta +from conekta.models.plan_response import PlanResponse +from conekta.models.plan_update_request import PlanUpdateRequest from conekta.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.conekta.io # See configuration.py for a list of all supported configuration parameters. configuration = conekta.Configuration( @@ -384,6 +395,7 @@ with conekta.ApiClient(configuration) as api_client: print("Exception when calling PlansApi->update_plan: %s\n" % e) ``` + ### Parameters Name | Type | Description | Notes diff --git a/docs/ProductsApi.md b/docs/ProductsApi.md index 12b6f58..b69d36f 100644 --- a/docs/ProductsApi.md +++ b/docs/ProductsApi.md @@ -20,12 +20,14 @@ Create a new product for an existing order. * Bearer Authentication (bearerAuth): ```python -from __future__ import print_function import time import os import conekta +from conekta.models.product import Product +from conekta.models.product_order_response import ProductOrderResponse from conekta.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.conekta.io # See configuration.py for a list of all supported configuration parameters. configuration = conekta.Configuration( @@ -60,6 +62,7 @@ with conekta.ApiClient(configuration) as api_client: print("Exception when calling ProductsApi->orders_create_product: %s\n" % e) ``` + ### Parameters Name | Type | Description | Notes @@ -103,12 +106,13 @@ Delete product for an existing orden * Bearer Authentication (bearerAuth): ```python -from __future__ import print_function import time import os import conekta +from conekta.models.product_order_response import ProductOrderResponse from conekta.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.conekta.io # See configuration.py for a list of all supported configuration parameters. configuration = conekta.Configuration( @@ -143,6 +147,7 @@ with conekta.ApiClient(configuration) as api_client: print("Exception when calling ProductsApi->orders_delete_product: %s\n" % e) ``` + ### Parameters Name | Type | Description | Notes @@ -187,12 +192,14 @@ Update an existing product for an existing orden * Bearer Authentication (bearerAuth): ```python -from __future__ import print_function import time import os import conekta +from conekta.models.product_order_response import ProductOrderResponse +from conekta.models.update_product import UpdateProduct from conekta.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.conekta.io # See configuration.py for a list of all supported configuration parameters. configuration = conekta.Configuration( @@ -228,6 +235,7 @@ with conekta.ApiClient(configuration) as api_client: print("Exception when calling ProductsApi->orders_update_product: %s\n" % e) ``` + ### Parameters Name | Type | Description | Notes diff --git a/docs/ShippingContactsApi.md b/docs/ShippingContactsApi.md index 7d10783..c8f045f 100644 --- a/docs/ShippingContactsApi.md +++ b/docs/ShippingContactsApi.md @@ -20,12 +20,14 @@ Create a shipping contacts for a customer. * Bearer Authentication (bearerAuth): ```python -from __future__ import print_function import time import os import conekta +from conekta.models.customer_shipping_contacts import CustomerShippingContacts +from conekta.models.customer_shipping_contacts_response import CustomerShippingContactsResponse from conekta.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.conekta.io # See configuration.py for a list of all supported configuration parameters. configuration = conekta.Configuration( @@ -60,6 +62,7 @@ with conekta.ApiClient(configuration) as api_client: print("Exception when calling ShippingContactsApi->create_customer_shipping_contacts: %s\n" % e) ``` + ### Parameters Name | Type | Description | Notes @@ -104,12 +107,13 @@ Delete shipping contact that corresponds to a customer ID. * Bearer Authentication (bearerAuth): ```python -from __future__ import print_function import time import os import conekta +from conekta.models.customer_shipping_contacts_response import CustomerShippingContactsResponse from conekta.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.conekta.io # See configuration.py for a list of all supported configuration parameters. configuration = conekta.Configuration( @@ -144,6 +148,7 @@ with conekta.ApiClient(configuration) as api_client: print("Exception when calling ShippingContactsApi->delete_customer_shipping_contacts: %s\n" % e) ``` + ### Parameters Name | Type | Description | Notes @@ -188,12 +193,14 @@ Update shipping contact that corresponds to a customer ID. * Bearer Authentication (bearerAuth): ```python -from __future__ import print_function import time import os import conekta +from conekta.models.customer_shipping_contacts_response import CustomerShippingContactsResponse +from conekta.models.customer_update_shipping_contacts import CustomerUpdateShippingContacts from conekta.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.conekta.io # See configuration.py for a list of all supported configuration parameters. configuration = conekta.Configuration( @@ -229,6 +236,7 @@ with conekta.ApiClient(configuration) as api_client: print("Exception when calling ShippingContactsApi->update_customer_shipping_contacts: %s\n" % e) ``` + ### Parameters Name | Type | Description | Notes diff --git a/docs/ShippingsApi.md b/docs/ShippingsApi.md index 32bc2c6..8496a4a 100644 --- a/docs/ShippingsApi.md +++ b/docs/ShippingsApi.md @@ -20,12 +20,14 @@ Create new shipping for an existing orden * Bearer Authentication (bearerAuth): ```python -from __future__ import print_function import time import os import conekta +from conekta.models.shipping_order_response import ShippingOrderResponse +from conekta.models.shipping_request import ShippingRequest from conekta.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.conekta.io # See configuration.py for a list of all supported configuration parameters. configuration = conekta.Configuration( @@ -60,6 +62,7 @@ with conekta.ApiClient(configuration) as api_client: print("Exception when calling ShippingsApi->orders_create_shipping: %s\n" % e) ``` + ### Parameters Name | Type | Description | Notes @@ -103,12 +106,13 @@ Delete shipping * Bearer Authentication (bearerAuth): ```python -from __future__ import print_function import time import os import conekta +from conekta.models.shipping_order_response import ShippingOrderResponse from conekta.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.conekta.io # See configuration.py for a list of all supported configuration parameters. configuration = conekta.Configuration( @@ -143,6 +147,7 @@ with conekta.ApiClient(configuration) as api_client: print("Exception when calling ShippingsApi->orders_delete_shipping: %s\n" % e) ``` + ### Parameters Name | Type | Description | Notes @@ -187,12 +192,14 @@ Update existing shipping for an existing orden * Bearer Authentication (bearerAuth): ```python -from __future__ import print_function import time import os import conekta +from conekta.models.shipping_order_response import ShippingOrderResponse +from conekta.models.shipping_request import ShippingRequest from conekta.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.conekta.io # See configuration.py for a list of all supported configuration parameters. configuration = conekta.Configuration( @@ -228,6 +235,7 @@ with conekta.ApiClient(configuration) as api_client: print("Exception when calling ShippingsApi->orders_update_shipping: %s\n" % e) ``` + ### Parameters Name | Type | Description | Notes diff --git a/docs/SubscriptionsApi.md b/docs/SubscriptionsApi.md index 9c5d4b9..a85f121 100644 --- a/docs/SubscriptionsApi.md +++ b/docs/SubscriptionsApi.md @@ -24,12 +24,13 @@ You can cancel the subscription to stop the plans that your customers consume * Bearer Authentication (bearerAuth): ```python -from __future__ import print_function import time import os import conekta +from conekta.models.subscription_response import SubscriptionResponse from conekta.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.conekta.io # See configuration.py for a list of all supported configuration parameters. configuration = conekta.Configuration( @@ -63,6 +64,7 @@ with conekta.ApiClient(configuration) as api_client: print("Exception when calling SubscriptionsApi->cancel_subscription: %s\n" % e) ``` + ### Parameters Name | Type | Description | Notes @@ -105,12 +107,14 @@ You can create the subscription to include the plans that your customers consume * Bearer Authentication (bearerAuth): ```python -from __future__ import print_function import time import os import conekta +from conekta.models.subscription_request import SubscriptionRequest +from conekta.models.subscription_response import SubscriptionResponse from conekta.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.conekta.io # See configuration.py for a list of all supported configuration parameters. configuration = conekta.Configuration( @@ -145,6 +149,7 @@ with conekta.ApiClient(configuration) as api_client: print("Exception when calling SubscriptionsApi->create_subscription: %s\n" % e) ``` + ### Parameters Name | Type | Description | Notes @@ -189,12 +194,13 @@ You can get the events of the subscription(s) of a client, with the customer id * Bearer Authentication (bearerAuth): ```python -from __future__ import print_function import time import os import conekta +from conekta.models.subscription_events_response import SubscriptionEventsResponse from conekta.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.conekta.io # See configuration.py for a list of all supported configuration parameters. configuration = conekta.Configuration( @@ -228,6 +234,7 @@ with conekta.ApiClient(configuration) as api_client: print("Exception when calling SubscriptionsApi->get_all_events_from_subscription: %s\n" % e) ``` + ### Parameters Name | Type | Description | Notes @@ -270,12 +277,13 @@ Get Subscription * Bearer Authentication (bearerAuth): ```python -from __future__ import print_function import time import os import conekta +from conekta.models.subscription_response import SubscriptionResponse from conekta.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.conekta.io # See configuration.py for a list of all supported configuration parameters. configuration = conekta.Configuration( @@ -308,6 +316,7 @@ with conekta.ApiClient(configuration) as api_client: print("Exception when calling SubscriptionsApi->get_subscription: %s\n" % e) ``` + ### Parameters Name | Type | Description | Notes @@ -349,12 +358,13 @@ You can pause the subscription to stop the plans that your customers consume * Bearer Authentication (bearerAuth): ```python -from __future__ import print_function import time import os import conekta +from conekta.models.subscription_response import SubscriptionResponse from conekta.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.conekta.io # See configuration.py for a list of all supported configuration parameters. configuration = conekta.Configuration( @@ -388,6 +398,7 @@ with conekta.ApiClient(configuration) as api_client: print("Exception when calling SubscriptionsApi->pause_subscription: %s\n" % e) ``` + ### Parameters Name | Type | Description | Notes @@ -431,12 +442,13 @@ You can resume the subscription to start the plans that your customers consume * Bearer Authentication (bearerAuth): ```python -from __future__ import print_function import time import os import conekta +from conekta.models.subscription_response import SubscriptionResponse from conekta.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.conekta.io # See configuration.py for a list of all supported configuration parameters. configuration = conekta.Configuration( @@ -470,6 +482,7 @@ with conekta.ApiClient(configuration) as api_client: print("Exception when calling SubscriptionsApi->resume_subscription: %s\n" % e) ``` + ### Parameters Name | Type | Description | Notes @@ -514,12 +527,14 @@ You can modify the subscription to change the plans that your customers consume * Bearer Authentication (bearerAuth): ```python -from __future__ import print_function import time import os import conekta +from conekta.models.subscription_response import SubscriptionResponse +from conekta.models.subscription_update_request import SubscriptionUpdateRequest from conekta.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.conekta.io # See configuration.py for a list of all supported configuration parameters. configuration = conekta.Configuration( @@ -554,6 +569,7 @@ with conekta.ApiClient(configuration) as api_client: print("Exception when calling SubscriptionsApi->update_subscription: %s\n" % e) ``` + ### Parameters Name | Type | Description | Notes diff --git a/docs/TaxesApi.md b/docs/TaxesApi.md index ca866ed..d6270a9 100644 --- a/docs/TaxesApi.md +++ b/docs/TaxesApi.md @@ -20,12 +20,14 @@ Create new taxes for an existing orden * Bearer Authentication (bearerAuth): ```python -from __future__ import print_function import time import os import conekta +from conekta.models.order_tax_request import OrderTaxRequest +from conekta.models.update_order_tax_response import UpdateOrderTaxResponse from conekta.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.conekta.io # See configuration.py for a list of all supported configuration parameters. configuration = conekta.Configuration( @@ -60,6 +62,7 @@ with conekta.ApiClient(configuration) as api_client: print("Exception when calling TaxesApi->orders_create_taxes: %s\n" % e) ``` + ### Parameters Name | Type | Description | Notes @@ -103,12 +106,13 @@ Delete taxes for an existing orden * Bearer Authentication (bearerAuth): ```python -from __future__ import print_function import time import os import conekta +from conekta.models.update_order_tax_response import UpdateOrderTaxResponse from conekta.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.conekta.io # See configuration.py for a list of all supported configuration parameters. configuration = conekta.Configuration( @@ -143,6 +147,7 @@ with conekta.ApiClient(configuration) as api_client: print("Exception when calling TaxesApi->orders_delete_taxes: %s\n" % e) ``` + ### Parameters Name | Type | Description | Notes @@ -187,12 +192,14 @@ Update taxes for an existing orden * Bearer Authentication (bearerAuth): ```python -from __future__ import print_function import time import os import conekta +from conekta.models.update_order_tax_request import UpdateOrderTaxRequest +from conekta.models.update_order_tax_response import UpdateOrderTaxResponse from conekta.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.conekta.io # See configuration.py for a list of all supported configuration parameters. configuration = conekta.Configuration( @@ -228,6 +235,7 @@ with conekta.ApiClient(configuration) as api_client: print("Exception when calling TaxesApi->orders_update_taxes: %s\n" % e) ``` + ### Parameters Name | Type | Description | Notes diff --git a/docs/TokensApi.md b/docs/TokensApi.md index 989b7ec..bba663b 100644 --- a/docs/TokensApi.md +++ b/docs/TokensApi.md @@ -18,12 +18,14 @@ Generate a payment token, to associate it with a card * Bearer Authentication (bearerAuth): ```python -from __future__ import print_function import time import os import conekta +from conekta.models.token import Token +from conekta.models.token_response import TokenResponse from conekta.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.conekta.io # See configuration.py for a list of all supported configuration parameters. configuration = conekta.Configuration( @@ -56,6 +58,7 @@ with conekta.ApiClient(configuration) as api_client: print("Exception when calling TokensApi->create_token: %s\n" % e) ``` + ### Parameters Name | Type | Description | Notes diff --git a/docs/TransactionsApi.md b/docs/TransactionsApi.md index d43fef3..d99db53 100644 --- a/docs/TransactionsApi.md +++ b/docs/TransactionsApi.md @@ -19,12 +19,13 @@ Get the details of a transaction * Bearer Authentication (bearerAuth): ```python -from __future__ import print_function import time import os import conekta +from conekta.models.transaction_response import TransactionResponse from conekta.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.conekta.io # See configuration.py for a list of all supported configuration parameters. configuration = conekta.Configuration( @@ -58,6 +59,7 @@ with conekta.ApiClient(configuration) as api_client: print("Exception when calling TransactionsApi->get_transaction: %s\n" % e) ``` + ### Parameters Name | Type | Description | Notes @@ -100,12 +102,13 @@ Get transaction details in the form of a list * Bearer Authentication (bearerAuth): ```python -from __future__ import print_function import time import os import conekta +from conekta.models.get_transactions_response import GetTransactionsResponse from conekta.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.conekta.io # See configuration.py for a list of all supported configuration parameters. configuration = conekta.Configuration( @@ -142,6 +145,7 @@ with conekta.ApiClient(configuration) as api_client: print("Exception when calling TransactionsApi->get_transactions: %s\n" % e) ``` + ### Parameters Name | Type | Description | Notes diff --git a/docs/TransfersApi.md b/docs/TransfersApi.md index 71553d5..83f0c10 100644 --- a/docs/TransfersApi.md +++ b/docs/TransfersApi.md @@ -19,12 +19,13 @@ Get the details of a Transfer * Bearer Authentication (bearerAuth): ```python -from __future__ import print_function import time import os import conekta +from conekta.models.transfer_response import TransferResponse from conekta.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.conekta.io # See configuration.py for a list of all supported configuration parameters. configuration = conekta.Configuration( @@ -58,6 +59,7 @@ with conekta.ApiClient(configuration) as api_client: print("Exception when calling TransfersApi->get_transfer: %s\n" % e) ``` + ### Parameters Name | Type | Description | Notes @@ -100,12 +102,13 @@ Get transfers details in the form of a list * Bearer Authentication (bearerAuth): ```python -from __future__ import print_function import time import os import conekta +from conekta.models.get_transfers_response import GetTransfersResponse from conekta.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.conekta.io # See configuration.py for a list of all supported configuration parameters. configuration = conekta.Configuration( @@ -142,6 +145,7 @@ with conekta.ApiClient(configuration) as api_client: print("Exception when calling TransfersApi->get_transfers: %s\n" % e) ``` + ### Parameters Name | Type | Description | Notes diff --git a/docs/WebhookKeysApi.md b/docs/WebhookKeysApi.md index 257be5e..ee4559d 100644 --- a/docs/WebhookKeysApi.md +++ b/docs/WebhookKeysApi.md @@ -22,12 +22,14 @@ Create a webhook key * Bearer Authentication (bearerAuth): ```python -from __future__ import print_function import time import os import conekta +from conekta.models.webhook_key_create_response import WebhookKeyCreateResponse +from conekta.models.webhook_key_request import WebhookKeyRequest from conekta.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.conekta.io # See configuration.py for a list of all supported configuration parameters. configuration = conekta.Configuration( @@ -60,6 +62,7 @@ with conekta.ApiClient(configuration) as api_client: print("Exception when calling WebhookKeysApi->create_webhook_key: %s\n" % e) ``` + ### Parameters Name | Type | Description | Notes @@ -98,12 +101,13 @@ Delete Webhook key * Bearer Authentication (bearerAuth): ```python -from __future__ import print_function import time import os import conekta +from conekta.models.webhook_key_delete_response import WebhookKeyDeleteResponse from conekta.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.conekta.io # See configuration.py for a list of all supported configuration parameters. configuration = conekta.Configuration( @@ -136,6 +140,7 @@ with conekta.ApiClient(configuration) as api_client: print("Exception when calling WebhookKeysApi->delete_webhook_key: %s\n" % e) ``` + ### Parameters Name | Type | Description | Notes @@ -175,12 +180,13 @@ Get Webhook Key * Bearer Authentication (bearerAuth): ```python -from __future__ import print_function import time import os import conekta +from conekta.models.webhook_key_response import WebhookKeyResponse from conekta.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.conekta.io # See configuration.py for a list of all supported configuration parameters. configuration = conekta.Configuration( @@ -214,6 +220,7 @@ with conekta.ApiClient(configuration) as api_client: print("Exception when calling WebhookKeysApi->get_webhook_key: %s\n" % e) ``` + ### Parameters Name | Type | Description | Notes @@ -256,12 +263,13 @@ Consume the list of webhook keys you have * Bearer Authentication (bearerAuth): ```python -from __future__ import print_function import time import os import conekta +from conekta.models.get_webhook_keys_response import GetWebhookKeysResponse from conekta.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.conekta.io # See configuration.py for a list of all supported configuration parameters. configuration = conekta.Configuration( @@ -298,6 +306,7 @@ with conekta.ApiClient(configuration) as api_client: print("Exception when calling WebhookKeysApi->get_webhook_keys: %s\n" % e) ``` + ### Parameters Name | Type | Description | Notes @@ -342,12 +351,14 @@ updates an existing webhook key * Bearer Authentication (bearerAuth): ```python -from __future__ import print_function import time import os import conekta +from conekta.models.webhook_key_response import WebhookKeyResponse +from conekta.models.webhook_key_update_request import WebhookKeyUpdateRequest from conekta.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.conekta.io # See configuration.py for a list of all supported configuration parameters. configuration = conekta.Configuration( @@ -381,6 +392,7 @@ with conekta.ApiClient(configuration) as api_client: print("Exception when calling WebhookKeysApi->update_webhook_key: %s\n" % e) ``` + ### Parameters Name | Type | Description | Notes diff --git a/docs/WebhooksApi.md b/docs/WebhooksApi.md index 94f0854..652551e 100644 --- a/docs/WebhooksApi.md +++ b/docs/WebhooksApi.md @@ -23,12 +23,14 @@ What we do at Conekta translates into events. For example, an event of interest * Bearer Authentication (bearerAuth): ```python -from __future__ import print_function import time import os import conekta +from conekta.models.webhook_request import WebhookRequest +from conekta.models.webhook_response import WebhookResponse from conekta.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.conekta.io # See configuration.py for a list of all supported configuration parameters. configuration = conekta.Configuration( @@ -61,6 +63,7 @@ with conekta.ApiClient(configuration) as api_client: print("Exception when calling WebhooksApi->create_webhook: %s\n" % e) ``` + ### Parameters Name | Type | Description | Notes @@ -99,12 +102,13 @@ Delete Webhook * Bearer Authentication (bearerAuth): ```python -from __future__ import print_function import time import os import conekta +from conekta.models.webhook_response import WebhookResponse from conekta.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.conekta.io # See configuration.py for a list of all supported configuration parameters. configuration = conekta.Configuration( @@ -137,6 +141,7 @@ with conekta.ApiClient(configuration) as api_client: print("Exception when calling WebhooksApi->delete_webhook: %s\n" % e) ``` + ### Parameters Name | Type | Description | Notes @@ -176,12 +181,13 @@ Get Webhook * Bearer Authentication (bearerAuth): ```python -from __future__ import print_function import time import os import conekta +from conekta.models.webhook_response import WebhookResponse from conekta.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.conekta.io # See configuration.py for a list of all supported configuration parameters. configuration = conekta.Configuration( @@ -215,6 +221,7 @@ with conekta.ApiClient(configuration) as api_client: print("Exception when calling WebhooksApi->get_webhook: %s\n" % e) ``` + ### Parameters Name | Type | Description | Notes @@ -257,12 +264,13 @@ Consume the list of webhooks you have, each environment supports 10 webhooks (Fo * Bearer Authentication (bearerAuth): ```python -from __future__ import print_function import time import os import conekta +from conekta.models.get_webhooks_response import GetWebhooksResponse from conekta.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.conekta.io # See configuration.py for a list of all supported configuration parameters. configuration = conekta.Configuration( @@ -299,6 +307,7 @@ with conekta.ApiClient(configuration) as api_client: print("Exception when calling WebhooksApi->get_webhooks: %s\n" % e) ``` + ### Parameters Name | Type | Description | Notes @@ -343,12 +352,13 @@ Send a webhook.ping event * Bearer Authentication (bearerAuth): ```python -from __future__ import print_function import time import os import conekta +from conekta.models.webhook_response import WebhookResponse from conekta.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.conekta.io # See configuration.py for a list of all supported configuration parameters. configuration = conekta.Configuration( @@ -381,6 +391,7 @@ with conekta.ApiClient(configuration) as api_client: print("Exception when calling WebhooksApi->test_webhook: %s\n" % e) ``` + ### Parameters Name | Type | Description | Notes @@ -422,12 +433,14 @@ updates an existing webhook * Bearer Authentication (bearerAuth): ```python -from __future__ import print_function import time import os import conekta +from conekta.models.webhook_response import WebhookResponse +from conekta.models.webhook_update_request import WebhookUpdateRequest from conekta.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.conekta.io # See configuration.py for a list of all supported configuration parameters. configuration = conekta.Configuration( @@ -462,6 +475,7 @@ with conekta.ApiClient(configuration) as api_client: print("Exception when calling WebhooksApi->update_webhook: %s\n" % e) ``` + ### Parameters Name | Type | Description | Notes diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..c69608e --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,29 @@ +[tool.poetry] +name = "conekta" +version = "6.0.0" +description = "Conekta API" +authors = ["Engineering Conekta "] +license = "MIT-LICENSE" +readme = "README.md" +repository = "https://github.com/conekta/conekta-python" +keywords = ["OpenAPI", "OpenAPI-Generator", "Conekta API"] + +[tool.poetry.dependencies] +python = "^3.7" + +urllib3 = ">= 1.25.3" +python-dateutil = ">=2.8.2" +pydantic = "^1.10.5, <2" +aenum = ">=3.1.11" + +[tool.poetry.dev-dependencies] +pytest = ">=7.2.1" +tox = ">=3.9.0" +flake8 = ">=4.0.0" + +[build-system] +requires = ["setuptools"] +build-backend = "setuptools.build_meta" + +[tool.pylint.'MESSAGES CONTROL'] +extension-pkg-whitelist = "pydantic" diff --git a/requirements.txt b/requirements.txt index b98ff3e..74ede17 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ python_dateutil >= 2.5.3 setuptools >= 21.0.0 urllib3 >= 1.25.3 -pydantic >= 1.10.2 +pydantic >= 1.10.5, < 2 aenum >= 3.1.11 diff --git a/setup.py b/setup.py index 7777f54..414bb47 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,9 @@ The version of the OpenAPI document: 2.1.0 Contact: engineering@conekta.com - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ @@ -25,7 +27,7 @@ REQUIRES = [ "urllib3 >= 1.25.3", "python-dateutil", - "pydantic", + "pydantic >= 1.10.5, < 2", "aenum" ] diff --git a/test/test_payment_methods_api.py b/test/test_payment_methods_api.py index d0d0142..bb66898 100644 --- a/test/test_payment_methods_api.py +++ b/test/test_payment_methods_api.py @@ -40,11 +40,12 @@ def test_create_customer_payment_methods(self): """ accept_language = 'es' rq = conekta.CreateCustomerPaymentMethodsRequest( - oneof_schema_2_validator=conekta.PaymentMethodCashRequest( + conekta.PaymentMethodCashRequest( type='oxxo_recurrent' ) ) - response = self.api.create_customer_payment_methods('cus_2tYENskzTjjgkGQLt', rq, accept_language) + + response = self.api.create_customer_payment_methods('cus_2tXyF9BwPG14UMkkg', rq, accept_language) self.assertIsNotNone(response) self.assertIsInstance(response.actual_instance, conekta.PaymentMethodCashResponse) self.assertEqual('oxxo_recurrent', response.actual_instance.type)