Skip to content

Commit

Permalink
AI-124: Regenerate SDK (#84)
Browse files Browse the repository at this point in the history
  • Loading branch information
nicocedron authored Dec 17, 2024
1 parent a3d2afc commit 0fa9d6e
Show file tree
Hide file tree
Showing 27 changed files with 1,176 additions and 12 deletions.
4 changes: 4 additions & 0 deletions .openapi-generator/FILES
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ conekta/models/charge_response_refunds.py
conekta/models/charge_response_refunds_data.py
conekta/models/charge_update_request.py
conekta/models/charges_data_response.py
conekta/models/charges_order_response.py
conekta/models/charges_order_response_all_of_data.py
conekta/models/checkout.py
conekta/models/checkout_order_template.py
conekta/models/checkout_order_template_customer_info.py
Expand Down Expand Up @@ -235,6 +237,8 @@ docs/ChargeResponseRefundsData.md
docs/ChargeUpdateRequest.md
docs/ChargesApi.md
docs/ChargesDataResponse.md
docs/ChargesOrderResponse.md
docs/ChargesOrderResponseAllOfData.md
docs/Checkout.md
docs/CheckoutOrderTemplate.md
docs/CheckoutOrderTemplateCustomerInfo.md
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ Class | Method | HTTP request | Description
*BalancesApi* | [**get_balance**](docs/BalancesApi.md#get_balance) | **GET** /balance | 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
*ChargesApi* | [**orders_create_charges**](docs/ChargesApi.md#orders_create_charges) | **POST** /orders/{id}/add_charges | Create charges
*ChargesApi* | [**update_charge**](docs/ChargesApi.md#update_charge) | **PUT** /charges/{id} | Update a charge
*CompaniesApi* | [**get_companies**](docs/CompaniesApi.md#get_companies) | **GET** /companies | Get List of Companies
*CompaniesApi* | [**get_company**](docs/CompaniesApi.md#get_company) | **GET** /companies/{id} | Get Company
Expand Down Expand Up @@ -147,6 +148,7 @@ Class | Method | HTTP request | Description
*PaymentMethodsApi* | [**delete_customer_payment_methods**](docs/PaymentMethodsApi.md#delete_customer_payment_methods) | **DELETE** /customers/{id}/payment_sources/{payment_method_id} | Delete Payment Method
*PaymentMethodsApi* | [**get_customer_payment_methods**](docs/PaymentMethodsApi.md#get_customer_payment_methods) | **GET** /customers/{id}/payment_sources | Get Payment Methods
*PaymentMethodsApi* | [**update_customer_payment_methods**](docs/PaymentMethodsApi.md#update_customer_payment_methods) | **PUT** /customers/{id}/payment_sources/{payment_method_id} | Update Payment Method
*PayoutOrdersApi* | [**cancel_payout_order_by_id**](docs/PayoutOrdersApi.md#cancel_payout_order_by_id) | **PUT** /payout_orders/{id}/cancel | Cancel Payout Order
*PayoutOrdersApi* | [**create_payout_order**](docs/PayoutOrdersApi.md#create_payout_order) | **POST** /payout_orders | Create payout order
*PayoutOrdersApi* | [**get_payout_order_by_id**](docs/PayoutOrdersApi.md#get_payout_order_by_id) | **GET** /payout_orders/{id} | Get Payout Order
*PayoutOrdersApi* | [**get_payout_orders**](docs/PayoutOrdersApi.md#get_payout_orders) | **GET** /payout_orders | Get a list of Payout Orders
Expand Down Expand Up @@ -213,6 +215,8 @@ Class | Method | HTTP request | Description
- [ChargeResponseRefundsData](docs/ChargeResponseRefundsData.md)
- [ChargeUpdateRequest](docs/ChargeUpdateRequest.md)
- [ChargesDataResponse](docs/ChargesDataResponse.md)
- [ChargesOrderResponse](docs/ChargesOrderResponse.md)
- [ChargesOrderResponseAllOfData](docs/ChargesOrderResponseAllOfData.md)
- [Checkout](docs/Checkout.md)
- [CheckoutOrderTemplate](docs/CheckoutOrderTemplate.md)
- [CheckoutOrderTemplateCustomerInfo](docs/CheckoutOrderTemplateCustomerInfo.md)
Expand Down
2 changes: 2 additions & 0 deletions conekta/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@
from conekta.models.charge_response_refunds_data import ChargeResponseRefundsData
from conekta.models.charge_update_request import ChargeUpdateRequest
from conekta.models.charges_data_response import ChargesDataResponse
from conekta.models.charges_order_response import ChargesOrderResponse
from conekta.models.charges_order_response_all_of_data import ChargesOrderResponseAllOfData
from conekta.models.checkout import Checkout
from conekta.models.checkout_order_template import CheckoutOrderTemplate
from conekta.models.checkout_order_template_customer_info import CheckoutOrderTemplateCustomerInfo
Expand Down
332 changes: 332 additions & 0 deletions conekta/api/charges_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
from conekta.models.charge_request import ChargeRequest
from conekta.models.charge_response import ChargeResponse
from conekta.models.charge_update_request import ChargeUpdateRequest
from conekta.models.charges_order_response import ChargesOrderResponse
from conekta.models.get_charges_response import GetChargesResponse

from conekta.api_client import ApiClient, RequestSerialized
Expand Down Expand Up @@ -722,6 +723,337 @@ def _orders_create_charge_serialize(



@validate_call
def orders_create_charges(
self,
id: Annotated[StrictStr, Field(description="Identifier of the resource")],
charge_request: Annotated[ChargeRequest, Field(description="requested field for a charge")],
accept_language: Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None,
x_child_company_id: Annotated[Optional[StrictStr], Field(description="In the case of a holding company, the company id of the child company to which will process the request.")] = None,
_request_timeout: Union[
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
Annotated[StrictFloat, Field(gt=0)],
Annotated[StrictFloat, Field(gt=0)]
]
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
_headers: Optional[Dict[StrictStr, Any]] = None,
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
) -> ChargesOrderResponse:
"""Create charges
Create charges for an existing orden
:param id: Identifier of the resource (required)
:type id: str
:param charge_request: requested field for a charge (required)
:type charge_request: ChargeRequest
: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 _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.
:type _request_timeout: int, tuple(int, int), optional
: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
:param _content_type: force content-type for the request.
:type _content_type: str, Optional
:param _headers: set to override the headers for a single
request; this effectively ignores the headers
in the spec for a single request.
:type _headers: dict, optional
:param _host_index: set to override the host_index for a single
request; this effectively ignores the host_index
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
""" # noqa: E501

_param = self._orders_create_charges_serialize(
id=id,
charge_request=charge_request,
accept_language=accept_language,
x_child_company_id=x_child_company_id,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
_host_index=_host_index
)

_response_types_map: Dict[str, Optional[str]] = {
'200': "ChargesOrderResponse",
'401': "Error",
'404': "Error",
'428': "Error",
'500': "Error",
}
response_data = self.api_client.call_api(
*_param,
_request_timeout=_request_timeout
)
response_data.read()
return self.api_client.response_deserialize(
response_data=response_data,
response_types_map=_response_types_map,
).data


@validate_call
def orders_create_charges_with_http_info(
self,
id: Annotated[StrictStr, Field(description="Identifier of the resource")],
charge_request: Annotated[ChargeRequest, Field(description="requested field for a charge")],
accept_language: Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None,
x_child_company_id: Annotated[Optional[StrictStr], Field(description="In the case of a holding company, the company id of the child company to which will process the request.")] = None,
_request_timeout: Union[
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
Annotated[StrictFloat, Field(gt=0)],
Annotated[StrictFloat, Field(gt=0)]
]
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
_headers: Optional[Dict[StrictStr, Any]] = None,
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
) -> ApiResponse[ChargesOrderResponse]:
"""Create charges
Create charges for an existing orden
:param id: Identifier of the resource (required)
:type id: str
:param charge_request: requested field for a charge (required)
:type charge_request: ChargeRequest
: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 _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.
:type _request_timeout: int, tuple(int, int), optional
: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
:param _content_type: force content-type for the request.
:type _content_type: str, Optional
:param _headers: set to override the headers for a single
request; this effectively ignores the headers
in the spec for a single request.
:type _headers: dict, optional
:param _host_index: set to override the host_index for a single
request; this effectively ignores the host_index
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
""" # noqa: E501

_param = self._orders_create_charges_serialize(
id=id,
charge_request=charge_request,
accept_language=accept_language,
x_child_company_id=x_child_company_id,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
_host_index=_host_index
)

_response_types_map: Dict[str, Optional[str]] = {
'200': "ChargesOrderResponse",
'401': "Error",
'404': "Error",
'428': "Error",
'500': "Error",
}
response_data = self.api_client.call_api(
*_param,
_request_timeout=_request_timeout
)
response_data.read()
return self.api_client.response_deserialize(
response_data=response_data,
response_types_map=_response_types_map,
)


@validate_call
def orders_create_charges_without_preload_content(
self,
id: Annotated[StrictStr, Field(description="Identifier of the resource")],
charge_request: Annotated[ChargeRequest, Field(description="requested field for a charge")],
accept_language: Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None,
x_child_company_id: Annotated[Optional[StrictStr], Field(description="In the case of a holding company, the company id of the child company to which will process the request.")] = None,
_request_timeout: Union[
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
Annotated[StrictFloat, Field(gt=0)],
Annotated[StrictFloat, Field(gt=0)]
]
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
_headers: Optional[Dict[StrictStr, Any]] = None,
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
) -> RESTResponseType:
"""Create charges
Create charges for an existing orden
:param id: Identifier of the resource (required)
:type id: str
:param charge_request: requested field for a charge (required)
:type charge_request: ChargeRequest
: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 _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.
:type _request_timeout: int, tuple(int, int), optional
: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
:param _content_type: force content-type for the request.
:type _content_type: str, Optional
:param _headers: set to override the headers for a single
request; this effectively ignores the headers
in the spec for a single request.
:type _headers: dict, optional
:param _host_index: set to override the host_index for a single
request; this effectively ignores the host_index
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
""" # noqa: E501

_param = self._orders_create_charges_serialize(
id=id,
charge_request=charge_request,
accept_language=accept_language,
x_child_company_id=x_child_company_id,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
_host_index=_host_index
)

_response_types_map: Dict[str, Optional[str]] = {
'200': "ChargesOrderResponse",
'401': "Error",
'404': "Error",
'428': "Error",
'500': "Error",
}
response_data = self.api_client.call_api(
*_param,
_request_timeout=_request_timeout
)
return response_data.response


def _orders_create_charges_serialize(
self,
id,
charge_request,
accept_language,
x_child_company_id,
_request_auth,
_content_type,
_headers,
_host_index,
) -> RequestSerialized:

_host = None

_collection_formats: Dict[str, str] = {
}

_path_params: Dict[str, str] = {}
_query_params: List[Tuple[str, str]] = []
_header_params: Dict[str, Optional[str]] = _headers or {}
_form_params: List[Tuple[str, str]] = []
_files: Dict[
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
] = {}
_body_params: Optional[bytes] = None

# process the path parameters
if id is not None:
_path_params['id'] = id
# process the query parameters
# process the header parameters
if accept_language is not None:
_header_params['Accept-Language'] = accept_language
if x_child_company_id is not None:
_header_params['X-Child-Company-Id'] = x_child_company_id
# process the form parameters
# process the body parameter
if charge_request is not None:
_body_params = charge_request


# set the HTTP header `Accept`
if 'Accept' not in _header_params:
_header_params['Accept'] = self.api_client.select_header_accept(
[
'application/vnd.conekta-v2.1.0+json'
]
)

# set the HTTP header `Content-Type`
if _content_type:
_header_params['Content-Type'] = _content_type
else:
_default_content_type = (
self.api_client.select_header_content_type(
[
'application/json'
]
)
)
if _default_content_type is not None:
_header_params['Content-Type'] = _default_content_type

# authentication setting
_auth_settings: List[str] = [
'bearerAuth'
]

return self.api_client.param_serialize(
method='POST',
resource_path='/orders/{id}/add_charges',
path_params=_path_params,
query_params=_query_params,
header_params=_header_params,
body=_body_params,
post_params=_form_params,
files=_files,
auth_settings=_auth_settings,
collection_formats=_collection_formats,
_host=_host,
_request_auth=_request_auth
)




@validate_call
def update_charge(
self,
Expand Down
Loading

0 comments on commit 0fa9d6e

Please sign in to comment.