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.
- checksums.yaml +7 -0
- data/Gemfile +9 -0
- data/LICENSE +21 -0
- data/README.md +2124 -0
- data/Rakefile +10 -0
- data/docs/ASNConnection.md +22 -0
- data/docs/ASNDetails.md +48 -0
- data/docs/ASNLookupApi.md +89 -0
- data/docs/ASNResponse.md +20 -0
- data/docs/ASNResponseXML.md +20 -0
- data/docs/ASNResponseXMLAsn.md +48 -0
- data/docs/Abuse.md +40 -0
- data/docs/AbuseContactApi.md +85 -0
- data/docs/AbuseResponse.md +20 -0
- data/docs/AbuseResponseXML.md +20 -0
- data/docs/Astronomy.md +68 -0
- data/docs/AstronomyApi.md +97 -0
- data/docs/AstronomyEvening.md +36 -0
- data/docs/AstronomyLocation.md +50 -0
- data/docs/AstronomyMorning.md +36 -0
- data/docs/AstronomyResponse.md +22 -0
- data/docs/AstronomyXMLResponse.md +22 -0
- data/docs/BulkIPGeolocation.md +42 -0
- data/docs/BulkIPSecurity.md +42 -0
- data/docs/CountryMetadata.md +22 -0
- data/docs/Currency.md +22 -0
- data/docs/ErrorResponse.md +18 -0
- data/docs/ErrorXMLResponse.md +18 -0
- data/docs/ErrorXMLResponseArray.md +18 -0
- data/docs/GeolocationResponse.md +38 -0
- data/docs/GeolocationXMLResponse.md +38 -0
- data/docs/GeolocationXMLResponseArray.md +38 -0
- data/docs/GetBulkIpGeolocation200ResponseInner1.md +49 -0
- data/docs/GetBulkIpGeolocationRequest.md +18 -0
- data/docs/GetBulkIpSecurityInfo200ResponseInner1.md +49 -0
- data/docs/IPLocationApi.md +175 -0
- data/docs/Location.md +58 -0
- data/docs/LocationMinimal.md +52 -0
- data/docs/Network.md +22 -0
- data/docs/NetworkAsn.md +38 -0
- data/docs/NetworkCompany.md +22 -0
- data/docs/NetworkMinimal.md +20 -0
- data/docs/NetworkMinimalAsn.md +22 -0
- data/docs/NetworkMinimalCompany.md +18 -0
- data/docs/ParseBulkUserAgentStringsRequest.md +18 -0
- data/docs/ParseUserAgentStringRequest.md +18 -0
- data/docs/Security.md +38 -0
- data/docs/SecurityAPIResponse.md +34 -0
- data/docs/SecurityAPIXMLResponse.md +34 -0
- data/docs/SecurityAPIXMLResponseArray.md +34 -0
- data/docs/SecurityApi.md +175 -0
- data/docs/TimeConversionApi.md +109 -0
- data/docs/TimeConversionResponse.md +24 -0
- data/docs/TimeConversionXMLResponse.md +24 -0
- data/docs/TimeZone.md +36 -0
- data/docs/TimeZoneDetailedResponse.md +26 -0
- data/docs/TimeZoneDetailedXMLResponse.md +26 -0
- data/docs/TimeZoneDstEnd.md +28 -0
- data/docs/TimeZoneDstStart.md +28 -0
- data/docs/TimezoneAirport.md +40 -0
- data/docs/TimezoneApi.md +99 -0
- data/docs/TimezoneDetail.md +56 -0
- data/docs/TimezoneDetailDstEnd.md +28 -0
- data/docs/TimezoneDetailDstStart.md +28 -0
- data/docs/TimezoneLocation.md +48 -0
- data/docs/TimezoneLocode.md +32 -0
- data/docs/UserAgentApi.md +235 -0
- data/docs/UserAgentData.md +32 -0
- data/docs/UserAgentDataDevice.md +24 -0
- data/docs/UserAgentDataEngine.md +24 -0
- data/docs/UserAgentDataOperatingSystem.md +26 -0
- data/docs/UserAgentXMLData.md +32 -0
- data/docs/UserAgentXMLDataArray.md +32 -0
- data/git_push.sh +57 -0
- data/ipgeolocation_sdk.gemspec +29 -0
- data/lib/ipgeolocation_sdk/api/abuse_contact_api.rb +86 -0
- data/lib/ipgeolocation_sdk/api/asn_lookup_api.rb +92 -0
- data/lib/ipgeolocation_sdk/api/astronomy_api.rb +116 -0
- data/lib/ipgeolocation_sdk/api/ip_geolocation_api.rb +186 -0
- data/lib/ipgeolocation_sdk/api/ip_security_api.rb +184 -0
- data/lib/ipgeolocation_sdk/api/time_conversion_api.rb +122 -0
- data/lib/ipgeolocation_sdk/api/timezone_api.rb +113 -0
- data/lib/ipgeolocation_sdk/api/user_agent_api.rb +158 -0
- data/lib/ipgeolocation_sdk/api_client.rb +393 -0
- data/lib/ipgeolocation_sdk/api_error.rb +58 -0
- data/lib/ipgeolocation_sdk/configuration.rb +308 -0
- data/lib/ipgeolocation_sdk/models/abuse.rb +305 -0
- data/lib/ipgeolocation_sdk/models/abuse_response.rb +229 -0
- data/lib/ipgeolocation_sdk/models/abuse_response_xml.rb +229 -0
- data/lib/ipgeolocation_sdk/models/asn_connection.rb +238 -0
- data/lib/ipgeolocation_sdk/models/asn_response.rb +230 -0
- data/lib/ipgeolocation_sdk/models/asn_response_asn.rb +368 -0
- data/lib/ipgeolocation_sdk/models/asn_response_xml.rb +229 -0
- data/lib/ipgeolocation_sdk/models/asn_response_xml_asn.rb +364 -0
- data/lib/ipgeolocation_sdk/models/astronomy.rb +445 -0
- data/lib/ipgeolocation_sdk/models/astronomy_evening.rb +301 -0
- data/lib/ipgeolocation_sdk/models/astronomy_location.rb +364 -0
- data/lib/ipgeolocation_sdk/models/astronomy_morning.rb +301 -0
- data/lib/ipgeolocation_sdk/models/astronomy_response.rb +238 -0
- data/lib/ipgeolocation_sdk/models/astronomy_xml_response.rb +238 -0
- data/lib/ipgeolocation_sdk/models/bulk_ip_geolocation.rb +113 -0
- data/lib/ipgeolocation_sdk/models/bulk_ip_security.rb +113 -0
- data/lib/ipgeolocation_sdk/models/country_metadata.rb +240 -0
- data/lib/ipgeolocation_sdk/models/currency.rb +238 -0
- data/lib/ipgeolocation_sdk/models/error_response.rb +220 -0
- data/lib/ipgeolocation_sdk/models/error_xml_response.rb +220 -0
- data/lib/ipgeolocation_sdk/models/error_xml_response_array.rb +220 -0
- data/lib/ipgeolocation_sdk/models/geolocation_response.rb +310 -0
- data/lib/ipgeolocation_sdk/models/geolocation_xml_response.rb +310 -0
- data/lib/ipgeolocation_sdk/models/geolocation_xml_response_array.rb +310 -0
- data/lib/ipgeolocation_sdk/models/get_bulk_ip_geolocation200_response_inner1.rb +105 -0
- data/lib/ipgeolocation_sdk/models/get_bulk_ip_geolocation_request.rb +241 -0
- data/lib/ipgeolocation_sdk/models/get_bulk_ip_security_info200_response_inner1.rb +105 -0
- data/lib/ipgeolocation_sdk/models/location.rb +400 -0
- data/lib/ipgeolocation_sdk/models/location_minimal.rb +373 -0
- data/lib/ipgeolocation_sdk/models/network.rb +238 -0
- data/lib/ipgeolocation_sdk/models/network_asn.rb +310 -0
- data/lib/ipgeolocation_sdk/models/network_company.rb +238 -0
- data/lib/ipgeolocation_sdk/models/network_minimal.rb +229 -0
- data/lib/ipgeolocation_sdk/models/network_minimal_asn.rb +238 -0
- data/lib/ipgeolocation_sdk/models/network_minimal_company.rb +220 -0
- data/lib/ipgeolocation_sdk/models/parse_bulk_user_agent_strings_request.rb +222 -0
- data/lib/ipgeolocation_sdk/models/parse_user_agent_string_request.rb +220 -0
- data/lib/ipgeolocation_sdk/models/security.rb +310 -0
- data/lib/ipgeolocation_sdk/models/security_api_response.rb +292 -0
- data/lib/ipgeolocation_sdk/models/security_apixml_response.rb +292 -0
- data/lib/ipgeolocation_sdk/models/security_apixml_response_array.rb +292 -0
- data/lib/ipgeolocation_sdk/models/time_conversion_response.rb +247 -0
- data/lib/ipgeolocation_sdk/models/time_conversion_xml_response.rb +247 -0
- data/lib/ipgeolocation_sdk/models/time_zone.rb +301 -0
- data/lib/ipgeolocation_sdk/models/time_zone_detailed_response.rb +256 -0
- data/lib/ipgeolocation_sdk/models/time_zone_detailed_xml_response.rb +256 -0
- data/lib/ipgeolocation_sdk/models/time_zone_dst_end.rb +265 -0
- data/lib/ipgeolocation_sdk/models/time_zone_dst_start.rb +265 -0
- data/lib/ipgeolocation_sdk/models/timezone_airport.rb +319 -0
- data/lib/ipgeolocation_sdk/models/timezone_detail.rb +391 -0
- data/lib/ipgeolocation_sdk/models/timezone_detail_dst_end.rb +265 -0
- data/lib/ipgeolocation_sdk/models/timezone_detail_dst_start.rb +265 -0
- data/lib/ipgeolocation_sdk/models/timezone_location.rb +355 -0
- data/lib/ipgeolocation_sdk/models/timezone_locode.rb +283 -0
- data/lib/ipgeolocation_sdk/models/user_agent_data.rb +283 -0
- data/lib/ipgeolocation_sdk/models/user_agent_data_device.rb +247 -0
- data/lib/ipgeolocation_sdk/models/user_agent_data_engine.rb +247 -0
- data/lib/ipgeolocation_sdk/models/user_agent_data_operating_system.rb +256 -0
- data/lib/ipgeolocation_sdk/models/user_agent_xml_data.rb +283 -0
- data/lib/ipgeolocation_sdk/models/user_agent_xml_data_array.rb +283 -0
- data/lib/ipgeolocation_sdk/version.rb +15 -0
- data/lib/ipgeolocation_sdk.rb +107 -0
- data/spec/api/abuse_contact_api_spec.rb +48 -0
- data/spec/api/asn_lookup_api_spec.rb +50 -0
- data/spec/api/astronomy_api_spec.rb +54 -0
- data/spec/api/ip_location_api_spec.rb +67 -0
- data/spec/api/security_api_spec.rb +67 -0
- data/spec/api/time_conversion_api_spec.rb +60 -0
- data/spec/api/timezone_api_spec.rb +56 -0
- data/spec/api/user_agent_api_spec.rb +74 -0
- data/spec/models/abuse_response_spec.rb +42 -0
- data/spec/models/abuse_response_xml_spec.rb +42 -0
- data/spec/models/abuse_spec.rb +90 -0
- data/spec/models/asn_connection_spec.rb +48 -0
- data/spec/models/asn_response_asn_spec.rb +126 -0
- data/spec/models/asn_response_spec.rb +42 -0
- data/spec/models/asn_response_xml_asn_spec.rb +126 -0
- data/spec/models/asn_response_xml_spec.rb +42 -0
- data/spec/models/astronomy_evening_spec.rb +90 -0
- data/spec/models/astronomy_location_spec.rb +132 -0
- data/spec/models/astronomy_morning_spec.rb +90 -0
- data/spec/models/astronomy_response_spec.rb +48 -0
- data/spec/models/astronomy_spec.rb +186 -0
- data/spec/models/astronomy_xml_response_spec.rb +48 -0
- data/spec/models/country_metadata_spec.rb +48 -0
- data/spec/models/currency_spec.rb +48 -0
- data/spec/models/error_response_spec.rb +36 -0
- data/spec/models/error_xml_response_array_spec.rb +36 -0
- data/spec/models/error_xml_response_spec.rb +36 -0
- data/spec/models/geolocation_response_spec.rb +96 -0
- data/spec/models/geolocation_xml_response_array_spec.rb +96 -0
- data/spec/models/geolocation_xml_response_spec.rb +96 -0
- data/spec/models/get_bulk_ip_geolocation200_response_inner1_spec.rb +32 -0
- data/spec/models/get_bulk_ip_geolocation200_response_inner_spec.rb +32 -0
- data/spec/models/get_bulk_ip_geolocation_request_spec.rb +36 -0
- data/spec/models/get_bulk_ip_security_info200_response_inner1_spec.rb +32 -0
- data/spec/models/get_bulk_ip_security_info200_response_inner_spec.rb +32 -0
- data/spec/models/location_minimal_spec.rb +138 -0
- data/spec/models/location_spec.rb +156 -0
- data/spec/models/network_asn_spec.rb +96 -0
- data/spec/models/network_company_spec.rb +48 -0
- data/spec/models/network_minimal_asn_spec.rb +48 -0
- data/spec/models/network_minimal_company_spec.rb +36 -0
- data/spec/models/network_minimal_spec.rb +42 -0
- data/spec/models/network_spec.rb +48 -0
- data/spec/models/parse_bulk_user_agent_strings_request_spec.rb +36 -0
- data/spec/models/parse_user_agent_string_request_spec.rb +36 -0
- data/spec/models/security_api_response_spec.rb +84 -0
- data/spec/models/security_apixml_response_array_spec.rb +84 -0
- data/spec/models/security_apixml_response_spec.rb +84 -0
- data/spec/models/security_spec.rb +96 -0
- data/spec/models/time_conversion_response_spec.rb +54 -0
- data/spec/models/time_conversion_xml_response_spec.rb +54 -0
- data/spec/models/time_zone_detailed_response_spec.rb +60 -0
- data/spec/models/time_zone_detailed_xml_response_spec.rb +60 -0
- data/spec/models/time_zone_dst_end_spec.rb +66 -0
- data/spec/models/time_zone_dst_start_spec.rb +66 -0
- data/spec/models/time_zone_spec.rb +90 -0
- data/spec/models/timezone_airport_spec.rb +102 -0
- data/spec/models/timezone_detail_dst_end_spec.rb +66 -0
- data/spec/models/timezone_detail_dst_start_spec.rb +66 -0
- data/spec/models/timezone_detail_spec.rb +150 -0
- data/spec/models/timezone_location_spec.rb +126 -0
- data/spec/models/timezone_locode_spec.rb +78 -0
- data/spec/models/user_agent_data_device_spec.rb +54 -0
- data/spec/models/user_agent_data_engine_spec.rb +54 -0
- data/spec/models/user_agent_data_operating_system_spec.rb +60 -0
- data/spec/models/user_agent_data_spec.rb +78 -0
- data/spec/models/user_agent_xml_data_array_spec.rb +78 -0
- data/spec/models/user_agent_xml_data_spec.rb +78 -0
- data/spec/spec_helper.rb +111 -0
- 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
|