cloudmersive-validate-api-client 1.4.1 → 2.0.4
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 +24 -8
- data/cloudmersive-validate-api-client.gemspec +3 -3
- data/docs/AddressApi.md +325 -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 +1 -1
- data/docs/ValidateAddressRequest.md +13 -0
- data/docs/ValidateAddressResponse.md +10 -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/docs/VatApi.md +4 -4
- data/lib/cloudmersive-validate-api-client.rb +11 -1
- data/lib/cloudmersive-validate-api-client/api/address_api.rb +327 -14
- 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 +5 -6
- 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 +9 -10
- 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/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 +236 -0
- data/lib/cloudmersive-validate-api-client/models/validate_address_response.rb +206 -0
- 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 +76 -5
- 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 +2 -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 +4 -4
- 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/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 +71 -0
- data/spec/models/validate_address_response_spec.rb +53 -0
- 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 +32 -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
|
|
@@ -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
|
|
|
@@ -18,7 +18,6 @@ module CloudmersiveValidateApiClient
|
|
|
18
18
|
# The user agent string you wish to parse and validate
|
|
19
19
|
attr_accessor :user_agent_string
|
|
20
20
|
|
|
21
|
-
|
|
22
21
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
23
22
|
def self.attribute_map
|
|
24
23
|
{
|
|
@@ -39,25 +38,24 @@ module CloudmersiveValidateApiClient
|
|
|
39
38
|
return unless attributes.is_a?(Hash)
|
|
40
39
|
|
|
41
40
|
# convert string to symbol for hash key
|
|
42
|
-
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
|
41
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
|
43
42
|
|
|
44
43
|
if attributes.has_key?(:'UserAgentString')
|
|
45
44
|
self.user_agent_string = attributes[:'UserAgentString']
|
|
46
45
|
end
|
|
47
|
-
|
|
48
46
|
end
|
|
49
47
|
|
|
50
48
|
# Show invalid properties with the reasons. Usually used together with valid?
|
|
51
49
|
# @return Array for valid properties with the reasons
|
|
52
50
|
def list_invalid_properties
|
|
53
51
|
invalid_properties = Array.new
|
|
54
|
-
|
|
52
|
+
invalid_properties
|
|
55
53
|
end
|
|
56
54
|
|
|
57
55
|
# Check to see if the all the properties in the model are valid
|
|
58
56
|
# @return true if the model is valid
|
|
59
57
|
def valid?
|
|
60
|
-
|
|
58
|
+
true
|
|
61
59
|
end
|
|
62
60
|
|
|
63
61
|
# Checks equality by comparing each attribute.
|
|
@@ -87,10 +85,10 @@ module CloudmersiveValidateApiClient
|
|
|
87
85
|
return nil unless attributes.is_a?(Hash)
|
|
88
86
|
self.class.swagger_types.each_pair do |key, type|
|
|
89
87
|
if type =~ /\AArray<(.*)>/i
|
|
90
|
-
# check to ensure the input is an array given that the
|
|
88
|
+
# check to ensure the input is an array given that the attribute
|
|
91
89
|
# is documented as an array but the input is not
|
|
92
90
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
|
93
|
-
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) }
|
|
91
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
|
94
92
|
end
|
|
95
93
|
elsif !attributes[self.class.attribute_map[key]].nil?
|
|
96
94
|
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
|
@@ -172,7 +170,7 @@ module CloudmersiveValidateApiClient
|
|
|
172
170
|
# @return [Hash] Returns the value in the form of hash
|
|
173
171
|
def _to_hash(value)
|
|
174
172
|
if value.is_a?(Array)
|
|
175
|
-
value.compact.map{ |v| _to_hash(v) }
|
|
173
|
+
value.compact.map { |v| _to_hash(v) }
|
|
176
174
|
elsif value.is_a?(Hash)
|
|
177
175
|
{}.tap do |hash|
|
|
178
176
|
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
@@ -185,5 +183,4 @@ module CloudmersiveValidateApiClient
|
|
|
185
183
|
end
|
|
186
184
|
|
|
187
185
|
end
|
|
188
|
-
|
|
189
186
|
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
|
|
|
@@ -57,7 +57,6 @@ module CloudmersiveValidateApiClient
|
|
|
57
57
|
# Version of the Browser Engine
|
|
58
58
|
attr_accessor :browser_engine_version
|
|
59
59
|
|
|
60
|
-
|
|
61
60
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
62
61
|
def self.attribute_map
|
|
63
62
|
{
|
|
@@ -104,7 +103,7 @@ module CloudmersiveValidateApiClient
|
|
|
104
103
|
return unless attributes.is_a?(Hash)
|
|
105
104
|
|
|
106
105
|
# convert string to symbol for hash key
|
|
107
|
-
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
|
106
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
|
108
107
|
|
|
109
108
|
if attributes.has_key?(:'Successful')
|
|
110
109
|
self.successful = attributes[:'Successful']
|
|
@@ -161,20 +160,19 @@ module CloudmersiveValidateApiClient
|
|
|
161
160
|
if attributes.has_key?(:'BrowserEngineVersion')
|
|
162
161
|
self.browser_engine_version = attributes[:'BrowserEngineVersion']
|
|
163
162
|
end
|
|
164
|
-
|
|
165
163
|
end
|
|
166
164
|
|
|
167
165
|
# Show invalid properties with the reasons. Usually used together with valid?
|
|
168
166
|
# @return Array for valid properties with the reasons
|
|
169
167
|
def list_invalid_properties
|
|
170
168
|
invalid_properties = Array.new
|
|
171
|
-
|
|
169
|
+
invalid_properties
|
|
172
170
|
end
|
|
173
171
|
|
|
174
172
|
# Check to see if the all the properties in the model are valid
|
|
175
173
|
# @return true if the model is valid
|
|
176
174
|
def valid?
|
|
177
|
-
|
|
175
|
+
true
|
|
178
176
|
end
|
|
179
177
|
|
|
180
178
|
# Checks equality by comparing each attribute.
|
|
@@ -217,10 +215,10 @@ module CloudmersiveValidateApiClient
|
|
|
217
215
|
return nil unless attributes.is_a?(Hash)
|
|
218
216
|
self.class.swagger_types.each_pair do |key, type|
|
|
219
217
|
if type =~ /\AArray<(.*)>/i
|
|
220
|
-
# check to ensure the input is an array given that the
|
|
218
|
+
# check to ensure the input is an array given that the attribute
|
|
221
219
|
# is documented as an array but the input is not
|
|
222
220
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
|
223
|
-
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) }
|
|
221
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
|
224
222
|
end
|
|
225
223
|
elsif !attributes[self.class.attribute_map[key]].nil?
|
|
226
224
|
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
|
@@ -302,7 +300,7 @@ module CloudmersiveValidateApiClient
|
|
|
302
300
|
# @return [Hash] Returns the value in the form of hash
|
|
303
301
|
def _to_hash(value)
|
|
304
302
|
if value.is_a?(Array)
|
|
305
|
-
value.compact.map{ |v| _to_hash(v) }
|
|
303
|
+
value.compact.map { |v| _to_hash(v) }
|
|
306
304
|
elsif value.is_a?(Hash)
|
|
307
305
|
{}.tap do |hash|
|
|
308
306
|
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
@@ -315,5 +313,4 @@ module CloudmersiveValidateApiClient
|
|
|
315
313
|
end
|
|
316
314
|
|
|
317
315
|
end
|
|
318
|
-
|
|
319
316
|
end
|
|
@@ -0,0 +1,236 @@
|
|
|
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
|
+
# Request to Validate a Street Address
|
|
17
|
+
class ValidateAddressRequest
|
|
18
|
+
# Required; Street address to validate, such as '2950 Buskirk Ave.'
|
|
19
|
+
attr_accessor :street_address
|
|
20
|
+
|
|
21
|
+
# Required; City part of the addrerss to validate, such as 'Walnut Creek'
|
|
22
|
+
attr_accessor :city
|
|
23
|
+
|
|
24
|
+
# Required; State or province of the address to validate, such as 'CA' or 'California'
|
|
25
|
+
attr_accessor :state_or_province
|
|
26
|
+
|
|
27
|
+
# Optional (recommended); Zip code or postal code of the address to validate, such as '94597'
|
|
28
|
+
attr_accessor :postal_code
|
|
29
|
+
|
|
30
|
+
# Optional (recommended); Name of the country, such as 'United States'. If left blank, and CountryCode is also left blank, will default to United States. Global countries are supported.
|
|
31
|
+
attr_accessor :country_full_name
|
|
32
|
+
|
|
33
|
+
# Optional; two-letter country code (Two-letter ISO 3166-1 country code) of the country. If left blank, and CountryFullName is also left blank, will default to United States. Global countries are supported.
|
|
34
|
+
attr_accessor :country_code
|
|
35
|
+
|
|
36
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
37
|
+
def self.attribute_map
|
|
38
|
+
{
|
|
39
|
+
:'street_address' => :'StreetAddress',
|
|
40
|
+
:'city' => :'City',
|
|
41
|
+
:'state_or_province' => :'StateOrProvince',
|
|
42
|
+
:'postal_code' => :'PostalCode',
|
|
43
|
+
:'country_full_name' => :'CountryFullName',
|
|
44
|
+
:'country_code' => :'CountryCode'
|
|
45
|
+
}
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
# Attribute type mapping.
|
|
49
|
+
def self.swagger_types
|
|
50
|
+
{
|
|
51
|
+
:'street_address' => :'String',
|
|
52
|
+
:'city' => :'String',
|
|
53
|
+
:'state_or_province' => :'String',
|
|
54
|
+
:'postal_code' => :'String',
|
|
55
|
+
:'country_full_name' => :'String',
|
|
56
|
+
:'country_code' => :'String'
|
|
57
|
+
}
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
# Initializes the object
|
|
61
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
62
|
+
def initialize(attributes = {})
|
|
63
|
+
return unless attributes.is_a?(Hash)
|
|
64
|
+
|
|
65
|
+
# convert string to symbol for hash key
|
|
66
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
|
67
|
+
|
|
68
|
+
if attributes.has_key?(:'StreetAddress')
|
|
69
|
+
self.street_address = attributes[:'StreetAddress']
|
|
70
|
+
end
|
|
71
|
+
|
|
72
|
+
if attributes.has_key?(:'City')
|
|
73
|
+
self.city = attributes[:'City']
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
if attributes.has_key?(:'StateOrProvince')
|
|
77
|
+
self.state_or_province = attributes[:'StateOrProvince']
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
if attributes.has_key?(:'PostalCode')
|
|
81
|
+
self.postal_code = attributes[:'PostalCode']
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
if attributes.has_key?(:'CountryFullName')
|
|
85
|
+
self.country_full_name = attributes[:'CountryFullName']
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
if attributes.has_key?(:'CountryCode')
|
|
89
|
+
self.country_code = attributes[:'CountryCode']
|
|
90
|
+
end
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
94
|
+
# @return Array for valid properties with the reasons
|
|
95
|
+
def list_invalid_properties
|
|
96
|
+
invalid_properties = Array.new
|
|
97
|
+
invalid_properties
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
# Check to see if the all the properties in the model are valid
|
|
101
|
+
# @return true if the model is valid
|
|
102
|
+
def valid?
|
|
103
|
+
true
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
# Checks equality by comparing each attribute.
|
|
107
|
+
# @param [Object] Object to be compared
|
|
108
|
+
def ==(o)
|
|
109
|
+
return true if self.equal?(o)
|
|
110
|
+
self.class == o.class &&
|
|
111
|
+
street_address == o.street_address &&
|
|
112
|
+
city == o.city &&
|
|
113
|
+
state_or_province == o.state_or_province &&
|
|
114
|
+
postal_code == o.postal_code &&
|
|
115
|
+
country_full_name == o.country_full_name &&
|
|
116
|
+
country_code == o.country_code
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
# @see the `==` method
|
|
120
|
+
# @param [Object] Object to be compared
|
|
121
|
+
def eql?(o)
|
|
122
|
+
self == o
|
|
123
|
+
end
|
|
124
|
+
|
|
125
|
+
# Calculates hash code according to all attributes.
|
|
126
|
+
# @return [Fixnum] Hash code
|
|
127
|
+
def hash
|
|
128
|
+
[street_address, city, state_or_province, postal_code, country_full_name, country_code].hash
|
|
129
|
+
end
|
|
130
|
+
|
|
131
|
+
# Builds the object from hash
|
|
132
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
133
|
+
# @return [Object] Returns the model itself
|
|
134
|
+
def build_from_hash(attributes)
|
|
135
|
+
return nil unless attributes.is_a?(Hash)
|
|
136
|
+
self.class.swagger_types.each_pair do |key, type|
|
|
137
|
+
if type =~ /\AArray<(.*)>/i
|
|
138
|
+
# check to ensure the input is an array given that the attribute
|
|
139
|
+
# is documented as an array but the input is not
|
|
140
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
|
141
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
|
142
|
+
end
|
|
143
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
|
144
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
|
145
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
|
146
|
+
end
|
|
147
|
+
|
|
148
|
+
self
|
|
149
|
+
end
|
|
150
|
+
|
|
151
|
+
# Deserializes the data based on type
|
|
152
|
+
# @param string type Data type
|
|
153
|
+
# @param string value Value to be deserialized
|
|
154
|
+
# @return [Object] Deserialized data
|
|
155
|
+
def _deserialize(type, value)
|
|
156
|
+
case type.to_sym
|
|
157
|
+
when :DateTime
|
|
158
|
+
DateTime.parse(value)
|
|
159
|
+
when :Date
|
|
160
|
+
Date.parse(value)
|
|
161
|
+
when :String
|
|
162
|
+
value.to_s
|
|
163
|
+
when :Integer
|
|
164
|
+
value.to_i
|
|
165
|
+
when :Float
|
|
166
|
+
value.to_f
|
|
167
|
+
when :BOOLEAN
|
|
168
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
169
|
+
true
|
|
170
|
+
else
|
|
171
|
+
false
|
|
172
|
+
end
|
|
173
|
+
when :Object
|
|
174
|
+
# generic object (usually a Hash), return directly
|
|
175
|
+
value
|
|
176
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
177
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
178
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
179
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
180
|
+
k_type = Regexp.last_match[:k_type]
|
|
181
|
+
v_type = Regexp.last_match[:v_type]
|
|
182
|
+
{}.tap do |hash|
|
|
183
|
+
value.each do |k, v|
|
|
184
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
185
|
+
end
|
|
186
|
+
end
|
|
187
|
+
else # model
|
|
188
|
+
temp_model = CloudmersiveValidateApiClient.const_get(type).new
|
|
189
|
+
temp_model.build_from_hash(value)
|
|
190
|
+
end
|
|
191
|
+
end
|
|
192
|
+
|
|
193
|
+
# Returns the string representation of the object
|
|
194
|
+
# @return [String] String presentation of the object
|
|
195
|
+
def to_s
|
|
196
|
+
to_hash.to_s
|
|
197
|
+
end
|
|
198
|
+
|
|
199
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
200
|
+
# @return [Hash] Returns the object in the form of hash
|
|
201
|
+
def to_body
|
|
202
|
+
to_hash
|
|
203
|
+
end
|
|
204
|
+
|
|
205
|
+
# Returns the object in the form of hash
|
|
206
|
+
# @return [Hash] Returns the object in the form of hash
|
|
207
|
+
def to_hash
|
|
208
|
+
hash = {}
|
|
209
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
210
|
+
value = self.send(attr)
|
|
211
|
+
next if value.nil?
|
|
212
|
+
hash[param] = _to_hash(value)
|
|
213
|
+
end
|
|
214
|
+
hash
|
|
215
|
+
end
|
|
216
|
+
|
|
217
|
+
# Outputs non-array value in the form of hash
|
|
218
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
219
|
+
# @param [Object] value Any valid value
|
|
220
|
+
# @return [Hash] Returns the value in the form of hash
|
|
221
|
+
def _to_hash(value)
|
|
222
|
+
if value.is_a?(Array)
|
|
223
|
+
value.compact.map { |v| _to_hash(v) }
|
|
224
|
+
elsif value.is_a?(Hash)
|
|
225
|
+
{}.tap do |hash|
|
|
226
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
227
|
+
end
|
|
228
|
+
elsif value.respond_to? :to_hash
|
|
229
|
+
value.to_hash
|
|
230
|
+
else
|
|
231
|
+
value
|
|
232
|
+
end
|
|
233
|
+
end
|
|
234
|
+
|
|
235
|
+
end
|
|
236
|
+
end
|