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

56 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 Location(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 'name': 'str' 

33 } 

34 

35 attribute_map = { 

36 'code': 'code', 

37 'name': 'name' 

38 } 

39 

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

41 """Location - a model defined in Swagger""" # noqa: E501 

42 self._code = None 

43 self._name = None 

44 self.discriminator = None 

45 self.code = code 

46 self.name = name 

47 

48 @property 

49 def code(self): 

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

51 

52 

53 :return: The code of this Location. # noqa: E501 

54 :rtype: str 

55 """ 

56 return self._code 

57 

58 @code.setter 

59 def code(self, code): 

60 """Sets the code of this Location. 

61 

62 

63 :param code: The code of this Location. # noqa: E501 

64 :type: str 

65 """ 

66 if code is None: 

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

68 

69 self._code = code 

70 

71 @property 

72 def name(self): 

73 """Gets the name of this Location. # noqa: E501 

74 

75 

76 :return: The name of this Location. # noqa: E501 

77 :rtype: str 

78 """ 

79 return self._name 

80 

81 @name.setter 

82 def name(self, name): 

83 """Sets the name of this Location. 

84 

85 

86 :param name: The name of this Location. # noqa: E501 

87 :type: str 

88 """ 

89 if name is None: 

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

91 

92 self._name = name 

93 

94 def to_dict(self): 

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

96 result = {} 

97 

98 for attr, _ in six.iteritems(self.swagger_types): 

99 value = getattr(self, attr) 

100 if isinstance(value, list): 

101 result[attr] = list(map( 

102 lambda x: x.to_dict() if hasattr(x, "to_dict") else x, 

103 value 

104 )) 

105 elif hasattr(value, "to_dict"): 

106 result[attr] = value.to_dict() 

107 elif isinstance(value, dict): 

108 result[attr] = dict(map( 

109 lambda item: (item[0], item[1].to_dict()) 

110 if hasattr(item[1], "to_dict") else item, 

111 value.items() 

112 )) 

113 else: 

114 result[attr] = value 

115 if issubclass(Location, dict): 

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

117 result[key] = value 

118 

119 return result 

120 

121 def to_str(self): 

122 """Returns the string representation of the model""" 

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

124 

125 def __repr__(self): 

126 """For `print` and `pprint`""" 

127 return self.to_str() 

128 

129 def __eq__(self, other): 

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

131 if not isinstance(other, Location): 

132 return False 

133 

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

135 

136 def __ne__(self, other): 

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

138 if not isinstance(other, Location): 

139 return True 

140 

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