cloudmersive-validate-api-client 1.3.7 → 1.3.9

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 (50) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +14 -8
  3. data/docs/AddressApi.md +56 -1
  4. data/docs/AddressVerifySyntaxOnlyResponse.md +3 -0
  5. data/docs/DomainApi.md +8 -8
  6. data/docs/EmailApi.md +3 -3
  7. data/docs/IPAddressApi.md +1 -1
  8. data/docs/LeadEnrichmentApi.md +61 -0
  9. data/docs/LeadEnrichmentRequest.md +21 -0
  10. data/docs/LeadEnrichmentResponse.md +25 -0
  11. data/docs/NameApi.md +5 -5
  12. data/docs/ParseAddressResponse.md +2 -1
  13. data/docs/PhoneNumberApi.md +1 -1
  14. data/docs/UserAgentApi.md +1 -1
  15. data/docs/ValidateCountryRequest.md +8 -0
  16. data/docs/ValidateCountryResponse.md +12 -0
  17. data/docs/VatApi.md +1 -1
  18. data/docs/VatLookupResponse.md +8 -1
  19. data/docs/WhoisResponse.md +11 -0
  20. data/lib/cloudmersive-validate-api-client.rb +5 -0
  21. data/lib/cloudmersive-validate-api-client/api/address_api.rb +56 -1
  22. data/lib/cloudmersive-validate-api-client/api/domain_api.rb +8 -8
  23. data/lib/cloudmersive-validate-api-client/api/email_api.rb +3 -3
  24. data/lib/cloudmersive-validate-api-client/api/ip_address_api.rb +1 -1
  25. data/lib/cloudmersive-validate-api-client/api/lead_enrichment_api.rb +78 -0
  26. data/lib/cloudmersive-validate-api-client/api/name_api.rb +5 -5
  27. data/lib/cloudmersive-validate-api-client/api/phone_number_api.rb +1 -1
  28. data/lib/cloudmersive-validate-api-client/api/user_agent_api.rb +1 -1
  29. data/lib/cloudmersive-validate-api-client/api/vat_api.rb +1 -1
  30. data/lib/cloudmersive-validate-api-client/models/address_verify_syntax_only_response.rb +34 -4
  31. data/lib/cloudmersive-validate-api-client/models/lead_enrichment_request.rb +319 -0
  32. data/lib/cloudmersive-validate-api-client/models/lead_enrichment_response.rb +359 -0
  33. data/lib/cloudmersive-validate-api-client/models/parse_address_response.rb +17 -7
  34. data/lib/cloudmersive-validate-api-client/models/validate_country_request.rb +189 -0
  35. data/lib/cloudmersive-validate-api-client/models/validate_country_response.rb +229 -0
  36. data/lib/cloudmersive-validate-api-client/models/vat_lookup_response.rb +75 -5
  37. data/lib/cloudmersive-validate-api-client/models/whois_response.rb +111 -1
  38. data/lib/cloudmersive-validate-api-client/version.rb +1 -1
  39. data/spec/api/address_api_spec.rb +12 -0
  40. data/spec/api/domain_api_spec.rb +2 -2
  41. data/spec/api/lead_enrichment_api_spec.rb +47 -0
  42. data/spec/models/address_verify_syntax_only_response_spec.rb +18 -0
  43. data/spec/models/lead_enrichment_request_spec.rb +120 -0
  44. data/spec/models/lead_enrichment_response_spec.rb +144 -0
  45. data/spec/models/parse_address_response_spec.rb +7 -1
  46. data/spec/models/validate_country_request_spec.rb +42 -0
  47. data/spec/models/validate_country_response_spec.rb +66 -0
  48. data/spec/models/vat_lookup_response_spec.rb +42 -0
  49. data/spec/models/whois_response_spec.rb +66 -0
  50. metadata +17 -2
@@ -37,7 +37,10 @@ module CloudmersiveValidateApiClient
37
37
  attr_accessor :postal_code
38
38
 
39
39
  # Country of the address, if present in the address. If not included in the address it will be null.
40
- attr_accessor :country
40
+ attr_accessor :country_full_name
41
+
42
+ # Two-letter ISO 3166-1 country code
43
+ attr_accessor :iso_two_letter_code
41
44
 
42
45
 
43
46
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -50,7 +53,8 @@ module CloudmersiveValidateApiClient
50
53
  :'city' => :'City',
51
54
  :'state_or_province' => :'StateOrProvince',
52
55
  :'postal_code' => :'PostalCode',
53
- :'country' => :'Country'
56
+ :'country_full_name' => :'CountryFullName',
57
+ :'iso_two_letter_code' => :'ISOTwoLetterCode'
54
58
  }
55
59
  end
56
60
 
@@ -64,7 +68,8 @@ module CloudmersiveValidateApiClient
64
68
  :'city' => :'String',
65
69
  :'state_or_province' => :'String',
66
70
  :'postal_code' => :'String',
67
- :'country' => :'String'
71
+ :'country_full_name' => :'String',
72
+ :'iso_two_letter_code' => :'String'
68
73
  }
69
74
  end
70
75
 
@@ -104,8 +109,12 @@ module CloudmersiveValidateApiClient
104
109
  self.postal_code = attributes[:'PostalCode']
105
110
  end
106
111
 
107
- if attributes.has_key?(:'Country')
108
- self.country = attributes[:'Country']
112
+ if attributes.has_key?(:'CountryFullName')
113
+ self.country_full_name = attributes[:'CountryFullName']
114
+ end
115
+
116
+ if attributes.has_key?(:'ISOTwoLetterCode')
117
+ self.iso_two_letter_code = attributes[:'ISOTwoLetterCode']
109
118
  end
110
119
 
111
120
  end
@@ -135,7 +144,8 @@ module CloudmersiveValidateApiClient
135
144
  city == o.city &&
136
145
  state_or_province == o.state_or_province &&
137
146
  postal_code == o.postal_code &&
138
- country == o.country
147
+ country_full_name == o.country_full_name &&
148
+ iso_two_letter_code == o.iso_two_letter_code
139
149
  end
140
150
 
141
151
  # @see the `==` method
@@ -147,7 +157,7 @@ module CloudmersiveValidateApiClient
147
157
  # Calculates hash code according to all attributes.
148
158
  # @return [Fixnum] Hash code
149
159
  def hash
150
- [successful, building, street_number, street, city, state_or_province, postal_code, country].hash
160
+ [successful, building, street_number, street, city, state_or_province, postal_code, country_full_name, iso_two_letter_code].hash
151
161
  end
152
162
 
153
163
  # Builds the object from hash
@@ -0,0 +1,189 @@
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.3.1
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module CloudmersiveValidateApiClient
16
+ # Input parameter to a country validation request
17
+ class ValidateCountryRequest
18
+ # Raw country input - can be a two-letter code (FIPS 10-4 or ISO 3166-1), three-letter code (ISO 3166-1) or country name
19
+ attr_accessor :raw_country_input
20
+
21
+
22
+ # Attribute mapping from ruby-style variable name to JSON key.
23
+ def self.attribute_map
24
+ {
25
+ :'raw_country_input' => :'RawCountryInput'
26
+ }
27
+ end
28
+
29
+ # Attribute type mapping.
30
+ def self.swagger_types
31
+ {
32
+ :'raw_country_input' => :'String'
33
+ }
34
+ end
35
+
36
+ # Initializes the object
37
+ # @param [Hash] attributes Model attributes in the form of hash
38
+ def initialize(attributes = {})
39
+ return unless attributes.is_a?(Hash)
40
+
41
+ # convert string to symbol for hash key
42
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
43
+
44
+ if attributes.has_key?(:'RawCountryInput')
45
+ self.raw_country_input = attributes[:'RawCountryInput']
46
+ end
47
+
48
+ end
49
+
50
+ # Show invalid properties with the reasons. Usually used together with valid?
51
+ # @return Array for valid properties with the reasons
52
+ def list_invalid_properties
53
+ invalid_properties = Array.new
54
+ return invalid_properties
55
+ end
56
+
57
+ # Check to see if the all the properties in the model are valid
58
+ # @return true if the model is valid
59
+ def valid?
60
+ return true
61
+ end
62
+
63
+ # Checks equality by comparing each attribute.
64
+ # @param [Object] Object to be compared
65
+ def ==(o)
66
+ return true if self.equal?(o)
67
+ self.class == o.class &&
68
+ raw_country_input == o.raw_country_input
69
+ end
70
+
71
+ # @see the `==` method
72
+ # @param [Object] Object to be compared
73
+ def eql?(o)
74
+ self == o
75
+ end
76
+
77
+ # Calculates hash code according to all attributes.
78
+ # @return [Fixnum] Hash code
79
+ def hash
80
+ [raw_country_input].hash
81
+ end
82
+
83
+ # Builds the object from hash
84
+ # @param [Hash] attributes Model attributes in the form of hash
85
+ # @return [Object] Returns the model itself
86
+ def build_from_hash(attributes)
87
+ return nil unless attributes.is_a?(Hash)
88
+ self.class.swagger_types.each_pair do |key, type|
89
+ if type =~ /\AArray<(.*)>/i
90
+ # check to ensure the input is an array given that the the attribute
91
+ # is documented as an array but the input is not
92
+ 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) } )
94
+ end
95
+ elsif !attributes[self.class.attribute_map[key]].nil?
96
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
97
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
98
+ end
99
+
100
+ self
101
+ end
102
+
103
+ # Deserializes the data based on type
104
+ # @param string type Data type
105
+ # @param string value Value to be deserialized
106
+ # @return [Object] Deserialized data
107
+ def _deserialize(type, value)
108
+ case type.to_sym
109
+ when :DateTime
110
+ DateTime.parse(value)
111
+ when :Date
112
+ Date.parse(value)
113
+ when :String
114
+ value.to_s
115
+ when :Integer
116
+ value.to_i
117
+ when :Float
118
+ value.to_f
119
+ when :BOOLEAN
120
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
121
+ true
122
+ else
123
+ false
124
+ end
125
+ when :Object
126
+ # generic object (usually a Hash), return directly
127
+ value
128
+ when /\AArray<(?<inner_type>.+)>\z/
129
+ inner_type = Regexp.last_match[:inner_type]
130
+ value.map { |v| _deserialize(inner_type, v) }
131
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
132
+ k_type = Regexp.last_match[:k_type]
133
+ v_type = Regexp.last_match[:v_type]
134
+ {}.tap do |hash|
135
+ value.each do |k, v|
136
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
137
+ end
138
+ end
139
+ else # model
140
+ temp_model = CloudmersiveValidateApiClient.const_get(type).new
141
+ temp_model.build_from_hash(value)
142
+ end
143
+ end
144
+
145
+ # Returns the string representation of the object
146
+ # @return [String] String presentation of the object
147
+ def to_s
148
+ to_hash.to_s
149
+ end
150
+
151
+ # to_body is an alias to to_hash (backward compatibility)
152
+ # @return [Hash] Returns the object in the form of hash
153
+ def to_body
154
+ to_hash
155
+ end
156
+
157
+ # Returns the object in the form of hash
158
+ # @return [Hash] Returns the object in the form of hash
159
+ def to_hash
160
+ hash = {}
161
+ self.class.attribute_map.each_pair do |attr, param|
162
+ value = self.send(attr)
163
+ next if value.nil?
164
+ hash[param] = _to_hash(value)
165
+ end
166
+ hash
167
+ end
168
+
169
+ # Outputs non-array value in the form of hash
170
+ # For object, use to_hash. Otherwise, just return the value
171
+ # @param [Object] value Any valid value
172
+ # @return [Hash] Returns the value in the form of hash
173
+ def _to_hash(value)
174
+ if value.is_a?(Array)
175
+ value.compact.map{ |v| _to_hash(v) }
176
+ elsif value.is_a?(Hash)
177
+ {}.tap do |hash|
178
+ value.each { |k, v| hash[k] = _to_hash(v) }
179
+ end
180
+ elsif value.respond_to? :to_hash
181
+ value.to_hash
182
+ else
183
+ value
184
+ end
185
+ end
186
+
187
+ end
188
+
189
+ end
@@ -0,0 +1,229 @@
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.3.1
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module CloudmersiveValidateApiClient
16
+ # Result of performing a country validation operation
17
+ class ValidateCountryResponse
18
+ # True if successful, false otherwise
19
+ attr_accessor :successful
20
+
21
+ # Full name of the country
22
+ attr_accessor :country_full_name
23
+
24
+ # Two-letter ISO 3166-1 country code
25
+ attr_accessor :iso_two_letter_code
26
+
27
+ # Two-letter FIPS 10-4 country code
28
+ attr_accessor :fips_two_letter_code
29
+
30
+ # Three-letter ISO 3166-1 country code
31
+ attr_accessor :three_letter_code
32
+
33
+
34
+ # Attribute mapping from ruby-style variable name to JSON key.
35
+ def self.attribute_map
36
+ {
37
+ :'successful' => :'Successful',
38
+ :'country_full_name' => :'CountryFullName',
39
+ :'iso_two_letter_code' => :'ISOTwoLetterCode',
40
+ :'fips_two_letter_code' => :'FIPSTwoLetterCode',
41
+ :'three_letter_code' => :'ThreeLetterCode'
42
+ }
43
+ end
44
+
45
+ # Attribute type mapping.
46
+ def self.swagger_types
47
+ {
48
+ :'successful' => :'BOOLEAN',
49
+ :'country_full_name' => :'String',
50
+ :'iso_two_letter_code' => :'String',
51
+ :'fips_two_letter_code' => :'String',
52
+ :'three_letter_code' => :'String'
53
+ }
54
+ end
55
+
56
+ # Initializes the object
57
+ # @param [Hash] attributes Model attributes in the form of hash
58
+ def initialize(attributes = {})
59
+ return unless attributes.is_a?(Hash)
60
+
61
+ # convert string to symbol for hash key
62
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
63
+
64
+ if attributes.has_key?(:'Successful')
65
+ self.successful = attributes[:'Successful']
66
+ end
67
+
68
+ if attributes.has_key?(:'CountryFullName')
69
+ self.country_full_name = attributes[:'CountryFullName']
70
+ end
71
+
72
+ if attributes.has_key?(:'ISOTwoLetterCode')
73
+ self.iso_two_letter_code = attributes[:'ISOTwoLetterCode']
74
+ end
75
+
76
+ if attributes.has_key?(:'FIPSTwoLetterCode')
77
+ self.fips_two_letter_code = attributes[:'FIPSTwoLetterCode']
78
+ end
79
+
80
+ if attributes.has_key?(:'ThreeLetterCode')
81
+ self.three_letter_code = attributes[:'ThreeLetterCode']
82
+ end
83
+
84
+ end
85
+
86
+ # Show invalid properties with the reasons. Usually used together with valid?
87
+ # @return Array for valid properties with the reasons
88
+ def list_invalid_properties
89
+ invalid_properties = Array.new
90
+ return invalid_properties
91
+ end
92
+
93
+ # Check to see if the all the properties in the model are valid
94
+ # @return true if the model is valid
95
+ def valid?
96
+ return true
97
+ end
98
+
99
+ # Checks equality by comparing each attribute.
100
+ # @param [Object] Object to be compared
101
+ def ==(o)
102
+ return true if self.equal?(o)
103
+ self.class == o.class &&
104
+ successful == o.successful &&
105
+ country_full_name == o.country_full_name &&
106
+ iso_two_letter_code == o.iso_two_letter_code &&
107
+ fips_two_letter_code == o.fips_two_letter_code &&
108
+ three_letter_code == o.three_letter_code
109
+ end
110
+
111
+ # @see the `==` method
112
+ # @param [Object] Object to be compared
113
+ def eql?(o)
114
+ self == o
115
+ end
116
+
117
+ # Calculates hash code according to all attributes.
118
+ # @return [Fixnum] Hash code
119
+ def hash
120
+ [successful, country_full_name, iso_two_letter_code, fips_two_letter_code, three_letter_code].hash
121
+ end
122
+
123
+ # Builds the object from hash
124
+ # @param [Hash] attributes Model attributes in the form of hash
125
+ # @return [Object] Returns the model itself
126
+ def build_from_hash(attributes)
127
+ return nil unless attributes.is_a?(Hash)
128
+ self.class.swagger_types.each_pair do |key, type|
129
+ if type =~ /\AArray<(.*)>/i
130
+ # check to ensure the input is an array given that the the attribute
131
+ # is documented as an array but the input is not
132
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
133
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
134
+ end
135
+ elsif !attributes[self.class.attribute_map[key]].nil?
136
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
137
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
138
+ end
139
+
140
+ self
141
+ end
142
+
143
+ # Deserializes the data based on type
144
+ # @param string type Data type
145
+ # @param string value Value to be deserialized
146
+ # @return [Object] Deserialized data
147
+ def _deserialize(type, value)
148
+ case type.to_sym
149
+ when :DateTime
150
+ DateTime.parse(value)
151
+ when :Date
152
+ Date.parse(value)
153
+ when :String
154
+ value.to_s
155
+ when :Integer
156
+ value.to_i
157
+ when :Float
158
+ value.to_f
159
+ when :BOOLEAN
160
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
161
+ true
162
+ else
163
+ false
164
+ end
165
+ when :Object
166
+ # generic object (usually a Hash), return directly
167
+ value
168
+ when /\AArray<(?<inner_type>.+)>\z/
169
+ inner_type = Regexp.last_match[:inner_type]
170
+ value.map { |v| _deserialize(inner_type, v) }
171
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
172
+ k_type = Regexp.last_match[:k_type]
173
+ v_type = Regexp.last_match[:v_type]
174
+ {}.tap do |hash|
175
+ value.each do |k, v|
176
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
177
+ end
178
+ end
179
+ else # model
180
+ temp_model = CloudmersiveValidateApiClient.const_get(type).new
181
+ temp_model.build_from_hash(value)
182
+ end
183
+ end
184
+
185
+ # Returns the string representation of the object
186
+ # @return [String] String presentation of the object
187
+ def to_s
188
+ to_hash.to_s
189
+ end
190
+
191
+ # to_body is an alias to to_hash (backward compatibility)
192
+ # @return [Hash] Returns the object in the form of hash
193
+ def to_body
194
+ to_hash
195
+ end
196
+
197
+ # Returns the object in the form of hash
198
+ # @return [Hash] Returns the object in the form of hash
199
+ def to_hash
200
+ hash = {}
201
+ self.class.attribute_map.each_pair do |attr, param|
202
+ value = self.send(attr)
203
+ next if value.nil?
204
+ hash[param] = _to_hash(value)
205
+ end
206
+ hash
207
+ end
208
+
209
+ # Outputs non-array value in the form of hash
210
+ # For object, use to_hash. Otherwise, just return the value
211
+ # @param [Object] value Any valid value
212
+ # @return [Hash] Returns the value in the form of hash
213
+ def _to_hash(value)
214
+ if value.is_a?(Array)
215
+ value.compact.map{ |v| _to_hash(v) }
216
+ elsif value.is_a?(Hash)
217
+ {}.tap do |hash|
218
+ value.each { |k, v| hash[k] = _to_hash(v) }
219
+ end
220
+ elsif value.respond_to? :to_hash
221
+ value.to_hash
222
+ else
223
+ value
224
+ end
225
+ end
226
+
227
+ end
228
+
229
+ end