cloudmersive-validate-api-client 1.4.2 → 2.0.5
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 +4 -4
- data/Gemfile +1 -1
- data/README.md +22 -7
- data/cloudmersive-validate-api-client.gemspec +3 -3
- data/docs/AddressApi.md +270 -1
- data/docs/CountryDetails.md +11 -0
- data/docs/CountryListResult.md +9 -0
- data/docs/DomainApi.md +2 -2
- data/docs/EmailApi.md +3 -3
- data/docs/IPAddressApi.md +56 -1
- data/docs/TorNodeResponse.md +8 -0
- data/docs/ValidateCityRequest.md +11 -0
- data/docs/ValidateCityResponse.md +12 -0
- data/docs/ValidateCountryResponse.md +1 -0
- data/docs/ValidatePostalCodeRequest.md +10 -0
- data/docs/ValidatePostalCodeResponse.md +12 -0
- data/docs/ValidateStateRequest.md +10 -0
- data/docs/ValidateStateResponse.md +11 -0
- data/lib/cloudmersive-validate-api-client.rb +10 -1
- data/lib/cloudmersive-validate-api-client/api/address_api.rb +276 -18
- data/lib/cloudmersive-validate-api-client/api/domain_api.rb +14 -18
- data/lib/cloudmersive-validate-api-client/api/email_api.rb +11 -14
- data/lib/cloudmersive-validate-api-client/api/ip_address_api.rb +58 -5
- data/lib/cloudmersive-validate-api-client/api/lead_enrichment_api.rb +5 -8
- data/lib/cloudmersive-validate-api-client/api/name_api.rb +17 -22
- data/lib/cloudmersive-validate-api-client/api/phone_number_api.rb +5 -6
- data/lib/cloudmersive-validate-api-client/api/user_agent_api.rb +5 -6
- data/lib/cloudmersive-validate-api-client/api/vat_api.rb +5 -6
- data/lib/cloudmersive-validate-api-client/api_client.rb +11 -9
- data/lib/cloudmersive-validate-api-client/api_error.rb +1 -1
- data/lib/cloudmersive-validate-api-client/configuration.rb +2 -2
- data/lib/cloudmersive-validate-api-client/models/address_get_servers_response.rb +7 -10
- data/lib/cloudmersive-validate-api-client/models/address_verify_syntax_only_response.rb +7 -10
- data/lib/cloudmersive-validate-api-client/models/check_response.rb +7 -10
- data/lib/cloudmersive-validate-api-client/models/country_details.rb +216 -0
- data/lib/cloudmersive-validate-api-client/models/country_list_result.rb +198 -0
- data/lib/cloudmersive-validate-api-client/models/first_name_validation_request.rb +7 -10
- data/lib/cloudmersive-validate-api-client/models/first_name_validation_response.rb +7 -10
- data/lib/cloudmersive-validate-api-client/models/full_email_validation_response.rb +7 -10
- data/lib/cloudmersive-validate-api-client/models/full_name_validation_request.rb +7 -10
- data/lib/cloudmersive-validate-api-client/models/full_name_validation_response.rb +7 -10
- data/lib/cloudmersive-validate-api-client/models/geolocate_response.rb +7 -10
- data/lib/cloudmersive-validate-api-client/models/get_gender_request.rb +7 -10
- data/lib/cloudmersive-validate-api-client/models/get_gender_response.rb +7 -10
- data/lib/cloudmersive-validate-api-client/models/get_timezones_request.rb +7 -10
- data/lib/cloudmersive-validate-api-client/models/get_timezones_response.rb +7 -10
- data/lib/cloudmersive-validate-api-client/models/last_name_validation_request.rb +7 -10
- data/lib/cloudmersive-validate-api-client/models/last_name_validation_response.rb +7 -10
- data/lib/cloudmersive-validate-api-client/models/lead_enrichment_request.rb +7 -10
- data/lib/cloudmersive-validate-api-client/models/lead_enrichment_response.rb +7 -10
- data/lib/cloudmersive-validate-api-client/models/parse_address_request.rb +7 -10
- data/lib/cloudmersive-validate-api-client/models/parse_address_response.rb +7 -10
- data/lib/cloudmersive-validate-api-client/models/phone_number_validate_request.rb +7 -10
- data/lib/cloudmersive-validate-api-client/models/phone_number_validation_response.rb +7 -10
- data/lib/cloudmersive-validate-api-client/models/timezone.rb +7 -10
- data/lib/cloudmersive-validate-api-client/models/tor_node_response.rb +186 -0
- data/lib/cloudmersive-validate-api-client/models/user_agent_validate_request.rb +7 -10
- data/lib/cloudmersive-validate-api-client/models/user_agent_validate_response.rb +7 -10
- data/lib/cloudmersive-validate-api-client/models/validate_address_request.rb +7 -10
- data/lib/cloudmersive-validate-api-client/models/validate_address_response.rb +7 -10
- data/lib/cloudmersive-validate-api-client/models/validate_city_request.rb +216 -0
- data/lib/cloudmersive-validate-api-client/models/validate_city_response.rb +226 -0
- data/lib/cloudmersive-validate-api-client/models/validate_country_request.rb +7 -10
- data/lib/cloudmersive-validate-api-client/models/validate_country_response.rb +18 -11
- data/lib/cloudmersive-validate-api-client/models/validate_identifier_request.rb +7 -10
- data/lib/cloudmersive-validate-api-client/models/validate_identifier_response.rb +7 -10
- data/lib/cloudmersive-validate-api-client/models/validate_postal_code_request.rb +206 -0
- data/lib/cloudmersive-validate-api-client/models/validate_postal_code_response.rb +226 -0
- data/lib/cloudmersive-validate-api-client/models/validate_state_request.rb +206 -0
- data/lib/cloudmersive-validate-api-client/models/validate_state_response.rb +216 -0
- data/lib/cloudmersive-validate-api-client/models/validate_url_request_full.rb +7 -10
- data/lib/cloudmersive-validate-api-client/models/validate_url_request_syntax_only.rb +7 -10
- data/lib/cloudmersive-validate-api-client/models/validate_url_response_full.rb +7 -10
- data/lib/cloudmersive-validate-api-client/models/validate_url_response_syntax_only.rb +7 -10
- data/lib/cloudmersive-validate-api-client/models/vat_lookup_request.rb +7 -10
- data/lib/cloudmersive-validate-api-client/models/vat_lookup_response.rb +7 -11
- data/lib/cloudmersive-validate-api-client/models/whois_response.rb +7 -10
- data/lib/cloudmersive-validate-api-client/version.rb +2 -2
- data/spec/api/address_api_spec.rb +65 -6
- data/spec/api/domain_api_spec.rb +5 -5
- data/spec/api/email_api_spec.rb +4 -4
- data/spec/api/ip_address_api_spec.rb +14 -2
- data/spec/api/lead_enrichment_api_spec.rb +2 -3
- data/spec/api/name_api_spec.rb +6 -6
- data/spec/api/phone_number_api_spec.rb +2 -2
- data/spec/api/user_agent_api_spec.rb +2 -2
- data/spec/api/vat_api_spec.rb +2 -2
- data/spec/api_client_spec.rb +52 -35
- data/spec/configuration_spec.rb +9 -9
- data/spec/models/address_get_servers_response_spec.rb +3 -4
- data/spec/models/address_verify_syntax_only_response_spec.rb +5 -6
- data/spec/models/check_response_spec.rb +2 -3
- data/spec/models/country_details_spec.rb +59 -0
- data/spec/models/country_list_result_spec.rb +47 -0
- data/spec/models/first_name_validation_request_spec.rb +2 -3
- data/spec/models/first_name_validation_response_spec.rb +3 -4
- data/spec/models/full_email_validation_response_spec.rb +10 -11
- data/spec/models/full_name_validation_request_spec.rb +2 -3
- data/spec/models/full_name_validation_response_spec.rb +11 -12
- data/spec/models/geolocate_response_spec.rb +10 -11
- data/spec/models/get_gender_request_spec.rb +3 -4
- data/spec/models/get_gender_response_spec.rb +3 -4
- data/spec/models/get_timezones_request_spec.rb +2 -3
- data/spec/models/get_timezones_response_spec.rb +7 -8
- data/spec/models/last_name_validation_request_spec.rb +2 -3
- data/spec/models/last_name_validation_response_spec.rb +3 -4
- data/spec/models/lead_enrichment_request_spec.rb +15 -16
- data/spec/models/lead_enrichment_response_spec.rb +19 -20
- data/spec/models/parse_address_request_spec.rb +3 -4
- data/spec/models/parse_address_response_spec.rb +10 -11
- data/spec/models/phone_number_validate_request_spec.rb +3 -4
- data/spec/models/phone_number_validation_response_spec.rb +9 -10
- data/spec/models/timezone_spec.rb +4 -5
- data/spec/models/tor_node_response_spec.rb +41 -0
- data/spec/models/user_agent_validate_request_spec.rb +2 -3
- data/spec/models/user_agent_validate_response_spec.rb +15 -16
- data/spec/models/validate_address_request_spec.rb +7 -8
- data/spec/models/validate_address_response_spec.rb +4 -5
- data/spec/models/validate_city_request_spec.rb +59 -0
- data/spec/models/validate_city_response_spec.rb +65 -0
- data/spec/models/validate_country_request_spec.rb +2 -3
- data/spec/models/validate_country_response_spec.rb +13 -8
- data/spec/models/validate_identifier_request_spec.rb +9 -10
- data/spec/models/validate_identifier_response_spec.rb +3 -4
- data/spec/models/validate_postal_code_request_spec.rb +53 -0
- data/spec/models/validate_postal_code_response_spec.rb +65 -0
- data/spec/models/validate_state_request_spec.rb +53 -0
- data/spec/models/validate_state_response_spec.rb +59 -0
- data/spec/models/validate_url_request_full_spec.rb +2 -3
- data/spec/models/validate_url_request_syntax_only_spec.rb +2 -3
- data/spec/models/validate_url_response_full_spec.rb +6 -7
- data/spec/models/validate_url_response_syntax_only_spec.rb +3 -4
- data/spec/models/vat_lookup_request_spec.rb +2 -3
- data/spec/models/vat_lookup_response_spec.rb +13 -14
- data/spec/models/whois_response_spec.rb +16 -17
- data/spec/spec_helper.rb +1 -1
- metadata +29 -2
@@ -6,7 +6,7 @@
|
|
6
6
|
OpenAPI spec version: v1
|
7
7
|
|
8
8
|
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
-
Swagger Codegen version: 2.
|
9
|
+
Swagger Codegen version: 2.4.14
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -42,7 +42,6 @@ module CloudmersiveValidateApiClient
|
|
42
42
|
# Two-letter ISO 3166-1 country code
|
43
43
|
attr_accessor :iso_two_letter_code
|
44
44
|
|
45
|
-
|
46
45
|
# Attribute mapping from ruby-style variable name to JSON key.
|
47
46
|
def self.attribute_map
|
48
47
|
{
|
@@ -79,7 +78,7 @@ module CloudmersiveValidateApiClient
|
|
79
78
|
return unless attributes.is_a?(Hash)
|
80
79
|
|
81
80
|
# convert string to symbol for hash key
|
82
|
-
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
81
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
83
82
|
|
84
83
|
if attributes.has_key?(:'Successful')
|
85
84
|
self.successful = attributes[:'Successful']
|
@@ -116,20 +115,19 @@ module CloudmersiveValidateApiClient
|
|
116
115
|
if attributes.has_key?(:'ISOTwoLetterCode')
|
117
116
|
self.iso_two_letter_code = attributes[:'ISOTwoLetterCode']
|
118
117
|
end
|
119
|
-
|
120
118
|
end
|
121
119
|
|
122
120
|
# Show invalid properties with the reasons. Usually used together with valid?
|
123
121
|
# @return Array for valid properties with the reasons
|
124
122
|
def list_invalid_properties
|
125
123
|
invalid_properties = Array.new
|
126
|
-
|
124
|
+
invalid_properties
|
127
125
|
end
|
128
126
|
|
129
127
|
# Check to see if the all the properties in the model are valid
|
130
128
|
# @return true if the model is valid
|
131
129
|
def valid?
|
132
|
-
|
130
|
+
true
|
133
131
|
end
|
134
132
|
|
135
133
|
# Checks equality by comparing each attribute.
|
@@ -167,10 +165,10 @@ module CloudmersiveValidateApiClient
|
|
167
165
|
return nil unless attributes.is_a?(Hash)
|
168
166
|
self.class.swagger_types.each_pair do |key, type|
|
169
167
|
if type =~ /\AArray<(.*)>/i
|
170
|
-
# check to ensure the input is an array given that the
|
168
|
+
# check to ensure the input is an array given that the attribute
|
171
169
|
# is documented as an array but the input is not
|
172
170
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
173
|
-
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) }
|
171
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
174
172
|
end
|
175
173
|
elsif !attributes[self.class.attribute_map[key]].nil?
|
176
174
|
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
@@ -252,7 +250,7 @@ module CloudmersiveValidateApiClient
|
|
252
250
|
# @return [Hash] Returns the value in the form of hash
|
253
251
|
def _to_hash(value)
|
254
252
|
if value.is_a?(Array)
|
255
|
-
value.compact.map{ |v| _to_hash(v) }
|
253
|
+
value.compact.map { |v| _to_hash(v) }
|
256
254
|
elsif value.is_a?(Hash)
|
257
255
|
{}.tap do |hash|
|
258
256
|
value.each { |k, v| hash[k] = _to_hash(v) }
|
@@ -265,5 +263,4 @@ module CloudmersiveValidateApiClient
|
|
265
263
|
end
|
266
264
|
|
267
265
|
end
|
268
|
-
|
269
266
|
end
|
@@ -6,7 +6,7 @@
|
|
6
6
|
OpenAPI spec version: v1
|
7
7
|
|
8
8
|
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
-
Swagger Codegen version: 2.
|
9
|
+
Swagger Codegen version: 2.4.14
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -21,7 +21,6 @@ module CloudmersiveValidateApiClient
|
|
21
21
|
# Optional, default country code. If left blank, will default to \"US\".
|
22
22
|
attr_accessor :default_country_code
|
23
23
|
|
24
|
-
|
25
24
|
# Attribute mapping from ruby-style variable name to JSON key.
|
26
25
|
def self.attribute_map
|
27
26
|
{
|
@@ -44,7 +43,7 @@ module CloudmersiveValidateApiClient
|
|
44
43
|
return unless attributes.is_a?(Hash)
|
45
44
|
|
46
45
|
# convert string to symbol for hash key
|
47
|
-
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
46
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
48
47
|
|
49
48
|
if attributes.has_key?(:'PhoneNumber')
|
50
49
|
self.phone_number = attributes[:'PhoneNumber']
|
@@ -53,20 +52,19 @@ module CloudmersiveValidateApiClient
|
|
53
52
|
if attributes.has_key?(:'DefaultCountryCode')
|
54
53
|
self.default_country_code = attributes[:'DefaultCountryCode']
|
55
54
|
end
|
56
|
-
|
57
55
|
end
|
58
56
|
|
59
57
|
# Show invalid properties with the reasons. Usually used together with valid?
|
60
58
|
# @return Array for valid properties with the reasons
|
61
59
|
def list_invalid_properties
|
62
60
|
invalid_properties = Array.new
|
63
|
-
|
61
|
+
invalid_properties
|
64
62
|
end
|
65
63
|
|
66
64
|
# Check to see if the all the properties in the model are valid
|
67
65
|
# @return true if the model is valid
|
68
66
|
def valid?
|
69
|
-
|
67
|
+
true
|
70
68
|
end
|
71
69
|
|
72
70
|
# Checks equality by comparing each attribute.
|
@@ -97,10 +95,10 @@ module CloudmersiveValidateApiClient
|
|
97
95
|
return nil unless attributes.is_a?(Hash)
|
98
96
|
self.class.swagger_types.each_pair do |key, type|
|
99
97
|
if type =~ /\AArray<(.*)>/i
|
100
|
-
# check to ensure the input is an array given that the
|
98
|
+
# check to ensure the input is an array given that the attribute
|
101
99
|
# is documented as an array but the input is not
|
102
100
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
103
|
-
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) }
|
101
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
104
102
|
end
|
105
103
|
elsif !attributes[self.class.attribute_map[key]].nil?
|
106
104
|
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
@@ -182,7 +180,7 @@ module CloudmersiveValidateApiClient
|
|
182
180
|
# @return [Hash] Returns the value in the form of hash
|
183
181
|
def _to_hash(value)
|
184
182
|
if value.is_a?(Array)
|
185
|
-
value.compact.map{ |v| _to_hash(v) }
|
183
|
+
value.compact.map { |v| _to_hash(v) }
|
186
184
|
elsif value.is_a?(Hash)
|
187
185
|
{}.tap do |hash|
|
188
186
|
value.each { |k, v| hash[k] = _to_hash(v) }
|
@@ -195,5 +193,4 @@ module CloudmersiveValidateApiClient
|
|
195
193
|
end
|
196
194
|
|
197
195
|
end
|
198
|
-
|
199
196
|
end
|
@@ -6,7 +6,7 @@
|
|
6
6
|
OpenAPI spec version: v1
|
7
7
|
|
8
8
|
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
-
Swagger Codegen version: 2.
|
9
|
+
Swagger Codegen version: 2.4.14
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -39,7 +39,6 @@ module CloudmersiveValidateApiClient
|
|
39
39
|
# User-friendly long name of the country for the phone number
|
40
40
|
attr_accessor :country_name
|
41
41
|
|
42
|
-
|
43
42
|
# Attribute mapping from ruby-style variable name to JSON key.
|
44
43
|
def self.attribute_map
|
45
44
|
{
|
@@ -74,7 +73,7 @@ module CloudmersiveValidateApiClient
|
|
74
73
|
return unless attributes.is_a?(Hash)
|
75
74
|
|
76
75
|
# convert string to symbol for hash key
|
77
|
-
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
76
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
78
77
|
|
79
78
|
if attributes.has_key?(:'IsValid')
|
80
79
|
self.is_valid = attributes[:'IsValid']
|
@@ -107,20 +106,19 @@ module CloudmersiveValidateApiClient
|
|
107
106
|
if attributes.has_key?(:'CountryName')
|
108
107
|
self.country_name = attributes[:'CountryName']
|
109
108
|
end
|
110
|
-
|
111
109
|
end
|
112
110
|
|
113
111
|
# Show invalid properties with the reasons. Usually used together with valid?
|
114
112
|
# @return Array for valid properties with the reasons
|
115
113
|
def list_invalid_properties
|
116
114
|
invalid_properties = Array.new
|
117
|
-
|
115
|
+
invalid_properties
|
118
116
|
end
|
119
117
|
|
120
118
|
# Check to see if the all the properties in the model are valid
|
121
119
|
# @return true if the model is valid
|
122
120
|
def valid?
|
123
|
-
|
121
|
+
true
|
124
122
|
end
|
125
123
|
|
126
124
|
# Checks equality by comparing each attribute.
|
@@ -157,10 +155,10 @@ module CloudmersiveValidateApiClient
|
|
157
155
|
return nil unless attributes.is_a?(Hash)
|
158
156
|
self.class.swagger_types.each_pair do |key, type|
|
159
157
|
if type =~ /\AArray<(.*)>/i
|
160
|
-
# check to ensure the input is an array given that the
|
158
|
+
# check to ensure the input is an array given that the attribute
|
161
159
|
# is documented as an array but the input is not
|
162
160
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
163
|
-
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) }
|
161
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
164
162
|
end
|
165
163
|
elsif !attributes[self.class.attribute_map[key]].nil?
|
166
164
|
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
@@ -242,7 +240,7 @@ module CloudmersiveValidateApiClient
|
|
242
240
|
# @return [Hash] Returns the value in the form of hash
|
243
241
|
def _to_hash(value)
|
244
242
|
if value.is_a?(Array)
|
245
|
-
value.compact.map{ |v| _to_hash(v) }
|
243
|
+
value.compact.map { |v| _to_hash(v) }
|
246
244
|
elsif value.is_a?(Hash)
|
247
245
|
{}.tap do |hash|
|
248
246
|
value.each { |k, v| hash[k] = _to_hash(v) }
|
@@ -255,5 +253,4 @@ module CloudmersiveValidateApiClient
|
|
255
253
|
end
|
256
254
|
|
257
255
|
end
|
258
|
-
|
259
256
|
end
|
@@ -6,7 +6,7 @@
|
|
6
6
|
OpenAPI spec version: v1
|
7
7
|
|
8
8
|
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
-
Swagger Codegen version: 2.
|
9
|
+
Swagger Codegen version: 2.4.14
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -24,7 +24,6 @@ module CloudmersiveValidateApiClient
|
|
24
24
|
# The current time (Now) in this time zone
|
25
25
|
attr_accessor :now
|
26
26
|
|
27
|
-
|
28
27
|
# Attribute mapping from ruby-style variable name to JSON key.
|
29
28
|
def self.attribute_map
|
30
29
|
{
|
@@ -49,7 +48,7 @@ module CloudmersiveValidateApiClient
|
|
49
48
|
return unless attributes.is_a?(Hash)
|
50
49
|
|
51
50
|
# convert string to symbol for hash key
|
52
|
-
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
51
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
53
52
|
|
54
53
|
if attributes.has_key?(:'Name')
|
55
54
|
self.name = attributes[:'Name']
|
@@ -62,20 +61,19 @@ module CloudmersiveValidateApiClient
|
|
62
61
|
if attributes.has_key?(:'Now')
|
63
62
|
self.now = attributes[:'Now']
|
64
63
|
end
|
65
|
-
|
66
64
|
end
|
67
65
|
|
68
66
|
# Show invalid properties with the reasons. Usually used together with valid?
|
69
67
|
# @return Array for valid properties with the reasons
|
70
68
|
def list_invalid_properties
|
71
69
|
invalid_properties = Array.new
|
72
|
-
|
70
|
+
invalid_properties
|
73
71
|
end
|
74
72
|
|
75
73
|
# Check to see if the all the properties in the model are valid
|
76
74
|
# @return true if the model is valid
|
77
75
|
def valid?
|
78
|
-
|
76
|
+
true
|
79
77
|
end
|
80
78
|
|
81
79
|
# Checks equality by comparing each attribute.
|
@@ -107,10 +105,10 @@ module CloudmersiveValidateApiClient
|
|
107
105
|
return nil unless attributes.is_a?(Hash)
|
108
106
|
self.class.swagger_types.each_pair do |key, type|
|
109
107
|
if type =~ /\AArray<(.*)>/i
|
110
|
-
# check to ensure the input is an array given that the
|
108
|
+
# check to ensure the input is an array given that the attribute
|
111
109
|
# is documented as an array but the input is not
|
112
110
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
113
|
-
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) }
|
111
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
114
112
|
end
|
115
113
|
elsif !attributes[self.class.attribute_map[key]].nil?
|
116
114
|
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
@@ -192,7 +190,7 @@ module CloudmersiveValidateApiClient
|
|
192
190
|
# @return [Hash] Returns the value in the form of hash
|
193
191
|
def _to_hash(value)
|
194
192
|
if value.is_a?(Array)
|
195
|
-
value.compact.map{ |v| _to_hash(v) }
|
193
|
+
value.compact.map { |v| _to_hash(v) }
|
196
194
|
elsif value.is_a?(Hash)
|
197
195
|
{}.tap do |hash|
|
198
196
|
value.each { |k, v| hash[k] = _to_hash(v) }
|
@@ -205,5 +203,4 @@ module CloudmersiveValidateApiClient
|
|
205
203
|
end
|
206
204
|
|
207
205
|
end
|
208
|
-
|
209
206
|
end
|
@@ -0,0 +1,186 @@
|
|
1
|
+
=begin
|
2
|
+
#validateapi
|
3
|
+
|
4
|
+
#The validation APIs help you validate data. Check if an E-mail address is real. Check if a domain is real. Check up on an IP address, and even where it is located. All this and much more is available in the validation API.
|
5
|
+
|
6
|
+
OpenAPI spec version: v1
|
7
|
+
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
+
Swagger Codegen version: 2.4.14
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
|
15
|
+
module CloudmersiveValidateApiClient
|
16
|
+
# Result of performing a Tor node check on an IP address
|
17
|
+
class TorNodeResponse
|
18
|
+
# True if the input IP address is a Tor exit node, false otherwise
|
19
|
+
attr_accessor :is_tor_node
|
20
|
+
|
21
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
22
|
+
def self.attribute_map
|
23
|
+
{
|
24
|
+
:'is_tor_node' => :'IsTorNode'
|
25
|
+
}
|
26
|
+
end
|
27
|
+
|
28
|
+
# Attribute type mapping.
|
29
|
+
def self.swagger_types
|
30
|
+
{
|
31
|
+
:'is_tor_node' => :'BOOLEAN'
|
32
|
+
}
|
33
|
+
end
|
34
|
+
|
35
|
+
# Initializes the object
|
36
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
37
|
+
def initialize(attributes = {})
|
38
|
+
return unless attributes.is_a?(Hash)
|
39
|
+
|
40
|
+
# convert string to symbol for hash key
|
41
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
42
|
+
|
43
|
+
if attributes.has_key?(:'IsTorNode')
|
44
|
+
self.is_tor_node = attributes[:'IsTorNode']
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
49
|
+
# @return Array for valid properties with the reasons
|
50
|
+
def list_invalid_properties
|
51
|
+
invalid_properties = Array.new
|
52
|
+
invalid_properties
|
53
|
+
end
|
54
|
+
|
55
|
+
# Check to see if the all the properties in the model are valid
|
56
|
+
# @return true if the model is valid
|
57
|
+
def valid?
|
58
|
+
true
|
59
|
+
end
|
60
|
+
|
61
|
+
# Checks equality by comparing each attribute.
|
62
|
+
# @param [Object] Object to be compared
|
63
|
+
def ==(o)
|
64
|
+
return true if self.equal?(o)
|
65
|
+
self.class == o.class &&
|
66
|
+
is_tor_node == o.is_tor_node
|
67
|
+
end
|
68
|
+
|
69
|
+
# @see the `==` method
|
70
|
+
# @param [Object] Object to be compared
|
71
|
+
def eql?(o)
|
72
|
+
self == o
|
73
|
+
end
|
74
|
+
|
75
|
+
# Calculates hash code according to all attributes.
|
76
|
+
# @return [Fixnum] Hash code
|
77
|
+
def hash
|
78
|
+
[is_tor_node].hash
|
79
|
+
end
|
80
|
+
|
81
|
+
# Builds the object from hash
|
82
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
83
|
+
# @return [Object] Returns the model itself
|
84
|
+
def build_from_hash(attributes)
|
85
|
+
return nil unless attributes.is_a?(Hash)
|
86
|
+
self.class.swagger_types.each_pair do |key, type|
|
87
|
+
if type =~ /\AArray<(.*)>/i
|
88
|
+
# check to ensure the input is an array given that the attribute
|
89
|
+
# is documented as an array but the input is not
|
90
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
91
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
92
|
+
end
|
93
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
94
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
95
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
96
|
+
end
|
97
|
+
|
98
|
+
self
|
99
|
+
end
|
100
|
+
|
101
|
+
# Deserializes the data based on type
|
102
|
+
# @param string type Data type
|
103
|
+
# @param string value Value to be deserialized
|
104
|
+
# @return [Object] Deserialized data
|
105
|
+
def _deserialize(type, value)
|
106
|
+
case type.to_sym
|
107
|
+
when :DateTime
|
108
|
+
DateTime.parse(value)
|
109
|
+
when :Date
|
110
|
+
Date.parse(value)
|
111
|
+
when :String
|
112
|
+
value.to_s
|
113
|
+
when :Integer
|
114
|
+
value.to_i
|
115
|
+
when :Float
|
116
|
+
value.to_f
|
117
|
+
when :BOOLEAN
|
118
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
119
|
+
true
|
120
|
+
else
|
121
|
+
false
|
122
|
+
end
|
123
|
+
when :Object
|
124
|
+
# generic object (usually a Hash), return directly
|
125
|
+
value
|
126
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
127
|
+
inner_type = Regexp.last_match[:inner_type]
|
128
|
+
value.map { |v| _deserialize(inner_type, v) }
|
129
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
130
|
+
k_type = Regexp.last_match[:k_type]
|
131
|
+
v_type = Regexp.last_match[:v_type]
|
132
|
+
{}.tap do |hash|
|
133
|
+
value.each do |k, v|
|
134
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
135
|
+
end
|
136
|
+
end
|
137
|
+
else # model
|
138
|
+
temp_model = CloudmersiveValidateApiClient.const_get(type).new
|
139
|
+
temp_model.build_from_hash(value)
|
140
|
+
end
|
141
|
+
end
|
142
|
+
|
143
|
+
# Returns the string representation of the object
|
144
|
+
# @return [String] String presentation of the object
|
145
|
+
def to_s
|
146
|
+
to_hash.to_s
|
147
|
+
end
|
148
|
+
|
149
|
+
# to_body is an alias to to_hash (backward compatibility)
|
150
|
+
# @return [Hash] Returns the object in the form of hash
|
151
|
+
def to_body
|
152
|
+
to_hash
|
153
|
+
end
|
154
|
+
|
155
|
+
# Returns the object in the form of hash
|
156
|
+
# @return [Hash] Returns the object in the form of hash
|
157
|
+
def to_hash
|
158
|
+
hash = {}
|
159
|
+
self.class.attribute_map.each_pair do |attr, param|
|
160
|
+
value = self.send(attr)
|
161
|
+
next if value.nil?
|
162
|
+
hash[param] = _to_hash(value)
|
163
|
+
end
|
164
|
+
hash
|
165
|
+
end
|
166
|
+
|
167
|
+
# Outputs non-array value in the form of hash
|
168
|
+
# For object, use to_hash. Otherwise, just return the value
|
169
|
+
# @param [Object] value Any valid value
|
170
|
+
# @return [Hash] Returns the value in the form of hash
|
171
|
+
def _to_hash(value)
|
172
|
+
if value.is_a?(Array)
|
173
|
+
value.compact.map { |v| _to_hash(v) }
|
174
|
+
elsif value.is_a?(Hash)
|
175
|
+
{}.tap do |hash|
|
176
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
177
|
+
end
|
178
|
+
elsif value.respond_to? :to_hash
|
179
|
+
value.to_hash
|
180
|
+
else
|
181
|
+
value
|
182
|
+
end
|
183
|
+
end
|
184
|
+
|
185
|
+
end
|
186
|
+
end
|