Coverage for fingerprint_pro_server_api_sdk/models/product_error.py: 54%
59 statements
« prev ^ index » next coverage.py v7.4.4, created at 2024-03-27 22:39 +0000
« prev ^ index » next coverage.py v7.4.4, created at 2024-03-27 22:39 +0000
1# coding: utf-8
3"""
4 Fingerprint Pro Server API
6 Fingerprint Pro Server API allows you to get information about visitors and about individual events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. # noqa: E501
8 OpenAPI spec version: 3
9 Contact: support@fingerprint.com
10 Generated by: https://github.com/swagger-api/swagger-codegen.git
11"""
13import pprint
14import re # noqa: F401
16import six
18class ProductError(object):
19 """NOTE: This class is auto generated by the swagger code generator program.
21 Do not edit the class manually.
22 """
23 """
24 Attributes:
25 swagger_types (dict): The key is attribute name
26 and the value is attribute type.
27 attribute_map (dict): The key is attribute name
28 and the value is json key in definition.
29 """
30 swagger_types = {
31 'code': 'str',
32 'message': 'str'
33 }
35 attribute_map = {
36 'code': 'code',
37 'message': 'message'
38 }
40 def __init__(self, code=None, message=None): # noqa: E501
41 """ProductError - a model defined in Swagger""" # noqa: E501
42 self._code = None
43 self._message = None
44 self.discriminator = None
45 self.code = code
46 self.message = message
48 @property
49 def code(self):
50 """Gets the code of this ProductError. # noqa: E501
52 Error code: * `TooManyRequests` - the limit on secret API key requests per second has been exceeded * `Failed` - internal server error # noqa: E501
54 :return: The code of this ProductError. # noqa: E501
55 :rtype: str
56 """
57 return self._code
59 @code.setter
60 def code(self, code):
61 """Sets the code of this ProductError.
63 Error code: * `TooManyRequests` - the limit on secret API key requests per second has been exceeded * `Failed` - internal server error # noqa: E501
65 :param code: The code of this ProductError. # noqa: E501
66 :type: str
67 """
68 if code is None:
69 raise ValueError("Invalid value for `code`, must not be `None`") # noqa: E501
70 allowed_values = ["TooManyRequests", "Failed"] # noqa: E501
71 if (code not in allowed_values):
72 raise ValueError(
73 "Invalid value for `code` ({0}), must be one of {1}" # noqa: E501
74 .format(code, allowed_values)
75 )
77 self._code = code
79 @property
80 def message(self):
81 """Gets the message of this ProductError. # noqa: E501
84 :return: The message of this ProductError. # noqa: E501
85 :rtype: str
86 """
87 return self._message
89 @message.setter
90 def message(self, message):
91 """Sets the message of this ProductError.
94 :param message: The message of this ProductError. # noqa: E501
95 :type: str
96 """
97 if message is None:
98 raise ValueError("Invalid value for `message`, must not be `None`") # noqa: E501
100 self._message = message
102 def to_dict(self):
103 """Returns the model properties as a dict"""
104 result = {}
106 for attr, _ in six.iteritems(self.swagger_types):
107 value = getattr(self, attr)
108 if isinstance(value, list):
109 result[attr] = list(map(
110 lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
111 value
112 ))
113 elif hasattr(value, "to_dict"):
114 result[attr] = value.to_dict()
115 elif isinstance(value, dict):
116 result[attr] = dict(map(
117 lambda item: (item[0], item[1].to_dict())
118 if hasattr(item[1], "to_dict") else item,
119 value.items()
120 ))
121 else:
122 result[attr] = value
123 if issubclass(ProductError, dict):
124 for key, value in self.items():
125 result[key] = value
127 return result
129 def to_str(self):
130 """Returns the string representation of the model"""
131 return pprint.pformat(self.to_dict())
133 def __repr__(self):
134 """For `print` and `pprint`"""
135 return self.to_str()
137 def __eq__(self, other):
138 """Returns true if both objects are equal"""
139 if not isinstance(other, ProductError):
140 return False
142 return self.to_dict() == other.to_dict()
144 def __ne__(self, other):
145 """Returns true if both objects are not equal"""
146 if not isinstance(other, ProductError):
147 return True
149 return self.to_dict() != other.to_dict()