Coverage for fingerprint_pro_server_api_sdk/models/identification_error.py: 54%

59 statements  

« prev     ^ index     » next       coverage.py v7.4.4, created at 2024-03-27 22:39 +0000

1# coding: utf-8 

2 

3""" 

4 Fingerprint Pro Server API 

5 

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 

7 

8 OpenAPI spec version: 3 

9 Contact: support@fingerprint.com 

10 Generated by: https://github.com/swagger-api/swagger-codegen.git 

11""" 

12 

13import pprint 

14import re # noqa: F401 

15 

16import six 

17 

18class IdentificationError(object): 

19 """NOTE: This class is auto generated by the swagger code generator program. 

20 

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 } 

34 

35 attribute_map = { 

36 'code': 'code', 

37 'message': 'message' 

38 } 

39 

40 def __init__(self, code=None, message=None): # noqa: E501 

41 """IdentificationError - 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 

47 

48 @property 

49 def code(self): 

50 """Gets the code of this IdentificationError. # noqa: E501 

51 

52 Error code: * `429 Too Many Requests` - the limit on secret API key requests per second has been exceeded * `Failed` - internal server error # noqa: E501 

53 

54 :return: The code of this IdentificationError. # noqa: E501 

55 :rtype: str 

56 """ 

57 return self._code 

58 

59 @code.setter 

60 def code(self, code): 

61 """Sets the code of this IdentificationError. 

62 

63 Error code: * `429 Too Many Requests` - the limit on secret API key requests per second has been exceeded * `Failed` - internal server error # noqa: E501 

64 

65 :param code: The code of this IdentificationError. # 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 = ["429 Too Many Requests", "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 ) 

76 

77 self._code = code 

78 

79 @property 

80 def message(self): 

81 """Gets the message of this IdentificationError. # noqa: E501 

82 

83 

84 :return: The message of this IdentificationError. # noqa: E501 

85 :rtype: str 

86 """ 

87 return self._message 

88 

89 @message.setter 

90 def message(self, message): 

91 """Sets the message of this IdentificationError. 

92 

93 

94 :param message: The message of this IdentificationError. # noqa: E501 

95 :type: str 

96 """ 

97 if message is None: 

98 raise ValueError("Invalid value for `message`, must not be `None`") # noqa: E501 

99 

100 self._message = message 

101 

102 def to_dict(self): 

103 """Returns the model properties as a dict""" 

104 result = {} 

105 

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(IdentificationError, dict): 

124 for key, value in self.items(): 

125 result[key] = value 

126 

127 return result 

128 

129 def to_str(self): 

130 """Returns the string representation of the model""" 

131 return pprint.pformat(self.to_dict()) 

132 

133 def __repr__(self): 

134 """For `print` and `pprint`""" 

135 return self.to_str() 

136 

137 def __eq__(self, other): 

138 """Returns true if both objects are equal""" 

139 if not isinstance(other, IdentificationError): 

140 return False 

141 

142 return self.to_dict() == other.to_dict() 

143 

144 def __ne__(self, other): 

145 """Returns true if both objects are not equal""" 

146 if not isinstance(other, IdentificationError): 

147 return True 

148 

149 return self.to_dict() != other.to_dict()