Coverage for fingerprint_pro_server_api_sdk/models/ip_location.py: 74%

117 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 IPLocation(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 'accuracy_radius': 'int', 

32 'latitude': 'float', 

33 'longitude': 'float', 

34 'postal_code': 'str', 

35 'timezone': 'str', 

36 'city': 'IPLocationCity', 

37 'country': 'Location', 

38 'continent': 'Location', 

39 'subdivisions': 'list[Subdivision]' 

40 } 

41 

42 attribute_map = { 

43 'accuracy_radius': 'accuracyRadius', 

44 'latitude': 'latitude', 

45 'longitude': 'longitude', 

46 'postal_code': 'postalCode', 

47 'timezone': 'timezone', 

48 'city': 'city', 

49 'country': 'country', 

50 'continent': 'continent', 

51 'subdivisions': 'subdivisions' 

52 } 

53 

54 def __init__(self, accuracy_radius=None, latitude=None, longitude=None, postal_code=None, timezone=None, city=None, country=None, continent=None, subdivisions=None): # noqa: E501 

55 """IPLocation - a model defined in Swagger""" # noqa: E501 

56 self._accuracy_radius = None 

57 self._latitude = None 

58 self._longitude = None 

59 self._postal_code = None 

60 self._timezone = None 

61 self._city = None 

62 self._country = None 

63 self._continent = None 

64 self._subdivisions = None 

65 self.discriminator = None 

66 if accuracy_radius is not None: 

67 self.accuracy_radius = accuracy_radius 

68 if latitude is not None: 

69 self.latitude = latitude 

70 if longitude is not None: 

71 self.longitude = longitude 

72 if postal_code is not None: 

73 self.postal_code = postal_code 

74 if timezone is not None: 

75 self.timezone = timezone 

76 if city is not None: 

77 self.city = city 

78 if country is not None: 

79 self.country = country 

80 if continent is not None: 

81 self.continent = continent 

82 if subdivisions is not None: 

83 self.subdivisions = subdivisions 

84 

85 @property 

86 def accuracy_radius(self): 

87 """Gets the accuracy_radius of this IPLocation. # noqa: E501 

88 

89 The IP address is likely to be within this radius (in km) of the specified location. # noqa: E501 

90 

91 :return: The accuracy_radius of this IPLocation. # noqa: E501 

92 :rtype: int 

93 """ 

94 return self._accuracy_radius 

95 

96 @accuracy_radius.setter 

97 def accuracy_radius(self, accuracy_radius): 

98 """Sets the accuracy_radius of this IPLocation. 

99 

100 The IP address is likely to be within this radius (in km) of the specified location. # noqa: E501 

101 

102 :param accuracy_radius: The accuracy_radius of this IPLocation. # noqa: E501 

103 :type: int 

104 """ 

105 

106 self._accuracy_radius = accuracy_radius 

107 

108 @property 

109 def latitude(self): 

110 """Gets the latitude of this IPLocation. # noqa: E501 

111 

112 

113 :return: The latitude of this IPLocation. # noqa: E501 

114 :rtype: float 

115 """ 

116 return self._latitude 

117 

118 @latitude.setter 

119 def latitude(self, latitude): 

120 """Sets the latitude of this IPLocation. 

121 

122 

123 :param latitude: The latitude of this IPLocation. # noqa: E501 

124 :type: float 

125 """ 

126 

127 self._latitude = latitude 

128 

129 @property 

130 def longitude(self): 

131 """Gets the longitude of this IPLocation. # noqa: E501 

132 

133 

134 :return: The longitude of this IPLocation. # noqa: E501 

135 :rtype: float 

136 """ 

137 return self._longitude 

138 

139 @longitude.setter 

140 def longitude(self, longitude): 

141 """Sets the longitude of this IPLocation. 

142 

143 

144 :param longitude: The longitude of this IPLocation. # noqa: E501 

145 :type: float 

146 """ 

147 

148 self._longitude = longitude 

149 

150 @property 

151 def postal_code(self): 

152 """Gets the postal_code of this IPLocation. # noqa: E501 

153 

154 

155 :return: The postal_code of this IPLocation. # noqa: E501 

156 :rtype: str 

157 """ 

158 return self._postal_code 

159 

160 @postal_code.setter 

161 def postal_code(self, postal_code): 

162 """Sets the postal_code of this IPLocation. 

163 

164 

165 :param postal_code: The postal_code of this IPLocation. # noqa: E501 

166 :type: str 

167 """ 

168 

169 self._postal_code = postal_code 

170 

171 @property 

172 def timezone(self): 

173 """Gets the timezone of this IPLocation. # noqa: E501 

174 

175 

176 :return: The timezone of this IPLocation. # noqa: E501 

177 :rtype: str 

178 """ 

179 return self._timezone 

180 

181 @timezone.setter 

182 def timezone(self, timezone): 

183 """Sets the timezone of this IPLocation. 

184 

185 

186 :param timezone: The timezone of this IPLocation. # noqa: E501 

187 :type: str 

188 """ 

189 

190 self._timezone = timezone 

191 

192 @property 

193 def city(self): 

194 """Gets the city of this IPLocation. # noqa: E501 

195 

196 

197 :return: The city of this IPLocation. # noqa: E501 

198 :rtype: IPLocationCity 

199 """ 

200 return self._city 

201 

202 @city.setter 

203 def city(self, city): 

204 """Sets the city of this IPLocation. 

205 

206 

207 :param city: The city of this IPLocation. # noqa: E501 

208 :type: IPLocationCity 

209 """ 

210 

211 self._city = city 

212 

213 @property 

214 def country(self): 

215 """Gets the country of this IPLocation. # noqa: E501 

216 

217 

218 :return: The country of this IPLocation. # noqa: E501 

219 :rtype: Location 

220 """ 

221 return self._country 

222 

223 @country.setter 

224 def country(self, country): 

225 """Sets the country of this IPLocation. 

226 

227 

228 :param country: The country of this IPLocation. # noqa: E501 

229 :type: Location 

230 """ 

231 

232 self._country = country 

233 

234 @property 

235 def continent(self): 

236 """Gets the continent of this IPLocation. # noqa: E501 

237 

238 

239 :return: The continent of this IPLocation. # noqa: E501 

240 :rtype: Location 

241 """ 

242 return self._continent 

243 

244 @continent.setter 

245 def continent(self, continent): 

246 """Sets the continent of this IPLocation. 

247 

248 

249 :param continent: The continent of this IPLocation. # noqa: E501 

250 :type: Location 

251 """ 

252 

253 self._continent = continent 

254 

255 @property 

256 def subdivisions(self): 

257 """Gets the subdivisions of this IPLocation. # noqa: E501 

258 

259 

260 :return: The subdivisions of this IPLocation. # noqa: E501 

261 :rtype: list[Subdivision] 

262 """ 

263 return self._subdivisions 

264 

265 @subdivisions.setter 

266 def subdivisions(self, subdivisions): 

267 """Sets the subdivisions of this IPLocation. 

268 

269 

270 :param subdivisions: The subdivisions of this IPLocation. # noqa: E501 

271 :type: list[Subdivision] 

272 """ 

273 

274 self._subdivisions = subdivisions 

275 

276 def to_dict(self): 

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

278 result = {} 

279 

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

281 value = getattr(self, attr) 

282 if isinstance(value, list): 

283 result[attr] = list(map( 

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

285 value 

286 )) 

287 elif hasattr(value, "to_dict"): 

288 result[attr] = value.to_dict() 

289 elif isinstance(value, dict): 

290 result[attr] = dict(map( 

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

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

293 value.items() 

294 )) 

295 else: 

296 result[attr] = value 

297 if issubclass(IPLocation, dict): 

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

299 result[key] = value 

300 

301 return result 

302 

303 def to_str(self): 

304 """Returns the string representation of the model""" 

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

306 

307 def __repr__(self): 

308 """For `print` and `pprint`""" 

309 return self.to_str() 

310 

311 def __eq__(self, other): 

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

313 if not isinstance(other, IPLocation): 

314 return False 

315 

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

317 

318 def __ne__(self, other): 

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

320 if not isinstance(other, IPLocation): 

321 return True 

322 

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