ipgeolocation_sdk 1.0.0 → 2.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 (228) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +8 -0
  3. data/README.md +288 -2003
  4. data/lib/ipgeolocation_sdk/client.rb +223 -0
  5. data/lib/ipgeolocation_sdk/client_config.rb +102 -0
  6. data/lib/ipgeolocation_sdk/enums.rb +110 -0
  7. data/lib/ipgeolocation_sdk/errors.rb +38 -0
  8. data/lib/ipgeolocation_sdk/json_output.rb +30 -0
  9. data/lib/ipgeolocation_sdk/models.rb +186 -0
  10. data/lib/ipgeolocation_sdk/request_models.rb +175 -0
  11. data/lib/ipgeolocation_sdk/serde.rb +433 -0
  12. data/lib/ipgeolocation_sdk/transport.rb +109 -0
  13. data/lib/ipgeolocation_sdk/value_object.rb +60 -0
  14. data/lib/ipgeolocation_sdk/version.rb +1 -13
  15. data/lib/ipgeolocation_sdk.rb +19 -101
  16. metadata +29 -310
  17. data/Gemfile +0 -9
  18. data/Rakefile +0 -10
  19. data/docs/ASNConnection.md +0 -22
  20. data/docs/ASNDetails.md +0 -48
  21. data/docs/ASNLookupApi.md +0 -89
  22. data/docs/ASNResponse.md +0 -20
  23. data/docs/ASNResponseXML.md +0 -20
  24. data/docs/ASNResponseXMLAsn.md +0 -48
  25. data/docs/Abuse.md +0 -40
  26. data/docs/AbuseContactApi.md +0 -85
  27. data/docs/AbuseResponse.md +0 -20
  28. data/docs/AbuseResponseXML.md +0 -20
  29. data/docs/Astronomy.md +0 -68
  30. data/docs/AstronomyApi.md +0 -97
  31. data/docs/AstronomyEvening.md +0 -36
  32. data/docs/AstronomyLocation.md +0 -50
  33. data/docs/AstronomyMorning.md +0 -36
  34. data/docs/AstronomyResponse.md +0 -22
  35. data/docs/AstronomyXMLResponse.md +0 -22
  36. data/docs/BulkIPGeolocation.md +0 -42
  37. data/docs/BulkIPSecurity.md +0 -42
  38. data/docs/CountryMetadata.md +0 -22
  39. data/docs/Currency.md +0 -22
  40. data/docs/ErrorResponse.md +0 -18
  41. data/docs/ErrorXMLResponse.md +0 -18
  42. data/docs/ErrorXMLResponseArray.md +0 -18
  43. data/docs/GeolocationResponse.md +0 -38
  44. data/docs/GeolocationXMLResponse.md +0 -38
  45. data/docs/GeolocationXMLResponseArray.md +0 -38
  46. data/docs/GetBulkIpGeolocation200ResponseInner1.md +0 -49
  47. data/docs/GetBulkIpGeolocationRequest.md +0 -18
  48. data/docs/GetBulkIpSecurityInfo200ResponseInner1.md +0 -49
  49. data/docs/IPLocationApi.md +0 -175
  50. data/docs/Location.md +0 -58
  51. data/docs/LocationMinimal.md +0 -52
  52. data/docs/Network.md +0 -22
  53. data/docs/NetworkAsn.md +0 -38
  54. data/docs/NetworkCompany.md +0 -22
  55. data/docs/NetworkMinimal.md +0 -20
  56. data/docs/NetworkMinimalAsn.md +0 -22
  57. data/docs/NetworkMinimalCompany.md +0 -18
  58. data/docs/ParseBulkUserAgentStringsRequest.md +0 -18
  59. data/docs/ParseUserAgentStringRequest.md +0 -18
  60. data/docs/Security.md +0 -38
  61. data/docs/SecurityAPIResponse.md +0 -34
  62. data/docs/SecurityAPIXMLResponse.md +0 -34
  63. data/docs/SecurityAPIXMLResponseArray.md +0 -34
  64. data/docs/SecurityApi.md +0 -175
  65. data/docs/TimeConversionApi.md +0 -109
  66. data/docs/TimeConversionResponse.md +0 -24
  67. data/docs/TimeConversionXMLResponse.md +0 -24
  68. data/docs/TimeZone.md +0 -36
  69. data/docs/TimeZoneDetailedResponse.md +0 -26
  70. data/docs/TimeZoneDetailedXMLResponse.md +0 -26
  71. data/docs/TimeZoneDstEnd.md +0 -28
  72. data/docs/TimeZoneDstStart.md +0 -28
  73. data/docs/TimezoneAirport.md +0 -40
  74. data/docs/TimezoneApi.md +0 -99
  75. data/docs/TimezoneDetail.md +0 -56
  76. data/docs/TimezoneDetailDstEnd.md +0 -28
  77. data/docs/TimezoneDetailDstStart.md +0 -28
  78. data/docs/TimezoneLocation.md +0 -48
  79. data/docs/TimezoneLocode.md +0 -32
  80. data/docs/UserAgentApi.md +0 -235
  81. data/docs/UserAgentData.md +0 -32
  82. data/docs/UserAgentDataDevice.md +0 -24
  83. data/docs/UserAgentDataEngine.md +0 -24
  84. data/docs/UserAgentDataOperatingSystem.md +0 -26
  85. data/docs/UserAgentXMLData.md +0 -32
  86. data/docs/UserAgentXMLDataArray.md +0 -32
  87. data/git_push.sh +0 -57
  88. data/ipgeolocation_sdk.gemspec +0 -29
  89. data/lib/ipgeolocation_sdk/api/abuse_contact_api.rb +0 -86
  90. data/lib/ipgeolocation_sdk/api/asn_lookup_api.rb +0 -92
  91. data/lib/ipgeolocation_sdk/api/astronomy_api.rb +0 -116
  92. data/lib/ipgeolocation_sdk/api/ip_geolocation_api.rb +0 -186
  93. data/lib/ipgeolocation_sdk/api/ip_security_api.rb +0 -184
  94. data/lib/ipgeolocation_sdk/api/time_conversion_api.rb +0 -122
  95. data/lib/ipgeolocation_sdk/api/timezone_api.rb +0 -113
  96. data/lib/ipgeolocation_sdk/api/user_agent_api.rb +0 -158
  97. data/lib/ipgeolocation_sdk/api_client.rb +0 -393
  98. data/lib/ipgeolocation_sdk/api_error.rb +0 -58
  99. data/lib/ipgeolocation_sdk/configuration.rb +0 -308
  100. data/lib/ipgeolocation_sdk/models/abuse.rb +0 -305
  101. data/lib/ipgeolocation_sdk/models/abuse_response.rb +0 -229
  102. data/lib/ipgeolocation_sdk/models/abuse_response_xml.rb +0 -229
  103. data/lib/ipgeolocation_sdk/models/asn_connection.rb +0 -238
  104. data/lib/ipgeolocation_sdk/models/asn_response.rb +0 -230
  105. data/lib/ipgeolocation_sdk/models/asn_response_asn.rb +0 -368
  106. data/lib/ipgeolocation_sdk/models/asn_response_xml.rb +0 -229
  107. data/lib/ipgeolocation_sdk/models/asn_response_xml_asn.rb +0 -364
  108. data/lib/ipgeolocation_sdk/models/astronomy.rb +0 -445
  109. data/lib/ipgeolocation_sdk/models/astronomy_evening.rb +0 -301
  110. data/lib/ipgeolocation_sdk/models/astronomy_location.rb +0 -364
  111. data/lib/ipgeolocation_sdk/models/astronomy_morning.rb +0 -301
  112. data/lib/ipgeolocation_sdk/models/astronomy_response.rb +0 -238
  113. data/lib/ipgeolocation_sdk/models/astronomy_xml_response.rb +0 -238
  114. data/lib/ipgeolocation_sdk/models/bulk_ip_geolocation.rb +0 -113
  115. data/lib/ipgeolocation_sdk/models/bulk_ip_security.rb +0 -113
  116. data/lib/ipgeolocation_sdk/models/country_metadata.rb +0 -240
  117. data/lib/ipgeolocation_sdk/models/currency.rb +0 -238
  118. data/lib/ipgeolocation_sdk/models/error_response.rb +0 -220
  119. data/lib/ipgeolocation_sdk/models/error_xml_response.rb +0 -220
  120. data/lib/ipgeolocation_sdk/models/error_xml_response_array.rb +0 -220
  121. data/lib/ipgeolocation_sdk/models/geolocation_response.rb +0 -310
  122. data/lib/ipgeolocation_sdk/models/geolocation_xml_response.rb +0 -310
  123. data/lib/ipgeolocation_sdk/models/geolocation_xml_response_array.rb +0 -310
  124. data/lib/ipgeolocation_sdk/models/get_bulk_ip_geolocation200_response_inner1.rb +0 -105
  125. data/lib/ipgeolocation_sdk/models/get_bulk_ip_geolocation_request.rb +0 -241
  126. data/lib/ipgeolocation_sdk/models/get_bulk_ip_security_info200_response_inner1.rb +0 -105
  127. data/lib/ipgeolocation_sdk/models/location.rb +0 -400
  128. data/lib/ipgeolocation_sdk/models/location_minimal.rb +0 -373
  129. data/lib/ipgeolocation_sdk/models/network.rb +0 -238
  130. data/lib/ipgeolocation_sdk/models/network_asn.rb +0 -310
  131. data/lib/ipgeolocation_sdk/models/network_company.rb +0 -238
  132. data/lib/ipgeolocation_sdk/models/network_minimal.rb +0 -229
  133. data/lib/ipgeolocation_sdk/models/network_minimal_asn.rb +0 -238
  134. data/lib/ipgeolocation_sdk/models/network_minimal_company.rb +0 -220
  135. data/lib/ipgeolocation_sdk/models/parse_bulk_user_agent_strings_request.rb +0 -222
  136. data/lib/ipgeolocation_sdk/models/parse_user_agent_string_request.rb +0 -220
  137. data/lib/ipgeolocation_sdk/models/security.rb +0 -310
  138. data/lib/ipgeolocation_sdk/models/security_api_response.rb +0 -292
  139. data/lib/ipgeolocation_sdk/models/security_apixml_response.rb +0 -292
  140. data/lib/ipgeolocation_sdk/models/security_apixml_response_array.rb +0 -292
  141. data/lib/ipgeolocation_sdk/models/time_conversion_response.rb +0 -247
  142. data/lib/ipgeolocation_sdk/models/time_conversion_xml_response.rb +0 -247
  143. data/lib/ipgeolocation_sdk/models/time_zone.rb +0 -301
  144. data/lib/ipgeolocation_sdk/models/time_zone_detailed_response.rb +0 -256
  145. data/lib/ipgeolocation_sdk/models/time_zone_detailed_xml_response.rb +0 -256
  146. data/lib/ipgeolocation_sdk/models/time_zone_dst_end.rb +0 -265
  147. data/lib/ipgeolocation_sdk/models/time_zone_dst_start.rb +0 -265
  148. data/lib/ipgeolocation_sdk/models/timezone_airport.rb +0 -319
  149. data/lib/ipgeolocation_sdk/models/timezone_detail.rb +0 -391
  150. data/lib/ipgeolocation_sdk/models/timezone_detail_dst_end.rb +0 -265
  151. data/lib/ipgeolocation_sdk/models/timezone_detail_dst_start.rb +0 -265
  152. data/lib/ipgeolocation_sdk/models/timezone_location.rb +0 -355
  153. data/lib/ipgeolocation_sdk/models/timezone_locode.rb +0 -283
  154. data/lib/ipgeolocation_sdk/models/user_agent_data.rb +0 -283
  155. data/lib/ipgeolocation_sdk/models/user_agent_data_device.rb +0 -247
  156. data/lib/ipgeolocation_sdk/models/user_agent_data_engine.rb +0 -247
  157. data/lib/ipgeolocation_sdk/models/user_agent_data_operating_system.rb +0 -256
  158. data/lib/ipgeolocation_sdk/models/user_agent_xml_data.rb +0 -283
  159. data/lib/ipgeolocation_sdk/models/user_agent_xml_data_array.rb +0 -283
  160. data/spec/api/abuse_contact_api_spec.rb +0 -48
  161. data/spec/api/asn_lookup_api_spec.rb +0 -50
  162. data/spec/api/astronomy_api_spec.rb +0 -54
  163. data/spec/api/ip_location_api_spec.rb +0 -67
  164. data/spec/api/security_api_spec.rb +0 -67
  165. data/spec/api/time_conversion_api_spec.rb +0 -60
  166. data/spec/api/timezone_api_spec.rb +0 -56
  167. data/spec/api/user_agent_api_spec.rb +0 -74
  168. data/spec/models/abuse_response_spec.rb +0 -42
  169. data/spec/models/abuse_response_xml_spec.rb +0 -42
  170. data/spec/models/abuse_spec.rb +0 -90
  171. data/spec/models/asn_connection_spec.rb +0 -48
  172. data/spec/models/asn_response_asn_spec.rb +0 -126
  173. data/spec/models/asn_response_spec.rb +0 -42
  174. data/spec/models/asn_response_xml_asn_spec.rb +0 -126
  175. data/spec/models/asn_response_xml_spec.rb +0 -42
  176. data/spec/models/astronomy_evening_spec.rb +0 -90
  177. data/spec/models/astronomy_location_spec.rb +0 -132
  178. data/spec/models/astronomy_morning_spec.rb +0 -90
  179. data/spec/models/astronomy_response_spec.rb +0 -48
  180. data/spec/models/astronomy_spec.rb +0 -186
  181. data/spec/models/astronomy_xml_response_spec.rb +0 -48
  182. data/spec/models/country_metadata_spec.rb +0 -48
  183. data/spec/models/currency_spec.rb +0 -48
  184. data/spec/models/error_response_spec.rb +0 -36
  185. data/spec/models/error_xml_response_array_spec.rb +0 -36
  186. data/spec/models/error_xml_response_spec.rb +0 -36
  187. data/spec/models/geolocation_response_spec.rb +0 -96
  188. data/spec/models/geolocation_xml_response_array_spec.rb +0 -96
  189. data/spec/models/geolocation_xml_response_spec.rb +0 -96
  190. data/spec/models/get_bulk_ip_geolocation200_response_inner1_spec.rb +0 -32
  191. data/spec/models/get_bulk_ip_geolocation200_response_inner_spec.rb +0 -32
  192. data/spec/models/get_bulk_ip_geolocation_request_spec.rb +0 -36
  193. data/spec/models/get_bulk_ip_security_info200_response_inner1_spec.rb +0 -32
  194. data/spec/models/get_bulk_ip_security_info200_response_inner_spec.rb +0 -32
  195. data/spec/models/location_minimal_spec.rb +0 -138
  196. data/spec/models/location_spec.rb +0 -156
  197. data/spec/models/network_asn_spec.rb +0 -96
  198. data/spec/models/network_company_spec.rb +0 -48
  199. data/spec/models/network_minimal_asn_spec.rb +0 -48
  200. data/spec/models/network_minimal_company_spec.rb +0 -36
  201. data/spec/models/network_minimal_spec.rb +0 -42
  202. data/spec/models/network_spec.rb +0 -48
  203. data/spec/models/parse_bulk_user_agent_strings_request_spec.rb +0 -36
  204. data/spec/models/parse_user_agent_string_request_spec.rb +0 -36
  205. data/spec/models/security_api_response_spec.rb +0 -84
  206. data/spec/models/security_apixml_response_array_spec.rb +0 -84
  207. data/spec/models/security_apixml_response_spec.rb +0 -84
  208. data/spec/models/security_spec.rb +0 -96
  209. data/spec/models/time_conversion_response_spec.rb +0 -54
  210. data/spec/models/time_conversion_xml_response_spec.rb +0 -54
  211. data/spec/models/time_zone_detailed_response_spec.rb +0 -60
  212. data/spec/models/time_zone_detailed_xml_response_spec.rb +0 -60
  213. data/spec/models/time_zone_dst_end_spec.rb +0 -66
  214. data/spec/models/time_zone_dst_start_spec.rb +0 -66
  215. data/spec/models/time_zone_spec.rb +0 -90
  216. data/spec/models/timezone_airport_spec.rb +0 -102
  217. data/spec/models/timezone_detail_dst_end_spec.rb +0 -66
  218. data/spec/models/timezone_detail_dst_start_spec.rb +0 -66
  219. data/spec/models/timezone_detail_spec.rb +0 -150
  220. data/spec/models/timezone_location_spec.rb +0 -126
  221. data/spec/models/timezone_locode_spec.rb +0 -78
  222. data/spec/models/user_agent_data_device_spec.rb +0 -54
  223. data/spec/models/user_agent_data_engine_spec.rb +0 -54
  224. data/spec/models/user_agent_data_operating_system_spec.rb +0 -60
  225. data/spec/models/user_agent_data_spec.rb +0 -78
  226. data/spec/models/user_agent_xml_data_array_spec.rb +0 -78
  227. data/spec/models/user_agent_xml_data_spec.rb +0 -78
  228. data/spec/spec_helper.rb +0 -111
@@ -1,247 +0,0 @@
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 TimeConversionResponse
18
- attr_accessor :original_time
19
-
20
- attr_accessor :converted_time
21
-
22
- attr_accessor :diff_hour
23
-
24
- attr_accessor :diff_min
25
-
26
- # Attribute mapping from ruby-style variable name to JSON key.
27
- def self.attribute_map
28
- {
29
- :'original_time' => :'original_time',
30
- :'converted_time' => :'converted_time',
31
- :'diff_hour' => :'diff_hour',
32
- :'diff_min' => :'diff_min'
33
- }
34
- end
35
-
36
- # Returns attribute mapping this model knows about
37
- def self.acceptable_attribute_map
38
- attribute_map
39
- end
40
-
41
- # Returns all the JSON keys this model knows about
42
- def self.acceptable_attributes
43
- acceptable_attribute_map.values
44
- end
45
-
46
- # Attribute type mapping.
47
- def self.openapi_types
48
- {
49
- :'original_time' => :'Time',
50
- :'converted_time' => :'Time',
51
- :'diff_hour' => :'Float',
52
- :'diff_min' => :'Integer'
53
- }
54
- end
55
-
56
- # List of attributes with nullable: true
57
- def self.openapi_nullable
58
- Set.new([
59
- ])
60
- end
61
-
62
- # Initializes the object
63
- # @param [Hash] attributes Model attributes in the form of hash
64
- def initialize(attributes = {})
65
- if (!attributes.is_a?(Hash))
66
- fail ArgumentError, "The input argument (attributes) must be a hash in `IpgeolocationSdk::TimeConversionResponse` initialize method"
67
- end
68
-
69
- # check to see if the attribute exists and convert string to symbol for hash key
70
- acceptable_attribute_map = self.class.acceptable_attribute_map
71
- attributes = attributes.each_with_object({}) { |(k, v), h|
72
- if (!acceptable_attribute_map.key?(k.to_sym))
73
- fail ArgumentError, "`#{k}` is not a valid attribute in `IpgeolocationSdk::TimeConversionResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
74
- end
75
- h[k.to_sym] = v
76
- }
77
-
78
- if attributes.key?(:'original_time')
79
- self.original_time = attributes[:'original_time']
80
- end
81
-
82
- if attributes.key?(:'converted_time')
83
- self.converted_time = attributes[:'converted_time']
84
- end
85
-
86
- if attributes.key?(:'diff_hour')
87
- self.diff_hour = attributes[:'diff_hour']
88
- end
89
-
90
- if attributes.key?(:'diff_min')
91
- self.diff_min = attributes[:'diff_min']
92
- end
93
- end
94
-
95
- # Show invalid properties with the reasons. Usually used together with valid?
96
- # @return Array for valid properties with the reasons
97
- def list_invalid_properties
98
- warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
99
- invalid_properties = Array.new
100
- invalid_properties
101
- end
102
-
103
- # Check to see if the all the properties in the model are valid
104
- # @return true if the model is valid
105
- def valid?
106
- warn '[DEPRECATED] the `valid?` method is obsolete'
107
- true
108
- end
109
-
110
- # Checks equality by comparing each attribute.
111
- # @param [Object] Object to be compared
112
- def ==(o)
113
- return true if self.equal?(o)
114
- self.class == o.class &&
115
- original_time == o.original_time &&
116
- converted_time == o.converted_time &&
117
- diff_hour == o.diff_hour &&
118
- diff_min == o.diff_min
119
- end
120
-
121
- # @see the `==` method
122
- # @param [Object] Object to be compared
123
- def eql?(o)
124
- self == o
125
- end
126
-
127
- # Calculates hash code according to all attributes.
128
- # @return [Integer] Hash code
129
- def hash
130
- [original_time, converted_time, diff_hour, diff_min].hash
131
- end
132
-
133
- # Builds the object from hash
134
- # @param [Hash] attributes Model attributes in the form of hash
135
- # @return [Object] Returns the model itself
136
- def self.build_from_hash(attributes)
137
- return nil unless attributes.is_a?(Hash)
138
- attributes = attributes.transform_keys(&:to_sym)
139
- transformed_hash = {}
140
- openapi_types.each_pair do |key, type|
141
- if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
142
- transformed_hash["#{key}"] = nil
143
- elsif type =~ /\AArray<(.*)>/i
144
- # check to ensure the input is an array given that the attribute
145
- # is documented as an array but the input is not
146
- if attributes[attribute_map[key]].is_a?(Array)
147
- transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
148
- end
149
- elsif !attributes[attribute_map[key]].nil?
150
- transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
151
- end
152
- end
153
- new(transformed_hash)
154
- end
155
-
156
- # Deserializes the data based on type
157
- # @param string type Data type
158
- # @param string value Value to be deserialized
159
- # @return [Object] Deserialized data
160
- def self._deserialize(type, value)
161
- case type.to_sym
162
- when :Time
163
- Time.parse(value)
164
- when :Date
165
- Date.parse(value)
166
- when :String
167
- value.to_s
168
- when :Integer
169
- value.to_i
170
- when :Float
171
- value.to_f
172
- when :Boolean
173
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
174
- true
175
- else
176
- false
177
- end
178
- when :Object
179
- # generic object (usually a Hash), return directly
180
- value
181
- when /\AArray<(?<inner_type>.+)>\z/
182
- inner_type = Regexp.last_match[:inner_type]
183
- value.map { |v| _deserialize(inner_type, v) }
184
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
185
- k_type = Regexp.last_match[:k_type]
186
- v_type = Regexp.last_match[:v_type]
187
- {}.tap do |hash|
188
- value.each do |k, v|
189
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
190
- end
191
- end
192
- else # model
193
- # models (e.g. Pet) or oneOf
194
- klass = IpgeolocationSdk.const_get(type)
195
- klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
196
- end
197
- end
198
-
199
- # Returns the string representation of the object
200
- # @return [String] String presentation of the object
201
- def to_s
202
- to_hash.to_s
203
- end
204
-
205
- # to_body is an alias to to_hash (backward compatibility)
206
- # @return [Hash] Returns the object in the form of hash
207
- def to_body
208
- to_hash
209
- end
210
-
211
- # Returns the object in the form of hash
212
- # @return [Hash] Returns the object in the form of hash
213
- def to_hash
214
- hash = {}
215
- self.class.attribute_map.each_pair do |attr, param|
216
- value = self.send(attr)
217
- if value.nil?
218
- is_nullable = self.class.openapi_nullable.include?(attr)
219
- next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
220
- end
221
-
222
- hash[param] = _to_hash(value)
223
- end
224
- hash
225
- end
226
-
227
- # Outputs non-array value in the form of hash
228
- # For object, use to_hash. Otherwise, just return the value
229
- # @param [Object] value Any valid value
230
- # @return [Hash] Returns the value in the form of hash
231
- def _to_hash(value)
232
- if value.is_a?(Array)
233
- value.compact.map { |v| _to_hash(v) }
234
- elsif value.is_a?(Hash)
235
- {}.tap do |hash|
236
- value.each { |k, v| hash[k] = _to_hash(v) }
237
- end
238
- elsif value.respond_to? :to_hash
239
- value.to_hash
240
- else
241
- value
242
- end
243
- end
244
-
245
- end
246
-
247
- end
@@ -1,247 +0,0 @@
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 TimeConversionXMLResponse
18
- attr_accessor :original_time
19
-
20
- attr_accessor :converted_time
21
-
22
- attr_accessor :diff_hour
23
-
24
- attr_accessor :diff_min
25
-
26
- # Attribute mapping from ruby-style variable name to JSON key.
27
- def self.attribute_map
28
- {
29
- :'original_time' => :'original_time',
30
- :'converted_time' => :'converted_time',
31
- :'diff_hour' => :'diff_hour',
32
- :'diff_min' => :'diff_min'
33
- }
34
- end
35
-
36
- # Returns attribute mapping this model knows about
37
- def self.acceptable_attribute_map
38
- attribute_map
39
- end
40
-
41
- # Returns all the JSON keys this model knows about
42
- def self.acceptable_attributes
43
- acceptable_attribute_map.values
44
- end
45
-
46
- # Attribute type mapping.
47
- def self.openapi_types
48
- {
49
- :'original_time' => :'String',
50
- :'converted_time' => :'String',
51
- :'diff_hour' => :'Float',
52
- :'diff_min' => :'Integer'
53
- }
54
- end
55
-
56
- # List of attributes with nullable: true
57
- def self.openapi_nullable
58
- Set.new([
59
- ])
60
- end
61
-
62
- # Initializes the object
63
- # @param [Hash] attributes Model attributes in the form of hash
64
- def initialize(attributes = {})
65
- if (!attributes.is_a?(Hash))
66
- fail ArgumentError, "The input argument (attributes) must be a hash in `IpgeolocationSdk::TimeConversionXMLResponse` initialize method"
67
- end
68
-
69
- # check to see if the attribute exists and convert string to symbol for hash key
70
- acceptable_attribute_map = self.class.acceptable_attribute_map
71
- attributes = attributes.each_with_object({}) { |(k, v), h|
72
- if (!acceptable_attribute_map.key?(k.to_sym))
73
- fail ArgumentError, "`#{k}` is not a valid attribute in `IpgeolocationSdk::TimeConversionXMLResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
74
- end
75
- h[k.to_sym] = v
76
- }
77
-
78
- if attributes.key?(:'original_time')
79
- self.original_time = attributes[:'original_time']
80
- end
81
-
82
- if attributes.key?(:'converted_time')
83
- self.converted_time = attributes[:'converted_time']
84
- end
85
-
86
- if attributes.key?(:'diff_hour')
87
- self.diff_hour = attributes[:'diff_hour']
88
- end
89
-
90
- if attributes.key?(:'diff_min')
91
- self.diff_min = attributes[:'diff_min']
92
- end
93
- end
94
-
95
- # Show invalid properties with the reasons. Usually used together with valid?
96
- # @return Array for valid properties with the reasons
97
- def list_invalid_properties
98
- warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
99
- invalid_properties = Array.new
100
- invalid_properties
101
- end
102
-
103
- # Check to see if the all the properties in the model are valid
104
- # @return true if the model is valid
105
- def valid?
106
- warn '[DEPRECATED] the `valid?` method is obsolete'
107
- true
108
- end
109
-
110
- # Checks equality by comparing each attribute.
111
- # @param [Object] Object to be compared
112
- def ==(o)
113
- return true if self.equal?(o)
114
- self.class == o.class &&
115
- original_time == o.original_time &&
116
- converted_time == o.converted_time &&
117
- diff_hour == o.diff_hour &&
118
- diff_min == o.diff_min
119
- end
120
-
121
- # @see the `==` method
122
- # @param [Object] Object to be compared
123
- def eql?(o)
124
- self == o
125
- end
126
-
127
- # Calculates hash code according to all attributes.
128
- # @return [Integer] Hash code
129
- def hash
130
- [original_time, converted_time, diff_hour, diff_min].hash
131
- end
132
-
133
- # Builds the object from hash
134
- # @param [Hash] attributes Model attributes in the form of hash
135
- # @return [Object] Returns the model itself
136
- def self.build_from_hash(attributes)
137
- return nil unless attributes.is_a?(Hash)
138
- attributes = attributes.transform_keys(&:to_sym)
139
- transformed_hash = {}
140
- openapi_types.each_pair do |key, type|
141
- if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
142
- transformed_hash["#{key}"] = nil
143
- elsif type =~ /\AArray<(.*)>/i
144
- # check to ensure the input is an array given that the attribute
145
- # is documented as an array but the input is not
146
- if attributes[attribute_map[key]].is_a?(Array)
147
- transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
148
- end
149
- elsif !attributes[attribute_map[key]].nil?
150
- transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
151
- end
152
- end
153
- new(transformed_hash)
154
- end
155
-
156
- # Deserializes the data based on type
157
- # @param string type Data type
158
- # @param string value Value to be deserialized
159
- # @return [Object] Deserialized data
160
- def self._deserialize(type, value)
161
- case type.to_sym
162
- when :Time
163
- Time.parse(value)
164
- when :Date
165
- Date.parse(value)
166
- when :String
167
- value.to_s
168
- when :Integer
169
- value.to_i
170
- when :Float
171
- value.to_f
172
- when :Boolean
173
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
174
- true
175
- else
176
- false
177
- end
178
- when :Object
179
- # generic object (usually a Hash), return directly
180
- value
181
- when /\AArray<(?<inner_type>.+)>\z/
182
- inner_type = Regexp.last_match[:inner_type]
183
- value.map { |v| _deserialize(inner_type, v) }
184
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
185
- k_type = Regexp.last_match[:k_type]
186
- v_type = Regexp.last_match[:v_type]
187
- {}.tap do |hash|
188
- value.each do |k, v|
189
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
190
- end
191
- end
192
- else # model
193
- # models (e.g. Pet) or oneOf
194
- klass = IpgeolocationSdk.const_get(type)
195
- klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
196
- end
197
- end
198
-
199
- # Returns the string representation of the object
200
- # @return [String] String presentation of the object
201
- def to_s
202
- to_hash.to_s
203
- end
204
-
205
- # to_body is an alias to to_hash (backward compatibility)
206
- # @return [Hash] Returns the object in the form of hash
207
- def to_body
208
- to_hash
209
- end
210
-
211
- # Returns the object in the form of hash
212
- # @return [Hash] Returns the object in the form of hash
213
- def to_hash
214
- hash = {}
215
- self.class.attribute_map.each_pair do |attr, param|
216
- value = self.send(attr)
217
- if value.nil?
218
- is_nullable = self.class.openapi_nullable.include?(attr)
219
- next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
220
- end
221
-
222
- hash[param] = _to_hash(value)
223
- end
224
- hash
225
- end
226
-
227
- # Outputs non-array value in the form of hash
228
- # For object, use to_hash. Otherwise, just return the value
229
- # @param [Object] value Any valid value
230
- # @return [Hash] Returns the value in the form of hash
231
- def _to_hash(value)
232
- if value.is_a?(Array)
233
- value.compact.map { |v| _to_hash(v) }
234
- elsif value.is_a?(Hash)
235
- {}.tap do |hash|
236
- value.each { |k, v| hash[k] = _to_hash(v) }
237
- end
238
- elsif value.respond_to? :to_hash
239
- value.to_hash
240
- else
241
- value
242
- end
243
- end
244
-
245
- end
246
-
247
- end