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
@@ -0,0 +1,226 @@
|
|
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 validating a city
|
17
|
+
class ValidateCityResponse
|
18
|
+
# True if the city is valid, false otherwise
|
19
|
+
attr_accessor :valid_city
|
20
|
+
|
21
|
+
# If valid, City corresponding to the input postal code, such as 'Walnut Creek'
|
22
|
+
attr_accessor :city
|
23
|
+
|
24
|
+
# If valid; State or province corresponding to the input state name, such as 'CA' or 'California'
|
25
|
+
attr_accessor :state_or_province
|
26
|
+
|
27
|
+
# If the postal code is valid, the degrees latitude of the centroid of the state, null otherwise
|
28
|
+
attr_accessor :latitude
|
29
|
+
|
30
|
+
# If the postal code is valid, the degrees longitude of the centroid of the state, null otherwise
|
31
|
+
attr_accessor :longitude
|
32
|
+
|
33
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
34
|
+
def self.attribute_map
|
35
|
+
{
|
36
|
+
:'valid_city' => :'ValidCity',
|
37
|
+
:'city' => :'City',
|
38
|
+
:'state_or_province' => :'StateOrProvince',
|
39
|
+
:'latitude' => :'Latitude',
|
40
|
+
:'longitude' => :'Longitude'
|
41
|
+
}
|
42
|
+
end
|
43
|
+
|
44
|
+
# Attribute type mapping.
|
45
|
+
def self.swagger_types
|
46
|
+
{
|
47
|
+
:'valid_city' => :'BOOLEAN',
|
48
|
+
:'city' => :'String',
|
49
|
+
:'state_or_province' => :'String',
|
50
|
+
:'latitude' => :'Float',
|
51
|
+
:'longitude' => :'Float'
|
52
|
+
}
|
53
|
+
end
|
54
|
+
|
55
|
+
# Initializes the object
|
56
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
57
|
+
def initialize(attributes = {})
|
58
|
+
return unless attributes.is_a?(Hash)
|
59
|
+
|
60
|
+
# convert string to symbol for hash key
|
61
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
62
|
+
|
63
|
+
if attributes.has_key?(:'ValidCity')
|
64
|
+
self.valid_city = attributes[:'ValidCity']
|
65
|
+
end
|
66
|
+
|
67
|
+
if attributes.has_key?(:'City')
|
68
|
+
self.city = attributes[:'City']
|
69
|
+
end
|
70
|
+
|
71
|
+
if attributes.has_key?(:'StateOrProvince')
|
72
|
+
self.state_or_province = attributes[:'StateOrProvince']
|
73
|
+
end
|
74
|
+
|
75
|
+
if attributes.has_key?(:'Latitude')
|
76
|
+
self.latitude = attributes[:'Latitude']
|
77
|
+
end
|
78
|
+
|
79
|
+
if attributes.has_key?(:'Longitude')
|
80
|
+
self.longitude = attributes[:'Longitude']
|
81
|
+
end
|
82
|
+
end
|
83
|
+
|
84
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
85
|
+
# @return Array for valid properties with the reasons
|
86
|
+
def list_invalid_properties
|
87
|
+
invalid_properties = Array.new
|
88
|
+
invalid_properties
|
89
|
+
end
|
90
|
+
|
91
|
+
# Check to see if the all the properties in the model are valid
|
92
|
+
# @return true if the model is valid
|
93
|
+
def valid?
|
94
|
+
true
|
95
|
+
end
|
96
|
+
|
97
|
+
# Checks equality by comparing each attribute.
|
98
|
+
# @param [Object] Object to be compared
|
99
|
+
def ==(o)
|
100
|
+
return true if self.equal?(o)
|
101
|
+
self.class == o.class &&
|
102
|
+
valid_city == o.valid_city &&
|
103
|
+
city == o.city &&
|
104
|
+
state_or_province == o.state_or_province &&
|
105
|
+
latitude == o.latitude &&
|
106
|
+
longitude == o.longitude
|
107
|
+
end
|
108
|
+
|
109
|
+
# @see the `==` method
|
110
|
+
# @param [Object] Object to be compared
|
111
|
+
def eql?(o)
|
112
|
+
self == o
|
113
|
+
end
|
114
|
+
|
115
|
+
# Calculates hash code according to all attributes.
|
116
|
+
# @return [Fixnum] Hash code
|
117
|
+
def hash
|
118
|
+
[valid_city, city, state_or_province, latitude, longitude].hash
|
119
|
+
end
|
120
|
+
|
121
|
+
# Builds the object from hash
|
122
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
123
|
+
# @return [Object] Returns the model itself
|
124
|
+
def build_from_hash(attributes)
|
125
|
+
return nil unless attributes.is_a?(Hash)
|
126
|
+
self.class.swagger_types.each_pair do |key, type|
|
127
|
+
if type =~ /\AArray<(.*)>/i
|
128
|
+
# check to ensure the input is an array given that the attribute
|
129
|
+
# is documented as an array but the input is not
|
130
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
131
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
132
|
+
end
|
133
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
134
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
135
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
136
|
+
end
|
137
|
+
|
138
|
+
self
|
139
|
+
end
|
140
|
+
|
141
|
+
# Deserializes the data based on type
|
142
|
+
# @param string type Data type
|
143
|
+
# @param string value Value to be deserialized
|
144
|
+
# @return [Object] Deserialized data
|
145
|
+
def _deserialize(type, value)
|
146
|
+
case type.to_sym
|
147
|
+
when :DateTime
|
148
|
+
DateTime.parse(value)
|
149
|
+
when :Date
|
150
|
+
Date.parse(value)
|
151
|
+
when :String
|
152
|
+
value.to_s
|
153
|
+
when :Integer
|
154
|
+
value.to_i
|
155
|
+
when :Float
|
156
|
+
value.to_f
|
157
|
+
when :BOOLEAN
|
158
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
159
|
+
true
|
160
|
+
else
|
161
|
+
false
|
162
|
+
end
|
163
|
+
when :Object
|
164
|
+
# generic object (usually a Hash), return directly
|
165
|
+
value
|
166
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
167
|
+
inner_type = Regexp.last_match[:inner_type]
|
168
|
+
value.map { |v| _deserialize(inner_type, v) }
|
169
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
170
|
+
k_type = Regexp.last_match[:k_type]
|
171
|
+
v_type = Regexp.last_match[:v_type]
|
172
|
+
{}.tap do |hash|
|
173
|
+
value.each do |k, v|
|
174
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
175
|
+
end
|
176
|
+
end
|
177
|
+
else # model
|
178
|
+
temp_model = CloudmersiveValidateApiClient.const_get(type).new
|
179
|
+
temp_model.build_from_hash(value)
|
180
|
+
end
|
181
|
+
end
|
182
|
+
|
183
|
+
# Returns the string representation of the object
|
184
|
+
# @return [String] String presentation of the object
|
185
|
+
def to_s
|
186
|
+
to_hash.to_s
|
187
|
+
end
|
188
|
+
|
189
|
+
# to_body is an alias to to_hash (backward compatibility)
|
190
|
+
# @return [Hash] Returns the object in the form of hash
|
191
|
+
def to_body
|
192
|
+
to_hash
|
193
|
+
end
|
194
|
+
|
195
|
+
# Returns the object in the form of hash
|
196
|
+
# @return [Hash] Returns the object in the form of hash
|
197
|
+
def to_hash
|
198
|
+
hash = {}
|
199
|
+
self.class.attribute_map.each_pair do |attr, param|
|
200
|
+
value = self.send(attr)
|
201
|
+
next if value.nil?
|
202
|
+
hash[param] = _to_hash(value)
|
203
|
+
end
|
204
|
+
hash
|
205
|
+
end
|
206
|
+
|
207
|
+
# Outputs non-array value in the form of hash
|
208
|
+
# For object, use to_hash. Otherwise, just return the value
|
209
|
+
# @param [Object] value Any valid value
|
210
|
+
# @return [Hash] Returns the value in the form of hash
|
211
|
+
def _to_hash(value)
|
212
|
+
if value.is_a?(Array)
|
213
|
+
value.compact.map { |v| _to_hash(v) }
|
214
|
+
elsif value.is_a?(Hash)
|
215
|
+
{}.tap do |hash|
|
216
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
217
|
+
end
|
218
|
+
elsif value.respond_to? :to_hash
|
219
|
+
value.to_hash
|
220
|
+
else
|
221
|
+
value
|
222
|
+
end
|
223
|
+
end
|
224
|
+
|
225
|
+
end
|
226
|
+
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
|
# 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
19
|
attr_accessor :raw_country_input
|
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?(:'RawCountryInput')
|
45
44
|
self.raw_country_input = attributes[:'RawCountryInput']
|
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
|
|
@@ -30,10 +30,12 @@ module CloudmersiveValidateApiClient
|
|
30
30
|
# Three-letter ISO 3166-1 country code
|
31
31
|
attr_accessor :three_letter_code
|
32
32
|
|
33
|
+
# True if this country is currently a member of the European Union (EU), false otherwise
|
34
|
+
attr_accessor :is_european_union_member
|
35
|
+
|
33
36
|
# Time zones (IANA/Olsen) in the country
|
34
37
|
attr_accessor :timezones
|
35
38
|
|
36
|
-
|
37
39
|
# Attribute mapping from ruby-style variable name to JSON key.
|
38
40
|
def self.attribute_map
|
39
41
|
{
|
@@ -42,6 +44,7 @@ module CloudmersiveValidateApiClient
|
|
42
44
|
:'iso_two_letter_code' => :'ISOTwoLetterCode',
|
43
45
|
:'fips_two_letter_code' => :'FIPSTwoLetterCode',
|
44
46
|
:'three_letter_code' => :'ThreeLetterCode',
|
47
|
+
:'is_european_union_member' => :'IsEuropeanUnionMember',
|
45
48
|
:'timezones' => :'Timezones'
|
46
49
|
}
|
47
50
|
end
|
@@ -54,6 +57,7 @@ module CloudmersiveValidateApiClient
|
|
54
57
|
:'iso_two_letter_code' => :'String',
|
55
58
|
:'fips_two_letter_code' => :'String',
|
56
59
|
:'three_letter_code' => :'String',
|
60
|
+
:'is_european_union_member' => :'BOOLEAN',
|
57
61
|
:'timezones' => :'Array<Timezone>'
|
58
62
|
}
|
59
63
|
end
|
@@ -64,7 +68,7 @@ module CloudmersiveValidateApiClient
|
|
64
68
|
return unless attributes.is_a?(Hash)
|
65
69
|
|
66
70
|
# convert string to symbol for hash key
|
67
|
-
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
71
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
68
72
|
|
69
73
|
if attributes.has_key?(:'Successful')
|
70
74
|
self.successful = attributes[:'Successful']
|
@@ -86,25 +90,28 @@ module CloudmersiveValidateApiClient
|
|
86
90
|
self.three_letter_code = attributes[:'ThreeLetterCode']
|
87
91
|
end
|
88
92
|
|
93
|
+
if attributes.has_key?(:'IsEuropeanUnionMember')
|
94
|
+
self.is_european_union_member = attributes[:'IsEuropeanUnionMember']
|
95
|
+
end
|
96
|
+
|
89
97
|
if attributes.has_key?(:'Timezones')
|
90
98
|
if (value = attributes[:'Timezones']).is_a?(Array)
|
91
99
|
self.timezones = value
|
92
100
|
end
|
93
101
|
end
|
94
|
-
|
95
102
|
end
|
96
103
|
|
97
104
|
# Show invalid properties with the reasons. Usually used together with valid?
|
98
105
|
# @return Array for valid properties with the reasons
|
99
106
|
def list_invalid_properties
|
100
107
|
invalid_properties = Array.new
|
101
|
-
|
108
|
+
invalid_properties
|
102
109
|
end
|
103
110
|
|
104
111
|
# Check to see if the all the properties in the model are valid
|
105
112
|
# @return true if the model is valid
|
106
113
|
def valid?
|
107
|
-
|
114
|
+
true
|
108
115
|
end
|
109
116
|
|
110
117
|
# Checks equality by comparing each attribute.
|
@@ -117,6 +124,7 @@ module CloudmersiveValidateApiClient
|
|
117
124
|
iso_two_letter_code == o.iso_two_letter_code &&
|
118
125
|
fips_two_letter_code == o.fips_two_letter_code &&
|
119
126
|
three_letter_code == o.three_letter_code &&
|
127
|
+
is_european_union_member == o.is_european_union_member &&
|
120
128
|
timezones == o.timezones
|
121
129
|
end
|
122
130
|
|
@@ -129,7 +137,7 @@ module CloudmersiveValidateApiClient
|
|
129
137
|
# Calculates hash code according to all attributes.
|
130
138
|
# @return [Fixnum] Hash code
|
131
139
|
def hash
|
132
|
-
[successful, country_full_name, iso_two_letter_code, fips_two_letter_code, three_letter_code, timezones].hash
|
140
|
+
[successful, country_full_name, iso_two_letter_code, fips_two_letter_code, three_letter_code, is_european_union_member, timezones].hash
|
133
141
|
end
|
134
142
|
|
135
143
|
# Builds the object from hash
|
@@ -139,10 +147,10 @@ module CloudmersiveValidateApiClient
|
|
139
147
|
return nil unless attributes.is_a?(Hash)
|
140
148
|
self.class.swagger_types.each_pair do |key, type|
|
141
149
|
if type =~ /\AArray<(.*)>/i
|
142
|
-
# check to ensure the input is an array given that the
|
150
|
+
# check to ensure the input is an array given that the attribute
|
143
151
|
# is documented as an array but the input is not
|
144
152
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
145
|
-
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) }
|
153
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
146
154
|
end
|
147
155
|
elsif !attributes[self.class.attribute_map[key]].nil?
|
148
156
|
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
@@ -224,7 +232,7 @@ module CloudmersiveValidateApiClient
|
|
224
232
|
# @return [Hash] Returns the value in the form of hash
|
225
233
|
def _to_hash(value)
|
226
234
|
if value.is_a?(Array)
|
227
|
-
value.compact.map{ |v| _to_hash(v) }
|
235
|
+
value.compact.map { |v| _to_hash(v) }
|
228
236
|
elsif value.is_a?(Hash)
|
229
237
|
{}.tap do |hash|
|
230
238
|
value.each { |k, v| hash[k] = _to_hash(v) }
|
@@ -237,5 +245,4 @@ module CloudmersiveValidateApiClient
|
|
237
245
|
end
|
238
246
|
|
239
247
|
end
|
240
|
-
|
241
248
|
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
|
# Optional; minimum length, if any, of the identifier
|
40
40
|
attr_accessor :min_length
|
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?(:'Input')
|
80
79
|
self.input = attributes[:'Input']
|
@@ -107,20 +106,19 @@ module CloudmersiveValidateApiClient
|
|
107
106
|
if attributes.has_key?(:'MinLength')
|
108
107
|
self.min_length = attributes[:'MinLength']
|
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
|