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
« 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 Location(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 'name': 'str'
33 }
35 attribute_map = {
36 'code': 'code',
37 'name': 'name'
38 }
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
48 @property
49 def code(self):
50 """Gets the code of this Location. # noqa: E501
53 :return: The code of this Location. # noqa: E501
54 :rtype: str
55 """
56 return self._code
58 @code.setter
59 def code(self, code):
60 """Sets the code of this Location.
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
69 self._code = code
71 @property
72 def name(self):
73 """Gets the name of this Location. # noqa: E501
76 :return: The name of this Location. # noqa: E501
77 :rtype: str
78 """
79 return self._name
81 @name.setter
82 def name(self, name):
83 """Sets the name of this Location.
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
92 self._name = name
94 def to_dict(self):
95 """Returns the model properties as a dict"""
96 result = {}
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
119 return result
121 def to_str(self):
122 """Returns the string representation of the model"""
123 return pprint.pformat(self.to_dict())
125 def __repr__(self):
126 """For `print` and `pprint`"""
127 return self.to_str()
129 def __eq__(self, other):
130 """Returns true if both objects are equal"""
131 if not isinstance(other, Location):
132 return False
134 return self.to_dict() == other.to_dict()
136 def __ne__(self, other):
137 """Returns true if both objects are not equal"""
138 if not isinstance(other, Location):
139 return True
141 return self.to_dict() != other.to_dict()