ipgeolocation_sdk 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (218) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +9 -0
  3. data/LICENSE +21 -0
  4. data/README.md +2124 -0
  5. data/Rakefile +10 -0
  6. data/docs/ASNConnection.md +22 -0
  7. data/docs/ASNDetails.md +48 -0
  8. data/docs/ASNLookupApi.md +89 -0
  9. data/docs/ASNResponse.md +20 -0
  10. data/docs/ASNResponseXML.md +20 -0
  11. data/docs/ASNResponseXMLAsn.md +48 -0
  12. data/docs/Abuse.md +40 -0
  13. data/docs/AbuseContactApi.md +85 -0
  14. data/docs/AbuseResponse.md +20 -0
  15. data/docs/AbuseResponseXML.md +20 -0
  16. data/docs/Astronomy.md +68 -0
  17. data/docs/AstronomyApi.md +97 -0
  18. data/docs/AstronomyEvening.md +36 -0
  19. data/docs/AstronomyLocation.md +50 -0
  20. data/docs/AstronomyMorning.md +36 -0
  21. data/docs/AstronomyResponse.md +22 -0
  22. data/docs/AstronomyXMLResponse.md +22 -0
  23. data/docs/BulkIPGeolocation.md +42 -0
  24. data/docs/BulkIPSecurity.md +42 -0
  25. data/docs/CountryMetadata.md +22 -0
  26. data/docs/Currency.md +22 -0
  27. data/docs/ErrorResponse.md +18 -0
  28. data/docs/ErrorXMLResponse.md +18 -0
  29. data/docs/ErrorXMLResponseArray.md +18 -0
  30. data/docs/GeolocationResponse.md +38 -0
  31. data/docs/GeolocationXMLResponse.md +38 -0
  32. data/docs/GeolocationXMLResponseArray.md +38 -0
  33. data/docs/GetBulkIpGeolocation200ResponseInner1.md +49 -0
  34. data/docs/GetBulkIpGeolocationRequest.md +18 -0
  35. data/docs/GetBulkIpSecurityInfo200ResponseInner1.md +49 -0
  36. data/docs/IPLocationApi.md +175 -0
  37. data/docs/Location.md +58 -0
  38. data/docs/LocationMinimal.md +52 -0
  39. data/docs/Network.md +22 -0
  40. data/docs/NetworkAsn.md +38 -0
  41. data/docs/NetworkCompany.md +22 -0
  42. data/docs/NetworkMinimal.md +20 -0
  43. data/docs/NetworkMinimalAsn.md +22 -0
  44. data/docs/NetworkMinimalCompany.md +18 -0
  45. data/docs/ParseBulkUserAgentStringsRequest.md +18 -0
  46. data/docs/ParseUserAgentStringRequest.md +18 -0
  47. data/docs/Security.md +38 -0
  48. data/docs/SecurityAPIResponse.md +34 -0
  49. data/docs/SecurityAPIXMLResponse.md +34 -0
  50. data/docs/SecurityAPIXMLResponseArray.md +34 -0
  51. data/docs/SecurityApi.md +175 -0
  52. data/docs/TimeConversionApi.md +109 -0
  53. data/docs/TimeConversionResponse.md +24 -0
  54. data/docs/TimeConversionXMLResponse.md +24 -0
  55. data/docs/TimeZone.md +36 -0
  56. data/docs/TimeZoneDetailedResponse.md +26 -0
  57. data/docs/TimeZoneDetailedXMLResponse.md +26 -0
  58. data/docs/TimeZoneDstEnd.md +28 -0
  59. data/docs/TimeZoneDstStart.md +28 -0
  60. data/docs/TimezoneAirport.md +40 -0
  61. data/docs/TimezoneApi.md +99 -0
  62. data/docs/TimezoneDetail.md +56 -0
  63. data/docs/TimezoneDetailDstEnd.md +28 -0
  64. data/docs/TimezoneDetailDstStart.md +28 -0
  65. data/docs/TimezoneLocation.md +48 -0
  66. data/docs/TimezoneLocode.md +32 -0
  67. data/docs/UserAgentApi.md +235 -0
  68. data/docs/UserAgentData.md +32 -0
  69. data/docs/UserAgentDataDevice.md +24 -0
  70. data/docs/UserAgentDataEngine.md +24 -0
  71. data/docs/UserAgentDataOperatingSystem.md +26 -0
  72. data/docs/UserAgentXMLData.md +32 -0
  73. data/docs/UserAgentXMLDataArray.md +32 -0
  74. data/git_push.sh +57 -0
  75. data/ipgeolocation_sdk.gemspec +29 -0
  76. data/lib/ipgeolocation_sdk/api/abuse_contact_api.rb +86 -0
  77. data/lib/ipgeolocation_sdk/api/asn_lookup_api.rb +92 -0
  78. data/lib/ipgeolocation_sdk/api/astronomy_api.rb +116 -0
  79. data/lib/ipgeolocation_sdk/api/ip_geolocation_api.rb +186 -0
  80. data/lib/ipgeolocation_sdk/api/ip_security_api.rb +184 -0
  81. data/lib/ipgeolocation_sdk/api/time_conversion_api.rb +122 -0
  82. data/lib/ipgeolocation_sdk/api/timezone_api.rb +113 -0
  83. data/lib/ipgeolocation_sdk/api/user_agent_api.rb +158 -0
  84. data/lib/ipgeolocation_sdk/api_client.rb +393 -0
  85. data/lib/ipgeolocation_sdk/api_error.rb +58 -0
  86. data/lib/ipgeolocation_sdk/configuration.rb +308 -0
  87. data/lib/ipgeolocation_sdk/models/abuse.rb +305 -0
  88. data/lib/ipgeolocation_sdk/models/abuse_response.rb +229 -0
  89. data/lib/ipgeolocation_sdk/models/abuse_response_xml.rb +229 -0
  90. data/lib/ipgeolocation_sdk/models/asn_connection.rb +238 -0
  91. data/lib/ipgeolocation_sdk/models/asn_response.rb +230 -0
  92. data/lib/ipgeolocation_sdk/models/asn_response_asn.rb +368 -0
  93. data/lib/ipgeolocation_sdk/models/asn_response_xml.rb +229 -0
  94. data/lib/ipgeolocation_sdk/models/asn_response_xml_asn.rb +364 -0
  95. data/lib/ipgeolocation_sdk/models/astronomy.rb +445 -0
  96. data/lib/ipgeolocation_sdk/models/astronomy_evening.rb +301 -0
  97. data/lib/ipgeolocation_sdk/models/astronomy_location.rb +364 -0
  98. data/lib/ipgeolocation_sdk/models/astronomy_morning.rb +301 -0
  99. data/lib/ipgeolocation_sdk/models/astronomy_response.rb +238 -0
  100. data/lib/ipgeolocation_sdk/models/astronomy_xml_response.rb +238 -0
  101. data/lib/ipgeolocation_sdk/models/bulk_ip_geolocation.rb +113 -0
  102. data/lib/ipgeolocation_sdk/models/bulk_ip_security.rb +113 -0
  103. data/lib/ipgeolocation_sdk/models/country_metadata.rb +240 -0
  104. data/lib/ipgeolocation_sdk/models/currency.rb +238 -0
  105. data/lib/ipgeolocation_sdk/models/error_response.rb +220 -0
  106. data/lib/ipgeolocation_sdk/models/error_xml_response.rb +220 -0
  107. data/lib/ipgeolocation_sdk/models/error_xml_response_array.rb +220 -0
  108. data/lib/ipgeolocation_sdk/models/geolocation_response.rb +310 -0
  109. data/lib/ipgeolocation_sdk/models/geolocation_xml_response.rb +310 -0
  110. data/lib/ipgeolocation_sdk/models/geolocation_xml_response_array.rb +310 -0
  111. data/lib/ipgeolocation_sdk/models/get_bulk_ip_geolocation200_response_inner1.rb +105 -0
  112. data/lib/ipgeolocation_sdk/models/get_bulk_ip_geolocation_request.rb +241 -0
  113. data/lib/ipgeolocation_sdk/models/get_bulk_ip_security_info200_response_inner1.rb +105 -0
  114. data/lib/ipgeolocation_sdk/models/location.rb +400 -0
  115. data/lib/ipgeolocation_sdk/models/location_minimal.rb +373 -0
  116. data/lib/ipgeolocation_sdk/models/network.rb +238 -0
  117. data/lib/ipgeolocation_sdk/models/network_asn.rb +310 -0
  118. data/lib/ipgeolocation_sdk/models/network_company.rb +238 -0
  119. data/lib/ipgeolocation_sdk/models/network_minimal.rb +229 -0
  120. data/lib/ipgeolocation_sdk/models/network_minimal_asn.rb +238 -0
  121. data/lib/ipgeolocation_sdk/models/network_minimal_company.rb +220 -0
  122. data/lib/ipgeolocation_sdk/models/parse_bulk_user_agent_strings_request.rb +222 -0
  123. data/lib/ipgeolocation_sdk/models/parse_user_agent_string_request.rb +220 -0
  124. data/lib/ipgeolocation_sdk/models/security.rb +310 -0
  125. data/lib/ipgeolocation_sdk/models/security_api_response.rb +292 -0
  126. data/lib/ipgeolocation_sdk/models/security_apixml_response.rb +292 -0
  127. data/lib/ipgeolocation_sdk/models/security_apixml_response_array.rb +292 -0
  128. data/lib/ipgeolocation_sdk/models/time_conversion_response.rb +247 -0
  129. data/lib/ipgeolocation_sdk/models/time_conversion_xml_response.rb +247 -0
  130. data/lib/ipgeolocation_sdk/models/time_zone.rb +301 -0
  131. data/lib/ipgeolocation_sdk/models/time_zone_detailed_response.rb +256 -0
  132. data/lib/ipgeolocation_sdk/models/time_zone_detailed_xml_response.rb +256 -0
  133. data/lib/ipgeolocation_sdk/models/time_zone_dst_end.rb +265 -0
  134. data/lib/ipgeolocation_sdk/models/time_zone_dst_start.rb +265 -0
  135. data/lib/ipgeolocation_sdk/models/timezone_airport.rb +319 -0
  136. data/lib/ipgeolocation_sdk/models/timezone_detail.rb +391 -0
  137. data/lib/ipgeolocation_sdk/models/timezone_detail_dst_end.rb +265 -0
  138. data/lib/ipgeolocation_sdk/models/timezone_detail_dst_start.rb +265 -0
  139. data/lib/ipgeolocation_sdk/models/timezone_location.rb +355 -0
  140. data/lib/ipgeolocation_sdk/models/timezone_locode.rb +283 -0
  141. data/lib/ipgeolocation_sdk/models/user_agent_data.rb +283 -0
  142. data/lib/ipgeolocation_sdk/models/user_agent_data_device.rb +247 -0
  143. data/lib/ipgeolocation_sdk/models/user_agent_data_engine.rb +247 -0
  144. data/lib/ipgeolocation_sdk/models/user_agent_data_operating_system.rb +256 -0
  145. data/lib/ipgeolocation_sdk/models/user_agent_xml_data.rb +283 -0
  146. data/lib/ipgeolocation_sdk/models/user_agent_xml_data_array.rb +283 -0
  147. data/lib/ipgeolocation_sdk/version.rb +15 -0
  148. data/lib/ipgeolocation_sdk.rb +107 -0
  149. data/spec/api/abuse_contact_api_spec.rb +48 -0
  150. data/spec/api/asn_lookup_api_spec.rb +50 -0
  151. data/spec/api/astronomy_api_spec.rb +54 -0
  152. data/spec/api/ip_location_api_spec.rb +67 -0
  153. data/spec/api/security_api_spec.rb +67 -0
  154. data/spec/api/time_conversion_api_spec.rb +60 -0
  155. data/spec/api/timezone_api_spec.rb +56 -0
  156. data/spec/api/user_agent_api_spec.rb +74 -0
  157. data/spec/models/abuse_response_spec.rb +42 -0
  158. data/spec/models/abuse_response_xml_spec.rb +42 -0
  159. data/spec/models/abuse_spec.rb +90 -0
  160. data/spec/models/asn_connection_spec.rb +48 -0
  161. data/spec/models/asn_response_asn_spec.rb +126 -0
  162. data/spec/models/asn_response_spec.rb +42 -0
  163. data/spec/models/asn_response_xml_asn_spec.rb +126 -0
  164. data/spec/models/asn_response_xml_spec.rb +42 -0
  165. data/spec/models/astronomy_evening_spec.rb +90 -0
  166. data/spec/models/astronomy_location_spec.rb +132 -0
  167. data/spec/models/astronomy_morning_spec.rb +90 -0
  168. data/spec/models/astronomy_response_spec.rb +48 -0
  169. data/spec/models/astronomy_spec.rb +186 -0
  170. data/spec/models/astronomy_xml_response_spec.rb +48 -0
  171. data/spec/models/country_metadata_spec.rb +48 -0
  172. data/spec/models/currency_spec.rb +48 -0
  173. data/spec/models/error_response_spec.rb +36 -0
  174. data/spec/models/error_xml_response_array_spec.rb +36 -0
  175. data/spec/models/error_xml_response_spec.rb +36 -0
  176. data/spec/models/geolocation_response_spec.rb +96 -0
  177. data/spec/models/geolocation_xml_response_array_spec.rb +96 -0
  178. data/spec/models/geolocation_xml_response_spec.rb +96 -0
  179. data/spec/models/get_bulk_ip_geolocation200_response_inner1_spec.rb +32 -0
  180. data/spec/models/get_bulk_ip_geolocation200_response_inner_spec.rb +32 -0
  181. data/spec/models/get_bulk_ip_geolocation_request_spec.rb +36 -0
  182. data/spec/models/get_bulk_ip_security_info200_response_inner1_spec.rb +32 -0
  183. data/spec/models/get_bulk_ip_security_info200_response_inner_spec.rb +32 -0
  184. data/spec/models/location_minimal_spec.rb +138 -0
  185. data/spec/models/location_spec.rb +156 -0
  186. data/spec/models/network_asn_spec.rb +96 -0
  187. data/spec/models/network_company_spec.rb +48 -0
  188. data/spec/models/network_minimal_asn_spec.rb +48 -0
  189. data/spec/models/network_minimal_company_spec.rb +36 -0
  190. data/spec/models/network_minimal_spec.rb +42 -0
  191. data/spec/models/network_spec.rb +48 -0
  192. data/spec/models/parse_bulk_user_agent_strings_request_spec.rb +36 -0
  193. data/spec/models/parse_user_agent_string_request_spec.rb +36 -0
  194. data/spec/models/security_api_response_spec.rb +84 -0
  195. data/spec/models/security_apixml_response_array_spec.rb +84 -0
  196. data/spec/models/security_apixml_response_spec.rb +84 -0
  197. data/spec/models/security_spec.rb +96 -0
  198. data/spec/models/time_conversion_response_spec.rb +54 -0
  199. data/spec/models/time_conversion_xml_response_spec.rb +54 -0
  200. data/spec/models/time_zone_detailed_response_spec.rb +60 -0
  201. data/spec/models/time_zone_detailed_xml_response_spec.rb +60 -0
  202. data/spec/models/time_zone_dst_end_spec.rb +66 -0
  203. data/spec/models/time_zone_dst_start_spec.rb +66 -0
  204. data/spec/models/time_zone_spec.rb +90 -0
  205. data/spec/models/timezone_airport_spec.rb +102 -0
  206. data/spec/models/timezone_detail_dst_end_spec.rb +66 -0
  207. data/spec/models/timezone_detail_dst_start_spec.rb +66 -0
  208. data/spec/models/timezone_detail_spec.rb +150 -0
  209. data/spec/models/timezone_location_spec.rb +126 -0
  210. data/spec/models/timezone_locode_spec.rb +78 -0
  211. data/spec/models/user_agent_data_device_spec.rb +54 -0
  212. data/spec/models/user_agent_data_engine_spec.rb +54 -0
  213. data/spec/models/user_agent_data_operating_system_spec.rb +60 -0
  214. data/spec/models/user_agent_data_spec.rb +78 -0
  215. data/spec/models/user_agent_xml_data_array_spec.rb +78 -0
  216. data/spec/models/user_agent_xml_data_spec.rb +78 -0
  217. data/spec/spec_helper.rb +111 -0
  218. metadata +373 -0
@@ -0,0 +1,445 @@
1
+ =begin
2
+ #IPGeolocation.io - IP intelligence products
3
+
4
+ #Ipgeolocation provides a set of APIs to make ip based decisions.
5
+
6
+ The version of the OpenAPI document: 2.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.13.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module IpgeolocationSdk
17
+ class Astronomy
18
+ attr_accessor :time_zone
19
+
20
+ attr_accessor :date
21
+
22
+ attr_accessor :current_time
23
+
24
+ attr_accessor :mid_night
25
+
26
+ attr_accessor :night_end
27
+
28
+ attr_accessor :morning
29
+
30
+ attr_accessor :sunrise
31
+
32
+ attr_accessor :sunset
33
+
34
+ attr_accessor :evening
35
+
36
+ attr_accessor :night_begin
37
+
38
+ attr_accessor :sun_status
39
+
40
+ attr_accessor :solar_noon
41
+
42
+ attr_accessor :day_length
43
+
44
+ attr_accessor :sun_altitude
45
+
46
+ attr_accessor :sun_distance
47
+
48
+ attr_accessor :sun_azimuth
49
+
50
+ attr_accessor :moon_phase
51
+
52
+ attr_accessor :moonrise
53
+
54
+ attr_accessor :moonset
55
+
56
+ attr_accessor :moon_status
57
+
58
+ attr_accessor :moon_altitude
59
+
60
+ attr_accessor :moon_distance
61
+
62
+ attr_accessor :moon_azimuth
63
+
64
+ attr_accessor :moon_parallactic_angle
65
+
66
+ attr_accessor :moon_illumination_percentage
67
+
68
+ attr_accessor :moon_angle
69
+
70
+ # Attribute mapping from ruby-style variable name to JSON key.
71
+ def self.attribute_map
72
+ {
73
+ :'time_zone' => :'time_zone',
74
+ :'date' => :'date',
75
+ :'current_time' => :'current_time',
76
+ :'mid_night' => :'mid_night',
77
+ :'night_end' => :'night_end',
78
+ :'morning' => :'morning',
79
+ :'sunrise' => :'sunrise',
80
+ :'sunset' => :'sunset',
81
+ :'evening' => :'evening',
82
+ :'night_begin' => :'night_begin',
83
+ :'sun_status' => :'sun_status',
84
+ :'solar_noon' => :'solar_noon',
85
+ :'day_length' => :'day_length',
86
+ :'sun_altitude' => :'sun_altitude',
87
+ :'sun_distance' => :'sun_distance',
88
+ :'sun_azimuth' => :'sun_azimuth',
89
+ :'moon_phase' => :'moon_phase',
90
+ :'moonrise' => :'moonrise',
91
+ :'moonset' => :'moonset',
92
+ :'moon_status' => :'moon_status',
93
+ :'moon_altitude' => :'moon_altitude',
94
+ :'moon_distance' => :'moon_distance',
95
+ :'moon_azimuth' => :'moon_azimuth',
96
+ :'moon_parallactic_angle' => :'moon_parallactic_angle',
97
+ :'moon_illumination_percentage' => :'moon_illumination_percentage',
98
+ :'moon_angle' => :'moon_angle'
99
+ }
100
+ end
101
+
102
+ # Returns attribute mapping this model knows about
103
+ def self.acceptable_attribute_map
104
+ attribute_map
105
+ end
106
+
107
+ # Returns all the JSON keys this model knows about
108
+ def self.acceptable_attributes
109
+ acceptable_attribute_map.values
110
+ end
111
+
112
+ # Attribute type mapping.
113
+ def self.openapi_types
114
+ {
115
+ :'time_zone' => :'String',
116
+ :'date' => :'String',
117
+ :'current_time' => :'String',
118
+ :'mid_night' => :'String',
119
+ :'night_end' => :'String',
120
+ :'morning' => :'AstronomyMorning',
121
+ :'sunrise' => :'String',
122
+ :'sunset' => :'String',
123
+ :'evening' => :'AstronomyEvening',
124
+ :'night_begin' => :'String',
125
+ :'sun_status' => :'String',
126
+ :'solar_noon' => :'String',
127
+ :'day_length' => :'String',
128
+ :'sun_altitude' => :'Float',
129
+ :'sun_distance' => :'Float',
130
+ :'sun_azimuth' => :'Float',
131
+ :'moon_phase' => :'String',
132
+ :'moonrise' => :'String',
133
+ :'moonset' => :'String',
134
+ :'moon_status' => :'String',
135
+ :'moon_altitude' => :'Float',
136
+ :'moon_distance' => :'Float',
137
+ :'moon_azimuth' => :'Float',
138
+ :'moon_parallactic_angle' => :'Float',
139
+ :'moon_illumination_percentage' => :'String',
140
+ :'moon_angle' => :'Float'
141
+ }
142
+ end
143
+
144
+ # List of attributes with nullable: true
145
+ def self.openapi_nullable
146
+ Set.new([
147
+ ])
148
+ end
149
+
150
+ # Initializes the object
151
+ # @param [Hash] attributes Model attributes in the form of hash
152
+ def initialize(attributes = {})
153
+ if (!attributes.is_a?(Hash))
154
+ fail ArgumentError, "The input argument (attributes) must be a hash in `IpgeolocationSdk::Astronomy` initialize method"
155
+ end
156
+
157
+ # check to see if the attribute exists and convert string to symbol for hash key
158
+ acceptable_attribute_map = self.class.acceptable_attribute_map
159
+ attributes = attributes.each_with_object({}) { |(k, v), h|
160
+ if (!acceptable_attribute_map.key?(k.to_sym))
161
+ fail ArgumentError, "`#{k}` is not a valid attribute in `IpgeolocationSdk::Astronomy`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
162
+ end
163
+ h[k.to_sym] = v
164
+ }
165
+
166
+ if attributes.key?(:'time_zone')
167
+ self.time_zone = attributes[:'time_zone']
168
+ end
169
+
170
+ if attributes.key?(:'date')
171
+ self.date = attributes[:'date']
172
+ end
173
+
174
+ if attributes.key?(:'current_time')
175
+ self.current_time = attributes[:'current_time']
176
+ end
177
+
178
+ if attributes.key?(:'mid_night')
179
+ self.mid_night = attributes[:'mid_night']
180
+ end
181
+
182
+ if attributes.key?(:'night_end')
183
+ self.night_end = attributes[:'night_end']
184
+ end
185
+
186
+ if attributes.key?(:'morning')
187
+ self.morning = attributes[:'morning']
188
+ end
189
+
190
+ if attributes.key?(:'sunrise')
191
+ self.sunrise = attributes[:'sunrise']
192
+ end
193
+
194
+ if attributes.key?(:'sunset')
195
+ self.sunset = attributes[:'sunset']
196
+ end
197
+
198
+ if attributes.key?(:'evening')
199
+ self.evening = attributes[:'evening']
200
+ end
201
+
202
+ if attributes.key?(:'night_begin')
203
+ self.night_begin = attributes[:'night_begin']
204
+ end
205
+
206
+ if attributes.key?(:'sun_status')
207
+ self.sun_status = attributes[:'sun_status']
208
+ end
209
+
210
+ if attributes.key?(:'solar_noon')
211
+ self.solar_noon = attributes[:'solar_noon']
212
+ end
213
+
214
+ if attributes.key?(:'day_length')
215
+ self.day_length = attributes[:'day_length']
216
+ end
217
+
218
+ if attributes.key?(:'sun_altitude')
219
+ self.sun_altitude = attributes[:'sun_altitude']
220
+ end
221
+
222
+ if attributes.key?(:'sun_distance')
223
+ self.sun_distance = attributes[:'sun_distance']
224
+ end
225
+
226
+ if attributes.key?(:'sun_azimuth')
227
+ self.sun_azimuth = attributes[:'sun_azimuth']
228
+ end
229
+
230
+ if attributes.key?(:'moon_phase')
231
+ self.moon_phase = attributes[:'moon_phase']
232
+ end
233
+
234
+ if attributes.key?(:'moonrise')
235
+ self.moonrise = attributes[:'moonrise']
236
+ end
237
+
238
+ if attributes.key?(:'moonset')
239
+ self.moonset = attributes[:'moonset']
240
+ end
241
+
242
+ if attributes.key?(:'moon_status')
243
+ self.moon_status = attributes[:'moon_status']
244
+ end
245
+
246
+ if attributes.key?(:'moon_altitude')
247
+ self.moon_altitude = attributes[:'moon_altitude']
248
+ end
249
+
250
+ if attributes.key?(:'moon_distance')
251
+ self.moon_distance = attributes[:'moon_distance']
252
+ end
253
+
254
+ if attributes.key?(:'moon_azimuth')
255
+ self.moon_azimuth = attributes[:'moon_azimuth']
256
+ end
257
+
258
+ if attributes.key?(:'moon_parallactic_angle')
259
+ self.moon_parallactic_angle = attributes[:'moon_parallactic_angle']
260
+ end
261
+
262
+ if attributes.key?(:'moon_illumination_percentage')
263
+ self.moon_illumination_percentage = attributes[:'moon_illumination_percentage']
264
+ end
265
+
266
+ if attributes.key?(:'moon_angle')
267
+ self.moon_angle = attributes[:'moon_angle']
268
+ end
269
+ end
270
+
271
+ # Show invalid properties with the reasons. Usually used together with valid?
272
+ # @return Array for valid properties with the reasons
273
+ def list_invalid_properties
274
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
275
+ invalid_properties = Array.new
276
+ invalid_properties
277
+ end
278
+
279
+ # Check to see if the all the properties in the model are valid
280
+ # @return true if the model is valid
281
+ def valid?
282
+ warn '[DEPRECATED] the `valid?` method is obsolete'
283
+ true
284
+ end
285
+
286
+ # Checks equality by comparing each attribute.
287
+ # @param [Object] Object to be compared
288
+ def ==(o)
289
+ return true if self.equal?(o)
290
+ self.class == o.class &&
291
+ time_zone == o.time_zone &&
292
+ date == o.date &&
293
+ current_time == o.current_time &&
294
+ mid_night == o.mid_night &&
295
+ night_end == o.night_end &&
296
+ morning == o.morning &&
297
+ sunrise == o.sunrise &&
298
+ sunset == o.sunset &&
299
+ evening == o.evening &&
300
+ night_begin == o.night_begin &&
301
+ sun_status == o.sun_status &&
302
+ solar_noon == o.solar_noon &&
303
+ day_length == o.day_length &&
304
+ sun_altitude == o.sun_altitude &&
305
+ sun_distance == o.sun_distance &&
306
+ sun_azimuth == o.sun_azimuth &&
307
+ moon_phase == o.moon_phase &&
308
+ moonrise == o.moonrise &&
309
+ moonset == o.moonset &&
310
+ moon_status == o.moon_status &&
311
+ moon_altitude == o.moon_altitude &&
312
+ moon_distance == o.moon_distance &&
313
+ moon_azimuth == o.moon_azimuth &&
314
+ moon_parallactic_angle == o.moon_parallactic_angle &&
315
+ moon_illumination_percentage == o.moon_illumination_percentage &&
316
+ moon_angle == o.moon_angle
317
+ end
318
+
319
+ # @see the `==` method
320
+ # @param [Object] Object to be compared
321
+ def eql?(o)
322
+ self == o
323
+ end
324
+
325
+ # Calculates hash code according to all attributes.
326
+ # @return [Integer] Hash code
327
+ def hash
328
+ [time_zone, date, current_time, mid_night, night_end, morning, sunrise, sunset, evening, night_begin, sun_status, solar_noon, day_length, sun_altitude, sun_distance, sun_azimuth, moon_phase, moonrise, moonset, moon_status, moon_altitude, moon_distance, moon_azimuth, moon_parallactic_angle, moon_illumination_percentage, moon_angle].hash
329
+ end
330
+
331
+ # Builds the object from hash
332
+ # @param [Hash] attributes Model attributes in the form of hash
333
+ # @return [Object] Returns the model itself
334
+ def self.build_from_hash(attributes)
335
+ return nil unless attributes.is_a?(Hash)
336
+ attributes = attributes.transform_keys(&:to_sym)
337
+ transformed_hash = {}
338
+ openapi_types.each_pair do |key, type|
339
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
340
+ transformed_hash["#{key}"] = nil
341
+ elsif type =~ /\AArray<(.*)>/i
342
+ # check to ensure the input is an array given that the attribute
343
+ # is documented as an array but the input is not
344
+ if attributes[attribute_map[key]].is_a?(Array)
345
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
346
+ end
347
+ elsif !attributes[attribute_map[key]].nil?
348
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
349
+ end
350
+ end
351
+ new(transformed_hash)
352
+ end
353
+
354
+ # Deserializes the data based on type
355
+ # @param string type Data type
356
+ # @param string value Value to be deserialized
357
+ # @return [Object] Deserialized data
358
+ def self._deserialize(type, value)
359
+ case type.to_sym
360
+ when :Time
361
+ Time.parse(value)
362
+ when :Date
363
+ Date.parse(value)
364
+ when :String
365
+ value.to_s
366
+ when :Integer
367
+ value.to_i
368
+ when :Float
369
+ value.to_f
370
+ when :Boolean
371
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
372
+ true
373
+ else
374
+ false
375
+ end
376
+ when :Object
377
+ # generic object (usually a Hash), return directly
378
+ value
379
+ when /\AArray<(?<inner_type>.+)>\z/
380
+ inner_type = Regexp.last_match[:inner_type]
381
+ value.map { |v| _deserialize(inner_type, v) }
382
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
383
+ k_type = Regexp.last_match[:k_type]
384
+ v_type = Regexp.last_match[:v_type]
385
+ {}.tap do |hash|
386
+ value.each do |k, v|
387
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
388
+ end
389
+ end
390
+ else # model
391
+ # models (e.g. Pet) or oneOf
392
+ klass = IpgeolocationSdk.const_get(type)
393
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
394
+ end
395
+ end
396
+
397
+ # Returns the string representation of the object
398
+ # @return [String] String presentation of the object
399
+ def to_s
400
+ to_hash.to_s
401
+ end
402
+
403
+ # to_body is an alias to to_hash (backward compatibility)
404
+ # @return [Hash] Returns the object in the form of hash
405
+ def to_body
406
+ to_hash
407
+ end
408
+
409
+ # Returns the object in the form of hash
410
+ # @return [Hash] Returns the object in the form of hash
411
+ def to_hash
412
+ hash = {}
413
+ self.class.attribute_map.each_pair do |attr, param|
414
+ value = self.send(attr)
415
+ if value.nil?
416
+ is_nullable = self.class.openapi_nullable.include?(attr)
417
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
418
+ end
419
+
420
+ hash[param] = _to_hash(value)
421
+ end
422
+ hash
423
+ end
424
+
425
+ # Outputs non-array value in the form of hash
426
+ # For object, use to_hash. Otherwise, just return the value
427
+ # @param [Object] value Any valid value
428
+ # @return [Hash] Returns the value in the form of hash
429
+ def _to_hash(value)
430
+ if value.is_a?(Array)
431
+ value.compact.map { |v| _to_hash(v) }
432
+ elsif value.is_a?(Hash)
433
+ {}.tap do |hash|
434
+ value.each { |k, v| hash[k] = _to_hash(v) }
435
+ end
436
+ elsif value.respond_to? :to_hash
437
+ value.to_hash
438
+ else
439
+ value
440
+ end
441
+ end
442
+
443
+ end
444
+
445
+ end