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.
Files changed (137) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +1 -1
  3. data/README.md +22 -7
  4. data/cloudmersive-validate-api-client.gemspec +3 -3
  5. data/docs/AddressApi.md +270 -1
  6. data/docs/CountryDetails.md +11 -0
  7. data/docs/CountryListResult.md +9 -0
  8. data/docs/DomainApi.md +2 -2
  9. data/docs/EmailApi.md +3 -3
  10. data/docs/IPAddressApi.md +56 -1
  11. data/docs/TorNodeResponse.md +8 -0
  12. data/docs/ValidateCityRequest.md +11 -0
  13. data/docs/ValidateCityResponse.md +12 -0
  14. data/docs/ValidateCountryResponse.md +1 -0
  15. data/docs/ValidatePostalCodeRequest.md +10 -0
  16. data/docs/ValidatePostalCodeResponse.md +12 -0
  17. data/docs/ValidateStateRequest.md +10 -0
  18. data/docs/ValidateStateResponse.md +11 -0
  19. data/lib/cloudmersive-validate-api-client.rb +10 -1
  20. data/lib/cloudmersive-validate-api-client/api/address_api.rb +276 -18
  21. data/lib/cloudmersive-validate-api-client/api/domain_api.rb +14 -18
  22. data/lib/cloudmersive-validate-api-client/api/email_api.rb +11 -14
  23. data/lib/cloudmersive-validate-api-client/api/ip_address_api.rb +58 -5
  24. data/lib/cloudmersive-validate-api-client/api/lead_enrichment_api.rb +5 -8
  25. data/lib/cloudmersive-validate-api-client/api/name_api.rb +17 -22
  26. data/lib/cloudmersive-validate-api-client/api/phone_number_api.rb +5 -6
  27. data/lib/cloudmersive-validate-api-client/api/user_agent_api.rb +5 -6
  28. data/lib/cloudmersive-validate-api-client/api/vat_api.rb +5 -6
  29. data/lib/cloudmersive-validate-api-client/api_client.rb +11 -9
  30. data/lib/cloudmersive-validate-api-client/api_error.rb +1 -1
  31. data/lib/cloudmersive-validate-api-client/configuration.rb +2 -2
  32. data/lib/cloudmersive-validate-api-client/models/address_get_servers_response.rb +7 -10
  33. data/lib/cloudmersive-validate-api-client/models/address_verify_syntax_only_response.rb +7 -10
  34. data/lib/cloudmersive-validate-api-client/models/check_response.rb +7 -10
  35. data/lib/cloudmersive-validate-api-client/models/country_details.rb +216 -0
  36. data/lib/cloudmersive-validate-api-client/models/country_list_result.rb +198 -0
  37. data/lib/cloudmersive-validate-api-client/models/first_name_validation_request.rb +7 -10
  38. data/lib/cloudmersive-validate-api-client/models/first_name_validation_response.rb +7 -10
  39. data/lib/cloudmersive-validate-api-client/models/full_email_validation_response.rb +7 -10
  40. data/lib/cloudmersive-validate-api-client/models/full_name_validation_request.rb +7 -10
  41. data/lib/cloudmersive-validate-api-client/models/full_name_validation_response.rb +7 -10
  42. data/lib/cloudmersive-validate-api-client/models/geolocate_response.rb +7 -10
  43. data/lib/cloudmersive-validate-api-client/models/get_gender_request.rb +7 -10
  44. data/lib/cloudmersive-validate-api-client/models/get_gender_response.rb +7 -10
  45. data/lib/cloudmersive-validate-api-client/models/get_timezones_request.rb +7 -10
  46. data/lib/cloudmersive-validate-api-client/models/get_timezones_response.rb +7 -10
  47. data/lib/cloudmersive-validate-api-client/models/last_name_validation_request.rb +7 -10
  48. data/lib/cloudmersive-validate-api-client/models/last_name_validation_response.rb +7 -10
  49. data/lib/cloudmersive-validate-api-client/models/lead_enrichment_request.rb +7 -10
  50. data/lib/cloudmersive-validate-api-client/models/lead_enrichment_response.rb +7 -10
  51. data/lib/cloudmersive-validate-api-client/models/parse_address_request.rb +7 -10
  52. data/lib/cloudmersive-validate-api-client/models/parse_address_response.rb +7 -10
  53. data/lib/cloudmersive-validate-api-client/models/phone_number_validate_request.rb +7 -10
  54. data/lib/cloudmersive-validate-api-client/models/phone_number_validation_response.rb +7 -10
  55. data/lib/cloudmersive-validate-api-client/models/timezone.rb +7 -10
  56. data/lib/cloudmersive-validate-api-client/models/tor_node_response.rb +186 -0
  57. data/lib/cloudmersive-validate-api-client/models/user_agent_validate_request.rb +7 -10
  58. data/lib/cloudmersive-validate-api-client/models/user_agent_validate_response.rb +7 -10
  59. data/lib/cloudmersive-validate-api-client/models/validate_address_request.rb +7 -10
  60. data/lib/cloudmersive-validate-api-client/models/validate_address_response.rb +7 -10
  61. data/lib/cloudmersive-validate-api-client/models/validate_city_request.rb +216 -0
  62. data/lib/cloudmersive-validate-api-client/models/validate_city_response.rb +226 -0
  63. data/lib/cloudmersive-validate-api-client/models/validate_country_request.rb +7 -10
  64. data/lib/cloudmersive-validate-api-client/models/validate_country_response.rb +18 -11
  65. data/lib/cloudmersive-validate-api-client/models/validate_identifier_request.rb +7 -10
  66. data/lib/cloudmersive-validate-api-client/models/validate_identifier_response.rb +7 -10
  67. data/lib/cloudmersive-validate-api-client/models/validate_postal_code_request.rb +206 -0
  68. data/lib/cloudmersive-validate-api-client/models/validate_postal_code_response.rb +226 -0
  69. data/lib/cloudmersive-validate-api-client/models/validate_state_request.rb +206 -0
  70. data/lib/cloudmersive-validate-api-client/models/validate_state_response.rb +216 -0
  71. data/lib/cloudmersive-validate-api-client/models/validate_url_request_full.rb +7 -10
  72. data/lib/cloudmersive-validate-api-client/models/validate_url_request_syntax_only.rb +7 -10
  73. data/lib/cloudmersive-validate-api-client/models/validate_url_response_full.rb +7 -10
  74. data/lib/cloudmersive-validate-api-client/models/validate_url_response_syntax_only.rb +7 -10
  75. data/lib/cloudmersive-validate-api-client/models/vat_lookup_request.rb +7 -10
  76. data/lib/cloudmersive-validate-api-client/models/vat_lookup_response.rb +7 -11
  77. data/lib/cloudmersive-validate-api-client/models/whois_response.rb +7 -10
  78. data/lib/cloudmersive-validate-api-client/version.rb +2 -2
  79. data/spec/api/address_api_spec.rb +65 -6
  80. data/spec/api/domain_api_spec.rb +5 -5
  81. data/spec/api/email_api_spec.rb +4 -4
  82. data/spec/api/ip_address_api_spec.rb +14 -2
  83. data/spec/api/lead_enrichment_api_spec.rb +2 -3
  84. data/spec/api/name_api_spec.rb +6 -6
  85. data/spec/api/phone_number_api_spec.rb +2 -2
  86. data/spec/api/user_agent_api_spec.rb +2 -2
  87. data/spec/api/vat_api_spec.rb +2 -2
  88. data/spec/api_client_spec.rb +52 -35
  89. data/spec/configuration_spec.rb +9 -9
  90. data/spec/models/address_get_servers_response_spec.rb +3 -4
  91. data/spec/models/address_verify_syntax_only_response_spec.rb +5 -6
  92. data/spec/models/check_response_spec.rb +2 -3
  93. data/spec/models/country_details_spec.rb +59 -0
  94. data/spec/models/country_list_result_spec.rb +47 -0
  95. data/spec/models/first_name_validation_request_spec.rb +2 -3
  96. data/spec/models/first_name_validation_response_spec.rb +3 -4
  97. data/spec/models/full_email_validation_response_spec.rb +10 -11
  98. data/spec/models/full_name_validation_request_spec.rb +2 -3
  99. data/spec/models/full_name_validation_response_spec.rb +11 -12
  100. data/spec/models/geolocate_response_spec.rb +10 -11
  101. data/spec/models/get_gender_request_spec.rb +3 -4
  102. data/spec/models/get_gender_response_spec.rb +3 -4
  103. data/spec/models/get_timezones_request_spec.rb +2 -3
  104. data/spec/models/get_timezones_response_spec.rb +7 -8
  105. data/spec/models/last_name_validation_request_spec.rb +2 -3
  106. data/spec/models/last_name_validation_response_spec.rb +3 -4
  107. data/spec/models/lead_enrichment_request_spec.rb +15 -16
  108. data/spec/models/lead_enrichment_response_spec.rb +19 -20
  109. data/spec/models/parse_address_request_spec.rb +3 -4
  110. data/spec/models/parse_address_response_spec.rb +10 -11
  111. data/spec/models/phone_number_validate_request_spec.rb +3 -4
  112. data/spec/models/phone_number_validation_response_spec.rb +9 -10
  113. data/spec/models/timezone_spec.rb +4 -5
  114. data/spec/models/tor_node_response_spec.rb +41 -0
  115. data/spec/models/user_agent_validate_request_spec.rb +2 -3
  116. data/spec/models/user_agent_validate_response_spec.rb +15 -16
  117. data/spec/models/validate_address_request_spec.rb +7 -8
  118. data/spec/models/validate_address_response_spec.rb +4 -5
  119. data/spec/models/validate_city_request_spec.rb +59 -0
  120. data/spec/models/validate_city_response_spec.rb +65 -0
  121. data/spec/models/validate_country_request_spec.rb +2 -3
  122. data/spec/models/validate_country_response_spec.rb +13 -8
  123. data/spec/models/validate_identifier_request_spec.rb +9 -10
  124. data/spec/models/validate_identifier_response_spec.rb +3 -4
  125. data/spec/models/validate_postal_code_request_spec.rb +53 -0
  126. data/spec/models/validate_postal_code_response_spec.rb +65 -0
  127. data/spec/models/validate_state_request_spec.rb +53 -0
  128. data/spec/models/validate_state_response_spec.rb +59 -0
  129. data/spec/models/validate_url_request_full_spec.rb +2 -3
  130. data/spec/models/validate_url_request_syntax_only_spec.rb +2 -3
  131. data/spec/models/validate_url_response_full_spec.rb +6 -7
  132. data/spec/models/validate_url_response_syntax_only_spec.rb +3 -4
  133. data/spec/models/vat_lookup_request_spec.rb +2 -3
  134. data/spec/models/vat_lookup_response_spec.rb +13 -14
  135. data/spec/models/whois_response_spec.rb +16 -17
  136. data/spec/spec_helper.rb +1 -1
  137. 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.3.1
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
- return invalid_properties
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
- return true
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 the attribute
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.3.1
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
- return invalid_properties
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
- return true
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 the attribute
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
@@ -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.3.1
9
+ Swagger Codegen version: 2.4.14
10
10
 
11
11
  =end
12
12
 
@@ -33,7 +33,6 @@ module CloudmersiveValidateApiClient
33
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
34
  attr_accessor :country_code
35
35
 
36
-
37
36
  # Attribute mapping from ruby-style variable name to JSON key.
38
37
  def self.attribute_map
39
38
  {
@@ -64,7 +63,7 @@ module CloudmersiveValidateApiClient
64
63
  return unless attributes.is_a?(Hash)
65
64
 
66
65
  # convert string to symbol for hash key
67
- attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
66
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
68
67
 
69
68
  if attributes.has_key?(:'StreetAddress')
70
69
  self.street_address = attributes[:'StreetAddress']
@@ -89,20 +88,19 @@ module CloudmersiveValidateApiClient
89
88
  if attributes.has_key?(:'CountryCode')
90
89
  self.country_code = attributes[:'CountryCode']
91
90
  end
92
-
93
91
  end
94
92
 
95
93
  # Show invalid properties with the reasons. Usually used together with valid?
96
94
  # @return Array for valid properties with the reasons
97
95
  def list_invalid_properties
98
96
  invalid_properties = Array.new
99
- return invalid_properties
97
+ invalid_properties
100
98
  end
101
99
 
102
100
  # Check to see if the all the properties in the model are valid
103
101
  # @return true if the model is valid
104
102
  def valid?
105
- return true
103
+ true
106
104
  end
107
105
 
108
106
  # Checks equality by comparing each attribute.
@@ -137,10 +135,10 @@ module CloudmersiveValidateApiClient
137
135
  return nil unless attributes.is_a?(Hash)
138
136
  self.class.swagger_types.each_pair do |key, type|
139
137
  if type =~ /\AArray<(.*)>/i
140
- # check to ensure the input is an array given that the the attribute
138
+ # check to ensure the input is an array given that the attribute
141
139
  # is documented as an array but the input is not
142
140
  if attributes[self.class.attribute_map[key]].is_a?(Array)
143
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
141
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
144
142
  end
145
143
  elsif !attributes[self.class.attribute_map[key]].nil?
146
144
  self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
@@ -222,7 +220,7 @@ module CloudmersiveValidateApiClient
222
220
  # @return [Hash] Returns the value in the form of hash
223
221
  def _to_hash(value)
224
222
  if value.is_a?(Array)
225
- value.compact.map{ |v| _to_hash(v) }
223
+ value.compact.map { |v| _to_hash(v) }
226
224
  elsif value.is_a?(Hash)
227
225
  {}.tap do |hash|
228
226
  value.each { |k, v| hash[k] = _to_hash(v) }
@@ -235,5 +233,4 @@ module CloudmersiveValidateApiClient
235
233
  end
236
234
 
237
235
  end
238
-
239
236
  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.3.1
9
+ Swagger Codegen version: 2.4.14
10
10
 
11
11
  =end
12
12
 
@@ -24,7 +24,6 @@ module CloudmersiveValidateApiClient
24
24
  # If the address is valid, the degrees longitude of the validated address, null otherwise
25
25
  attr_accessor :longitude
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?(:'ValidAddress')
55
54
  self.valid_address = attributes[:'ValidAddress']
@@ -62,20 +61,19 @@ module CloudmersiveValidateApiClient
62
61
  if attributes.has_key?(:'Longitude')
63
62
  self.longitude = attributes[:'Longitude']
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
- return invalid_properties
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
- return true
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 the attribute
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,216 @@
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 City and State or Province in a country
17
+ class ValidateCityRequest
18
+ # Required: City of the address to validate, such as 'San Francisco' or 'London'
19
+ attr_accessor :city
20
+
21
+ # Required: State or province of the address to validate, such as 'California' or 'CA'
22
+ attr_accessor :state_or_province
23
+
24
+ # 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.
25
+ attr_accessor :country_full_name
26
+
27
+ # 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.
28
+ attr_accessor :country_code
29
+
30
+ # Attribute mapping from ruby-style variable name to JSON key.
31
+ def self.attribute_map
32
+ {
33
+ :'city' => :'City',
34
+ :'state_or_province' => :'StateOrProvince',
35
+ :'country_full_name' => :'CountryFullName',
36
+ :'country_code' => :'CountryCode'
37
+ }
38
+ end
39
+
40
+ # Attribute type mapping.
41
+ def self.swagger_types
42
+ {
43
+ :'city' => :'String',
44
+ :'state_or_province' => :'String',
45
+ :'country_full_name' => :'String',
46
+ :'country_code' => :'String'
47
+ }
48
+ end
49
+
50
+ # Initializes the object
51
+ # @param [Hash] attributes Model attributes in the form of hash
52
+ def initialize(attributes = {})
53
+ return unless attributes.is_a?(Hash)
54
+
55
+ # convert string to symbol for hash key
56
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
57
+
58
+ if attributes.has_key?(:'City')
59
+ self.city = attributes[:'City']
60
+ end
61
+
62
+ if attributes.has_key?(:'StateOrProvince')
63
+ self.state_or_province = attributes[:'StateOrProvince']
64
+ end
65
+
66
+ if attributes.has_key?(:'CountryFullName')
67
+ self.country_full_name = attributes[:'CountryFullName']
68
+ end
69
+
70
+ if attributes.has_key?(:'CountryCode')
71
+ self.country_code = attributes[:'CountryCode']
72
+ end
73
+ end
74
+
75
+ # Show invalid properties with the reasons. Usually used together with valid?
76
+ # @return Array for valid properties with the reasons
77
+ def list_invalid_properties
78
+ invalid_properties = Array.new
79
+ invalid_properties
80
+ end
81
+
82
+ # Check to see if the all the properties in the model are valid
83
+ # @return true if the model is valid
84
+ def valid?
85
+ true
86
+ end
87
+
88
+ # Checks equality by comparing each attribute.
89
+ # @param [Object] Object to be compared
90
+ def ==(o)
91
+ return true if self.equal?(o)
92
+ self.class == o.class &&
93
+ city == o.city &&
94
+ state_or_province == o.state_or_province &&
95
+ country_full_name == o.country_full_name &&
96
+ country_code == o.country_code
97
+ end
98
+
99
+ # @see the `==` method
100
+ # @param [Object] Object to be compared
101
+ def eql?(o)
102
+ self == o
103
+ end
104
+
105
+ # Calculates hash code according to all attributes.
106
+ # @return [Fixnum] Hash code
107
+ def hash
108
+ [city, state_or_province, country_full_name, country_code].hash
109
+ end
110
+
111
+ # Builds the object from hash
112
+ # @param [Hash] attributes Model attributes in the form of hash
113
+ # @return [Object] Returns the model itself
114
+ def build_from_hash(attributes)
115
+ return nil unless attributes.is_a?(Hash)
116
+ self.class.swagger_types.each_pair do |key, type|
117
+ if type =~ /\AArray<(.*)>/i
118
+ # check to ensure the input is an array given that the attribute
119
+ # is documented as an array but the input is not
120
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
121
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
122
+ end
123
+ elsif !attributes[self.class.attribute_map[key]].nil?
124
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
125
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
126
+ end
127
+
128
+ self
129
+ end
130
+
131
+ # Deserializes the data based on type
132
+ # @param string type Data type
133
+ # @param string value Value to be deserialized
134
+ # @return [Object] Deserialized data
135
+ def _deserialize(type, value)
136
+ case type.to_sym
137
+ when :DateTime
138
+ DateTime.parse(value)
139
+ when :Date
140
+ Date.parse(value)
141
+ when :String
142
+ value.to_s
143
+ when :Integer
144
+ value.to_i
145
+ when :Float
146
+ value.to_f
147
+ when :BOOLEAN
148
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
149
+ true
150
+ else
151
+ false
152
+ end
153
+ when :Object
154
+ # generic object (usually a Hash), return directly
155
+ value
156
+ when /\AArray<(?<inner_type>.+)>\z/
157
+ inner_type = Regexp.last_match[:inner_type]
158
+ value.map { |v| _deserialize(inner_type, v) }
159
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
160
+ k_type = Regexp.last_match[:k_type]
161
+ v_type = Regexp.last_match[:v_type]
162
+ {}.tap do |hash|
163
+ value.each do |k, v|
164
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
165
+ end
166
+ end
167
+ else # model
168
+ temp_model = CloudmersiveValidateApiClient.const_get(type).new
169
+ temp_model.build_from_hash(value)
170
+ end
171
+ end
172
+
173
+ # Returns the string representation of the object
174
+ # @return [String] String presentation of the object
175
+ def to_s
176
+ to_hash.to_s
177
+ end
178
+
179
+ # to_body is an alias to to_hash (backward compatibility)
180
+ # @return [Hash] Returns the object in the form of hash
181
+ def to_body
182
+ to_hash
183
+ end
184
+
185
+ # Returns the object in the form of hash
186
+ # @return [Hash] Returns the object in the form of hash
187
+ def to_hash
188
+ hash = {}
189
+ self.class.attribute_map.each_pair do |attr, param|
190
+ value = self.send(attr)
191
+ next if value.nil?
192
+ hash[param] = _to_hash(value)
193
+ end
194
+ hash
195
+ end
196
+
197
+ # Outputs non-array value in the form of hash
198
+ # For object, use to_hash. Otherwise, just return the value
199
+ # @param [Object] value Any valid value
200
+ # @return [Hash] Returns the value in the form of hash
201
+ def _to_hash(value)
202
+ if value.is_a?(Array)
203
+ value.compact.map { |v| _to_hash(v) }
204
+ elsif value.is_a?(Hash)
205
+ {}.tap do |hash|
206
+ value.each { |k, v| hash[k] = _to_hash(v) }
207
+ end
208
+ elsif value.respond_to? :to_hash
209
+ value.to_hash
210
+ else
211
+ value
212
+ end
213
+ end
214
+
215
+ end
216
+ end