cloudmersive-validate-api-client 2.0.1 → 2.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +7 -0
- data/README.md +175 -0
- data/Rakefile +8 -0
- data/cloudmersive-validate-api-client.gemspec +45 -0
- data/docs/AddressApi.md +497 -0
- data/docs/AddressGetServersResponse.md +9 -0
- data/docs/AddressVerifySyntaxOnlyResponse.md +11 -0
- data/docs/CheckResponse.md +8 -0
- data/docs/CountryDetails.md +11 -0
- data/docs/CountryListResult.md +9 -0
- data/docs/DomainApi.md +228 -0
- data/docs/EmailApi.md +173 -0
- data/docs/FirstNameValidationRequest.md +8 -0
- data/docs/FirstNameValidationResponse.md +9 -0
- data/docs/FullEmailValidationResponse.md +16 -0
- data/docs/FullNameValidationRequest.md +8 -0
- data/docs/FullNameValidationResponse.md +17 -0
- data/docs/GeolocateResponse.md +16 -0
- data/docs/GetGenderRequest.md +9 -0
- data/docs/GetGenderResponse.md +9 -0
- data/docs/GetTimezonesRequest.md +8 -0
- data/docs/GetTimezonesResponse.md +13 -0
- data/docs/IPAddressApi.md +173 -0
- data/docs/IPThreatResponse.md +9 -0
- data/docs/LastNameValidationRequest.md +8 -0
- data/docs/LastNameValidationResponse.md +9 -0
- data/docs/LeadEnrichmentApi.md +61 -0
- data/docs/LeadEnrichmentRequest.md +21 -0
- data/docs/LeadEnrichmentResponse.md +25 -0
- data/docs/NameApi.md +283 -0
- data/docs/ParseAddressRequest.md +9 -0
- data/docs/ParseAddressResponse.md +16 -0
- data/docs/PhoneNumberApi.md +63 -0
- data/docs/PhoneNumberValidateRequest.md +9 -0
- data/docs/PhoneNumberValidationResponse.md +15 -0
- data/docs/Timezone.md +10 -0
- data/docs/TorNodeResponse.md +8 -0
- data/docs/UserAgentApi.md +63 -0
- data/docs/UserAgentValidateRequest.md +8 -0
- data/docs/UserAgentValidateResponse.md +21 -0
- 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/ValidateCountryRequest.md +8 -0
- data/docs/ValidateCountryResponse.md +14 -0
- data/docs/ValidateIdentifierRequest.md +15 -0
- data/docs/ValidateIdentifierResponse.md +9 -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/ValidateUrlRequestFull.md +8 -0
- data/docs/ValidateUrlRequestSyntaxOnly.md +8 -0
- data/docs/ValidateUrlResponseFull.md +12 -0
- data/docs/ValidateUrlResponseSyntaxOnly.md +9 -0
- data/docs/VatApi.md +63 -0
- data/docs/VatLookupRequest.md +8 -0
- data/docs/VatLookupResponse.md +19 -0
- data/docs/WhoisResponse.md +22 -0
- data/git_push.sh +55 -0
- data/lib/cloudmersive-validate-api-client.rb +95 -0
- data/lib/cloudmersive-validate-api-client/api/address_api.rb +501 -0
- data/lib/cloudmersive-validate-api-client/api/domain_api.rb +239 -0
- data/lib/cloudmersive-validate-api-client/api/email_api.rb +185 -0
- data/lib/cloudmersive-validate-api-client/api/ip_address_api.rb +185 -0
- data/lib/cloudmersive-validate-api-client/api/lead_enrichment_api.rb +75 -0
- data/lib/cloudmersive-validate-api-client/api/name_api.rb +293 -0
- data/lib/cloudmersive-validate-api-client/api/phone_number_api.rb +77 -0
- data/lib/cloudmersive-validate-api-client/api/user_agent_api.rb +77 -0
- data/lib/cloudmersive-validate-api-client/api/vat_api.rb +77 -0
- data/lib/cloudmersive-validate-api-client/api_client.rb +391 -0
- data/lib/cloudmersive-validate-api-client/api_error.rb +38 -0
- data/lib/cloudmersive-validate-api-client/configuration.rb +209 -0
- data/lib/cloudmersive-validate-api-client/models/address_get_servers_response.rb +198 -0
- data/lib/cloudmersive-validate-api-client/models/address_verify_syntax_only_response.rb +216 -0
- data/lib/cloudmersive-validate-api-client/models/check_response.rb +186 -0
- 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 +186 -0
- data/lib/cloudmersive-validate-api-client/models/first_name_validation_response.rb +196 -0
- data/lib/cloudmersive-validate-api-client/models/full_email_validation_response.rb +266 -0
- data/lib/cloudmersive-validate-api-client/models/full_name_validation_request.rb +186 -0
- data/lib/cloudmersive-validate-api-client/models/full_name_validation_response.rb +276 -0
- data/lib/cloudmersive-validate-api-client/models/geolocate_response.rb +266 -0
- data/lib/cloudmersive-validate-api-client/models/get_gender_request.rb +196 -0
- data/lib/cloudmersive-validate-api-client/models/get_gender_response.rb +196 -0
- data/lib/cloudmersive-validate-api-client/models/get_timezones_request.rb +186 -0
- data/lib/cloudmersive-validate-api-client/models/get_timezones_response.rb +238 -0
- data/lib/cloudmersive-validate-api-client/models/ip_threat_response.rb +196 -0
- data/lib/cloudmersive-validate-api-client/models/last_name_validation_request.rb +186 -0
- data/lib/cloudmersive-validate-api-client/models/last_name_validation_response.rb +196 -0
- data/lib/cloudmersive-validate-api-client/models/lead_enrichment_request.rb +316 -0
- data/lib/cloudmersive-validate-api-client/models/lead_enrichment_response.rb +356 -0
- data/lib/cloudmersive-validate-api-client/models/parse_address_request.rb +196 -0
- data/lib/cloudmersive-validate-api-client/models/parse_address_response.rb +266 -0
- data/lib/cloudmersive-validate-api-client/models/phone_number_validate_request.rb +196 -0
- data/lib/cloudmersive-validate-api-client/models/phone_number_validation_response.rb +256 -0
- data/lib/cloudmersive-validate-api-client/models/timezone.rb +206 -0
- 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 +186 -0
- data/lib/cloudmersive-validate-api-client/models/user_agent_validate_response.rb +316 -0
- 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 +186 -0
- data/lib/cloudmersive-validate-api-client/models/validate_country_response.rb +248 -0
- data/lib/cloudmersive-validate-api-client/models/validate_identifier_request.rb +256 -0
- data/lib/cloudmersive-validate-api-client/models/validate_identifier_response.rb +196 -0
- 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 +186 -0
- data/lib/cloudmersive-validate-api-client/models/validate_url_request_syntax_only.rb +186 -0
- data/lib/cloudmersive-validate-api-client/models/validate_url_response_full.rb +226 -0
- data/lib/cloudmersive-validate-api-client/models/validate_url_response_syntax_only.rb +196 -0
- data/lib/cloudmersive-validate-api-client/models/vat_lookup_request.rb +186 -0
- data/lib/cloudmersive-validate-api-client/models/vat_lookup_response.rb +295 -0
- data/lib/cloudmersive-validate-api-client/models/whois_response.rb +326 -0
- data/lib/cloudmersive-validate-api-client/version.rb +15 -0
- data/spec/api/address_api_spec.rb +142 -0
- data/spec/api/domain_api_spec.rb +83 -0
- data/spec/api/email_api_spec.rb +71 -0
- data/spec/api/ip_address_api_spec.rb +71 -0
- data/spec/api/lead_enrichment_api_spec.rb +46 -0
- data/spec/api/name_api_spec.rb +95 -0
- data/spec/api/phone_number_api_spec.rb +47 -0
- data/spec/api/user_agent_api_spec.rb +47 -0
- data/spec/api/vat_api_spec.rb +47 -0
- data/spec/api_client_spec.rb +243 -0
- data/spec/configuration_spec.rb +42 -0
- data/spec/models/address_get_servers_response_spec.rb +47 -0
- data/spec/models/address_verify_syntax_only_response_spec.rb +59 -0
- data/spec/models/check_response_spec.rb +41 -0
- 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 +41 -0
- data/spec/models/first_name_validation_response_spec.rb +47 -0
- data/spec/models/full_email_validation_response_spec.rb +89 -0
- data/spec/models/full_name_validation_request_spec.rb +41 -0
- data/spec/models/full_name_validation_response_spec.rb +95 -0
- data/spec/models/geolocate_response_spec.rb +89 -0
- data/spec/models/get_gender_request_spec.rb +47 -0
- data/spec/models/get_gender_response_spec.rb +47 -0
- data/spec/models/get_timezones_request_spec.rb +41 -0
- data/spec/models/get_timezones_response_spec.rb +71 -0
- data/spec/models/ip_threat_response_spec.rb +47 -0
- data/spec/models/last_name_validation_request_spec.rb +41 -0
- data/spec/models/last_name_validation_response_spec.rb +47 -0
- data/spec/models/lead_enrichment_request_spec.rb +119 -0
- data/spec/models/lead_enrichment_response_spec.rb +143 -0
- data/spec/models/parse_address_request_spec.rb +47 -0
- data/spec/models/parse_address_response_spec.rb +89 -0
- data/spec/models/phone_number_validate_request_spec.rb +47 -0
- data/spec/models/phone_number_validation_response_spec.rb +83 -0
- data/spec/models/timezone_spec.rb +53 -0
- data/spec/models/tor_node_response_spec.rb +41 -0
- data/spec/models/user_agent_validate_request_spec.rb +41 -0
- data/spec/models/user_agent_validate_response_spec.rb +119 -0
- 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 +41 -0
- data/spec/models/validate_country_response_spec.rb +77 -0
- data/spec/models/validate_identifier_request_spec.rb +83 -0
- data/spec/models/validate_identifier_response_spec.rb +47 -0
- 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 +41 -0
- data/spec/models/validate_url_request_syntax_only_spec.rb +41 -0
- data/spec/models/validate_url_response_full_spec.rb +65 -0
- data/spec/models/validate_url_response_syntax_only_spec.rb +47 -0
- data/spec/models/vat_lookup_request_spec.rb +41 -0
- data/spec/models/vat_lookup_response_spec.rb +107 -0
- data/spec/models/whois_response_spec.rb +125 -0
- data/spec/spec_helper.rb +111 -0
- metadata +184 -3
@@ -0,0 +1,326 @@
|
|
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 a WHOIS operation
|
17
|
+
class WhoisResponse
|
18
|
+
# True if the domain is valid, false if it is not
|
19
|
+
attr_accessor :valid_domain
|
20
|
+
|
21
|
+
# Name of the domain registrant
|
22
|
+
attr_accessor :registrant_name
|
23
|
+
|
24
|
+
# Organization name of the domain registrant
|
25
|
+
attr_accessor :registrant_organization
|
26
|
+
|
27
|
+
# Email address of the domain registrant
|
28
|
+
attr_accessor :registrant_email
|
29
|
+
|
30
|
+
# Street number of the address of the domain registrant, if available
|
31
|
+
attr_accessor :registrant_street_number
|
32
|
+
|
33
|
+
# Street name of the address of the domain registrant, if available
|
34
|
+
attr_accessor :registrant_street
|
35
|
+
|
36
|
+
# City of the domain registrant, if available
|
37
|
+
attr_accessor :registrant_city
|
38
|
+
|
39
|
+
# State or Province of the address of the domain registrant, if available
|
40
|
+
attr_accessor :registrant_state_or_province
|
41
|
+
|
42
|
+
# Postal code of the address of the domain registrant, if available
|
43
|
+
attr_accessor :registrant_postal_code
|
44
|
+
|
45
|
+
# Country of the address of the domain registrant, if available
|
46
|
+
attr_accessor :registrant_country
|
47
|
+
|
48
|
+
# Raw address string of the domain registrant, if available
|
49
|
+
attr_accessor :registrant_raw_address
|
50
|
+
|
51
|
+
# Telephone number of the address of the domain registrant
|
52
|
+
attr_accessor :registrant_telephone
|
53
|
+
|
54
|
+
# Server used to lookup WHOIS information (may change based on lookup).
|
55
|
+
attr_accessor :whois_server
|
56
|
+
|
57
|
+
# WHOIS raw text record
|
58
|
+
attr_accessor :raw_text_record
|
59
|
+
|
60
|
+
# Creation date for the record
|
61
|
+
attr_accessor :created_dt
|
62
|
+
|
63
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
64
|
+
def self.attribute_map
|
65
|
+
{
|
66
|
+
:'valid_domain' => :'ValidDomain',
|
67
|
+
:'registrant_name' => :'RegistrantName',
|
68
|
+
:'registrant_organization' => :'RegistrantOrganization',
|
69
|
+
:'registrant_email' => :'RegistrantEmail',
|
70
|
+
:'registrant_street_number' => :'RegistrantStreetNumber',
|
71
|
+
:'registrant_street' => :'RegistrantStreet',
|
72
|
+
:'registrant_city' => :'RegistrantCity',
|
73
|
+
:'registrant_state_or_province' => :'RegistrantStateOrProvince',
|
74
|
+
:'registrant_postal_code' => :'RegistrantPostalCode',
|
75
|
+
:'registrant_country' => :'RegistrantCountry',
|
76
|
+
:'registrant_raw_address' => :'RegistrantRawAddress',
|
77
|
+
:'registrant_telephone' => :'RegistrantTelephone',
|
78
|
+
:'whois_server' => :'WhoisServer',
|
79
|
+
:'raw_text_record' => :'RawTextRecord',
|
80
|
+
:'created_dt' => :'CreatedDt'
|
81
|
+
}
|
82
|
+
end
|
83
|
+
|
84
|
+
# Attribute type mapping.
|
85
|
+
def self.swagger_types
|
86
|
+
{
|
87
|
+
:'valid_domain' => :'BOOLEAN',
|
88
|
+
:'registrant_name' => :'String',
|
89
|
+
:'registrant_organization' => :'String',
|
90
|
+
:'registrant_email' => :'String',
|
91
|
+
:'registrant_street_number' => :'String',
|
92
|
+
:'registrant_street' => :'String',
|
93
|
+
:'registrant_city' => :'String',
|
94
|
+
:'registrant_state_or_province' => :'String',
|
95
|
+
:'registrant_postal_code' => :'String',
|
96
|
+
:'registrant_country' => :'String',
|
97
|
+
:'registrant_raw_address' => :'String',
|
98
|
+
:'registrant_telephone' => :'String',
|
99
|
+
:'whois_server' => :'String',
|
100
|
+
:'raw_text_record' => :'String',
|
101
|
+
:'created_dt' => :'DateTime'
|
102
|
+
}
|
103
|
+
end
|
104
|
+
|
105
|
+
# Initializes the object
|
106
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
107
|
+
def initialize(attributes = {})
|
108
|
+
return unless attributes.is_a?(Hash)
|
109
|
+
|
110
|
+
# convert string to symbol for hash key
|
111
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
112
|
+
|
113
|
+
if attributes.has_key?(:'ValidDomain')
|
114
|
+
self.valid_domain = attributes[:'ValidDomain']
|
115
|
+
end
|
116
|
+
|
117
|
+
if attributes.has_key?(:'RegistrantName')
|
118
|
+
self.registrant_name = attributes[:'RegistrantName']
|
119
|
+
end
|
120
|
+
|
121
|
+
if attributes.has_key?(:'RegistrantOrganization')
|
122
|
+
self.registrant_organization = attributes[:'RegistrantOrganization']
|
123
|
+
end
|
124
|
+
|
125
|
+
if attributes.has_key?(:'RegistrantEmail')
|
126
|
+
self.registrant_email = attributes[:'RegistrantEmail']
|
127
|
+
end
|
128
|
+
|
129
|
+
if attributes.has_key?(:'RegistrantStreetNumber')
|
130
|
+
self.registrant_street_number = attributes[:'RegistrantStreetNumber']
|
131
|
+
end
|
132
|
+
|
133
|
+
if attributes.has_key?(:'RegistrantStreet')
|
134
|
+
self.registrant_street = attributes[:'RegistrantStreet']
|
135
|
+
end
|
136
|
+
|
137
|
+
if attributes.has_key?(:'RegistrantCity')
|
138
|
+
self.registrant_city = attributes[:'RegistrantCity']
|
139
|
+
end
|
140
|
+
|
141
|
+
if attributes.has_key?(:'RegistrantStateOrProvince')
|
142
|
+
self.registrant_state_or_province = attributes[:'RegistrantStateOrProvince']
|
143
|
+
end
|
144
|
+
|
145
|
+
if attributes.has_key?(:'RegistrantPostalCode')
|
146
|
+
self.registrant_postal_code = attributes[:'RegistrantPostalCode']
|
147
|
+
end
|
148
|
+
|
149
|
+
if attributes.has_key?(:'RegistrantCountry')
|
150
|
+
self.registrant_country = attributes[:'RegistrantCountry']
|
151
|
+
end
|
152
|
+
|
153
|
+
if attributes.has_key?(:'RegistrantRawAddress')
|
154
|
+
self.registrant_raw_address = attributes[:'RegistrantRawAddress']
|
155
|
+
end
|
156
|
+
|
157
|
+
if attributes.has_key?(:'RegistrantTelephone')
|
158
|
+
self.registrant_telephone = attributes[:'RegistrantTelephone']
|
159
|
+
end
|
160
|
+
|
161
|
+
if attributes.has_key?(:'WhoisServer')
|
162
|
+
self.whois_server = attributes[:'WhoisServer']
|
163
|
+
end
|
164
|
+
|
165
|
+
if attributes.has_key?(:'RawTextRecord')
|
166
|
+
self.raw_text_record = attributes[:'RawTextRecord']
|
167
|
+
end
|
168
|
+
|
169
|
+
if attributes.has_key?(:'CreatedDt')
|
170
|
+
self.created_dt = attributes[:'CreatedDt']
|
171
|
+
end
|
172
|
+
end
|
173
|
+
|
174
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
175
|
+
# @return Array for valid properties with the reasons
|
176
|
+
def list_invalid_properties
|
177
|
+
invalid_properties = Array.new
|
178
|
+
invalid_properties
|
179
|
+
end
|
180
|
+
|
181
|
+
# Check to see if the all the properties in the model are valid
|
182
|
+
# @return true if the model is valid
|
183
|
+
def valid?
|
184
|
+
true
|
185
|
+
end
|
186
|
+
|
187
|
+
# Checks equality by comparing each attribute.
|
188
|
+
# @param [Object] Object to be compared
|
189
|
+
def ==(o)
|
190
|
+
return true if self.equal?(o)
|
191
|
+
self.class == o.class &&
|
192
|
+
valid_domain == o.valid_domain &&
|
193
|
+
registrant_name == o.registrant_name &&
|
194
|
+
registrant_organization == o.registrant_organization &&
|
195
|
+
registrant_email == o.registrant_email &&
|
196
|
+
registrant_street_number == o.registrant_street_number &&
|
197
|
+
registrant_street == o.registrant_street &&
|
198
|
+
registrant_city == o.registrant_city &&
|
199
|
+
registrant_state_or_province == o.registrant_state_or_province &&
|
200
|
+
registrant_postal_code == o.registrant_postal_code &&
|
201
|
+
registrant_country == o.registrant_country &&
|
202
|
+
registrant_raw_address == o.registrant_raw_address &&
|
203
|
+
registrant_telephone == o.registrant_telephone &&
|
204
|
+
whois_server == o.whois_server &&
|
205
|
+
raw_text_record == o.raw_text_record &&
|
206
|
+
created_dt == o.created_dt
|
207
|
+
end
|
208
|
+
|
209
|
+
# @see the `==` method
|
210
|
+
# @param [Object] Object to be compared
|
211
|
+
def eql?(o)
|
212
|
+
self == o
|
213
|
+
end
|
214
|
+
|
215
|
+
# Calculates hash code according to all attributes.
|
216
|
+
# @return [Fixnum] Hash code
|
217
|
+
def hash
|
218
|
+
[valid_domain, registrant_name, registrant_organization, registrant_email, registrant_street_number, registrant_street, registrant_city, registrant_state_or_province, registrant_postal_code, registrant_country, registrant_raw_address, registrant_telephone, whois_server, raw_text_record, created_dt].hash
|
219
|
+
end
|
220
|
+
|
221
|
+
# Builds the object from hash
|
222
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
223
|
+
# @return [Object] Returns the model itself
|
224
|
+
def build_from_hash(attributes)
|
225
|
+
return nil unless attributes.is_a?(Hash)
|
226
|
+
self.class.swagger_types.each_pair do |key, type|
|
227
|
+
if type =~ /\AArray<(.*)>/i
|
228
|
+
# check to ensure the input is an array given that the attribute
|
229
|
+
# is documented as an array but the input is not
|
230
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
231
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
232
|
+
end
|
233
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
234
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
235
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
236
|
+
end
|
237
|
+
|
238
|
+
self
|
239
|
+
end
|
240
|
+
|
241
|
+
# Deserializes the data based on type
|
242
|
+
# @param string type Data type
|
243
|
+
# @param string value Value to be deserialized
|
244
|
+
# @return [Object] Deserialized data
|
245
|
+
def _deserialize(type, value)
|
246
|
+
case type.to_sym
|
247
|
+
when :DateTime
|
248
|
+
DateTime.parse(value)
|
249
|
+
when :Date
|
250
|
+
Date.parse(value)
|
251
|
+
when :String
|
252
|
+
value.to_s
|
253
|
+
when :Integer
|
254
|
+
value.to_i
|
255
|
+
when :Float
|
256
|
+
value.to_f
|
257
|
+
when :BOOLEAN
|
258
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
259
|
+
true
|
260
|
+
else
|
261
|
+
false
|
262
|
+
end
|
263
|
+
when :Object
|
264
|
+
# generic object (usually a Hash), return directly
|
265
|
+
value
|
266
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
267
|
+
inner_type = Regexp.last_match[:inner_type]
|
268
|
+
value.map { |v| _deserialize(inner_type, v) }
|
269
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
270
|
+
k_type = Regexp.last_match[:k_type]
|
271
|
+
v_type = Regexp.last_match[:v_type]
|
272
|
+
{}.tap do |hash|
|
273
|
+
value.each do |k, v|
|
274
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
275
|
+
end
|
276
|
+
end
|
277
|
+
else # model
|
278
|
+
temp_model = CloudmersiveValidateApiClient.const_get(type).new
|
279
|
+
temp_model.build_from_hash(value)
|
280
|
+
end
|
281
|
+
end
|
282
|
+
|
283
|
+
# Returns the string representation of the object
|
284
|
+
# @return [String] String presentation of the object
|
285
|
+
def to_s
|
286
|
+
to_hash.to_s
|
287
|
+
end
|
288
|
+
|
289
|
+
# to_body is an alias to to_hash (backward compatibility)
|
290
|
+
# @return [Hash] Returns the object in the form of hash
|
291
|
+
def to_body
|
292
|
+
to_hash
|
293
|
+
end
|
294
|
+
|
295
|
+
# Returns the object in the form of hash
|
296
|
+
# @return [Hash] Returns the object in the form of hash
|
297
|
+
def to_hash
|
298
|
+
hash = {}
|
299
|
+
self.class.attribute_map.each_pair do |attr, param|
|
300
|
+
value = self.send(attr)
|
301
|
+
next if value.nil?
|
302
|
+
hash[param] = _to_hash(value)
|
303
|
+
end
|
304
|
+
hash
|
305
|
+
end
|
306
|
+
|
307
|
+
# Outputs non-array value in the form of hash
|
308
|
+
# For object, use to_hash. Otherwise, just return the value
|
309
|
+
# @param [Object] value Any valid value
|
310
|
+
# @return [Hash] Returns the value in the form of hash
|
311
|
+
def _to_hash(value)
|
312
|
+
if value.is_a?(Array)
|
313
|
+
value.compact.map { |v| _to_hash(v) }
|
314
|
+
elsif value.is_a?(Hash)
|
315
|
+
{}.tap do |hash|
|
316
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
317
|
+
end
|
318
|
+
elsif value.respond_to? :to_hash
|
319
|
+
value.to_hash
|
320
|
+
else
|
321
|
+
value
|
322
|
+
end
|
323
|
+
end
|
324
|
+
|
325
|
+
end
|
326
|
+
end
|
@@ -0,0 +1,15 @@
|
|
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
|
+
module CloudmersiveValidateApiClient
|
14
|
+
VERSION = '2.0.6'
|
15
|
+
end
|
@@ -0,0 +1,142 @@
|
|
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 'spec_helper'
|
14
|
+
require 'json'
|
15
|
+
|
16
|
+
# Unit tests for CloudmersiveValidateApiClient::AddressApi
|
17
|
+
# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen)
|
18
|
+
# Please update as you see appropriate
|
19
|
+
describe 'AddressApi' do
|
20
|
+
before do
|
21
|
+
# run before each test
|
22
|
+
@instance = CloudmersiveValidateApiClient::AddressApi.new
|
23
|
+
end
|
24
|
+
|
25
|
+
after do
|
26
|
+
# run after each test
|
27
|
+
end
|
28
|
+
|
29
|
+
describe 'test an instance of AddressApi' do
|
30
|
+
it 'should create an instance of AddressApi' do
|
31
|
+
expect(@instance).to be_instance_of(CloudmersiveValidateApiClient::AddressApi)
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
# unit tests for address_check_eu_membership
|
36
|
+
# Check if a country is a member of the European Union (EU)
|
37
|
+
# Checks if the input country is a member of the European Union or not.
|
38
|
+
# @param input Input request
|
39
|
+
# @param [Hash] opts the optional parameters
|
40
|
+
# @return [ValidateCountryResponse]
|
41
|
+
describe 'address_check_eu_membership test' do
|
42
|
+
it 'should work' do
|
43
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
# unit tests for address_country
|
48
|
+
# Validate and normalize country information, return ISO 3166-1 country codes and country name
|
49
|
+
# Validates and normalizes country information, and returns key information about a country, as well as whether it is a member of the European Union. Also returns distinct time zones in the country.
|
50
|
+
# @param input Input request
|
51
|
+
# @param [Hash] opts the optional parameters
|
52
|
+
# @return [ValidateCountryResponse]
|
53
|
+
describe 'address_country test' do
|
54
|
+
it 'should work' do
|
55
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
# unit tests for address_country_list
|
60
|
+
# Get a list of ISO 3166-1 countries
|
61
|
+
# Enumerates the list of ISO 3166-1 countries, including name, country codes, and more.
|
62
|
+
# @param [Hash] opts the optional parameters
|
63
|
+
# @return [CountryListResult]
|
64
|
+
describe 'address_country_list test' do
|
65
|
+
it 'should work' do
|
66
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
70
|
+
# unit tests for address_get_timezone
|
71
|
+
# Gets IANA/Olsen time zones for a country
|
72
|
+
# Gets the IANA/Olsen time zones for a country.
|
73
|
+
# @param input Input request
|
74
|
+
# @param [Hash] opts the optional parameters
|
75
|
+
# @return [GetTimezonesResponse]
|
76
|
+
describe 'address_get_timezone test' do
|
77
|
+
it 'should work' do
|
78
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
79
|
+
end
|
80
|
+
end
|
81
|
+
|
82
|
+
# unit tests for address_parse_string
|
83
|
+
# Parse an unstructured input text string into an international, formatted address
|
84
|
+
# Uses machine learning and Natural Language Processing (NLP) to handle a wide array of cases, including non-standard and unstructured address strings across a wide array of countries and address formatting norms.
|
85
|
+
# @param input Input parse request
|
86
|
+
# @param [Hash] opts the optional parameters
|
87
|
+
# @return [ParseAddressResponse]
|
88
|
+
describe 'address_parse_string test' do
|
89
|
+
it 'should work' do
|
90
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
91
|
+
end
|
92
|
+
end
|
93
|
+
|
94
|
+
# unit tests for address_validate_address
|
95
|
+
# Validate a street address
|
96
|
+
# Determines if an input structured street address is valid or invalid. If the address is valid, also returns the latitude and longitude of the address. Supports all major international addresses.
|
97
|
+
# @param input Input parse request
|
98
|
+
# @param [Hash] opts the optional parameters
|
99
|
+
# @return [ValidateAddressResponse]
|
100
|
+
describe 'address_validate_address test' do
|
101
|
+
it 'should work' do
|
102
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
103
|
+
end
|
104
|
+
end
|
105
|
+
|
106
|
+
# unit tests for address_validate_city
|
107
|
+
# Validate a City and State/Province combination, get location information about it
|
108
|
+
# Checks if the input city and state name or code is valid, and returns information about it such as normalized City name, State name and more. Supports all major international addresses.
|
109
|
+
# @param input Input parse request
|
110
|
+
# @param [Hash] opts the optional parameters
|
111
|
+
# @return [ValidateCityResponse]
|
112
|
+
describe 'address_validate_city test' do
|
113
|
+
it 'should work' do
|
114
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
115
|
+
end
|
116
|
+
end
|
117
|
+
|
118
|
+
# unit tests for address_validate_postal_code
|
119
|
+
# Validate a postal code, get location information about it
|
120
|
+
# Checks if the input postal code is valid, and returns information about it such as City, State and more. Supports all major countries.
|
121
|
+
# @param input Input parse request
|
122
|
+
# @param [Hash] opts the optional parameters
|
123
|
+
# @return [ValidatePostalCodeResponse]
|
124
|
+
describe 'address_validate_postal_code test' do
|
125
|
+
it 'should work' do
|
126
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
127
|
+
end
|
128
|
+
end
|
129
|
+
|
130
|
+
# unit tests for address_validate_state
|
131
|
+
# Validate a state or province, name or abbreviation, get location information about it
|
132
|
+
# Checks if the input state name or code is valid, and returns information about it such as normalized State name and more. Supports all major countries.
|
133
|
+
# @param input Input parse request
|
134
|
+
# @param [Hash] opts the optional parameters
|
135
|
+
# @return [ValidateStateResponse]
|
136
|
+
describe 'address_validate_state test' do
|
137
|
+
it 'should work' do
|
138
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
139
|
+
end
|
140
|
+
end
|
141
|
+
|
142
|
+
end
|