-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
19 changed files
with
1,574 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,155 @@ | ||
# coding: utf-8 | ||
|
||
""" | ||
MONEI API v1 | ||
<p>The MONEI API is organized around <a href=\"https://en.wikipedia.org/wiki/Representational_State_Transfer\">REST</a>. Our API has predictable resource-oriented URLs, accepts JSON-encoded request bodies, returns JSON-encoded responses, and uses standard HTTP response codes, authentication, and verbs.</p> <h4 id=\"base-url\">Base URL:</h4> <p><a href=\"https://api.monei.com/v1\">https://api.monei.com/v1</a></p> <h4 id=\"client-libraries\">Client libraries:</h4> <ul> <li><a href=\"https://github.com/MONEI/monei-php-sdk\">PHP SDK</a></li> <li><a href=\"https://github.com/MONEI/monei-python-sdk\">Python SDK</a></li> <li><a href=\"https://github.com/MONEI/monei-node-sdk\">Node.js SDK</a></li> <li><a href=\"https://postman.monei.com/\">Postman</a></li> </ul> <h4 id=\"important\">Important:</h4> <p><strong>If you are not using our official SDKs, you need to provide a valid <code>User-Agent</code> header in each request, otherwise your requests will be rejected.</strong></p> # noqa: E501 | ||
The version of the OpenAPI document: 1.4.2 | ||
Generated by: https://openapi-generator.tech | ||
""" | ||
|
||
|
||
from __future__ import absolute_import | ||
|
||
import re # noqa: F401 | ||
|
||
# python 2 and python 3 compatibility library | ||
import six | ||
|
||
from Monei.api_client import ApiClient | ||
from Monei.exceptions import ( # noqa: F401 | ||
ApiTypeError, | ||
ApiValueError | ||
) | ||
|
||
|
||
class BizumApi(object): | ||
"""NOTE: This class is auto generated by OpenAPI Generator | ||
Ref: https://openapi-generator.tech | ||
Do not edit the class manually. | ||
""" | ||
|
||
def __init__(self, api_client=None): | ||
if api_client is None: | ||
api_client = ApiClient() | ||
self.api_client = api_client | ||
|
||
def validate_phone(self, validate_bizum_phone_request, **kwargs): # noqa: E501 | ||
"""Validate Phone # noqa: E501 | ||
<p>Verifies if the provided phone number is registered in Bizum. This method does not require authentication. Either <code>accountId</code> or <code>paymentId</code> must be provided in the request body.</p> # noqa: E501 | ||
This method makes a synchronous HTTP request by default. To make an | ||
asynchronous HTTP request, please pass async_req=True | ||
>>> thread = api.validate_phone(validate_bizum_phone_request, async_req=True) | ||
>>> result = thread.get() | ||
:param async_req bool: execute request asynchronously | ||
:param ValidateBizumPhoneRequest validate_bizum_phone_request: (required) | ||
:param _preload_content: if False, the urllib3.HTTPResponse object will | ||
be returned without reading/decoding response | ||
data. Default is True. | ||
:param _request_timeout: timeout setting for this request. If one | ||
number provided, it will be total request | ||
timeout. It can also be a pair (tuple) of | ||
(connection, read) timeouts. | ||
:return: InlineResponse2001 | ||
If the method is called asynchronously, | ||
returns the request thread. | ||
""" | ||
kwargs['_return_http_data_only'] = True | ||
return self.validate_phone_with_http_info(validate_bizum_phone_request, **kwargs) # noqa: E501 | ||
|
||
def validate_phone_with_http_info(self, validate_bizum_phone_request, **kwargs): # noqa: E501 | ||
"""Validate Phone # noqa: E501 | ||
<p>Verifies if the provided phone number is registered in Bizum. This method does not require authentication. Either <code>accountId</code> or <code>paymentId</code> must be provided in the request body.</p> # noqa: E501 | ||
This method makes a synchronous HTTP request by default. To make an | ||
asynchronous HTTP request, please pass async_req=True | ||
>>> thread = api.validate_phone_with_http_info(validate_bizum_phone_request, async_req=True) | ||
>>> result = thread.get() | ||
:param async_req bool: execute request asynchronously | ||
:param ValidateBizumPhoneRequest validate_bizum_phone_request: (required) | ||
:param _return_http_data_only: response data without head status code | ||
and headers | ||
:param _preload_content: if False, the urllib3.HTTPResponse object will | ||
be returned without reading/decoding response | ||
data. Default is True. | ||
:param _request_timeout: timeout setting for this request. If one | ||
number provided, it will be total request | ||
timeout. It can also be a pair (tuple) of | ||
(connection, read) timeouts. | ||
:return: tuple(InlineResponse2001, status_code(int), headers(HTTPHeaderDict)) | ||
If the method is called asynchronously, | ||
returns the request thread. | ||
""" | ||
|
||
local_var_params = locals() | ||
|
||
all_params = [ | ||
'validate_bizum_phone_request' | ||
] | ||
all_params.extend( | ||
[ | ||
'async_req', | ||
'_return_http_data_only', | ||
'_preload_content', | ||
'_request_timeout' | ||
] | ||
) | ||
|
||
for key, val in six.iteritems(local_var_params['kwargs']): | ||
if key not in all_params: | ||
raise ApiTypeError( | ||
"Got an unexpected keyword argument '%s'" | ||
" to method validate_phone" % key | ||
) | ||
local_var_params[key] = val | ||
del local_var_params['kwargs'] | ||
# verify the required parameter 'validate_bizum_phone_request' is set | ||
if self.api_client.client_side_validation and ('validate_bizum_phone_request' not in local_var_params or # noqa: E501 | ||
local_var_params['validate_bizum_phone_request'] is None): # noqa: E501 | ||
raise ApiValueError("Missing the required parameter `validate_bizum_phone_request` when calling `validate_phone`") # noqa: E501 | ||
|
||
collection_formats = {} | ||
|
||
path_params = {} | ||
|
||
query_params = [] | ||
|
||
header_params = {} | ||
|
||
form_params = [] | ||
local_var_files = {} | ||
|
||
body_params = None | ||
if 'validate_bizum_phone_request' in local_var_params: | ||
body_params = local_var_params['validate_bizum_phone_request'] | ||
# HTTP header `Accept` | ||
header_params['Accept'] = self.api_client.select_header_accept( | ||
['application/json']) # noqa: E501 | ||
|
||
# HTTP header `Content-Type` | ||
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 | ||
['application/json']) # noqa: E501 | ||
|
||
# Authentication setting | ||
auth_settings = [] # noqa: E501 | ||
|
||
return self.api_client.call_api( | ||
'/bizum/validate-phone', 'POST', | ||
path_params, | ||
query_params, | ||
header_params, | ||
body=body_params, | ||
post_params=form_params, | ||
files=local_var_files, | ||
response_type='InlineResponse2001', # noqa: E501 | ||
auth_settings=auth_settings, | ||
async_req=local_var_params.get('async_req'), | ||
_return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 | ||
_preload_content=local_var_params.get('_preload_content', True), | ||
_request_timeout=local_var_params.get('_request_timeout'), | ||
collection_formats=collection_formats) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,120 @@ | ||
# coding: utf-8 | ||
|
||
""" | ||
MONEI API v1 | ||
<p>The MONEI API is organized around <a href=\"https://en.wikipedia.org/wiki/Representational_State_Transfer\">REST</a>. Our API has predictable resource-oriented URLs, accepts JSON-encoded request bodies, returns JSON-encoded responses, and uses standard HTTP response codes, authentication, and verbs.</p> <h4 id=\"base-url\">Base URL:</h4> <p><a href=\"https://api.monei.com/v1\">https://api.monei.com/v1</a></p> <h4 id=\"client-libraries\">Client libraries:</h4> <ul> <li><a href=\"https://github.com/MONEI/monei-php-sdk\">PHP SDK</a></li> <li><a href=\"https://github.com/MONEI/monei-python-sdk\">Python SDK</a></li> <li><a href=\"https://github.com/MONEI/monei-node-sdk\">Node.js SDK</a></li> <li><a href=\"https://postman.monei.com/\">Postman</a></li> </ul> <h4 id=\"important\">Important:</h4> <p><strong>If you are not using our official SDKs, you need to provide a valid <code>User-Agent</code> header in each request, otherwise your requests will be rejected.</strong></p> # noqa: E501 | ||
The version of the OpenAPI document: 1.4.2 | ||
Generated by: https://openapi-generator.tech | ||
""" | ||
|
||
|
||
import pprint | ||
import re # noqa: F401 | ||
|
||
import six | ||
|
||
from Monei.configuration import Configuration | ||
|
||
|
||
class InlineResponse2001(object): | ||
"""NOTE: This class is auto generated by OpenAPI Generator. | ||
Ref: https://openapi-generator.tech | ||
Do not edit the class manually. | ||
""" | ||
|
||
""" | ||
Attributes: | ||
openapi_types (dict): The key is attribute name | ||
and the value is attribute type. | ||
attribute_map (dict): The key is attribute name | ||
and the value is json key in definition. | ||
""" | ||
openapi_types = { | ||
'is_valid': 'bool' | ||
} | ||
|
||
attribute_map = { | ||
'is_valid': 'isValid' | ||
} | ||
|
||
def __init__(self, is_valid=None, local_vars_configuration=None): # noqa: E501 | ||
"""InlineResponse2001 - a model defined in OpenAPI""" # noqa: E501 | ||
if local_vars_configuration is None: | ||
local_vars_configuration = Configuration() | ||
self.local_vars_configuration = local_vars_configuration | ||
|
||
self._is_valid = None | ||
self.discriminator = None | ||
|
||
if is_valid is not None: | ||
self.is_valid = is_valid | ||
|
||
@property | ||
def is_valid(self): | ||
"""Gets the is_valid of this InlineResponse2001. # noqa: E501 | ||
:return: The is_valid of this InlineResponse2001. # noqa: E501 | ||
:rtype: bool | ||
""" | ||
return self._is_valid | ||
|
||
@is_valid.setter | ||
def is_valid(self, is_valid): | ||
"""Sets the is_valid of this InlineResponse2001. | ||
:param is_valid: The is_valid of this InlineResponse2001. # noqa: E501 | ||
:type: bool | ||
""" | ||
|
||
self._is_valid = is_valid | ||
|
||
def to_dict(self): | ||
"""Returns the model properties as a dict""" | ||
result = {} | ||
|
||
for attr, _ in six.iteritems(self.openapi_types): | ||
value = getattr(self, attr) | ||
if isinstance(value, list): | ||
result[attr] = list(map( | ||
lambda x: x.to_dict() if hasattr(x, "to_dict") else x, | ||
value | ||
)) | ||
elif hasattr(value, "to_dict"): | ||
result[attr] = value.to_dict() | ||
elif isinstance(value, dict): | ||
result[attr] = dict(map( | ||
lambda item: (item[0], item[1].to_dict()) | ||
if hasattr(item[1], "to_dict") else item, | ||
value.items() | ||
)) | ||
else: | ||
result[attr] = value | ||
|
||
return result | ||
|
||
def to_str(self): | ||
"""Returns the string representation of the model""" | ||
return pprint.pformat(self.to_dict()) | ||
|
||
def __repr__(self): | ||
"""For `print` and `pprint`""" | ||
return self.to_str() | ||
|
||
def __eq__(self, other): | ||
"""Returns true if both objects are equal""" | ||
if not isinstance(other, InlineResponse2001): | ||
return False | ||
|
||
return self.to_dict() == other.to_dict() | ||
|
||
def __ne__(self, other): | ||
"""Returns true if both objects are not equal""" | ||
if not isinstance(other, InlineResponse2001): | ||
return True | ||
|
||
return self.to_dict() != other.to_dict() |
Oops, something went wrong.