diff --git a/Monei/models/send_payment_request.py b/Monei/models/send_payment_request.py new file mode 100644 index 0000000..8899796 --- /dev/null +++ b/Monei/models/send_payment_request.py @@ -0,0 +1,149 @@ +# coding: utf-8 + +""" + MONEI API v1 + +

The MONEI API is organized around REST. 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.

Base URL:

https://api.monei.com/v1

Client libraries:

Important:

If you are not using our official SDKs, you need to provide a valid User-Agent header in each request, otherwise your requests will be rejected.

# noqa: E501 + + The version of the OpenAPI document: 1.4.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from Monei.configuration import Configuration + + +class SendPaymentRequest(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 = { + 'phone_number': 'str', + 'language': 'PaymentMessageLanguage' + } + + attribute_map = { + 'phone_number': 'phoneNumber', + 'language': 'language' + } + + def __init__(self, phone_number=None, language=None, local_vars_configuration=None): # noqa: E501 + """SendPaymentRequest - 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._phone_number = None + self._language = None + self.discriminator = None + + self.phone_number = phone_number + if language is not None: + self.language = language + + @property + def phone_number(self): + """Gets the phone_number of this SendPaymentRequest. # noqa: E501 + + Phone number in E.164 format. The customer will receive payment link on this phone number. # noqa: E501 + + :return: The phone_number of this SendPaymentRequest. # noqa: E501 + :rtype: str + """ + return self._phone_number + + @phone_number.setter + def phone_number(self, phone_number): + """Sets the phone_number of this SendPaymentRequest. + + Phone number in E.164 format. The customer will receive payment link on this phone number. # noqa: E501 + + :param phone_number: The phone_number of this SendPaymentRequest. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and phone_number is None: # noqa: E501 + raise ValueError("Invalid value for `phone_number`, must not be `None`") # noqa: E501 + + self._phone_number = phone_number + + @property + def language(self): + """Gets the language of this SendPaymentRequest. # noqa: E501 + + + :return: The language of this SendPaymentRequest. # noqa: E501 + :rtype: PaymentMessageLanguage + """ + return self._language + + @language.setter + def language(self, language): + """Sets the language of this SendPaymentRequest. + + + :param language: The language of this SendPaymentRequest. # noqa: E501 + :type: PaymentMessageLanguage + """ + + self._language = language + + 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, SendPaymentRequest): + 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, SendPaymentRequest): + return True + + return self.to_dict() != other.to_dict() diff --git a/test/test_send_payment_request.py b/test/test_send_payment_request.py new file mode 100644 index 0000000..ac8c5c7 --- /dev/null +++ b/test/test_send_payment_request.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + MONEI API v1 + +

The MONEI API is organized around REST. 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.

Base URL:

https://api.monei.com/v1

Client libraries:

Important:

If you are not using our official SDKs, you need to provide a valid User-Agent header in each request, otherwise your requests will be rejected.

# noqa: E501 + + The version of the OpenAPI document: 1.4.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest +import datetime + +import Monei +from Monei.models.send_payment_request import SendPaymentRequest # noqa: E501 +from Monei.rest import ApiException + +class TestSendPaymentRequest(unittest.TestCase): + """SendPaymentRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional): + """Test SendPaymentRequest + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # model = Monei.models.send_payment_request.SendPaymentRequest() # noqa: E501 + if include_optional : + return SendPaymentRequest( + phone_number = '+34500000000', + language = 'en' + ) + else : + return SendPaymentRequest( + ) + + def testSendPaymentRequest(self): + """Test SendPaymentRequest""" + inst_req_only = self.make_instance(include_optional=False) + inst_req_and_optional = self.make_instance(include_optional=True) + + +if __name__ == '__main__': + unittest.main()