diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index 452e222..f4912b0 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -8,6 +8,7 @@ conekta/__init__.py conekta/api/__init__.py conekta/api/antifraud_api.py conekta/api/api_keys_api.py +conekta/api/balances_api.py conekta/api/charges_api.py conekta/api/companies_api.py conekta/api/customers_api.py @@ -37,7 +38,10 @@ conekta/models/api_key_create_response.py conekta/models/api_key_create_response_all_of.py conekta/models/api_key_request.py conekta/models/api_key_response.py +conekta/models/api_key_response_on_delete.py conekta/models/api_key_update_request.py +conekta/models/balance_common_field.py +conekta/models/balance_response.py conekta/models/blacklist_rule_response.py conekta/models/charge_data_payment_method_bank_transfer_response.py conekta/models/charge_data_payment_method_card_response.py @@ -123,6 +127,8 @@ conekta/models/get_companies_response_all_of.py conekta/models/get_customer_payment_method_data_response.py conekta/models/get_events_response.py conekta/models/get_events_response_all_of.py +conekta/models/get_order_discount_lines_response.py +conekta/models/get_order_discount_lines_response_all_of.py conekta/models/get_orders_response.py conekta/models/get_payment_method_response.py conekta/models/get_payment_method_response_all_of.py @@ -161,6 +167,7 @@ conekta/models/order_response_shipping_contact.py conekta/models/order_response_shipping_contact_all_of.py conekta/models/order_tax_request.py conekta/models/order_update_request.py +conekta/models/order_update_request_customer_info.py conekta/models/orders_response.py conekta/models/page.py conekta/models/pagination.py @@ -235,8 +242,12 @@ docs/ApiKeyCreateResponse.md docs/ApiKeyCreateResponseAllOf.md docs/ApiKeyRequest.md docs/ApiKeyResponse.md +docs/ApiKeyResponseOnDelete.md docs/ApiKeyUpdateRequest.md docs/ApiKeysApi.md +docs/BalanceCommonField.md +docs/BalanceResponse.md +docs/BalancesApi.md docs/BlacklistRuleResponse.md docs/ChargeDataPaymentMethodBankTransferResponse.md docs/ChargeDataPaymentMethodCardResponse.md @@ -327,6 +338,8 @@ docs/GetCompaniesResponseAllOf.md docs/GetCustomerPaymentMethodDataResponse.md docs/GetEventsResponse.md docs/GetEventsResponseAllOf.md +docs/GetOrderDiscountLinesResponse.md +docs/GetOrderDiscountLinesResponseAllOf.md docs/GetOrdersResponse.md docs/GetPaymentMethodResponse.md docs/GetPaymentMethodResponseAllOf.md @@ -366,6 +379,7 @@ docs/OrderResponseShippingContact.md docs/OrderResponseShippingContactAllOf.md docs/OrderTaxRequest.md docs/OrderUpdateRequest.md +docs/OrderUpdateRequestCustomerInfo.md docs/OrdersApi.md docs/OrdersResponse.md docs/Page.md @@ -454,4 +468,5 @@ setup.cfg setup.py test-requirements.txt test/__init__.py +test/test_balances_api.py tox.ini diff --git a/README.md b/README.md index 8ca2665..57884f1 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ Conekta sdk This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: - API version: 2.1.0 -- Package version: 6.0.0 +- Package version: 6.0.1 - Build package: org.openapitools.codegen.languages.PythonNextgenClientCodegen For more information, please visit [https://github.com/conekta/openapi/issues](https://github.com/conekta/openapi/issues) @@ -105,6 +105,7 @@ Class | Method | HTTP request | Description *ApiKeysApi* | [**get_api_key**](docs/ApiKeysApi.md#get_api_key) | **GET** /api_keys/{id} | Get Api Key *ApiKeysApi* | [**get_api_keys**](docs/ApiKeysApi.md#get_api_keys) | **GET** /api_keys | Get list of Api Keys *ApiKeysApi* | [**update_api_key**](docs/ApiKeysApi.md#update_api_key) | **PUT** /api_keys/{id} | Update Api Key +*BalancesApi* | [**get_balance**](docs/BalancesApi.md#get_balance) | **GET** /balances | Get a company's balance *ChargesApi* | [**get_charges**](docs/ChargesApi.md#get_charges) | **GET** /charges | Get A List of Charges *ChargesApi* | [**orders_create_charge**](docs/ChargesApi.md#orders_create_charge) | **POST** /orders/{id}/charges | Create charge *CompaniesApi* | [**get_companies**](docs/CompaniesApi.md#get_companies) | **GET** /companies | Get List of Companies @@ -118,6 +119,8 @@ Class | Method | HTTP request | Description *CustomersApi* | [**update_customer_fiscal_entities**](docs/CustomersApi.md#update_customer_fiscal_entities) | **PUT** /customers/{id}/fiscal_entities/{fiscal_entities_id} | Update Fiscal Entity *DiscountsApi* | [**orders_create_discount_line**](docs/DiscountsApi.md#orders_create_discount_line) | **POST** /orders/{id}/discount_lines | Create Discount *DiscountsApi* | [**orders_delete_discount_lines**](docs/DiscountsApi.md#orders_delete_discount_lines) | **DELETE** /orders/{id}/discount_lines/{discount_lines_id} | Delete Discount +*DiscountsApi* | [**orders_get_discount_line**](docs/DiscountsApi.md#orders_get_discount_line) | **GET** /orders/{id}/discount_lines/{discount_lines_id} | Get Discount +*DiscountsApi* | [**orders_get_discount_lines**](docs/DiscountsApi.md#orders_get_discount_lines) | **GET** /orders/{id}/discount_lines | Get a List of Discount *DiscountsApi* | [**orders_update_discount_lines**](docs/DiscountsApi.md#orders_update_discount_lines) | **PUT** /orders/{id}/discount_lines/{discount_lines_id} | Update Discount *EventsApi* | [**get_event**](docs/EventsApi.md#get_event) | **GET** /events/{id} | Get Event *EventsApi* | [**get_events**](docs/EventsApi.md#get_events) | **GET** /events | Get list of Events @@ -190,7 +193,10 @@ Class | Method | HTTP request | Description - [ApiKeyCreateResponseAllOf](docs/ApiKeyCreateResponseAllOf.md) - [ApiKeyRequest](docs/ApiKeyRequest.md) - [ApiKeyResponse](docs/ApiKeyResponse.md) + - [ApiKeyResponseOnDelete](docs/ApiKeyResponseOnDelete.md) - [ApiKeyUpdateRequest](docs/ApiKeyUpdateRequest.md) + - [BalanceCommonField](docs/BalanceCommonField.md) + - [BalanceResponse](docs/BalanceResponse.md) - [BlacklistRuleResponse](docs/BlacklistRuleResponse.md) - [ChargeDataPaymentMethodBankTransferResponse](docs/ChargeDataPaymentMethodBankTransferResponse.md) - [ChargeDataPaymentMethodCardResponse](docs/ChargeDataPaymentMethodCardResponse.md) @@ -276,6 +282,8 @@ Class | Method | HTTP request | Description - [GetCustomerPaymentMethodDataResponse](docs/GetCustomerPaymentMethodDataResponse.md) - [GetEventsResponse](docs/GetEventsResponse.md) - [GetEventsResponseAllOf](docs/GetEventsResponseAllOf.md) + - [GetOrderDiscountLinesResponse](docs/GetOrderDiscountLinesResponse.md) + - [GetOrderDiscountLinesResponseAllOf](docs/GetOrderDiscountLinesResponseAllOf.md) - [GetOrdersResponse](docs/GetOrdersResponse.md) - [GetPaymentMethodResponse](docs/GetPaymentMethodResponse.md) - [GetPaymentMethodResponseAllOf](docs/GetPaymentMethodResponseAllOf.md) @@ -314,6 +322,7 @@ Class | Method | HTTP request | Description - [OrderResponseShippingContactAllOf](docs/OrderResponseShippingContactAllOf.md) - [OrderTaxRequest](docs/OrderTaxRequest.md) - [OrderUpdateRequest](docs/OrderUpdateRequest.md) + - [OrderUpdateRequestCustomerInfo](docs/OrderUpdateRequestCustomerInfo.md) - [OrdersResponse](docs/OrdersResponse.md) - [Page](docs/Page.md) - [Pagination](docs/Pagination.md) diff --git a/VERSION b/VERSION index 09b254e..5fe6072 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -6.0.0 +6.0.1 diff --git a/conekta/__init__.py b/conekta/__init__.py index 05816aa..cbee805 100644 --- a/conekta/__init__.py +++ b/conekta/__init__.py @@ -15,11 +15,12 @@ """ -__version__ = "6.0.0" +__version__ = "6.0.1" # import apis into sdk package from conekta.api.antifraud_api import AntifraudApi from conekta.api.api_keys_api import ApiKeysApi +from conekta.api.balances_api import BalancesApi from conekta.api.charges_api import ChargesApi from conekta.api.companies_api import CompaniesApi from conekta.api.customers_api import CustomersApi @@ -57,7 +58,10 @@ from conekta.models.api_key_create_response_all_of import ApiKeyCreateResponseAllOf from conekta.models.api_key_request import ApiKeyRequest from conekta.models.api_key_response import ApiKeyResponse +from conekta.models.api_key_response_on_delete import ApiKeyResponseOnDelete from conekta.models.api_key_update_request import ApiKeyUpdateRequest +from conekta.models.balance_common_field import BalanceCommonField +from conekta.models.balance_response import BalanceResponse from conekta.models.blacklist_rule_response import BlacklistRuleResponse from conekta.models.charge_data_payment_method_bank_transfer_response import ChargeDataPaymentMethodBankTransferResponse from conekta.models.charge_data_payment_method_card_response import ChargeDataPaymentMethodCardResponse @@ -143,6 +147,8 @@ from conekta.models.get_customer_payment_method_data_response import GetCustomerPaymentMethodDataResponse from conekta.models.get_events_response import GetEventsResponse from conekta.models.get_events_response_all_of import GetEventsResponseAllOf +from conekta.models.get_order_discount_lines_response import GetOrderDiscountLinesResponse +from conekta.models.get_order_discount_lines_response_all_of import GetOrderDiscountLinesResponseAllOf from conekta.models.get_orders_response import GetOrdersResponse from conekta.models.get_payment_method_response import GetPaymentMethodResponse from conekta.models.get_payment_method_response_all_of import GetPaymentMethodResponseAllOf @@ -181,6 +187,7 @@ from conekta.models.order_response_shipping_contact_all_of import OrderResponseShippingContactAllOf from conekta.models.order_tax_request import OrderTaxRequest from conekta.models.order_update_request import OrderUpdateRequest +from conekta.models.order_update_request_customer_info import OrderUpdateRequestCustomerInfo from conekta.models.orders_response import OrdersResponse from conekta.models.page import Page from conekta.models.pagination import Pagination diff --git a/conekta/api/__init__.py b/conekta/api/__init__.py index cac28f6..8d8660e 100644 --- a/conekta/api/__init__.py +++ b/conekta/api/__init__.py @@ -3,6 +3,7 @@ # import apis into api package from conekta.api.antifraud_api import AntifraudApi from conekta.api.api_keys_api import ApiKeysApi +from conekta.api.balances_api import BalancesApi from conekta.api.charges_api import ChargesApi from conekta.api.companies_api import CompaniesApi from conekta.api.customers_api import CustomersApi diff --git a/conekta/api/api_keys_api.py b/conekta/api/api_keys_api.py index 078618b..20f201d 100644 --- a/conekta/api/api_keys_api.py +++ b/conekta/api/api_keys_api.py @@ -525,14 +525,14 @@ def get_api_key_with_http_info(self, id : Annotated[StrictStr, Field(..., descri _request_auth=_params.get('_request_auth')) @validate_arguments - def get_api_keys(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) -> GetApiKeysResponse: # noqa: E501 + def get_api_keys(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, 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 search, e.g. by id, description, prefix")] = None, **kwargs) -> GetApiKeysResponse: # noqa: E501 """Get list of Api Keys # noqa: E501 Consume the list of api keys you have # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_api_keys(accept_language, x_child_company_id, limit, search, next, previous, async_req=True) + >>> thread = api.get_api_keys(accept_language, x_child_company_id, limit, next, previous, search, async_req=True) >>> result = thread.get() :param accept_language: Use for knowing which language to use @@ -541,12 +541,12 @@ def get_api_keys(self, accept_language : Annotated[Optional[StrictStr], Field(de :type x_child_company_id: str :param limit: The numbers of items to return, the maximum value is 250 :type limit: int - :param search: General order search, e.g. by mail, reference etc. - :type search: str :param next: next page :type next: str :param previous: previous page :type previous: str + :param search: General search, e.g. by id, description, prefix + :type search: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one @@ -561,17 +561,17 @@ def get_api_keys(self, accept_language : Annotated[Optional[StrictStr], Field(de 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 + return self.get_api_keys_with_http_info(accept_language, x_child_company_id, limit, next, previous, search, **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) -> ApiResponse: # 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, 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 search, e.g. by id, description, prefix")] = None, **kwargs) -> ApiResponse: # noqa: E501 """Get list of Api Keys # noqa: E501 Consume the list of api keys you have # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_api_keys_with_http_info(accept_language, x_child_company_id, limit, search, next, previous, async_req=True) + >>> thread = api.get_api_keys_with_http_info(accept_language, x_child_company_id, limit, next, previous, search, async_req=True) >>> result = thread.get() :param accept_language: Use for knowing which language to use @@ -580,12 +580,12 @@ def get_api_keys_with_http_info(self, accept_language : Annotated[Optional[Stric :type x_child_company_id: str :param limit: The numbers of items to return, the maximum value is 250 :type limit: int - :param search: General order search, e.g. by mail, reference etc. - :type search: str :param next: next page :type next: str :param previous: previous page :type previous: str + :param search: General search, e.g. by id, description, prefix + :type search: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the ApiResponse.data will @@ -617,9 +617,9 @@ def get_api_keys_with_http_info(self, accept_language : Annotated[Optional[Stric 'accept_language', 'x_child_company_id', 'limit', - 'search', 'next', - 'previous' + 'previous', + 'search' ] _all_params.extend( [ @@ -653,15 +653,15 @@ def get_api_keys_with_http_info(self, accept_language : Annotated[Optional[Stric 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'])) + if _params.get('search') is not None: # noqa: E501 + _query_params.append(('search', _params['search'])) + # process the header parameters _header_params = dict(_params.get('_headers', {})) if _params['accept_language']: diff --git a/conekta/api/balances_api.py b/conekta/api/balances_api.py new file mode 100644 index 0000000..4a97bc3 --- /dev/null +++ b/conekta/api/balances_api.py @@ -0,0 +1,188 @@ +# coding: utf-8 + +""" + Conekta API + + Conekta sdk # noqa: E501 + + The version of the OpenAPI document: 2.1.0 + Contact: engineering@conekta.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" + + +import re # noqa: F401 +import io +import warnings + +from pydantic import validate_arguments, ValidationError +from typing_extensions import Annotated + +from pydantic import Field, StrictStr + +from typing import Optional + +from conekta.models.balance_response import BalanceResponse + +from conekta.api_client import ApiClient +from conekta.api_response import ApiResponse +from conekta.exceptions import ( # noqa: F401 + ApiTypeError, + ApiValueError +) + + +class BalancesApi(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + @validate_arguments + def get_balance(self, accept_language : Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None, **kwargs) -> BalanceResponse: # noqa: E501 + """Get a company's balance # noqa: E501 + + Get a company's balance # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_balance(accept_language, async_req=True) + >>> result = thread.get() + + :param accept_language: Use for knowing which language to use + :type accept_language: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: 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 + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: BalanceResponse + """ + kwargs['_return_http_data_only'] = True + if '_preload_content' in kwargs: + raise ValueError("Error! Please call the get_balance_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") + return self.get_balance_with_http_info(accept_language, **kwargs) # noqa: E501 + + @validate_arguments + def get_balance_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 company's balance # noqa: E501 + + Get a company's balance # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_balance_with_http_info(accept_language, async_req=True) + >>> result = thread.get() + + :param accept_language: Use for knowing which language to use + :type accept_language: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :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 + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(BalanceResponse, status_code(int), headers(HTTPHeaderDict)) + """ + + _params = locals() + + _all_params = [ + 'accept_language' + ] + _all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + # validate the arguments + for _key, _val in _params['kwargs'].items(): + if _key not in _all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_balance" % _key + ) + _params[_key] = _val + del _params['kwargs'] + + _collection_formats = {} + + # process the path parameters + _path_params = {} + + # 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'] + + # 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 + + # authentication setting + _auth_settings = ['bearerAuth'] # noqa: E501 + + _response_types_map = { + '200': "BalanceResponse", + '401': "Error", + '500': "Error", + } + + return self.api_client.call_api( + '/balances', 'GET', + _path_params, + _query_params, + _header_params, + body=_body_params, + post_params=_form_params, + files=_files, + response_types_map=_response_types_map, + auth_settings=_auth_settings, + async_req=_params.get('async_req'), + _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=_params.get('_preload_content', True), + _request_timeout=_params.get('_request_timeout'), + collection_formats=_collection_formats, + _request_auth=_params.get('_request_auth')) diff --git a/conekta/api/discounts_api.py b/conekta/api/discounts_api.py index 5b23d33..c45b7bd 100644 --- a/conekta/api/discounts_api.py +++ b/conekta/api/discounts_api.py @@ -20,11 +20,12 @@ from pydantic import validate_arguments, ValidationError from typing_extensions import Annotated -from pydantic import Field, StrictStr +from pydantic import Field, StrictStr, conint from typing import Optional from conekta.models.discount_lines_response import DiscountLinesResponse +from conekta.models.get_order_discount_lines_response import GetOrderDiscountLinesResponse from conekta.models.order_discount_lines_request import OrderDiscountLinesRequest from conekta.models.update_order_discount_lines_request import UpdateOrderDiscountLinesRequest @@ -222,7 +223,7 @@ def orders_create_discount_line_with_http_info(self, id : Annotated[StrictStr, F _request_auth=_params.get('_request_auth')) @validate_arguments - def orders_delete_discount_lines(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) -> DiscountLinesResponse: # noqa: E501 + def orders_delete_discount_lines(self, id : Annotated[StrictStr, Field(..., description="Identifier of the resource")], discount_lines_id : Annotated[StrictStr, Field(..., description="discount line id 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) -> DiscountLinesResponse: # noqa: E501 """Delete Discount # noqa: E501 Delete an existing discount lines for an existing orden # noqa: E501 @@ -234,7 +235,7 @@ def orders_delete_discount_lines(self, id : Annotated[StrictStr, Field(..., desc :param id: Identifier of the resource (required) :type id: str - :param discount_lines_id: identifier (required) + :param discount_lines_id: discount line id identifier (required) :type discount_lines_id: str :param accept_language: Use for knowing which language to use :type accept_language: str @@ -257,7 +258,7 @@ def orders_delete_discount_lines(self, id : Annotated[StrictStr, Field(..., desc 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) -> ApiResponse: # 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="discount line id 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 @@ -269,7 +270,7 @@ def orders_delete_discount_lines_with_http_info(self, id : Annotated[StrictStr, :param id: Identifier of the resource (required) :type id: str - :param discount_lines_id: identifier (required) + :param discount_lines_id: discount line id identifier (required) :type discount_lines_id: str :param accept_language: Use for knowing which language to use :type accept_language: str @@ -389,7 +390,363 @@ def orders_delete_discount_lines_with_http_info(self, id : Annotated[StrictStr, _request_auth=_params.get('_request_auth')) @validate_arguments - def orders_update_discount_lines(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) -> DiscountLinesResponse: # noqa: E501 + def orders_get_discount_line(self, id : Annotated[StrictStr, Field(..., description="Identifier of the resource")], discount_lines_id : Annotated[StrictStr, Field(..., description="discount line id 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) -> DiscountLinesResponse: # noqa: E501 + """Get Discount # noqa: E501 + + Get an existing discount lines for an existing orden # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.orders_get_discount_line(id, discount_lines_id, accept_language, x_child_company_id, async_req=True) + >>> result = thread.get() + + :param id: Identifier of the resource (required) + :type id: str + :param discount_lines_id: discount line id identifier (required) + :type discount_lines_id: str + :param accept_language: Use for knowing which language to use + :type accept_language: str + :param x_child_company_id: In the case of a holding company, the company id of the child company to which will process the request. + :type x_child_company_id: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: 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 + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: DiscountLinesResponse + """ + kwargs['_return_http_data_only'] = True + if '_preload_content' in kwargs: + raise ValueError("Error! Please call the orders_get_discount_line_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") + return self.orders_get_discount_line_with_http_info(id, discount_lines_id, accept_language, x_child_company_id, **kwargs) # noqa: E501 + + @validate_arguments + def orders_get_discount_line_with_http_info(self, id : Annotated[StrictStr, Field(..., description="Identifier of the resource")], discount_lines_id : Annotated[StrictStr, Field(..., description="discount line id 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 + """Get Discount # noqa: E501 + + Get an existing discount lines for an existing orden # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.orders_get_discount_line_with_http_info(id, discount_lines_id, accept_language, x_child_company_id, async_req=True) + >>> result = thread.get() + + :param id: Identifier of the resource (required) + :type id: str + :param discount_lines_id: discount line id identifier (required) + :type discount_lines_id: str + :param accept_language: Use for knowing which language to use + :type accept_language: str + :param x_child_company_id: In the case of a holding company, the company id of the child company to which will process the request. + :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 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 + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(DiscountLinesResponse, status_code(int), headers(HTTPHeaderDict)) + """ + + _params = locals() + + _all_params = [ + 'id', + 'discount_lines_id', + 'accept_language', + 'x_child_company_id' + ] + _all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + # validate the arguments + for _key, _val in _params['kwargs'].items(): + if _key not in _all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method orders_get_discount_line" % _key + ) + _params[_key] = _val + del _params['kwargs'] + + _collection_formats = {} + + # process the path parameters + _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 + + # authentication setting + _auth_settings = ['bearerAuth'] # noqa: E501 + + _response_types_map = { + '200': "DiscountLinesResponse", + '401': "Error", + '404': "Error", + '422': "Error", + '500': "Error", + } + + return self.api_client.call_api( + '/orders/{id}/discount_lines/{discount_lines_id}', 'GET', + _path_params, + _query_params, + _header_params, + body=_body_params, + post_params=_form_params, + files=_files, + response_types_map=_response_types_map, + auth_settings=_auth_settings, + async_req=_params.get('async_req'), + _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=_params.get('_preload_content', True), + _request_timeout=_params.get('_request_timeout'), + collection_formats=_collection_formats, + _request_auth=_params.get('_request_auth')) + + @validate_arguments + def orders_get_discount_lines(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, 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) -> GetOrderDiscountLinesResponse: # noqa: E501 + """Get a List of Discount # noqa: E501 + + Get discount lines for an existing orden # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.orders_get_discount_lines(id, accept_language, x_child_company_id, limit, search, next, previous, async_req=True) + >>> result = thread.get() + + :param id: Identifier of the resource (required) + :type id: str + :param accept_language: Use for knowing which language to use + :type accept_language: str + :param x_child_company_id: In the case of a holding company, the company id of the child company to which will process the request. + :type x_child_company_id: str + :param limit: The numbers of items to return, the maximum value is 250 + :type limit: int + :param search: General order search, e.g. by mail, reference etc. + :type search: str + :param next: next page + :type next: str + :param previous: previous page + :type previous: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: 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 + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: GetOrderDiscountLinesResponse + """ + kwargs['_return_http_data_only'] = True + if '_preload_content' in kwargs: + raise ValueError("Error! Please call the orders_get_discount_lines_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") + return self.orders_get_discount_lines_with_http_info(id, accept_language, x_child_company_id, limit, search, next, previous, **kwargs) # noqa: E501 + + @validate_arguments + def orders_get_discount_lines_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, 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 Discount # noqa: E501 + + Get discount lines for an existing orden # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.orders_get_discount_lines_with_http_info(id, accept_language, x_child_company_id, limit, search, next, previous, async_req=True) + >>> result = thread.get() + + :param id: Identifier of the resource (required) + :type id: str + :param accept_language: Use for knowing which language to use + :type accept_language: str + :param x_child_company_id: In the case of a holding company, the company id of the child company to which will process the request. + :type x_child_company_id: str + :param limit: The numbers of items to return, the maximum value is 250 + :type limit: int + :param search: General order search, e.g. by mail, reference etc. + :type search: str + :param next: next page + :type next: str + :param previous: previous page + :type previous: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :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 + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(GetOrderDiscountLinesResponse, status_code(int), headers(HTTPHeaderDict)) + """ + + _params = locals() + + _all_params = [ + 'id', + 'accept_language', + 'x_child_company_id', + 'limit', + 'search', + 'next', + 'previous' + ] + _all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + # validate the arguments + for _key, _val in _params['kwargs'].items(): + if _key not in _all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method orders_get_discount_lines" % _key + ) + _params[_key] = _val + del _params['kwargs'] + + _collection_formats = {} + + # process the path parameters + _path_params = {} + 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('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'])) + + # 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 + + # authentication setting + _auth_settings = ['bearerAuth'] # noqa: E501 + + _response_types_map = { + '200': "GetOrderDiscountLinesResponse", + '401': "Error", + '500': "Error", + } + + return self.api_client.call_api( + '/orders/{id}/discount_lines', 'GET', + _path_params, + _query_params, + _header_params, + body=_body_params, + post_params=_form_params, + files=_files, + response_types_map=_response_types_map, + auth_settings=_auth_settings, + async_req=_params.get('async_req'), + _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=_params.get('_preload_content', True), + _request_timeout=_params.get('_request_timeout'), + collection_formats=_collection_formats, + _request_auth=_params.get('_request_auth')) + + @validate_arguments + def orders_update_discount_lines(self, id : Annotated[StrictStr, Field(..., description="Identifier of the resource")], discount_lines_id : Annotated[StrictStr, Field(..., description="discount line id 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) -> DiscountLinesResponse: # noqa: E501 """Update Discount # noqa: E501 Update an existing discount lines for an existing orden # noqa: E501 @@ -401,7 +758,7 @@ def orders_update_discount_lines(self, id : Annotated[StrictStr, Field(..., desc :param id: Identifier of the resource (required) :type id: str - :param discount_lines_id: identifier (required) + :param discount_lines_id: discount line id identifier (required) :type discount_lines_id: str :param update_order_discount_lines_request: requested field for a discount lines (required) :type update_order_discount_lines_request: UpdateOrderDiscountLinesRequest @@ -426,7 +783,7 @@ def orders_update_discount_lines(self, id : Annotated[StrictStr, Field(..., desc 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) -> ApiResponse: # 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="discount line id 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 @@ -438,7 +795,7 @@ def orders_update_discount_lines_with_http_info(self, id : Annotated[StrictStr, :param id: Identifier of the resource (required) :type id: str - :param discount_lines_id: identifier (required) + :param discount_lines_id: discount line id identifier (required) :type discount_lines_id: str :param update_order_discount_lines_request: requested field for a discount lines (required) :type update_order_discount_lines_request: UpdateOrderDiscountLinesRequest diff --git a/conekta/api/shippings_api.py b/conekta/api/shippings_api.py index 8e738f5..de8006b 100644 --- a/conekta/api/shippings_api.py +++ b/conekta/api/shippings_api.py @@ -367,6 +367,7 @@ def orders_delete_shipping_with_http_info(self, id : Annotated[StrictStr, Field( '401': "Error", '404': "Error", '422': "Error", + '428': "Error", '500': "Error", } diff --git a/conekta/api_client.py b/conekta/api_client.py index 6da6a07..a0bec09 100644 --- a/conekta/api_client.py +++ b/conekta/api_client.py @@ -66,7 +66,7 @@ class ApiClient(object): 'lang': 'python', 'lang_version': platform.python_version(), 'publisher': 'conekta', - 'bindings_version': '6.0.0', + 'bindings_version': '6.0.1', 'uname': platform.uname() } _pool = None @@ -85,7 +85,7 @@ def __init__(self, configuration=None, header_name=None, header_value=None, self.default_headers[header_name] = header_value self.cookie = cookie # Set default User-Agent. - self.user_agent = 'Conekta/v2 PythonBindings/6.0.0' + self.user_agent = 'Conekta/v2 PythonBindings/6.0.1' self.conekta_user_agent = json.dumps(self.data) self.client_side_validation = configuration.client_side_validation diff --git a/conekta/configuration.py b/conekta/configuration.py index 762e412..df2d4a3 100644 --- a/conekta/configuration.py +++ b/conekta/configuration.py @@ -375,7 +375,7 @@ def to_debug_report(self): "OS: {env}\n"\ "Python Version: {pyversion}\n"\ "Version of the API: 2.1.0\n"\ - "SDK Package Version: 6.0.0".\ + "SDK Package Version: 6.0.1".\ format(env=sys.platform, pyversion=sys.version) def get_host_settings(self): diff --git a/conekta/models/__init__.py b/conekta/models/__init__.py index 375a80c..42b83ac 100644 --- a/conekta/models/__init__.py +++ b/conekta/models/__init__.py @@ -19,7 +19,10 @@ from conekta.models.api_key_create_response_all_of import ApiKeyCreateResponseAllOf from conekta.models.api_key_request import ApiKeyRequest from conekta.models.api_key_response import ApiKeyResponse +from conekta.models.api_key_response_on_delete import ApiKeyResponseOnDelete from conekta.models.api_key_update_request import ApiKeyUpdateRequest +from conekta.models.balance_common_field import BalanceCommonField +from conekta.models.balance_response import BalanceResponse from conekta.models.blacklist_rule_response import BlacklistRuleResponse from conekta.models.charge_data_payment_method_bank_transfer_response import ChargeDataPaymentMethodBankTransferResponse from conekta.models.charge_data_payment_method_card_response import ChargeDataPaymentMethodCardResponse @@ -105,6 +108,8 @@ from conekta.models.get_customer_payment_method_data_response import GetCustomerPaymentMethodDataResponse from conekta.models.get_events_response import GetEventsResponse from conekta.models.get_events_response_all_of import GetEventsResponseAllOf +from conekta.models.get_order_discount_lines_response import GetOrderDiscountLinesResponse +from conekta.models.get_order_discount_lines_response_all_of import GetOrderDiscountLinesResponseAllOf from conekta.models.get_orders_response import GetOrdersResponse from conekta.models.get_payment_method_response import GetPaymentMethodResponse from conekta.models.get_payment_method_response_all_of import GetPaymentMethodResponseAllOf @@ -143,6 +148,7 @@ from conekta.models.order_response_shipping_contact_all_of import OrderResponseShippingContactAllOf from conekta.models.order_tax_request import OrderTaxRequest from conekta.models.order_update_request import OrderUpdateRequest +from conekta.models.order_update_request_customer_info import OrderUpdateRequestCustomerInfo from conekta.models.orders_response import OrdersResponse from conekta.models.page import Page from conekta.models.pagination import Pagination diff --git a/conekta/models/api_key_create_response.py b/conekta/models/api_key_create_response.py index a32d409..8bda16c 100644 --- a/conekta/models/api_key_create_response.py +++ b/conekta/models/api_key_create_response.py @@ -26,16 +26,19 @@ class ApiKeyCreateResponse(BaseModel): """ 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") + 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. Copy and save it in a safe place.") 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") - description: Optional[StrictStr] = Field(None, description="Detail of the use that will be given to the api key") + created_at: Optional[StrictInt] = Field(None, description="Unix timestamp in seconds of when the api key was created") + updated_at: Optional[StrictInt] = Field(None, description="Unix timestamp in seconds of when the api key was last updated") + deactivated_at: Optional[StrictInt] = Field(None, description="Unix timestamp in seconds of when the api key was deleted") + description: Optional[StrictStr] = Field(None, description="A name or brief explanation of what this api key is used for") id: Optional[StrictStr] = Field(None, description="Unique identifier of the api key") - livemode: Optional[StrictBool] = Field(None, description="Indicates if the api key is in live mode") - object: Optional[StrictStr] = Field(None, description="Object name, value is api_key") + livemode: Optional[StrictBool] = Field(None, description="Indicates if the api key is in production") + deleted: Optional[StrictBool] = Field(None, description="Indicates if the api key was deleted") + object: Optional[StrictStr] = Field(None, description="Object name, value is 'api_key'") prefix: Optional[StrictStr] = Field(None, description="The first few characters of the authentication_token") - role: Optional[StrictStr] = Field(None, description="Indicates the user account private=owner or public=public") - __properties = ["authentication_token", "active", "created_at", "description", "id", "livemode", "object", "prefix", "role"] + role: Optional[StrictStr] = Field(None, description="Indicates if the api key is private or public") + __properties = ["authentication_token", "active", "created_at", "updated_at", "deactivated_at", "description", "id", "livemode", "deleted", "object", "prefix", "role"] class Config: """Pydantic configuration""" @@ -61,6 +64,11 @@ def to_dict(self): exclude={ }, exclude_none=True) + # set to None if deactivated_at (nullable) 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 @classmethod @@ -76,9 +84,12 @@ def from_dict(cls, obj: dict) -> ApiKeyCreateResponse: "authentication_token": obj.get("authentication_token"), "active": obj.get("active"), "created_at": obj.get("created_at"), + "updated_at": obj.get("updated_at"), + "deactivated_at": obj.get("deactivated_at"), "description": obj.get("description"), "id": obj.get("id"), "livemode": obj.get("livemode"), + "deleted": obj.get("deleted"), "object": obj.get("object"), "prefix": obj.get("prefix"), "role": obj.get("role") diff --git a/conekta/models/api_key_create_response_all_of.py b/conekta/models/api_key_create_response_all_of.py index f76ca4e..eb53a6d 100644 --- a/conekta/models/api_key_create_response_all_of.py +++ b/conekta/models/api_key_create_response_all_of.py @@ -26,7 +26,7 @@ class ApiKeyCreateResponseAllOf(BaseModel): """ 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") + 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. Copy and save it in a safe place.") __properties = ["authentication_token"] class Config: diff --git a/conekta/models/api_key_request.py b/conekta/models/api_key_request.py index 7513b55..49bfe38 100644 --- a/conekta/models/api_key_request.py +++ b/conekta/models/api_key_request.py @@ -19,17 +19,16 @@ import json - -from pydantic import BaseModel, Field, StrictBool, StrictStr +from typing import Optional +from pydantic import BaseModel, Field, StrictStr class ApiKeyRequest(BaseModel): """ 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") + description: Optional[StrictStr] = Field(None, description="A name or brief explanation of what this api key is used for") role: StrictStr = Field(...) - __properties = ["active", "description", "role"] + __properties = ["description", "role"] class Config: """Pydantic configuration""" @@ -67,7 +66,6 @@ def from_dict(cls, obj: dict) -> ApiKeyRequest: return ApiKeyRequest.parse_obj(obj) _obj = ApiKeyRequest.parse_obj({ - "active": obj.get("active"), "description": obj.get("description"), "role": obj.get("role") }) diff --git a/conekta/models/api_key_response.py b/conekta/models/api_key_response.py index 5a3077f..be803c7 100644 --- a/conekta/models/api_key_response.py +++ b/conekta/models/api_key_response.py @@ -27,14 +27,17 @@ class ApiKeyResponse(BaseModel): 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") - description: Optional[StrictStr] = Field(None, description="Detail of the use that will be given to the api key") + created_at: Optional[StrictInt] = Field(None, description="Unix timestamp in seconds of when the api key was created") + updated_at: Optional[StrictInt] = Field(None, description="Unix timestamp in seconds of when the api key was last updated") + deactivated_at: Optional[StrictInt] = Field(None, description="Unix timestamp in seconds of when the api key was deleted") + description: Optional[StrictStr] = Field(None, description="A name or brief explanation of what this api key is used for") id: Optional[StrictStr] = Field(None, description="Unique identifier of the api key") - livemode: Optional[StrictBool] = Field(None, description="Indicates if the api key is in live mode") - object: Optional[StrictStr] = Field(None, description="Object name, value is api_key") + livemode: Optional[StrictBool] = Field(None, description="Indicates if the api key is in production") + deleted: Optional[StrictBool] = Field(None, description="Indicates if the api key was deleted") + object: Optional[StrictStr] = Field(None, description="Object name, value is 'api_key'") prefix: Optional[StrictStr] = Field(None, description="The first few characters of the authentication_token") - role: Optional[StrictStr] = Field(None, description="Indicates the user account private=owner or public=public") - __properties = ["active", "created_at", "description", "id", "livemode", "object", "prefix", "role"] + role: Optional[StrictStr] = Field(None, description="Indicates if the api key is private or public") + __properties = ["active", "created_at", "updated_at", "deactivated_at", "description", "id", "livemode", "deleted", "object", "prefix", "role"] class Config: """Pydantic configuration""" @@ -60,6 +63,11 @@ def to_dict(self): exclude={ }, exclude_none=True) + # set to None if deactivated_at (nullable) 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 @classmethod @@ -74,9 +82,12 @@ def from_dict(cls, obj: dict) -> ApiKeyResponse: _obj = ApiKeyResponse.parse_obj({ "active": obj.get("active"), "created_at": obj.get("created_at"), + "updated_at": obj.get("updated_at"), + "deactivated_at": obj.get("deactivated_at"), "description": obj.get("description"), "id": obj.get("id"), "livemode": obj.get("livemode"), + "deleted": obj.get("deleted"), "object": obj.get("object"), "prefix": obj.get("prefix"), "role": obj.get("role") diff --git a/conekta/models/api_key_response_on_delete.py b/conekta/models/api_key_response_on_delete.py new file mode 100644 index 0000000..f160cd3 --- /dev/null +++ b/conekta/models/api_key_response_on_delete.py @@ -0,0 +1,87 @@ +# coding: utf-8 + +""" + Conekta API + + Conekta sdk # noqa: E501 + + The version of the OpenAPI document: 2.1.0 + Contact: engineering@conekta.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Optional +from pydantic import BaseModel, Field, StrictBool, StrictInt, StrictStr + +class ApiKeyResponseOnDelete(BaseModel): + """ + 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 of when the api key was created") + description: Optional[StrictStr] = Field(None, description="A name or brief explanation of what this api key is used for") + livemode: Optional[StrictBool] = Field(None, description="Indicates if the api key is in production") + prefix: Optional[StrictStr] = Field(None, description="The first few characters of the authentication_token") + id: Optional[StrictStr] = Field(None, description="Unique identifier of the api key") + object: Optional[StrictStr] = Field(None, description="Object name, value is 'api_key'") + deleted: Optional[StrictBool] = Field(None, description="Indicates if the api key was deleted") + role: Optional[StrictStr] = Field(None, description="Indicates if the api key is private or public") + __properties = ["active", "created_at", "description", "livemode", "prefix", "id", "object", "deleted", "role"] + + class Config: + """Pydantic configuration""" + allow_population_by_field_name = True + validate_assignment = True + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> ApiKeyResponseOnDelete: + """Create an instance of ApiKeyResponseOnDelete from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, + exclude={ + }, + exclude_none=True) + return _dict + + @classmethod + def from_dict(cls, obj: dict) -> ApiKeyResponseOnDelete: + """Create an instance of ApiKeyResponseOnDelete from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return ApiKeyResponseOnDelete.parse_obj(obj) + + _obj = ApiKeyResponseOnDelete.parse_obj({ + "active": obj.get("active"), + "created_at": obj.get("created_at"), + "description": obj.get("description"), + "livemode": obj.get("livemode"), + "prefix": obj.get("prefix"), + "id": obj.get("id"), + "object": obj.get("object"), + "deleted": obj.get("deleted"), + "role": obj.get("role") + }) + return _obj + diff --git a/conekta/models/api_key_update_request.py b/conekta/models/api_key_update_request.py index dfa76ee..cbaa0ee 100644 --- a/conekta/models/api_key_update_request.py +++ b/conekta/models/api_key_update_request.py @@ -27,7 +27,7 @@ class ApiKeyUpdateRequest(BaseModel): 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") + description: Optional[StrictStr] = Field(None, description="A name or brief explanation of what this api key is used for") __properties = ["active", "description"] class Config: diff --git a/conekta/models/balance_common_field.py b/conekta/models/balance_common_field.py new file mode 100644 index 0000000..d5537ca --- /dev/null +++ b/conekta/models/balance_common_field.py @@ -0,0 +1,73 @@ +# coding: utf-8 + +""" + Conekta API + + Conekta sdk # noqa: E501 + + The version of the OpenAPI document: 2.1.0 + Contact: engineering@conekta.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Optional +from pydantic import BaseModel, Field, StrictInt, StrictStr + +class BalanceCommonField(BaseModel): + """ + balance common fields model + """ + amount: Optional[StrictInt] = Field(None, description="The balance's amount") + currency: Optional[StrictStr] = Field(None, description="The balance's currency") + __properties = ["amount", "currency"] + + class Config: + """Pydantic configuration""" + allow_population_by_field_name = True + validate_assignment = True + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> BalanceCommonField: + """Create an instance of BalanceCommonField from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, + exclude={ + }, + exclude_none=True) + return _dict + + @classmethod + def from_dict(cls, obj: dict) -> BalanceCommonField: + """Create an instance of BalanceCommonField from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return BalanceCommonField.parse_obj(obj) + + _obj = BalanceCommonField.parse_obj({ + "amount": obj.get("amount"), + "currency": obj.get("currency") + }) + return _obj + diff --git a/conekta/models/balance_response.py b/conekta/models/balance_response.py new file mode 100644 index 0000000..1e7cc74 --- /dev/null +++ b/conekta/models/balance_response.py @@ -0,0 +1,153 @@ +# coding: utf-8 + +""" + Conekta API + + Conekta sdk # noqa: E501 + + The version of the OpenAPI document: 2.1.0 + Contact: engineering@conekta.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Any, Dict, List, Optional +from pydantic import BaseModel, Field, conlist +from conekta.models.balance_common_field import BalanceCommonField + +class BalanceResponse(BaseModel): + """ + balance model + """ + available: Optional[conlist(BalanceCommonField)] = Field(None, description="The balance's available") + cashout_retention_amount: Optional[conlist(BalanceCommonField)] = Field(None, description="The balance's cashout retention amount") + conekta_retention: Optional[conlist(BalanceCommonField)] = Field(None, description="The balance's conekta retention") + gateway: Optional[conlist(BalanceCommonField)] = Field(None, description="The balance's gateway") + pending: Optional[conlist(BalanceCommonField)] = Field(None, description="The balance's pending") + retained: Optional[conlist(BalanceCommonField)] = Field(None, description="The balance's retained") + retention_amount: Optional[conlist(BalanceCommonField)] = Field(None, description="The balance's retention amount") + target_collateral_amount: Optional[Dict[str, Any]] = Field(None, description="The balance's target collateral amount") + target_retention_amount: Optional[conlist(BalanceCommonField)] = Field(None, description="The balance's target retention amount") + temporarily_retained: Optional[conlist(BalanceCommonField)] = Field(None, description="The balance's temporarily retained") + __properties = ["available", "cashout_retention_amount", "conekta_retention", "gateway", "pending", "retained", "retention_amount", "target_collateral_amount", "target_retention_amount", "temporarily_retained"] + + class Config: + """Pydantic configuration""" + allow_population_by_field_name = True + validate_assignment = True + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> BalanceResponse: + """Create an instance of BalanceResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, + exclude={ + }, + exclude_none=True) + # override the default output from pydantic by calling `to_dict()` of each item in available (list) + _items = [] + if self.available: + for _item in self.available: + if _item: + _items.append(_item.to_dict()) + _dict['available'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in cashout_retention_amount (list) + _items = [] + if self.cashout_retention_amount: + for _item in self.cashout_retention_amount: + if _item: + _items.append(_item.to_dict()) + _dict['cashout_retention_amount'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in conekta_retention (list) + _items = [] + if self.conekta_retention: + for _item in self.conekta_retention: + if _item: + _items.append(_item.to_dict()) + _dict['conekta_retention'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in gateway (list) + _items = [] + if self.gateway: + for _item in self.gateway: + if _item: + _items.append(_item.to_dict()) + _dict['gateway'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in pending (list) + _items = [] + if self.pending: + for _item in self.pending: + if _item: + _items.append(_item.to_dict()) + _dict['pending'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in retained (list) + _items = [] + if self.retained: + for _item in self.retained: + if _item: + _items.append(_item.to_dict()) + _dict['retained'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in retention_amount (list) + _items = [] + if self.retention_amount: + for _item in self.retention_amount: + if _item: + _items.append(_item.to_dict()) + _dict['retention_amount'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in target_retention_amount (list) + _items = [] + if self.target_retention_amount: + for _item in self.target_retention_amount: + if _item: + _items.append(_item.to_dict()) + _dict['target_retention_amount'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in temporarily_retained (list) + _items = [] + if self.temporarily_retained: + for _item in self.temporarily_retained: + if _item: + _items.append(_item.to_dict()) + _dict['temporarily_retained'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: dict) -> BalanceResponse: + """Create an instance of BalanceResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return BalanceResponse.parse_obj(obj) + + _obj = BalanceResponse.parse_obj({ + "available": [BalanceCommonField.from_dict(_item) for _item in obj.get("available")] if obj.get("available") is not None else None, + "cashout_retention_amount": [BalanceCommonField.from_dict(_item) for _item in obj.get("cashout_retention_amount")] if obj.get("cashout_retention_amount") is not None else None, + "conekta_retention": [BalanceCommonField.from_dict(_item) for _item in obj.get("conekta_retention")] if obj.get("conekta_retention") is not None else None, + "gateway": [BalanceCommonField.from_dict(_item) for _item in obj.get("gateway")] if obj.get("gateway") is not None else None, + "pending": [BalanceCommonField.from_dict(_item) for _item in obj.get("pending")] if obj.get("pending") is not None else None, + "retained": [BalanceCommonField.from_dict(_item) for _item in obj.get("retained")] if obj.get("retained") is not None else None, + "retention_amount": [BalanceCommonField.from_dict(_item) for _item in obj.get("retention_amount")] if obj.get("retention_amount") is not None else None, + "target_collateral_amount": obj.get("target_collateral_amount"), + "target_retention_amount": [BalanceCommonField.from_dict(_item) for _item in obj.get("target_retention_amount")] if obj.get("target_retention_amount") is not None else None, + "temporarily_retained": [BalanceCommonField.from_dict(_item) for _item in obj.get("temporarily_retained")] if obj.get("temporarily_retained") is not None else None + }) + return _obj + diff --git a/conekta/models/charge_data_payment_method_card_response.py b/conekta/models/charge_data_payment_method_card_response.py index 46201a8..e44c7e6 100644 --- a/conekta/models/charge_data_payment_method_card_response.py +++ b/conekta/models/charge_data_payment_method_card_response.py @@ -20,7 +20,7 @@ from typing import Any, List, Optional -from pydantic import BaseModel, StrictStr, conlist +from pydantic import BaseModel, Field, StrictStr, conlist, constr class ChargeDataPaymentMethodCardResponse(BaseModel): """ @@ -29,6 +29,7 @@ class ChargeDataPaymentMethodCardResponse(BaseModel): account_type: Optional[StrictStr] = None auth_code: Optional[StrictStr] = None brand: Optional[StrictStr] = None + contract_id: Optional[constr(strict=True, max_length=10, min_length=10)] = Field(None, description="Id sent for recurrent charges.") country: Optional[StrictStr] = None exp_month: Optional[StrictStr] = None exp_year: Optional[StrictStr] = None @@ -36,7 +37,7 @@ class ChargeDataPaymentMethodCardResponse(BaseModel): 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"] + __properties = ["account_type", "auth_code", "brand", "contract_id", "country", "exp_month", "exp_year", "fraud_indicators", "issuer", "last4", "name"] class Config: """Pydantic configuration""" @@ -77,6 +78,7 @@ def from_dict(cls, obj: dict) -> ChargeDataPaymentMethodCardResponse: "account_type": obj.get("account_type"), "auth_code": obj.get("auth_code"), "brand": obj.get("brand"), + "contract_id": obj.get("contract_id"), "country": obj.get("country"), "exp_month": obj.get("exp_month"), "exp_year": obj.get("exp_year"), diff --git a/conekta/models/charge_request_payment_method.py b/conekta/models/charge_request_payment_method.py index 7a5580d..c81d01a 100644 --- a/conekta/models/charge_request_payment_method.py +++ b/conekta/models/charge_request_payment_method.py @@ -20,7 +20,7 @@ from typing import Optional -from pydantic import BaseModel, Field, StrictInt, StrictStr +from pydantic import BaseModel, Field, StrictInt, StrictStr, constr class ChargeRequestPaymentMethod(BaseModel): """ @@ -30,7 +30,8 @@ class ChargeRequestPaymentMethod(BaseModel): type: StrictStr = Field(...) token_id: Optional[StrictStr] = None payment_source_id: Optional[StrictStr] = None - __properties = ["expires_at", "type", "token_id", "payment_source_id"] + contract_id: Optional[constr(strict=True, max_length=10, min_length=10)] = Field(None, description="Optional id sent to indicate the bank contract for recurrent card charges.") + __properties = ["expires_at", "type", "token_id", "payment_source_id", "contract_id"] class Config: """Pydantic configuration""" @@ -71,7 +72,8 @@ def from_dict(cls, obj: dict) -> ChargeRequestPaymentMethod: "expires_at": obj.get("expires_at"), "type": obj.get("type"), "token_id": obj.get("token_id"), - "payment_source_id": obj.get("payment_source_id") + "payment_source_id": obj.get("payment_source_id"), + "contract_id": obj.get("contract_id") }) return _obj diff --git a/conekta/models/charge_response_refunds.py b/conekta/models/charge_response_refunds.py index 26d47f2..70986b6 100644 --- a/conekta/models/charge_response_refunds.py +++ b/conekta/models/charge_response_refunds.py @@ -31,7 +31,7 @@ class ChargeResponseRefunds(BaseModel): 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[conlist(ChargeResponseRefundsData)] = None + data: Optional[conlist(ChargeResponseRefundsData)] = Field(None, description="refunds") __properties = ["has_more", "object", "next_page_url", "previous_page_url", "data"] class Config: diff --git a/conekta/models/charge_response_refunds_all_of.py b/conekta/models/charge_response_refunds_all_of.py index 09c933e..f21dd71 100644 --- a/conekta/models/charge_response_refunds_all_of.py +++ b/conekta/models/charge_response_refunds_all_of.py @@ -20,14 +20,14 @@ from typing import List, Optional -from pydantic import BaseModel, conlist +from pydantic import BaseModel, Field, conlist from conekta.models.charge_response_refunds_data import ChargeResponseRefundsData class ChargeResponseRefundsAllOf(BaseModel): """ ChargeResponseRefundsAllOf """ - data: Optional[conlist(ChargeResponseRefundsData)] = None + data: Optional[conlist(ChargeResponseRefundsData)] = Field(None, description="refunds") __properties = ["data"] class Config: diff --git a/conekta/models/checkout_request.py b/conekta/models/checkout_request.py index 216a1f1..9c8f574 100644 --- a/conekta/models/checkout_request.py +++ b/conekta/models/checkout_request.py @@ -24,7 +24,7 @@ class CheckoutRequest(BaseModel): """ - [Checkout](https://developers.conekta.com/reference/checkout) details + [Checkout](https://developers.conekta.com/v2.1.0/reference/payment-link) 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") diff --git a/conekta/models/delete_api_keys_response.py b/conekta/models/delete_api_keys_response.py index 9bbf6c7..ba99270 100644 --- a/conekta/models/delete_api_keys_response.py +++ b/conekta/models/delete_api_keys_response.py @@ -27,15 +27,15 @@ class DeleteApiKeysResponse(BaseModel): 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") - description: Optional[StrictStr] = Field(None, description="Detail of the use that will be given to the api key") - id: Optional[StrictStr] = Field(None, description="Unique identifier of the api key") - livemode: Optional[StrictBool] = Field(None, description="Indicates if the api key is in live mode") - object: Optional[StrictStr] = Field(None, description="Object name, value is api_key") + created_at: Optional[StrictInt] = Field(None, description="Unix timestamp in seconds of when the api key was created") + description: Optional[StrictStr] = Field(None, description="A name or brief explanation of what this api key is used for") + livemode: Optional[StrictBool] = Field(None, description="Indicates if the api key is in production") prefix: Optional[StrictStr] = Field(None, description="The first few characters of the authentication_token") - role: Optional[StrictStr] = Field(None, description="Indicates the user account private=owner or public=public") + id: Optional[StrictStr] = Field(None, description="Unique identifier of the api key") + object: Optional[StrictStr] = Field(None, description="Object name, value is 'api_key'") deleted: Optional[StrictBool] = None - __properties = ["active", "created_at", "description", "id", "livemode", "object", "prefix", "role", "deleted"] + role: Optional[StrictStr] = Field(None, description="Indicates if the api key is private or public") + __properties = ["active", "created_at", "description", "livemode", "prefix", "id", "object", "deleted", "role"] class Config: """Pydantic configuration""" @@ -76,12 +76,12 @@ def from_dict(cls, obj: dict) -> DeleteApiKeysResponse: "active": obj.get("active"), "created_at": obj.get("created_at"), "description": obj.get("description"), - "id": obj.get("id"), "livemode": obj.get("livemode"), - "object": obj.get("object"), "prefix": obj.get("prefix"), - "role": obj.get("role"), - "deleted": obj.get("deleted") + "id": obj.get("id"), + "object": obj.get("object"), + "deleted": obj.get("deleted"), + "role": obj.get("role") }) return _obj diff --git a/conekta/models/discount_lines_data_response.py b/conekta/models/discount_lines_data_response.py index a828018..dd2a56d 100644 --- a/conekta/models/discount_lines_data_response.py +++ b/conekta/models/discount_lines_data_response.py @@ -19,7 +19,7 @@ import json -from typing import Optional + from pydantic import BaseModel, Field, StrictStr, conint class DiscountLinesDataResponse(BaseModel): @@ -29,9 +29,9 @@ class DiscountLinesDataResponse(BaseModel): 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.") type: StrictStr = Field(..., description="It can be 'loyalty', 'campaign', 'coupon' o 'sign'") - id: Optional[StrictStr] = None - object: Optional[StrictStr] = None - parent_id: Optional[StrictStr] = None + id: StrictStr = Field(..., description="The discount line id") + object: StrictStr = Field(..., description="The object name") + parent_id: StrictStr = Field(..., description="The order id") __properties = ["amount", "code", "type", "id", "object", "parent_id"] class Config: diff --git a/conekta/models/discount_lines_response.py b/conekta/models/discount_lines_response.py index 66b62c1..de3c31f 100644 --- a/conekta/models/discount_lines_response.py +++ b/conekta/models/discount_lines_response.py @@ -19,7 +19,7 @@ import json -from typing import Optional + from pydantic import BaseModel, Field, StrictStr, conint class DiscountLinesResponse(BaseModel): @@ -29,9 +29,9 @@ class DiscountLinesResponse(BaseModel): 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.") type: StrictStr = Field(..., description="It can be 'loyalty', 'campaign', 'coupon' o 'sign'") - id: Optional[StrictStr] = None - object: Optional[StrictStr] = None - parent_id: Optional[StrictStr] = None + id: StrictStr = Field(..., description="The discount line id") + object: StrictStr = Field(..., description="The object name") + parent_id: StrictStr = Field(..., description="The order id") __properties = ["amount", "code", "type", "id", "object", "parent_id"] class Config: diff --git a/conekta/models/discount_lines_response_all_of.py b/conekta/models/discount_lines_response_all_of.py index fc71b9a..1cc47b6 100644 --- a/conekta/models/discount_lines_response_all_of.py +++ b/conekta/models/discount_lines_response_all_of.py @@ -19,16 +19,16 @@ import json -from typing import Optional -from pydantic import BaseModel, StrictStr + +from pydantic import BaseModel, Field, StrictStr class DiscountLinesResponseAllOf(BaseModel): """ DiscountLinesResponseAllOf """ - id: Optional[StrictStr] = None - object: Optional[StrictStr] = None - parent_id: Optional[StrictStr] = None + id: StrictStr = Field(..., description="The discount line id") + object: StrictStr = Field(..., description="The object name") + parent_id: StrictStr = Field(..., description="The order id") __properties = ["id", "object", "parent_id"] class Config: diff --git a/conekta/models/get_order_discount_lines_response.py b/conekta/models/get_order_discount_lines_response.py new file mode 100644 index 0000000..24772d8 --- /dev/null +++ b/conekta/models/get_order_discount_lines_response.py @@ -0,0 +1,97 @@ +# coding: utf-8 + +""" + Conekta API + + Conekta sdk # noqa: E501 + + The version of the OpenAPI document: 2.1.0 + Contact: engineering@conekta.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import List, Optional +from pydantic import BaseModel, Field, StrictBool, StrictStr, conlist +from conekta.models.discount_lines_response import DiscountLinesResponse + +class GetOrderDiscountLinesResponse(BaseModel): + """ + GetOrderDiscountLinesResponse + """ + 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[conlist(DiscountLinesResponse)] = 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 + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> GetOrderDiscountLinesResponse: + """Create an instance of GetOrderDiscountLinesResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, + exclude={ + }, + exclude_none=True) + # override the default output from pydantic by calling `to_dict()` of each item in data (list) + _items = [] + if self.data: + for _item in self.data: + if _item: + _items.append(_item.to_dict()) + _dict['data'] = _items + # set to None if next_page_url (nullable) 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 + # 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 + + @classmethod + def from_dict(cls, obj: dict) -> GetOrderDiscountLinesResponse: + """Create an instance of GetOrderDiscountLinesResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return GetOrderDiscountLinesResponse.parse_obj(obj) + + _obj = GetOrderDiscountLinesResponse.parse_obj({ + "has_more": obj.get("has_more"), + "object": obj.get("object"), + "next_page_url": obj.get("next_page_url"), + "previous_page_url": obj.get("previous_page_url"), + "data": [DiscountLinesResponse.from_dict(_item) for _item in obj.get("data")] if obj.get("data") is not None else None + }) + return _obj + diff --git a/conekta/models/get_order_discount_lines_response_all_of.py b/conekta/models/get_order_discount_lines_response_all_of.py new file mode 100644 index 0000000..37f8d3a --- /dev/null +++ b/conekta/models/get_order_discount_lines_response_all_of.py @@ -0,0 +1,79 @@ +# coding: utf-8 + +""" + Conekta API + + Conekta sdk # noqa: E501 + + The version of the OpenAPI document: 2.1.0 + Contact: engineering@conekta.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import List, Optional +from pydantic import BaseModel, conlist +from conekta.models.discount_lines_response import DiscountLinesResponse + +class GetOrderDiscountLinesResponseAllOf(BaseModel): + """ + GetOrderDiscountLinesResponseAllOf + """ + data: Optional[conlist(DiscountLinesResponse)] = None + __properties = ["data"] + + class Config: + """Pydantic configuration""" + allow_population_by_field_name = True + validate_assignment = True + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> GetOrderDiscountLinesResponseAllOf: + """Create an instance of GetOrderDiscountLinesResponseAllOf from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, + exclude={ + }, + exclude_none=True) + # override the default output from pydantic by calling `to_dict()` of each item in data (list) + _items = [] + if self.data: + for _item in self.data: + if _item: + _items.append(_item.to_dict()) + _dict['data'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: dict) -> GetOrderDiscountLinesResponseAllOf: + """Create an instance of GetOrderDiscountLinesResponseAllOf from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return GetOrderDiscountLinesResponseAllOf.parse_obj(obj) + + _obj = GetOrderDiscountLinesResponseAllOf.parse_obj({ + "data": [DiscountLinesResponse.from_dict(_item) for _item in obj.get("data")] if obj.get("data") is not None else None + }) + return _obj + diff --git a/conekta/models/order_request.py b/conekta/models/order_request.py index 227b39d..97eb2f0 100644 --- a/conekta/models/order_request.py +++ b/conekta/models/order_request.py @@ -20,7 +20,7 @@ from typing import Any, Dict, List, Optional -from pydantic import BaseModel, Field, StrictBool, conlist, 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 @@ -40,13 +40,14 @@ class OrderRequest(BaseModel): 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 + metadata: Optional[Dict[str, Any]] = Field(None, description="Metadata associated with the order") 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") + processing_mode: Optional[StrictStr] = Field(None, description="Indicates the processing mode for the order, either ecommerce, recurrent or validation.") shipping_contact: Optional[CustomerShippingContacts] = 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)] = 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"] + __properties = ["charges", "checkout", "currency", "customer_info", "discount_lines", "line_items", "metadata", "needs_shipping_contact", "pre_authorize", "processing_mode", "shipping_contact", "shipping_lines", "tax_lines"] class Config: """Pydantic configuration""" @@ -137,6 +138,7 @@ def from_dict(cls, obj: dict) -> OrderRequest: "metadata": obj.get("metadata"), "needs_shipping_contact": obj.get("needs_shipping_contact"), "pre_authorize": obj.get("pre_authorize") if obj.get("pre_authorize") is not None else False, + "processing_mode": obj.get("processing_mode"), "shipping_contact": CustomerShippingContacts.from_dict(obj.get("shipping_contact")) if obj.get("shipping_contact") is not None else None, "shipping_lines": [ShippingRequest.from_dict(_item) for _item in obj.get("shipping_lines")] if obj.get("shipping_lines") is not None else None, "tax_lines": [OrderTaxRequest.from_dict(_item) for _item in obj.get("tax_lines")] if obj.get("tax_lines") is not None else None diff --git a/conekta/models/order_request_customer_info.py b/conekta/models/order_request_customer_info.py index 3d5f251..3b1e928 100644 --- a/conekta/models/order_request_customer_info.py +++ b/conekta/models/order_request_customer_info.py @@ -30,7 +30,7 @@ class OrderRequestCustomerInfo(BaseModel): """ - OrderRequestCustomerInfo + Customer information """ # data type: CustomerInfo oneof_schema_1_validator: Optional[CustomerInfo] = None diff --git a/conekta/models/order_response.py b/conekta/models/order_response.py index 16922a7..3e766c4 100644 --- a/conekta/models/order_response.py +++ b/conekta/models/order_response.py @@ -51,9 +51,10 @@ class OrderResponse(BaseModel): metadata: Optional[Dict[str, Any]] = Field(None, description="Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format.") object: Optional[StrictStr] = Field(None, description="String representing the object’s type. Objects of the same type share the same value.") payment_status: Optional[StrictStr] = Field(None, description="The payment status of the order.") + processing_mode: Optional[StrictStr] = Field(None, description="Indicates the processing mode for the order, either ecommerce, recurrent or validation.") shipping_contact: Optional[OrderResponseShippingContact] = None updated_at: Optional[StrictInt] = Field(None, description="The time at which the object was last updated in seconds since the Unix epoch") - __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"] + __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", "processing_mode", "shipping_contact", "updated_at"] class Config: """Pydantic configuration""" @@ -132,6 +133,7 @@ def from_dict(cls, obj: dict) -> OrderResponse: "metadata": obj.get("metadata"), "object": obj.get("object"), "payment_status": obj.get("payment_status"), + "processing_mode": obj.get("processing_mode"), "shipping_contact": OrderResponseShippingContact.from_dict(obj.get("shipping_contact")) if obj.get("shipping_contact") is not None else None, "updated_at": obj.get("updated_at") }) diff --git a/conekta/models/order_update_request.py b/conekta/models/order_update_request.py index 4c225fd..ec4d26f 100644 --- a/conekta/models/order_update_request.py +++ b/conekta/models/order_update_request.py @@ -25,8 +25,8 @@ from conekta.models.checkout_request import CheckoutRequest from conekta.models.customer_shipping_contacts import CustomerShippingContacts from conekta.models.order_discount_lines_request import OrderDiscountLinesRequest -from conekta.models.order_request_customer_info import OrderRequestCustomerInfo from conekta.models.order_tax_request import OrderTaxRequest +from conekta.models.order_update_request_customer_info import OrderUpdateRequestCustomerInfo from conekta.models.product import Product from conekta.models.shipping_request import ShippingRequest @@ -37,7 +37,7 @@ class OrderUpdateRequest(BaseModel): 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 + customer_info: Optional[OrderUpdateRequestCustomerInfo] = None 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 @@ -130,7 +130,7 @@ def from_dict(cls, obj: dict) -> OrderUpdateRequest: "charges": [ChargeRequest.from_dict(_item) for _item in obj.get("charges")] if obj.get("charges") is not None else None, "checkout": CheckoutRequest.from_dict(obj.get("checkout")) if obj.get("checkout") is not None else None, "currency": obj.get("currency"), - "customer_info": OrderRequestCustomerInfo.from_dict(obj.get("customer_info")) if obj.get("customer_info") is not None else None, + "customer_info": OrderUpdateRequestCustomerInfo.from_dict(obj.get("customer_info")) if obj.get("customer_info") is not None else None, "discount_lines": [OrderDiscountLinesRequest.from_dict(_item) for _item in obj.get("discount_lines")] if obj.get("discount_lines") is not None else None, "line_items": [Product.from_dict(_item) for _item in obj.get("line_items")] if obj.get("line_items") is not None else None, "metadata": obj.get("metadata"), diff --git a/conekta/models/order_update_request_customer_info.py b/conekta/models/order_update_request_customer_info.py new file mode 100644 index 0000000..01d59ab --- /dev/null +++ b/conekta/models/order_update_request_customer_info.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + Conekta API + + Conekta sdk # noqa: E501 + + The version of the OpenAPI document: 2.1.0 + Contact: engineering@conekta.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 + +from typing import Any, List, Optional +from pydantic import BaseModel, Field, StrictStr, ValidationError, validator +from conekta.models.customer_info import CustomerInfo +from conekta.models.customer_info_just_customer_id import CustomerInfoJustCustomerId +from typing import Any, List +from pydantic import StrictStr, Field + +ORDERUPDATEREQUESTCUSTOMERINFO_ONE_OF_SCHEMAS = ["CustomerInfo", "CustomerInfoJustCustomerId"] + +class OrderUpdateRequestCustomerInfo(BaseModel): + """ + OrderUpdateRequestCustomerInfo + """ + # data type: CustomerInfo + oneof_schema_1_validator: Optional[CustomerInfo] = None + # data type: CustomerInfoJustCustomerId + oneof_schema_2_validator: Optional[CustomerInfoJustCustomerId] = None + actual_instance: Any + one_of_schemas: List[str] = Field(ORDERUPDATEREQUESTCUSTOMERINFO_ONE_OF_SCHEMAS, const=True) + + 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 = OrderUpdateRequestCustomerInfo.construct() + error_messages = [] + match = 0 + # validate data type: 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 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 setting `actual_instance` in OrderUpdateRequestCustomerInfo with oneOf schemas: CustomerInfo, CustomerInfoJustCustomerId. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when setting `actual_instance` in OrderUpdateRequestCustomerInfo with oneOf schemas: CustomerInfo, CustomerInfoJustCustomerId. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: dict) -> OrderUpdateRequestCustomerInfo: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> OrderUpdateRequestCustomerInfo: + """Returns the object represented by the json string""" + instance = OrderUpdateRequestCustomerInfo.construct() + error_messages = [] + match = 0 + + # deserialize data into CustomerInfo + try: + instance.actual_instance = CustomerInfo.from_json(json_str) + match += 1 + 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, ValueError) as e: + error_messages.append(str(e)) + + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when deserializing the JSON string into OrderUpdateRequestCustomerInfo 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 OrderUpdateRequestCustomerInfo with oneOf schemas: CustomerInfo, CustomerInfoJustCustomerId. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + 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 json.dumps(self.actual_instance) + + def to_dict(self) -> dict: + """Returns the dict representation of the actual instance""" + 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: + # primitive type + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.dict()) + diff --git a/conekta/models/payment_method_card.py b/conekta/models/payment_method_card.py index 94a7659..f44af6f 100644 --- a/conekta/models/payment_method_card.py +++ b/conekta/models/payment_method_card.py @@ -20,7 +20,7 @@ from typing import Any, List, Optional -from pydantic import BaseModel, Field, StrictStr, conlist +from pydantic import BaseModel, Field, StrictStr, conlist, constr class PaymentMethodCard(BaseModel): """ @@ -31,6 +31,7 @@ class PaymentMethodCard(BaseModel): account_type: Optional[StrictStr] = None auth_code: Optional[StrictStr] = None brand: Optional[StrictStr] = None + contract_id: Optional[constr(strict=True, max_length=10, min_length=10)] = Field(None, description="Id sent for recurrent charges.") country: Optional[StrictStr] = None exp_month: Optional[StrictStr] = None exp_year: Optional[StrictStr] = None @@ -38,7 +39,7 @@ class PaymentMethodCard(BaseModel): 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"] + __properties = ["type", "object", "account_type", "auth_code", "brand", "contract_id", "country", "exp_month", "exp_year", "fraud_indicators", "issuer", "last4", "name"] class Config: """Pydantic configuration""" @@ -81,6 +82,7 @@ def from_dict(cls, obj: dict) -> PaymentMethodCard: "account_type": obj.get("account_type"), "auth_code": obj.get("auth_code"), "brand": obj.get("brand"), + "contract_id": obj.get("contract_id"), "country": obj.get("country"), "exp_month": obj.get("exp_month"), "exp_year": obj.get("exp_year"), diff --git a/docs/ApiKeyCreateResponse.md b/docs/ApiKeyCreateResponse.md index 1d95115..e61b0a3 100644 --- a/docs/ApiKeyCreateResponse.md +++ b/docs/ApiKeyCreateResponse.md @@ -4,15 +4,18 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**authentication_token** | **str** | 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 | [optional] +**authentication_token** | **str** | 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. Copy and save it in a safe place. | [optional] **active** | **bool** | Indicates if the api key is active | [optional] -**created_at** | **int** | Unix timestamp in seconds with the creation date of the api key | [optional] -**description** | **str** | Detail of the use that will be given to the api key | [optional] +**created_at** | **int** | Unix timestamp in seconds of when the api key was created | [optional] +**updated_at** | **int** | Unix timestamp in seconds of when the api key was last updated | [optional] +**deactivated_at** | **int** | Unix timestamp in seconds of when the api key was deleted | [optional] +**description** | **str** | A name or brief explanation of what this api key is used for | [optional] **id** | **str** | Unique identifier of the api key | [optional] -**livemode** | **bool** | Indicates if the api key is in live mode | [optional] -**object** | **str** | Object name, value is api_key | [optional] +**livemode** | **bool** | Indicates if the api key is in production | [optional] +**deleted** | **bool** | Indicates if the api key was deleted | [optional] +**object** | **str** | Object name, value is 'api_key' | [optional] **prefix** | **str** | The first few characters of the authentication_token | [optional] -**role** | **str** | Indicates the user account private=owner or public=public | [optional] +**role** | **str** | Indicates if the api key is private or public | [optional] ## Example diff --git a/docs/ApiKeyCreateResponseAllOf.md b/docs/ApiKeyCreateResponseAllOf.md index 2b0e192..0173dbf 100644 --- a/docs/ApiKeyCreateResponseAllOf.md +++ b/docs/ApiKeyCreateResponseAllOf.md @@ -4,7 +4,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**authentication_token** | **str** | 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 | [optional] +**authentication_token** | **str** | 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. Copy and save it in a safe place. | [optional] ## Example diff --git a/docs/ApiKeyRequest.md b/docs/ApiKeyRequest.md index 9b76a30..0f62ac9 100644 --- a/docs/ApiKeyRequest.md +++ b/docs/ApiKeyRequest.md @@ -4,8 +4,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**active** | **bool** | Indicates if the api key is active | -**description** | **str** | Detail of the use that will be given to the api key | +**description** | **str** | A name or brief explanation of what this api key is used for | [optional] **role** | **str** | | ## Example diff --git a/docs/ApiKeyResponse.md b/docs/ApiKeyResponse.md index 5845863..cdbdd21 100644 --- a/docs/ApiKeyResponse.md +++ b/docs/ApiKeyResponse.md @@ -6,13 +6,16 @@ api keys model Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **active** | **bool** | Indicates if the api key is active | [optional] -**created_at** | **int** | Unix timestamp in seconds with the creation date of the api key | [optional] -**description** | **str** | Detail of the use that will be given to the api key | [optional] +**created_at** | **int** | Unix timestamp in seconds of when the api key was created | [optional] +**updated_at** | **int** | Unix timestamp in seconds of when the api key was last updated | [optional] +**deactivated_at** | **int** | Unix timestamp in seconds of when the api key was deleted | [optional] +**description** | **str** | A name or brief explanation of what this api key is used for | [optional] **id** | **str** | Unique identifier of the api key | [optional] -**livemode** | **bool** | Indicates if the api key is in live mode | [optional] -**object** | **str** | Object name, value is api_key | [optional] +**livemode** | **bool** | Indicates if the api key is in production | [optional] +**deleted** | **bool** | Indicates if the api key was deleted | [optional] +**object** | **str** | Object name, value is 'api_key' | [optional] **prefix** | **str** | The first few characters of the authentication_token | [optional] -**role** | **str** | Indicates the user account private=owner or public=public | [optional] +**role** | **str** | Indicates if the api key is private or public | [optional] ## Example diff --git a/docs/ApiKeyResponseOnDelete.md b/docs/ApiKeyResponseOnDelete.md new file mode 100644 index 0000000..1bfa065 --- /dev/null +++ b/docs/ApiKeyResponseOnDelete.md @@ -0,0 +1,37 @@ +# ApiKeyResponseOnDelete + +api keys model + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**active** | **bool** | Indicates if the api key is active | [optional] +**created_at** | **int** | Unix timestamp in seconds of when the api key was created | [optional] +**description** | **str** | A name or brief explanation of what this api key is used for | [optional] +**livemode** | **bool** | Indicates if the api key is in production | [optional] +**prefix** | **str** | The first few characters of the authentication_token | [optional] +**id** | **str** | Unique identifier of the api key | [optional] +**object** | **str** | Object name, value is 'api_key' | [optional] +**deleted** | **bool** | Indicates if the api key was deleted | [optional] +**role** | **str** | Indicates if the api key is private or public | [optional] + +## Example + +```python +from conekta.models.api_key_response_on_delete import ApiKeyResponseOnDelete + +# TODO update the JSON string below +json = "{}" +# create an instance of ApiKeyResponseOnDelete from a JSON string +api_key_response_on_delete_instance = ApiKeyResponseOnDelete.from_json(json) +# print the JSON string representation of the object +print ApiKeyResponseOnDelete.to_json() + +# convert the object into a dict +api_key_response_on_delete_dict = api_key_response_on_delete_instance.to_dict() +# create an instance of ApiKeyResponseOnDelete from a dict +api_key_response_on_delete_form_dict = api_key_response_on_delete.from_dict(api_key_response_on_delete_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ApiKeyUpdateRequest.md b/docs/ApiKeyUpdateRequest.md index b67e24b..7361958 100644 --- a/docs/ApiKeyUpdateRequest.md +++ b/docs/ApiKeyUpdateRequest.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **active** | **bool** | Indicates if the webhook key is active | [optional] -**description** | **str** | Detail of the use that will be given to the api key | [optional] +**description** | **str** | A name or brief explanation of what this api key is used for | [optional] ## Example diff --git a/docs/ApiKeysApi.md b/docs/ApiKeysApi.md index 8d64bbf..1d9f071 100644 --- a/docs/ApiKeysApi.md +++ b/docs/ApiKeysApi.md @@ -260,7 +260,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **get_api_keys** -> GetApiKeysResponse get_api_keys(accept_language=accept_language, x_child_company_id=x_child_company_id, limit=limit, search=search, next=next, previous=previous) +> GetApiKeysResponse get_api_keys(accept_language=accept_language, x_child_company_id=x_child_company_id, limit=limit, next=next, previous=previous, search=search) Get list of Api Keys @@ -300,13 +300,13 @@ with conekta.ApiClient(configuration) as api_client: accept_language = 'es' # str | Use for knowing which language to use (optional) (default to 'es') x_child_company_id = '6441b6376b60c3a638da80af' # str | In the case of a holding company, the company id of the child company to which will process the request. (optional) limit = 20 # int | The numbers of items to return, the maximum value is 250 (optional) (default to 20) - search = 'search_example' # str | General order search, e.g. by mail, reference etc. (optional) next = 'next_example' # str | next page (optional) previous = 'previous_example' # str | previous page (optional) + search = 'search_example' # str | General search, e.g. by id, description, prefix (optional) try: # Get list of Api Keys - api_response = api_instance.get_api_keys(accept_language=accept_language, x_child_company_id=x_child_company_id, limit=limit, search=search, next=next, previous=previous) + api_response = api_instance.get_api_keys(accept_language=accept_language, x_child_company_id=x_child_company_id, limit=limit, next=next, previous=previous, search=search) print("The response of ApiKeysApi->get_api_keys:\n") pprint(api_response) except Exception as e: @@ -321,9 +321,9 @@ Name | Type | Description | Notes **accept_language** | **str**| Use for knowing which language to use | [optional] [default to 'es'] **x_child_company_id** | **str**| In the case of a holding company, the company id of the child company to which will process the request. | [optional] **limit** | **int**| The numbers of items to return, the maximum value is 250 | [optional] [default to 20] - **search** | **str**| General order search, e.g. by mail, reference etc. | [optional] **next** | **str**| next page | [optional] **previous** | **str**| previous page | [optional] + **search** | **str**| General search, e.g. by id, description, prefix | [optional] ### Return type diff --git a/docs/BalanceCommonField.md b/docs/BalanceCommonField.md new file mode 100644 index 0000000..4825c16 --- /dev/null +++ b/docs/BalanceCommonField.md @@ -0,0 +1,30 @@ +# BalanceCommonField + +balance common fields model + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**amount** | **int** | The balance's amount | [optional] +**currency** | **str** | The balance's currency | [optional] + +## Example + +```python +from conekta.models.balance_common_field import BalanceCommonField + +# TODO update the JSON string below +json = "{}" +# create an instance of BalanceCommonField from a JSON string +balance_common_field_instance = BalanceCommonField.from_json(json) +# print the JSON string representation of the object +print BalanceCommonField.to_json() + +# convert the object into a dict +balance_common_field_dict = balance_common_field_instance.to_dict() +# create an instance of BalanceCommonField from a dict +balance_common_field_form_dict = balance_common_field.from_dict(balance_common_field_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/BalanceResponse.md b/docs/BalanceResponse.md new file mode 100644 index 0000000..a545c02 --- /dev/null +++ b/docs/BalanceResponse.md @@ -0,0 +1,38 @@ +# BalanceResponse + +balance model + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**available** | [**List[BalanceCommonField]**](BalanceCommonField.md) | The balance's available | [optional] +**cashout_retention_amount** | [**List[BalanceCommonField]**](BalanceCommonField.md) | The balance's cashout retention amount | [optional] +**conekta_retention** | [**List[BalanceCommonField]**](BalanceCommonField.md) | The balance's conekta retention | [optional] +**gateway** | [**List[BalanceCommonField]**](BalanceCommonField.md) | The balance's gateway | [optional] +**pending** | [**List[BalanceCommonField]**](BalanceCommonField.md) | The balance's pending | [optional] +**retained** | [**List[BalanceCommonField]**](BalanceCommonField.md) | The balance's retained | [optional] +**retention_amount** | [**List[BalanceCommonField]**](BalanceCommonField.md) | The balance's retention amount | [optional] +**target_collateral_amount** | **object** | The balance's target collateral amount | [optional] +**target_retention_amount** | [**List[BalanceCommonField]**](BalanceCommonField.md) | The balance's target retention amount | [optional] +**temporarily_retained** | [**List[BalanceCommonField]**](BalanceCommonField.md) | The balance's temporarily retained | [optional] + +## Example + +```python +from conekta.models.balance_response import BalanceResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of BalanceResponse from a JSON string +balance_response_instance = BalanceResponse.from_json(json) +# print the JSON string representation of the object +print BalanceResponse.to_json() + +# convert the object into a dict +balance_response_dict = balance_response_instance.to_dict() +# create an instance of BalanceResponse from a dict +balance_response_form_dict = balance_response.from_dict(balance_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/BalancesApi.md b/docs/BalancesApi.md new file mode 100644 index 0000000..3ab8421 --- /dev/null +++ b/docs/BalancesApi.md @@ -0,0 +1,87 @@ +# conekta.BalancesApi + +All URIs are relative to *https://api.conekta.io* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**get_balance**](BalancesApi.md#get_balance) | **GET** /balances | Get a company's balance + + +# **get_balance** +> BalanceResponse get_balance(accept_language=accept_language) + +Get a company's balance + +Get a company's balance + +### Example + +* Bearer Authentication (bearerAuth): +```python +import time +import os +import conekta +from conekta.models.balance_response import BalanceResponse +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( + host = "https://api.conekta.io" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: bearerAuth +configuration = conekta.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with conekta.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = conekta.BalancesApi(api_client) + accept_language = 'es' # str | Use for knowing which language to use (optional) (default to 'es') + + try: + # Get a company's balance + api_response = api_instance.get_balance(accept_language=accept_language) + print("The response of BalancesApi->get_balance:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling BalancesApi->get_balance: %s\n" % e) +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **accept_language** | **str**| Use for knowing which language to use | [optional] [default to 'es'] + +### Return type + +[**BalanceResponse**](BalanceResponse.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/vnd.conekta-v2.1.0+json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful | * Date - The date and time that the response was sent
* Content-Type - The format of the response body
* Content-Length - The length of the response body in bytes
* Connection - The type of connection used to transfer the response
* Conekta-Media-Type -
| +**401** | authentication error | - | +**500** | internal server error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/docs/ChargeDataPaymentMethodCardResponse.md b/docs/ChargeDataPaymentMethodCardResponse.md index 569b7e8..ec048a0 100644 --- a/docs/ChargeDataPaymentMethodCardResponse.md +++ b/docs/ChargeDataPaymentMethodCardResponse.md @@ -8,6 +8,7 @@ Name | Type | Description | Notes **account_type** | **str** | | [optional] **auth_code** | **str** | | [optional] **brand** | **str** | | [optional] +**contract_id** | **str** | Id sent for recurrent charges. | [optional] **country** | **str** | | [optional] **exp_month** | **str** | | [optional] **exp_year** | **str** | | [optional] diff --git a/docs/ChargeOrderResponsePaymentMethod.md b/docs/ChargeOrderResponsePaymentMethod.md index cf2da1b..4500222 100644 --- a/docs/ChargeOrderResponsePaymentMethod.md +++ b/docs/ChargeOrderResponsePaymentMethod.md @@ -16,6 +16,7 @@ Name | Type | Description | Notes **store_name** | **str** | | [optional] **account_type** | **str** | | [optional] **brand** | **str** | | [optional] +**contract_id** | **str** | Id sent for recurrent charges. | [optional] **country** | **str** | | [optional] **exp_month** | **str** | | [optional] **exp_year** | **str** | | [optional] diff --git a/docs/ChargeRequestPaymentMethod.md b/docs/ChargeRequestPaymentMethod.md index c028b6f..b28673b 100644 --- a/docs/ChargeRequestPaymentMethod.md +++ b/docs/ChargeRequestPaymentMethod.md @@ -9,6 +9,7 @@ Name | Type | Description | Notes **type** | **str** | | **token_id** | **str** | | [optional] **payment_source_id** | **str** | | [optional] +**contract_id** | **str** | Optional id sent to indicate the bank contract for recurrent card charges. | [optional] ## Example diff --git a/docs/ChargeResponsePaymentMethod.md b/docs/ChargeResponsePaymentMethod.md index c7bdf6b..204fd00 100644 --- a/docs/ChargeResponsePaymentMethod.md +++ b/docs/ChargeResponsePaymentMethod.md @@ -16,6 +16,7 @@ Name | Type | Description | Notes **store_name** | **str** | | [optional] **account_type** | **str** | | [optional] **brand** | **str** | | [optional] +**contract_id** | **str** | Id sent for recurrent charges. | [optional] **country** | **str** | | [optional] **exp_month** | **str** | | [optional] **exp_year** | **str** | | [optional] diff --git a/docs/ChargeResponseRefunds.md b/docs/ChargeResponseRefunds.md index 629eead..7d203f1 100644 --- a/docs/ChargeResponseRefunds.md +++ b/docs/ChargeResponseRefunds.md @@ -8,7 +8,7 @@ Name | Type | Description | Notes **object** | **str** | Object type, in this case is list | **next_page_url** | **str** | URL of the next page. | [optional] **previous_page_url** | **str** | Url of the previous page. | [optional] -**data** | [**List[ChargeResponseRefundsData]**](ChargeResponseRefundsData.md) | | [optional] +**data** | [**List[ChargeResponseRefundsData]**](ChargeResponseRefundsData.md) | refunds | [optional] ## Example diff --git a/docs/ChargeResponseRefundsAllOf.md b/docs/ChargeResponseRefundsAllOf.md index c578865..9a34390 100644 --- a/docs/ChargeResponseRefundsAllOf.md +++ b/docs/ChargeResponseRefundsAllOf.md @@ -4,7 +4,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**data** | [**List[ChargeResponseRefundsData]**](ChargeResponseRefundsData.md) | | [optional] +**data** | [**List[ChargeResponseRefundsData]**](ChargeResponseRefundsData.md) | refunds | [optional] ## Example diff --git a/docs/CheckoutRequest.md b/docs/CheckoutRequest.md index 0291010..f37eb80 100644 --- a/docs/CheckoutRequest.md +++ b/docs/CheckoutRequest.md @@ -1,6 +1,6 @@ # CheckoutRequest -[Checkout](https://developers.conekta.com/reference/checkout) details +[Checkout](https://developers.conekta.com/v2.1.0/reference/payment-link) details ## Properties Name | Type | Description | Notes diff --git a/docs/DeleteApiKeysResponse.md b/docs/DeleteApiKeysResponse.md index 95ae19a..1039a68 100644 --- a/docs/DeleteApiKeysResponse.md +++ b/docs/DeleteApiKeysResponse.md @@ -5,14 +5,14 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **active** | **bool** | Indicates if the api key is active | [optional] -**created_at** | **int** | Unix timestamp in seconds with the creation date of the api key | [optional] -**description** | **str** | Detail of the use that will be given to the api key | [optional] -**id** | **str** | Unique identifier of the api key | [optional] -**livemode** | **bool** | Indicates if the api key is in live mode | [optional] -**object** | **str** | Object name, value is api_key | [optional] +**created_at** | **int** | Unix timestamp in seconds of when the api key was created | [optional] +**description** | **str** | A name or brief explanation of what this api key is used for | [optional] +**livemode** | **bool** | Indicates if the api key is in production | [optional] **prefix** | **str** | The first few characters of the authentication_token | [optional] -**role** | **str** | Indicates the user account private=owner or public=public | [optional] +**id** | **str** | Unique identifier of the api key | [optional] +**object** | **str** | Object name, value is 'api_key' | [optional] **deleted** | **bool** | | [optional] +**role** | **str** | Indicates if the api key is private or public | [optional] ## Example diff --git a/docs/DiscountLinesDataResponse.md b/docs/DiscountLinesDataResponse.md index e49133d..c5b466d 100644 --- a/docs/DiscountLinesDataResponse.md +++ b/docs/DiscountLinesDataResponse.md @@ -7,9 +7,9 @@ Name | Type | Description | Notes **amount** | **int** | The amount to be deducted from the total sum of all payments, in cents. | **code** | **str** | Discount code. | **type** | **str** | It can be 'loyalty', 'campaign', 'coupon' o 'sign' | -**id** | **str** | | [optional] -**object** | **str** | | [optional] -**parent_id** | **str** | | [optional] +**id** | **str** | The discount line id | +**object** | **str** | The object name | +**parent_id** | **str** | The order id | ## Example diff --git a/docs/DiscountLinesResponse.md b/docs/DiscountLinesResponse.md index 2a54aed..677ebef 100644 --- a/docs/DiscountLinesResponse.md +++ b/docs/DiscountLinesResponse.md @@ -7,9 +7,9 @@ Name | Type | Description | Notes **amount** | **int** | The amount to be deducted from the total sum of all payments, in cents. | **code** | **str** | Discount code. | **type** | **str** | It can be 'loyalty', 'campaign', 'coupon' o 'sign' | -**id** | **str** | | [optional] -**object** | **str** | | [optional] -**parent_id** | **str** | | [optional] +**id** | **str** | The discount line id | +**object** | **str** | The object name | +**parent_id** | **str** | The order id | ## Example diff --git a/docs/DiscountLinesResponseAllOf.md b/docs/DiscountLinesResponseAllOf.md index 7b38c6c..fd86cc6 100644 --- a/docs/DiscountLinesResponseAllOf.md +++ b/docs/DiscountLinesResponseAllOf.md @@ -4,9 +4,9 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**id** | **str** | | [optional] -**object** | **str** | | [optional] -**parent_id** | **str** | | [optional] +**id** | **str** | The discount line id | +**object** | **str** | The object name | +**parent_id** | **str** | The order id | ## Example diff --git a/docs/DiscountsApi.md b/docs/DiscountsApi.md index 68c1dfd..32c1c0c 100644 --- a/docs/DiscountsApi.md +++ b/docs/DiscountsApi.md @@ -6,6 +6,8 @@ Method | HTTP request | Description ------------- | ------------- | ------------- [**orders_create_discount_line**](DiscountsApi.md#orders_create_discount_line) | **POST** /orders/{id}/discount_lines | Create Discount [**orders_delete_discount_lines**](DiscountsApi.md#orders_delete_discount_lines) | **DELETE** /orders/{id}/discount_lines/{discount_lines_id} | Delete Discount +[**orders_get_discount_line**](DiscountsApi.md#orders_get_discount_line) | **GET** /orders/{id}/discount_lines/{discount_lines_id} | Get Discount +[**orders_get_discount_lines**](DiscountsApi.md#orders_get_discount_lines) | **GET** /orders/{id}/discount_lines | Get a List of Discount [**orders_update_discount_lines**](DiscountsApi.md#orders_update_discount_lines) | **PUT** /orders/{id}/discount_lines/{discount_lines_id} | Update Discount @@ -134,7 +136,7 @@ with conekta.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = conekta.DiscountsApi(api_client) id = '6307a60c41de27127515a575' # str | Identifier of the resource - discount_lines_id = 'dis_lin_2tQ974hSHcsdeSZHG' # str | identifier + discount_lines_id = 'dis_lin_2tQ974hSHcsdeSZHG' # str | discount line id identifier accept_language = 'es' # str | Use for knowing which language to use (optional) (default to 'es') x_child_company_id = '6441b6376b60c3a638da80af' # str | In the case of a holding company, the company id of the child company to which will process the request. (optional) @@ -153,7 +155,7 @@ with conekta.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **str**| Identifier of the resource | - **discount_lines_id** | **str**| identifier | + **discount_lines_id** | **str**| discount line id identifier | **accept_language** | **str**| Use for knowing which language to use | [optional] [default to 'es'] **x_child_company_id** | **str**| In the case of a holding company, the company id of the child company to which will process the request. | [optional] @@ -181,6 +183,182 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **orders_get_discount_line** +> DiscountLinesResponse orders_get_discount_line(id, discount_lines_id, accept_language=accept_language, x_child_company_id=x_child_company_id) + +Get Discount + +Get an existing discount lines for an existing orden + +### Example + +* Bearer Authentication (bearerAuth): +```python +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( + host = "https://api.conekta.io" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: bearerAuth +configuration = conekta.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with conekta.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = conekta.DiscountsApi(api_client) + id = '6307a60c41de27127515a575' # str | Identifier of the resource + discount_lines_id = 'dis_lin_2tQ974hSHcsdeSZHG' # str | discount line id identifier + accept_language = 'es' # str | Use for knowing which language to use (optional) (default to 'es') + x_child_company_id = '6441b6376b60c3a638da80af' # str | In the case of a holding company, the company id of the child company to which will process the request. (optional) + + try: + # Get Discount + api_response = api_instance.orders_get_discount_line(id, discount_lines_id, accept_language=accept_language, x_child_company_id=x_child_company_id) + print("The response of DiscountsApi->orders_get_discount_line:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling DiscountsApi->orders_get_discount_line: %s\n" % e) +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| Identifier of the resource | + **discount_lines_id** | **str**| discount line id identifier | + **accept_language** | **str**| Use for knowing which language to use | [optional] [default to 'es'] + **x_child_company_id** | **str**| In the case of a holding company, the company id of the child company to which will process the request. | [optional] + +### Return type + +[**DiscountLinesResponse**](DiscountLinesResponse.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/vnd.conekta-v2.1.0+json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful | - | +**401** | authentication error | - | +**404** | not found entity | - | +**422** | parameter validation error | - | +**500** | internal server error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **orders_get_discount_lines** +> GetOrderDiscountLinesResponse orders_get_discount_lines(id, accept_language=accept_language, x_child_company_id=x_child_company_id, limit=limit, search=search, next=next, previous=previous) + +Get a List of Discount + +Get discount lines for an existing orden + +### Example + +* Bearer Authentication (bearerAuth): +```python +import time +import os +import conekta +from conekta.models.get_order_discount_lines_response import GetOrderDiscountLinesResponse +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( + host = "https://api.conekta.io" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: bearerAuth +configuration = conekta.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with conekta.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = conekta.DiscountsApi(api_client) + id = '6307a60c41de27127515a575' # str | Identifier of the resource + accept_language = 'es' # str | Use for knowing which language to use (optional) (default to 'es') + x_child_company_id = '6441b6376b60c3a638da80af' # str | In the case of a holding company, the company id of the child company to which will process the request. (optional) + limit = 20 # int | The numbers of items to return, the maximum value is 250 (optional) (default to 20) + search = 'search_example' # str | General order search, e.g. by mail, reference etc. (optional) + next = 'next_example' # str | next page (optional) + previous = 'previous_example' # str | previous page (optional) + + try: + # Get a List of Discount + api_response = api_instance.orders_get_discount_lines(id, accept_language=accept_language, x_child_company_id=x_child_company_id, limit=limit, search=search, next=next, previous=previous) + print("The response of DiscountsApi->orders_get_discount_lines:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling DiscountsApi->orders_get_discount_lines: %s\n" % e) +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| Identifier of the resource | + **accept_language** | **str**| Use for knowing which language to use | [optional] [default to 'es'] + **x_child_company_id** | **str**| In the case of a holding company, the company id of the child company to which will process the request. | [optional] + **limit** | **int**| The numbers of items to return, the maximum value is 250 | [optional] [default to 20] + **search** | **str**| General order search, e.g. by mail, reference etc. | [optional] + **next** | **str**| next page | [optional] + **previous** | **str**| previous page | [optional] + +### Return type + +[**GetOrderDiscountLinesResponse**](GetOrderDiscountLinesResponse.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/vnd.conekta-v2.1.0+json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful | - | +**401** | authentication error | - | +**500** | internal server error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + # **orders_update_discount_lines** > DiscountLinesResponse orders_update_discount_lines(id, discount_lines_id, update_order_discount_lines_request, accept_language=accept_language, x_child_company_id=x_child_company_id) @@ -221,7 +399,7 @@ with conekta.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = conekta.DiscountsApi(api_client) id = '6307a60c41de27127515a575' # str | Identifier of the resource - discount_lines_id = 'dis_lin_2tQ974hSHcsdeSZHG' # str | identifier + discount_lines_id = 'dis_lin_2tQ974hSHcsdeSZHG' # str | discount line id identifier update_order_discount_lines_request = conekta.UpdateOrderDiscountLinesRequest() # UpdateOrderDiscountLinesRequest | requested field for a discount lines accept_language = 'es' # str | Use for knowing which language to use (optional) (default to 'es') x_child_company_id = '6441b6376b60c3a638da80af' # str | In the case of a holding company, the company id of the child company to which will process the request. (optional) @@ -241,7 +419,7 @@ with conekta.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **str**| Identifier of the resource | - **discount_lines_id** | **str**| identifier | + **discount_lines_id** | **str**| discount line id identifier | **update_order_discount_lines_request** | [**UpdateOrderDiscountLinesRequest**](UpdateOrderDiscountLinesRequest.md)| requested field for a discount lines | **accept_language** | **str**| Use for knowing which language to use | [optional] [default to 'es'] **x_child_company_id** | **str**| In the case of a holding company, the company id of the child company to which will process the request. | [optional] diff --git a/docs/GetOrderDiscountLinesResponse.md b/docs/GetOrderDiscountLinesResponse.md new file mode 100644 index 0000000..697c33e --- /dev/null +++ b/docs/GetOrderDiscountLinesResponse.md @@ -0,0 +1,32 @@ +# GetOrderDiscountLinesResponse + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**has_more** | **bool** | Indicates if there are more pages to be requested | +**object** | **str** | Object type, in this case is list | +**next_page_url** | **str** | URL of the next page. | [optional] +**previous_page_url** | **str** | Url of the previous page. | [optional] +**data** | [**List[DiscountLinesResponse]**](DiscountLinesResponse.md) | | [optional] + +## Example + +```python +from conekta.models.get_order_discount_lines_response import GetOrderDiscountLinesResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of GetOrderDiscountLinesResponse from a JSON string +get_order_discount_lines_response_instance = GetOrderDiscountLinesResponse.from_json(json) +# print the JSON string representation of the object +print GetOrderDiscountLinesResponse.to_json() + +# convert the object into a dict +get_order_discount_lines_response_dict = get_order_discount_lines_response_instance.to_dict() +# create an instance of GetOrderDiscountLinesResponse from a dict +get_order_discount_lines_response_form_dict = get_order_discount_lines_response.from_dict(get_order_discount_lines_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/GetOrderDiscountLinesResponseAllOf.md b/docs/GetOrderDiscountLinesResponseAllOf.md new file mode 100644 index 0000000..dedaadd --- /dev/null +++ b/docs/GetOrderDiscountLinesResponseAllOf.md @@ -0,0 +1,28 @@ +# GetOrderDiscountLinesResponseAllOf + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**List[DiscountLinesResponse]**](DiscountLinesResponse.md) | | [optional] + +## Example + +```python +from conekta.models.get_order_discount_lines_response_all_of import GetOrderDiscountLinesResponseAllOf + +# TODO update the JSON string below +json = "{}" +# create an instance of GetOrderDiscountLinesResponseAllOf from a JSON string +get_order_discount_lines_response_all_of_instance = GetOrderDiscountLinesResponseAllOf.from_json(json) +# print the JSON string representation of the object +print GetOrderDiscountLinesResponseAllOf.to_json() + +# convert the object into a dict +get_order_discount_lines_response_all_of_dict = get_order_discount_lines_response_all_of_instance.to_dict() +# create an instance of GetOrderDiscountLinesResponseAllOf from a dict +get_order_discount_lines_response_all_of_form_dict = get_order_discount_lines_response_all_of.from_dict(get_order_discount_lines_response_all_of_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/OrderRequest.md b/docs/OrderRequest.md index 926cca6..59699c4 100644 --- a/docs/OrderRequest.md +++ b/docs/OrderRequest.md @@ -11,9 +11,10 @@ Name | Type | Description | Notes **customer_info** | [**OrderRequestCustomerInfo**](OrderRequestCustomerInfo.md) | | **discount_lines** | [**List[OrderDiscountLinesRequest]**](OrderDiscountLinesRequest.md) | 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. | [optional] **line_items** | [**List[Product]**](Product.md) | 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** | **Dict[str, object]** | | [optional] +**metadata** | **Dict[str, object]** | Metadata associated with the order | [optional] **needs_shipping_contact** | **bool** | Allows you to fill out the shipping information at checkout | [optional] **pre_authorize** | **bool** | Indicates whether the order charges must be preauthorized | [optional] [default to False] +**processing_mode** | **str** | Indicates the processing mode for the order, either ecommerce, recurrent or validation. | [optional] **shipping_contact** | [**CustomerShippingContacts**](CustomerShippingContacts.md) | | [optional] **shipping_lines** | [**List[ShippingRequest]**](ShippingRequest.md) | List of [shipping costs](https://developers.conekta.com/v2.1.0/reference/orderscreateshipping). If the online store offers digital products. | [optional] **tax_lines** | [**List[OrderTaxRequest]**](OrderTaxRequest.md) | List of [taxes](https://developers.conekta.com/v2.1.0/reference/orderscreatetaxes) that are applied to the order. | [optional] diff --git a/docs/OrderRequestCustomerInfo.md b/docs/OrderRequestCustomerInfo.md index 76f5310..a21121d 100644 --- a/docs/OrderRequestCustomerInfo.md +++ b/docs/OrderRequestCustomerInfo.md @@ -1,5 +1,6 @@ # OrderRequestCustomerInfo +Customer information ## Properties Name | Type | Description | Notes diff --git a/docs/OrderResponse.md b/docs/OrderResponse.md index 3b59c04..880b0b3 100644 --- a/docs/OrderResponse.md +++ b/docs/OrderResponse.md @@ -22,6 +22,7 @@ Name | Type | Description | Notes **metadata** | **Dict[str, object]** | Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. | [optional] **object** | **str** | String representing the object’s type. Objects of the same type share the same value. | [optional] **payment_status** | **str** | The payment status of the order. | [optional] +**processing_mode** | **str** | Indicates the processing mode for the order, either ecommerce, recurrent or validation. | [optional] **shipping_contact** | [**OrderResponseShippingContact**](OrderResponseShippingContact.md) | | [optional] **updated_at** | **int** | The time at which the object was last updated in seconds since the Unix epoch | [optional] diff --git a/docs/OrderUpdateRequest.md b/docs/OrderUpdateRequest.md index 6412708..27426fe 100644 --- a/docs/OrderUpdateRequest.md +++ b/docs/OrderUpdateRequest.md @@ -8,7 +8,7 @@ Name | Type | Description | Notes **charges** | [**List[ChargeRequest]**](ChargeRequest.md) | | [optional] **checkout** | [**CheckoutRequest**](CheckoutRequest.md) | | [optional] **currency** | **str** | 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) | [optional] -**customer_info** | [**OrderRequestCustomerInfo**](OrderRequestCustomerInfo.md) | | [optional] +**customer_info** | [**OrderUpdateRequestCustomerInfo**](OrderUpdateRequestCustomerInfo.md) | | [optional] **discount_lines** | [**List[OrderDiscountLinesRequest]**](OrderDiscountLinesRequest.md) | 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. | [optional] **line_items** | [**List[Product]**](Product.md) | 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. | [optional] **metadata** | **Dict[str, str]** | | [optional] diff --git a/docs/OrderUpdateRequestCustomerInfo.md b/docs/OrderUpdateRequestCustomerInfo.md new file mode 100644 index 0000000..72c540a --- /dev/null +++ b/docs/OrderUpdateRequestCustomerInfo.md @@ -0,0 +1,33 @@ +# OrderUpdateRequestCustomerInfo + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | | +**email** | **str** | | +**phone** | **str** | | +**corporate** | **bool** | | [optional] +**object** | **str** | | [optional] +**customer_id** | **str** | | + +## Example + +```python +from conekta.models.order_update_request_customer_info import OrderUpdateRequestCustomerInfo + +# TODO update the JSON string below +json = "{}" +# create an instance of OrderUpdateRequestCustomerInfo from a JSON string +order_update_request_customer_info_instance = OrderUpdateRequestCustomerInfo.from_json(json) +# print the JSON string representation of the object +print OrderUpdateRequestCustomerInfo.to_json() + +# convert the object into a dict +order_update_request_customer_info_dict = order_update_request_customer_info_instance.to_dict() +# create an instance of OrderUpdateRequestCustomerInfo from a dict +order_update_request_customer_info_form_dict = order_update_request_customer_info.from_dict(order_update_request_customer_info_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/PaymentMethodCard.md b/docs/PaymentMethodCard.md index 65b2d6f..52e2b07 100644 --- a/docs/PaymentMethodCard.md +++ b/docs/PaymentMethodCard.md @@ -9,6 +9,7 @@ Name | Type | Description | Notes **account_type** | **str** | | [optional] **auth_code** | **str** | | [optional] **brand** | **str** | | [optional] +**contract_id** | **str** | Id sent for recurrent charges. | [optional] **country** | **str** | | [optional] **exp_month** | **str** | | [optional] **exp_year** | **str** | | [optional] diff --git a/docs/ShippingsApi.md b/docs/ShippingsApi.md index 8496a4a..60c3ce4 100644 --- a/docs/ShippingsApi.md +++ b/docs/ShippingsApi.md @@ -177,6 +177,7 @@ Name | Type | Description | Notes **401** | authentication error | - | **404** | not found entity | - | **422** | parameter validation error | - | +**428** | Precondition Required | - | **500** | internal server error | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/pyproject.toml b/pyproject.toml index f0e4ae6..027defd 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "conekta" -version = "6.0.0" +version = "6.0.1" description = "Conekta API" authors = ["Engineering Conekta "] license = "MIT-LICENSE" @@ -32,7 +32,7 @@ extension-pkg-whitelist = "pydantic" [project] name = "conekta" -version = "6.0.0" +version = "6.0.1" authors = [ { name="Engineering Conekta", email="engineering@conekta.com" }, ] diff --git a/setup.py b/setup.py index 414bb47..6b5a550 100644 --- a/setup.py +++ b/setup.py @@ -22,7 +22,7 @@ # prerequisite: setuptools # http://pypi.python.org/pypi/setuptools NAME = "conekta" -VERSION = "6.0.0" +VERSION = "6.0.1" PYTHON_REQUIRES = ">=3.7" REQUIRES = [ "urllib3 >= 1.25.3", diff --git a/test/test_balances_api.py b/test/test_balances_api.py new file mode 100644 index 0000000..2851bc7 --- /dev/null +++ b/test/test_balances_api.py @@ -0,0 +1,41 @@ +# coding: utf-8 + +""" + Conekta API + + Conekta sdk # noqa: E501 + + The version of the OpenAPI document: 2.1.0 + Contact: engineering@conekta.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" + + +import unittest + +import conekta +from conekta.api.balances_api import BalancesApi # noqa: E501 +from conekta.rest import ApiException + + +class TestBalancesApi(unittest.TestCase): + """BalancesApi unit test stubs""" + + def setUp(self): + self.api = conekta.api.balances_api.BalancesApi() # noqa: E501 + + def tearDown(self): + pass + + def test_get_balance(self): + """Test case for get_balance + + Get a company's balance # noqa: E501 + """ + pass + + +if __name__ == '__main__': + unittest.main()