Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Conekta sdk
This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:

- API version: 2.2.0
- Package version: 7.0.3
- Package version: 7.0.5
- Generator version: 7.9.0
- Build package: org.openapitools.codegen.languages.PythonClientCodegen
For more information, please visit [https://github.com/conekta/openapi/issues](https://github.com/conekta/openapi/issues)
Expand Down Expand Up @@ -115,6 +115,7 @@ Class | Method | HTTP request | Description
*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
*CompaniesApi* | [**get_company_documents**](docs/CompaniesApi.md#get_company_documents) | **GET** /companies/{company_id}/documents | Get Company Documents
*CompaniesApi* | [**get_current_company**](docs/CompaniesApi.md#get_current_company) | **GET** /companies/current | Get Current Company
*CompaniesApi* | [**update_company_document**](docs/CompaniesApi.md#update_company_document) | **PATCH** /companies/{company_id}/document | Update Company Document
*CompaniesApi* | [**upload_company_document**](docs/CompaniesApi.md#upload_company_document) | **POST** /companies/{company_id}/document | Upload Company Document
*CustomersApi* | [**create_customer**](docs/CustomersApi.md#create_customer) | **POST** /customers | Create customer
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7.0.3
7.0.5
2 changes: 1 addition & 1 deletion conekta/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
""" # noqa: E501


__version__ = "7.0.3"
__version__ = "7.0.5"

# import apis into sdk package
from conekta.api.antifraud_api import AntifraudApi
Expand Down
267 changes: 267 additions & 0 deletions conekta/api/companies_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -1226,6 +1226,273 @@ def _get_company_documents_serialize(



@validate_call
def get_current_company(
self,
accept_language: Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = 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,
) -> CompanyResponse:
"""Get Current Company

Retrieves information about the currently authenticated company. This endpoint returns the same data as the standard company endpoint but automatically uses the current company's context.

:param accept_language: Use for knowing which language to use
:type accept_language: 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._get_current_company_serialize(
accept_language=accept_language,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
_host_index=_host_index
)

_response_types_map: Dict[str, Optional[str]] = {
'200': "CompanyResponse",
'401': "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 get_current_company_with_http_info(
self,
accept_language: Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = 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[CompanyResponse]:
"""Get Current Company

Retrieves information about the currently authenticated company. This endpoint returns the same data as the standard company endpoint but automatically uses the current company's context.

:param accept_language: Use for knowing which language to use
:type accept_language: 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._get_current_company_serialize(
accept_language=accept_language,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
_host_index=_host_index
)

_response_types_map: Dict[str, Optional[str]] = {
'200': "CompanyResponse",
'401': "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 get_current_company_without_preload_content(
self,
accept_language: Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = 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:
"""Get Current Company

Retrieves information about the currently authenticated company. This endpoint returns the same data as the standard company endpoint but automatically uses the current company's context.

:param accept_language: Use for knowing which language to use
:type accept_language: 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._get_current_company_serialize(
accept_language=accept_language,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
_host_index=_host_index
)

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


def _get_current_company_serialize(
self,
accept_language,
_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
# process the query parameters
# process the header parameters
if accept_language is not None:
_header_params['Accept-Language'] = accept_language
# process the form parameters
# process the body parameter


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


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

return self.api_client.param_serialize(
method='GET',
resource_path='/companies/current',
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_company_document(
self,
Expand Down
4 changes: 2 additions & 2 deletions conekta/api_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ class ApiClient:
'lang': 'python',
'lang_version': platform.python_version(),
'publisher': 'conekta',
'bindings_version': '7.0.3',
'bindings_version': '7.0.5',
'uname': platform.uname()
}
_pool = None
Expand All @@ -97,7 +97,7 @@ def __init__(
self.default_headers[header_name] = header_value
self.cookie = cookie
# Set default User-Agent.
self.user_agent = 'Conekta/v2 PythonBindings/7.0.3'
self.user_agent = 'Conekta/v2 PythonBindings/7.0.5'
self.conekta_user_agent = json.dumps(self.data)
self.client_side_validation = configuration.client_side_validation

Expand Down
2 changes: 1 addition & 1 deletion conekta/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ def to_debug_report(self):
"OS: {env}\n"\
"Python Version: {pyversion}\n"\
"Version of the API: 2.2.0\n"\
"SDK Package Version: 7.0.3".\
"SDK Package Version: 7.0.5".\
format(env=sys.platform, pyversion=sys.version)

def get_host_settings(self):
Expand Down
7 changes: 6 additions & 1 deletion conekta/models/checkout.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class Checkout(BaseModel):
expires_at: StrictInt = Field(description="It is the time when the link will expire. It is expressed in seconds since the Unix epoch. The valid range is from 2 to 365 days (the valid range will be taken from the next day of the creation date at 00:01 hrs) ")
monthly_installments_enabled: Optional[StrictBool] = Field(default=None, description="This flag allows you to specify if months without interest will be active.")
monthly_installments_options: Optional[List[StrictInt]] = Field(default=None, description="This field allows you to specify the number of months without interest.")
three_ds_mode: Optional[StrictStr] = Field(default=None, description="Indicates the 3DS2 mode for the order, either smart or strict.")
three_ds_mode: Optional[StrictStr] = Field(default=None, description="Indicates the 3DS2 mode for the order, either smart or strict. This property is only applicable when 3DS is enabled. When 3DS is disabled, this field should be null.")
name: StrictStr = Field(description="Reason for charge")
needs_shipping_contact: Optional[StrictBool] = Field(default=None, description="This flag allows you to fill in the shipping information at checkout.")
on_demand_enabled: Optional[StrictBool] = Field(default=None, description="This flag allows you to specify if the link will be on demand.")
Expand Down Expand Up @@ -84,6 +84,11 @@ def to_dict(self) -> Dict[str, Any]:
# override the default output from pydantic by calling `to_dict()` of order_template
if self.order_template:
_dict['order_template'] = self.order_template.to_dict()
# set to None if three_ds_mode (nullable) is None
# and model_fields_set contains the field
if self.three_ds_mode is None and "three_ds_mode" in self.model_fields_set:
_dict['three_ds_mode'] = None

# set to None if on_demand_enabled (nullable) is None
# and model_fields_set contains the field
if self.on_demand_enabled is None and "on_demand_enabled" in self.model_fields_set:
Expand Down
4 changes: 2 additions & 2 deletions conekta/models/checkout_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ class CheckoutRequest(BaseModel):
def allowed_payment_methods_validate_enum(cls, value):
"""Validates the enum"""
for i in value:
if i not in set(['cash', 'card', 'bank_transfer', 'bnpl']):
raise ValueError("each list item must be one of ('cash', 'card', 'bank_transfer', 'bnpl')")
if i not in set(['cash', 'card', 'bank_transfer', 'bnpl', 'pay_by_bank']):
raise ValueError("each list item must be one of ('cash', 'card', 'bank_transfer', 'bnpl', 'pay_by_bank')")
return value

model_config = ConfigDict(
Expand Down
Loading