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,283 @@
|
|
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 UserAgentXMLDataArray
|
18
|
+
attr_accessor :user_agent_string
|
19
|
+
|
20
|
+
attr_accessor :name
|
21
|
+
|
22
|
+
attr_accessor :type
|
23
|
+
|
24
|
+
attr_accessor :version
|
25
|
+
|
26
|
+
attr_accessor :version_major
|
27
|
+
|
28
|
+
attr_accessor :device
|
29
|
+
|
30
|
+
attr_accessor :engine
|
31
|
+
|
32
|
+
attr_accessor :operating_system
|
33
|
+
|
34
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
35
|
+
def self.attribute_map
|
36
|
+
{
|
37
|
+
:'user_agent_string' => :'user_agent_string',
|
38
|
+
:'name' => :'name',
|
39
|
+
:'type' => :'type',
|
40
|
+
:'version' => :'version',
|
41
|
+
:'version_major' => :'version_major',
|
42
|
+
:'device' => :'device',
|
43
|
+
:'engine' => :'engine',
|
44
|
+
:'operating_system' => :'operating_system'
|
45
|
+
}
|
46
|
+
end
|
47
|
+
|
48
|
+
# Returns attribute mapping this model knows about
|
49
|
+
def self.acceptable_attribute_map
|
50
|
+
attribute_map
|
51
|
+
end
|
52
|
+
|
53
|
+
# Returns all the JSON keys this model knows about
|
54
|
+
def self.acceptable_attributes
|
55
|
+
acceptable_attribute_map.values
|
56
|
+
end
|
57
|
+
|
58
|
+
# Attribute type mapping.
|
59
|
+
def self.openapi_types
|
60
|
+
{
|
61
|
+
:'user_agent_string' => :'String',
|
62
|
+
:'name' => :'String',
|
63
|
+
:'type' => :'String',
|
64
|
+
:'version' => :'String',
|
65
|
+
:'version_major' => :'String',
|
66
|
+
:'device' => :'UserAgentDataDevice',
|
67
|
+
:'engine' => :'UserAgentDataEngine',
|
68
|
+
:'operating_system' => :'UserAgentDataOperatingSystem'
|
69
|
+
}
|
70
|
+
end
|
71
|
+
|
72
|
+
# List of attributes with nullable: true
|
73
|
+
def self.openapi_nullable
|
74
|
+
Set.new([
|
75
|
+
])
|
76
|
+
end
|
77
|
+
|
78
|
+
# Initializes the object
|
79
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
80
|
+
def initialize(attributes = {})
|
81
|
+
if (!attributes.is_a?(Hash))
|
82
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `IpgeolocationSdk::UserAgentXMLDataArray` initialize method"
|
83
|
+
end
|
84
|
+
|
85
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
86
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
87
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
88
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
89
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `IpgeolocationSdk::UserAgentXMLDataArray`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
90
|
+
end
|
91
|
+
h[k.to_sym] = v
|
92
|
+
}
|
93
|
+
|
94
|
+
if attributes.key?(:'user_agent_string')
|
95
|
+
self.user_agent_string = attributes[:'user_agent_string']
|
96
|
+
end
|
97
|
+
|
98
|
+
if attributes.key?(:'name')
|
99
|
+
self.name = attributes[:'name']
|
100
|
+
end
|
101
|
+
|
102
|
+
if attributes.key?(:'type')
|
103
|
+
self.type = attributes[:'type']
|
104
|
+
end
|
105
|
+
|
106
|
+
if attributes.key?(:'version')
|
107
|
+
self.version = attributes[:'version']
|
108
|
+
end
|
109
|
+
|
110
|
+
if attributes.key?(:'version_major')
|
111
|
+
self.version_major = attributes[:'version_major']
|
112
|
+
end
|
113
|
+
|
114
|
+
if attributes.key?(:'device')
|
115
|
+
self.device = attributes[:'device']
|
116
|
+
end
|
117
|
+
|
118
|
+
if attributes.key?(:'engine')
|
119
|
+
self.engine = attributes[:'engine']
|
120
|
+
end
|
121
|
+
|
122
|
+
if attributes.key?(:'operating_system')
|
123
|
+
self.operating_system = attributes[:'operating_system']
|
124
|
+
end
|
125
|
+
end
|
126
|
+
|
127
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
128
|
+
# @return Array for valid properties with the reasons
|
129
|
+
def list_invalid_properties
|
130
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
131
|
+
invalid_properties = Array.new
|
132
|
+
invalid_properties
|
133
|
+
end
|
134
|
+
|
135
|
+
# Check to see if the all the properties in the model are valid
|
136
|
+
# @return true if the model is valid
|
137
|
+
def valid?
|
138
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
139
|
+
true
|
140
|
+
end
|
141
|
+
|
142
|
+
# Checks equality by comparing each attribute.
|
143
|
+
# @param [Object] Object to be compared
|
144
|
+
def ==(o)
|
145
|
+
return true if self.equal?(o)
|
146
|
+
self.class == o.class &&
|
147
|
+
user_agent_string == o.user_agent_string &&
|
148
|
+
name == o.name &&
|
149
|
+
type == o.type &&
|
150
|
+
version == o.version &&
|
151
|
+
version_major == o.version_major &&
|
152
|
+
device == o.device &&
|
153
|
+
engine == o.engine &&
|
154
|
+
operating_system == o.operating_system
|
155
|
+
end
|
156
|
+
|
157
|
+
# @see the `==` method
|
158
|
+
# @param [Object] Object to be compared
|
159
|
+
def eql?(o)
|
160
|
+
self == o
|
161
|
+
end
|
162
|
+
|
163
|
+
# Calculates hash code according to all attributes.
|
164
|
+
# @return [Integer] Hash code
|
165
|
+
def hash
|
166
|
+
[user_agent_string, name, type, version, version_major, device, engine, operating_system].hash
|
167
|
+
end
|
168
|
+
|
169
|
+
# Builds the object from hash
|
170
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
171
|
+
# @return [Object] Returns the model itself
|
172
|
+
def self.build_from_hash(attributes)
|
173
|
+
return nil unless attributes.is_a?(Hash)
|
174
|
+
attributes = attributes.transform_keys(&:to_sym)
|
175
|
+
transformed_hash = {}
|
176
|
+
openapi_types.each_pair do |key, type|
|
177
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
178
|
+
transformed_hash["#{key}"] = nil
|
179
|
+
elsif type =~ /\AArray<(.*)>/i
|
180
|
+
# check to ensure the input is an array given that the attribute
|
181
|
+
# is documented as an array but the input is not
|
182
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
183
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
184
|
+
end
|
185
|
+
elsif !attributes[attribute_map[key]].nil?
|
186
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
187
|
+
end
|
188
|
+
end
|
189
|
+
new(transformed_hash)
|
190
|
+
end
|
191
|
+
|
192
|
+
# Deserializes the data based on type
|
193
|
+
# @param string type Data type
|
194
|
+
# @param string value Value to be deserialized
|
195
|
+
# @return [Object] Deserialized data
|
196
|
+
def self._deserialize(type, value)
|
197
|
+
case type.to_sym
|
198
|
+
when :Time
|
199
|
+
Time.parse(value)
|
200
|
+
when :Date
|
201
|
+
Date.parse(value)
|
202
|
+
when :String
|
203
|
+
value.to_s
|
204
|
+
when :Integer
|
205
|
+
value.to_i
|
206
|
+
when :Float
|
207
|
+
value.to_f
|
208
|
+
when :Boolean
|
209
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
210
|
+
true
|
211
|
+
else
|
212
|
+
false
|
213
|
+
end
|
214
|
+
when :Object
|
215
|
+
# generic object (usually a Hash), return directly
|
216
|
+
value
|
217
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
218
|
+
inner_type = Regexp.last_match[:inner_type]
|
219
|
+
value.map { |v| _deserialize(inner_type, v) }
|
220
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
221
|
+
k_type = Regexp.last_match[:k_type]
|
222
|
+
v_type = Regexp.last_match[:v_type]
|
223
|
+
{}.tap do |hash|
|
224
|
+
value.each do |k, v|
|
225
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
226
|
+
end
|
227
|
+
end
|
228
|
+
else # model
|
229
|
+
# models (e.g. Pet) or oneOf
|
230
|
+
klass = IpgeolocationSdk.const_get(type)
|
231
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
232
|
+
end
|
233
|
+
end
|
234
|
+
|
235
|
+
# Returns the string representation of the object
|
236
|
+
# @return [String] String presentation of the object
|
237
|
+
def to_s
|
238
|
+
to_hash.to_s
|
239
|
+
end
|
240
|
+
|
241
|
+
# to_body is an alias to to_hash (backward compatibility)
|
242
|
+
# @return [Hash] Returns the object in the form of hash
|
243
|
+
def to_body
|
244
|
+
to_hash
|
245
|
+
end
|
246
|
+
|
247
|
+
# Returns the object in the form of hash
|
248
|
+
# @return [Hash] Returns the object in the form of hash
|
249
|
+
def to_hash
|
250
|
+
hash = {}
|
251
|
+
self.class.attribute_map.each_pair do |attr, param|
|
252
|
+
value = self.send(attr)
|
253
|
+
if value.nil?
|
254
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
255
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
256
|
+
end
|
257
|
+
|
258
|
+
hash[param] = _to_hash(value)
|
259
|
+
end
|
260
|
+
hash
|
261
|
+
end
|
262
|
+
|
263
|
+
# Outputs non-array value in the form of hash
|
264
|
+
# For object, use to_hash. Otherwise, just return the value
|
265
|
+
# @param [Object] value Any valid value
|
266
|
+
# @return [Hash] Returns the value in the form of hash
|
267
|
+
def _to_hash(value)
|
268
|
+
if value.is_a?(Array)
|
269
|
+
value.compact.map { |v| _to_hash(v) }
|
270
|
+
elsif value.is_a?(Hash)
|
271
|
+
{}.tap do |hash|
|
272
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
273
|
+
end
|
274
|
+
elsif value.respond_to? :to_hash
|
275
|
+
value.to_hash
|
276
|
+
else
|
277
|
+
value
|
278
|
+
end
|
279
|
+
end
|
280
|
+
|
281
|
+
end
|
282
|
+
|
283
|
+
end
|
@@ -0,0 +1,15 @@
|
|
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
|
+
module IpgeolocationSdk
|
14
|
+
VERSION = '1.0.0'
|
15
|
+
end
|
@@ -0,0 +1,107 @@
|
|
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
|
+
# Common files
|
14
|
+
require 'ipgeolocation_sdk/api_client'
|
15
|
+
require 'ipgeolocation_sdk/api_error'
|
16
|
+
require 'ipgeolocation_sdk/version'
|
17
|
+
require 'ipgeolocation_sdk/configuration'
|
18
|
+
|
19
|
+
# Models
|
20
|
+
require 'ipgeolocation_sdk/models/asn_connection'
|
21
|
+
require 'ipgeolocation_sdk/models/asn_response'
|
22
|
+
require 'ipgeolocation_sdk/models/asn_response_asn'
|
23
|
+
require 'ipgeolocation_sdk/models/asn_response_xml'
|
24
|
+
require 'ipgeolocation_sdk/models/asn_response_xml_asn'
|
25
|
+
require 'ipgeolocation_sdk/models/abuse'
|
26
|
+
require 'ipgeolocation_sdk/models/abuse_response'
|
27
|
+
require 'ipgeolocation_sdk/models/abuse_response_xml'
|
28
|
+
require 'ipgeolocation_sdk/models/astronomy'
|
29
|
+
require 'ipgeolocation_sdk/models/astronomy_evening'
|
30
|
+
require 'ipgeolocation_sdk/models/astronomy_location'
|
31
|
+
require 'ipgeolocation_sdk/models/astronomy_morning'
|
32
|
+
require 'ipgeolocation_sdk/models/astronomy_response'
|
33
|
+
require 'ipgeolocation_sdk/models/astronomy_xml_response'
|
34
|
+
require 'ipgeolocation_sdk/models/country_metadata'
|
35
|
+
require 'ipgeolocation_sdk/models/currency'
|
36
|
+
require 'ipgeolocation_sdk/models/error_response'
|
37
|
+
require 'ipgeolocation_sdk/models/error_xml_response'
|
38
|
+
require 'ipgeolocation_sdk/models/error_xml_response_array'
|
39
|
+
require 'ipgeolocation_sdk/models/geolocation_response'
|
40
|
+
require 'ipgeolocation_sdk/models/geolocation_xml_response'
|
41
|
+
require 'ipgeolocation_sdk/models/geolocation_xml_response_array'
|
42
|
+
require 'ipgeolocation_sdk/models/bulk_ip_geolocation'
|
43
|
+
require 'ipgeolocation_sdk/models/get_bulk_ip_geolocation200_response_inner1'
|
44
|
+
require 'ipgeolocation_sdk/models/get_bulk_ip_geolocation_request'
|
45
|
+
require 'ipgeolocation_sdk/models/bulk_ip_security'
|
46
|
+
require 'ipgeolocation_sdk/models/get_bulk_ip_security_info200_response_inner1'
|
47
|
+
require 'ipgeolocation_sdk/models/location'
|
48
|
+
require 'ipgeolocation_sdk/models/location_minimal'
|
49
|
+
require 'ipgeolocation_sdk/models/network'
|
50
|
+
require 'ipgeolocation_sdk/models/network_asn'
|
51
|
+
require 'ipgeolocation_sdk/models/network_company'
|
52
|
+
require 'ipgeolocation_sdk/models/network_minimal'
|
53
|
+
require 'ipgeolocation_sdk/models/network_minimal_asn'
|
54
|
+
require 'ipgeolocation_sdk/models/network_minimal_company'
|
55
|
+
require 'ipgeolocation_sdk/models/parse_bulk_user_agent_strings_request'
|
56
|
+
require 'ipgeolocation_sdk/models/parse_user_agent_string_request'
|
57
|
+
require 'ipgeolocation_sdk/models/security'
|
58
|
+
require 'ipgeolocation_sdk/models/security_api_response'
|
59
|
+
require 'ipgeolocation_sdk/models/security_apixml_response'
|
60
|
+
require 'ipgeolocation_sdk/models/security_apixml_response_array'
|
61
|
+
require 'ipgeolocation_sdk/models/time_conversion_response'
|
62
|
+
require 'ipgeolocation_sdk/models/time_conversion_xml_response'
|
63
|
+
require 'ipgeolocation_sdk/models/time_zone'
|
64
|
+
require 'ipgeolocation_sdk/models/time_zone_detailed_response'
|
65
|
+
require 'ipgeolocation_sdk/models/time_zone_detailed_xml_response'
|
66
|
+
require 'ipgeolocation_sdk/models/time_zone_dst_end'
|
67
|
+
require 'ipgeolocation_sdk/models/time_zone_dst_start'
|
68
|
+
require 'ipgeolocation_sdk/models/timezone_airport'
|
69
|
+
require 'ipgeolocation_sdk/models/timezone_detail'
|
70
|
+
require 'ipgeolocation_sdk/models/timezone_detail_dst_end'
|
71
|
+
require 'ipgeolocation_sdk/models/timezone_detail_dst_start'
|
72
|
+
require 'ipgeolocation_sdk/models/timezone_location'
|
73
|
+
require 'ipgeolocation_sdk/models/timezone_locode'
|
74
|
+
require 'ipgeolocation_sdk/models/user_agent_data'
|
75
|
+
require 'ipgeolocation_sdk/models/user_agent_data_device'
|
76
|
+
require 'ipgeolocation_sdk/models/user_agent_data_engine'
|
77
|
+
require 'ipgeolocation_sdk/models/user_agent_data_operating_system'
|
78
|
+
require 'ipgeolocation_sdk/models/user_agent_xml_data'
|
79
|
+
require 'ipgeolocation_sdk/models/user_agent_xml_data_array'
|
80
|
+
|
81
|
+
# APIs
|
82
|
+
require 'ipgeolocation_sdk/api/asn_lookup_api'
|
83
|
+
require 'ipgeolocation_sdk/api/abuse_contact_api'
|
84
|
+
require 'ipgeolocation_sdk/api/astronomy_api'
|
85
|
+
require 'ipgeolocation_sdk/api/ip_geolocation_api'
|
86
|
+
require 'ipgeolocation_sdk/api/ip_security_api'
|
87
|
+
require 'ipgeolocation_sdk/api/time_conversion_api'
|
88
|
+
require 'ipgeolocation_sdk/api/timezone_api'
|
89
|
+
require 'ipgeolocation_sdk/api/user_agent_api'
|
90
|
+
|
91
|
+
module IpgeolocationSdk
|
92
|
+
class << self
|
93
|
+
# Customize default settings for the SDK using block.
|
94
|
+
# IpgeolocationSdk.configure do |config|
|
95
|
+
# config.username = "xxx"
|
96
|
+
# config.password = "xxx"
|
97
|
+
# end
|
98
|
+
# If no block given, return the default Configuration object.
|
99
|
+
def configure
|
100
|
+
if block_given?
|
101
|
+
yield(Configuration.default)
|
102
|
+
else
|
103
|
+
Configuration.default
|
104
|
+
end
|
105
|
+
end
|
106
|
+
end
|
107
|
+
end
|
@@ -0,0 +1,48 @@
|
|
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 'spec_helper'
|
14
|
+
require 'json'
|
15
|
+
|
16
|
+
# Unit tests for IpgeolocationSdk::AbuseContactApi
|
17
|
+
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
18
|
+
# Please update as you see appropriate
|
19
|
+
describe 'AbuseContactApi' do
|
20
|
+
before do
|
21
|
+
# run before each test
|
22
|
+
@api_instance = IpgeolocationSdk::AbuseContactApi.new
|
23
|
+
end
|
24
|
+
|
25
|
+
after do
|
26
|
+
# run after each test
|
27
|
+
end
|
28
|
+
|
29
|
+
describe 'test an instance of AbuseContactApi' do
|
30
|
+
it 'should create an instance of AbuseContactApi' do
|
31
|
+
expect(@api_instance).to be_instance_of(IpgeolocationSdk::AbuseContactApi)
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
# unit tests for get_abuse_contact_info
|
36
|
+
# The Abuse Contact API provides essential contact information to report abusive activity associated with IP addresses. By querying an IP address (IPv4 or IPv6), users receive detailed abuse contact data, including the responsible organization, abuse handling role, contact emails, phone numbers, and registered address. This enables users to swiftly take action to report and mitigate threats such as spam, DDoS attacks, and phishing. In addition to abuse-specific contacts, the API also includes registration metadata like the registered country and abuse handle. This empowers cybersecurity teams, hosting providers, and compliance entities to take appropriate legal or administrative action.
|
37
|
+
# @param [Hash] opts the optional parameters
|
38
|
+
# @option opts [String] :ip query parameter 'ip'.
|
39
|
+
# @option opts [String] :excludes You can exclude specific fields from the API response (except the ip field) by listing them in the excludes parameter as a comma-separated list. For example, you want to remove emails and handle from api response, you can put the keys in excludes parameter like this.
|
40
|
+
# @option opts [String] :fields You can customize the API response by using the fields parameter to include only the specific data you need. For example, to retrieve only the role and emails, specify these keys in the fields parameter as shown below.
|
41
|
+
# @return [AbuseResponse]
|
42
|
+
describe 'get_abuse_contact_info test' do
|
43
|
+
it 'should work' do
|
44
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
end
|
@@ -0,0 +1,50 @@
|
|
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 'spec_helper'
|
14
|
+
require 'json'
|
15
|
+
|
16
|
+
# Unit tests for IpgeolocationSdk::ASNLookupApi
|
17
|
+
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
18
|
+
# Please update as you see appropriate
|
19
|
+
describe 'ASNLookupApi' do
|
20
|
+
before do
|
21
|
+
# run before each test
|
22
|
+
@api_instance = IpgeolocationSdk::ASNLookupApi.new
|
23
|
+
end
|
24
|
+
|
25
|
+
after do
|
26
|
+
# run after each test
|
27
|
+
end
|
28
|
+
|
29
|
+
describe 'test an instance of ASNLookupApi' do
|
30
|
+
it 'should create an instance of ASNLookupApi' do
|
31
|
+
expect(@api_instance).to be_instance_of(IpgeolocationSdk::ASNLookupApi)
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
# unit tests for get_asn_info
|
36
|
+
# ASN API provides comprehensive details for an ASN including the as name, organization name, the country of registration, associated domain, and its type (ISP, host provider, or business). The API also shows the allocation date of provided ASN and if it is currently allocated or not. It also contains the routing information including peering, upstreams, and downstreams to help understand the relationship between different ASNs. Example Use Cases: - Looking up ASN information for an IP address (e.g., `GET /asn?ip=8.8.8.8`) - Retrieving ASN information for a specific ASN number (e.g., `GET /asn?asn=12345`) - Getting peering relationships for an ASN (e.g., `GET /asn?asn=12345&include=peers`)
|
37
|
+
# @param [Hash] opts the optional parameters
|
38
|
+
# @option opts [String] :ip query parameter 'ip'.
|
39
|
+
# @option opts [Integer] :asn query paramter 'asn'.
|
40
|
+
# @option opts [String] :include This parameter can have four options: a) peers b) downstreams c) upstreams d) routes e) whois_response. You may add any of them in comma-separated way. In order to get the ASN details with peering data, pass peers string in the include parameter like mentioned below.
|
41
|
+
# @option opts [String] :excludes You can exclude fields from the response according to you requirement with the exception of ip field. For example, you want to remove date_allocated and allocation_status from api response, you can put the keys in excludes parameter like this.
|
42
|
+
# @option opts [String] :fields You can filter out only those fields which you want to see in the response by using the fields parameter. To retrieve only the AS organization, its country and downstreams in api response, you can put the keys in fields parameter like this. API will combine these fields with the default ASN response. Note: Parameters `peers, downstreams, upstreams, routes, whois_response` can be used in both `include` , and `fields`. If you use include and fields at the same time, fields parameter will be considered only.
|
43
|
+
# @return [ASNResponse]
|
44
|
+
describe 'get_asn_info test' do
|
45
|
+
it 'should work' do
|
46
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
end
|
@@ -0,0 +1,54 @@
|
|
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 'spec_helper'
|
14
|
+
require 'json'
|
15
|
+
|
16
|
+
# Unit tests for IpgeolocationSdk::AstronomyApi
|
17
|
+
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
18
|
+
# Please update as you see appropriate
|
19
|
+
describe 'AstronomyApi' do
|
20
|
+
before do
|
21
|
+
# run before each test
|
22
|
+
@api_instance = IpgeolocationSdk::AstronomyApi.new
|
23
|
+
end
|
24
|
+
|
25
|
+
after do
|
26
|
+
# run after each test
|
27
|
+
end
|
28
|
+
|
29
|
+
describe 'test an instance of AstronomyApi' do
|
30
|
+
it 'should create an instance of AstronomyApi' do
|
31
|
+
expect(@api_instance).to be_instance_of(IpgeolocationSdk::AstronomyApi)
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
# unit tests for get_astronomy_details
|
36
|
+
# The Astronomy API provides the location-based rise and set times for the Sun and Moon along with the current position, distance from earth, and azimuth of the Sun and the Moon for a specific date at the queried time.
|
37
|
+
# @param [Hash] opts the optional parameters
|
38
|
+
# @option opts [String] :ip query paramter 'ip'. If not provided, will be your network IP
|
39
|
+
# @option opts [String] :location query paramter 'location'. If not provided, will be your ip location
|
40
|
+
# @option opts [String] :lat query paramter 'lat'.
|
41
|
+
# @option opts [String] :long query paramter 'long'.
|
42
|
+
# @option opts [String] :time_zone
|
43
|
+
# @option opts [String] :date The date (YYYY-MM-DD) to lookup for. default will be the current date
|
44
|
+
# @option opts [Float] :elevation query parameter 'elevation'
|
45
|
+
# @option opts [String] :output Desired output format.
|
46
|
+
# @option opts [String] :lang By default, the API responds in English. You can change the response language by passing the language code as a query parameter `lang`. Multi language feature is available only for `paid users`.
|
47
|
+
# @return [AstronomyResponse]
|
48
|
+
describe 'get_astronomy_details test' do
|
49
|
+
it 'should work' do
|
50
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
end
|
@@ -0,0 +1,67 @@
|
|
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 'spec_helper'
|
14
|
+
require 'json'
|
15
|
+
|
16
|
+
# Unit tests for IpgeolocationSdk::IPLocationApi
|
17
|
+
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
18
|
+
# Please update as you see appropriate
|
19
|
+
describe 'IPLocationApi' do
|
20
|
+
before do
|
21
|
+
# run before each test
|
22
|
+
@api_instance = IpgeolocationSdk::IPLocationApi.new
|
23
|
+
end
|
24
|
+
|
25
|
+
after do
|
26
|
+
# run after each test
|
27
|
+
end
|
28
|
+
|
29
|
+
describe 'test an instance of IPLocationApi' do
|
30
|
+
it 'should create an instance of IPLocationApi' do
|
31
|
+
expect(@api_instance).to be_instance_of(IpgeolocationSdk::IPLocationApi)
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
# unit tests for get_bulk_ip_geolocation
|
36
|
+
# This feature is available only on our paid API subscriptions (STANDARD or ADVANCED). This endpoint allows you to perform the geolocation lookup for multiple IPv4, IPv6 addresses or domain names (maximum 50,000) at the same time. The requests count per lookup is equal to total IP addresses or domain names passed. To perform bulk IP Geolocation Lookup, send a POST request and pass the \"ips\" array as JSON data along with it.
|
37
|
+
# @param get_bulk_ip_geolocation_request
|
38
|
+
# @param [Hash] opts the optional parameters
|
39
|
+
# @option opts [String] :lang By default, the API responds in English. You can change the response language by passing the language code as a query parameter `lang`. Multi language feature is available only for `paid users`.
|
40
|
+
# @option opts [String] :fields you can filter the API response by specifying the fields that you need, instead of getting the full response. To do this, pass the desired field names using the `fields` query parameter with each field represented as a dot-separated path.
|
41
|
+
# @option opts [String] :excludes you can also filter the API response by excluding specific fields (except the IP address) that you don't need. To do this, pass the unwanted field names using the excludes query parameter, with each field represented as a dot-separated path
|
42
|
+
# @option opts [String] :include IP Geolocation API also provides IP-Security, abuse, timezone, user-agent and DMA (Designated Market Area) code, which is specifically used in the US for marketing and regional targeting information on Advanced API subscription, but doesn't respond it by default. To get these information along with the geolocation information, you must pass the `include=security` or `include=abuse` or `include=dma` or `include=time_zone` or `include=user-agent` or you can fetch multiples by adding values in comma-separated way. In addition to that, IPGeolocation API also provide hostname lookup for an IP address on all the paid API subscriptions (STANDARD and ADVANCED), but doesn't respond it by default. To get the hostname for an IP address, you can pass one of the three values `hostname, liveHostname, hostnameFallbackLive` as a URL parameter `include=`.
|
43
|
+
# @option opts [String] :output Desired output format(json or xml).
|
44
|
+
# @return [Array<GetBulkIpGeolocation200ResponseInner>]
|
45
|
+
describe 'get_bulk_ip_geolocation test' do
|
46
|
+
it 'should work' do
|
47
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
# unit tests for get_ip_geolocation
|
52
|
+
# IP Geolocation API provides real-time and accurate geolocation, network, abuse, and security information for any IPv4 or IPv6 address and domain name along with the user-agent detail for the provided user-agent string. You can geolocate your online visitors and provide them the customized user-experience accordingly.
|
53
|
+
# @param [Hash] opts the optional parameters
|
54
|
+
# @option opts [String] :ip In order to find geolocation information about an IP (ipv4 ipv6) address or a domain name, pass it as a query parameter ip. When this endpoint is queried without an IP address, it returns the geolocation information of the device/client which is calling it
|
55
|
+
# @option opts [String] :lang By default, the API responds in English. You can change the response language by passing the language code as a query parameter `lang`. Multi language feature is available only for `paid users`.
|
56
|
+
# @option opts [String] :fields you can filter the API response by specifying the fields that you need, instead of getting the full response. To do this, pass the desired field names using the `fields` query parameter with each field represented as a dot-separated path.
|
57
|
+
# @option opts [String] :excludes you can also filter the API response by excluding specific fields (except the IP address) that you don't need. To do this, pass the unwanted field names using the excludes query parameter, with each field represented as a dot-separated path
|
58
|
+
# @option opts [String] :include IP Geolocation API also provides IP-Security, abuse, timezone, user-agent and DMA (Designated Market Area) code, which is specifically used in the US for marketing and regional targeting information on Advanced API subscription, but doesn't respond it by default. To get these information along with the geolocation information, you must pass the `include=security` or `include=abuse` or `include=dma` or `include=time_zone` or `include=user-agent` or you can fetch multiples by adding values in comma-separated way. In addition to that, IPGeolocation API also provide hostname lookup for an IP address on all the paid API subscriptions (STANDARD and ADVANCED), but doesn't respond it by default. To get the hostname for an IP address, you can pass one of the three values `hostname, liveHostname, hostnameFallbackLive` as a URL parameter `include=`.
|
59
|
+
# @option opts [String] :output Desired output format (json or xml).
|
60
|
+
# @return [GeolocationResponse]
|
61
|
+
describe 'get_ip_geolocation test' do
|
62
|
+
it 'should work' do
|
63
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
end
|