cloudmersive-validate-api-client 2.0.3 → 2.0.8
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 +7 -0
- data/README.md +177 -0
- data/Rakefile +8 -0
- data/cloudmersive-validate-api-client.gemspec +45 -0
- data/docs/AddressApi.md +607 -0
- data/docs/AddressGetServersResponse.md +9 -0
- data/docs/AddressVerifySyntaxOnlyResponse.md +11 -0
- data/docs/CheckResponse.md +8 -0
- data/docs/CountryDetails.md +16 -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 +19 -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 +609 -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 +266 -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 +298 -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 +166 -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 +89 -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 +107 -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,266 @@
|
|
|
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
|
+
# Full email addresss validation result
|
|
17
|
+
class FullEmailValidationResponse
|
|
18
|
+
# True if the email address is valid overall, false otherwise
|
|
19
|
+
attr_accessor :valid_address
|
|
20
|
+
|
|
21
|
+
# Email server connected to for verification
|
|
22
|
+
attr_accessor :mail_server_used_for_validation
|
|
23
|
+
|
|
24
|
+
# True if the syntax of the email address is valid, false otherwise. This is one component of ValidAddress, but not the only one.
|
|
25
|
+
attr_accessor :valid_syntax
|
|
26
|
+
|
|
27
|
+
# True if the domain name of the email address is valid, false otherwise. This is one component of ValidAddress, but not the only one.
|
|
28
|
+
attr_accessor :valid_domain
|
|
29
|
+
|
|
30
|
+
# True if the email address was verified by the remote server, false otherwise. This is one component of ValidAddress, but not the only one.
|
|
31
|
+
attr_accessor :valid_smtp
|
|
32
|
+
|
|
33
|
+
# True if the domain is a catch-all domain name, false otherwise. Catch-all domain names, while rare, always accept inbound email to ensure they do not lose any potentially useful emails. Catch-all domain names can occassionally be configured to first accept and store all inbound email, but then later send a bounce email back to the sender after a delayed period of time.
|
|
34
|
+
attr_accessor :is_catchall_domain
|
|
35
|
+
|
|
36
|
+
# Domain name of the email address
|
|
37
|
+
attr_accessor :domain
|
|
38
|
+
|
|
39
|
+
# True if the email domain name is a free provider (typically a free to sign up web email provider for consumers / personal use), false otherwise.
|
|
40
|
+
attr_accessor :is_free_email_provider
|
|
41
|
+
|
|
42
|
+
# True if the email address is a disposable email address, false otherwise; these disposable providers are not typically used to receive email and so will have a low likelihood of opening mail sent there.
|
|
43
|
+
attr_accessor :is_disposable
|
|
44
|
+
|
|
45
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
46
|
+
def self.attribute_map
|
|
47
|
+
{
|
|
48
|
+
:'valid_address' => :'ValidAddress',
|
|
49
|
+
:'mail_server_used_for_validation' => :'MailServerUsedForValidation',
|
|
50
|
+
:'valid_syntax' => :'Valid_Syntax',
|
|
51
|
+
:'valid_domain' => :'Valid_Domain',
|
|
52
|
+
:'valid_smtp' => :'Valid_SMTP',
|
|
53
|
+
:'is_catchall_domain' => :'IsCatchallDomain',
|
|
54
|
+
:'domain' => :'Domain',
|
|
55
|
+
:'is_free_email_provider' => :'IsFreeEmailProvider',
|
|
56
|
+
:'is_disposable' => :'IsDisposable'
|
|
57
|
+
}
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
# Attribute type mapping.
|
|
61
|
+
def self.swagger_types
|
|
62
|
+
{
|
|
63
|
+
:'valid_address' => :'BOOLEAN',
|
|
64
|
+
:'mail_server_used_for_validation' => :'String',
|
|
65
|
+
:'valid_syntax' => :'BOOLEAN',
|
|
66
|
+
:'valid_domain' => :'BOOLEAN',
|
|
67
|
+
:'valid_smtp' => :'BOOLEAN',
|
|
68
|
+
:'is_catchall_domain' => :'BOOLEAN',
|
|
69
|
+
:'domain' => :'String',
|
|
70
|
+
:'is_free_email_provider' => :'BOOLEAN',
|
|
71
|
+
:'is_disposable' => :'BOOLEAN'
|
|
72
|
+
}
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
# Initializes the object
|
|
76
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
77
|
+
def initialize(attributes = {})
|
|
78
|
+
return unless attributes.is_a?(Hash)
|
|
79
|
+
|
|
80
|
+
# convert string to symbol for hash key
|
|
81
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
|
82
|
+
|
|
83
|
+
if attributes.has_key?(:'ValidAddress')
|
|
84
|
+
self.valid_address = attributes[:'ValidAddress']
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
if attributes.has_key?(:'MailServerUsedForValidation')
|
|
88
|
+
self.mail_server_used_for_validation = attributes[:'MailServerUsedForValidation']
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
if attributes.has_key?(:'Valid_Syntax')
|
|
92
|
+
self.valid_syntax = attributes[:'Valid_Syntax']
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
if attributes.has_key?(:'Valid_Domain')
|
|
96
|
+
self.valid_domain = attributes[:'Valid_Domain']
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
if attributes.has_key?(:'Valid_SMTP')
|
|
100
|
+
self.valid_smtp = attributes[:'Valid_SMTP']
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
if attributes.has_key?(:'IsCatchallDomain')
|
|
104
|
+
self.is_catchall_domain = attributes[:'IsCatchallDomain']
|
|
105
|
+
end
|
|
106
|
+
|
|
107
|
+
if attributes.has_key?(:'Domain')
|
|
108
|
+
self.domain = attributes[:'Domain']
|
|
109
|
+
end
|
|
110
|
+
|
|
111
|
+
if attributes.has_key?(:'IsFreeEmailProvider')
|
|
112
|
+
self.is_free_email_provider = attributes[:'IsFreeEmailProvider']
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
if attributes.has_key?(:'IsDisposable')
|
|
116
|
+
self.is_disposable = attributes[:'IsDisposable']
|
|
117
|
+
end
|
|
118
|
+
end
|
|
119
|
+
|
|
120
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
121
|
+
# @return Array for valid properties with the reasons
|
|
122
|
+
def list_invalid_properties
|
|
123
|
+
invalid_properties = Array.new
|
|
124
|
+
invalid_properties
|
|
125
|
+
end
|
|
126
|
+
|
|
127
|
+
# Check to see if the all the properties in the model are valid
|
|
128
|
+
# @return true if the model is valid
|
|
129
|
+
def valid?
|
|
130
|
+
true
|
|
131
|
+
end
|
|
132
|
+
|
|
133
|
+
# Checks equality by comparing each attribute.
|
|
134
|
+
# @param [Object] Object to be compared
|
|
135
|
+
def ==(o)
|
|
136
|
+
return true if self.equal?(o)
|
|
137
|
+
self.class == o.class &&
|
|
138
|
+
valid_address == o.valid_address &&
|
|
139
|
+
mail_server_used_for_validation == o.mail_server_used_for_validation &&
|
|
140
|
+
valid_syntax == o.valid_syntax &&
|
|
141
|
+
valid_domain == o.valid_domain &&
|
|
142
|
+
valid_smtp == o.valid_smtp &&
|
|
143
|
+
is_catchall_domain == o.is_catchall_domain &&
|
|
144
|
+
domain == o.domain &&
|
|
145
|
+
is_free_email_provider == o.is_free_email_provider &&
|
|
146
|
+
is_disposable == o.is_disposable
|
|
147
|
+
end
|
|
148
|
+
|
|
149
|
+
# @see the `==` method
|
|
150
|
+
# @param [Object] Object to be compared
|
|
151
|
+
def eql?(o)
|
|
152
|
+
self == o
|
|
153
|
+
end
|
|
154
|
+
|
|
155
|
+
# Calculates hash code according to all attributes.
|
|
156
|
+
# @return [Fixnum] Hash code
|
|
157
|
+
def hash
|
|
158
|
+
[valid_address, mail_server_used_for_validation, valid_syntax, valid_domain, valid_smtp, is_catchall_domain, domain, is_free_email_provider, is_disposable].hash
|
|
159
|
+
end
|
|
160
|
+
|
|
161
|
+
# Builds the object from hash
|
|
162
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
163
|
+
# @return [Object] Returns the model itself
|
|
164
|
+
def build_from_hash(attributes)
|
|
165
|
+
return nil unless attributes.is_a?(Hash)
|
|
166
|
+
self.class.swagger_types.each_pair do |key, type|
|
|
167
|
+
if type =~ /\AArray<(.*)>/i
|
|
168
|
+
# check to ensure the input is an array given that the attribute
|
|
169
|
+
# is documented as an array but the input is not
|
|
170
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
|
171
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
|
172
|
+
end
|
|
173
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
|
174
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
|
175
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
|
176
|
+
end
|
|
177
|
+
|
|
178
|
+
self
|
|
179
|
+
end
|
|
180
|
+
|
|
181
|
+
# Deserializes the data based on type
|
|
182
|
+
# @param string type Data type
|
|
183
|
+
# @param string value Value to be deserialized
|
|
184
|
+
# @return [Object] Deserialized data
|
|
185
|
+
def _deserialize(type, value)
|
|
186
|
+
case type.to_sym
|
|
187
|
+
when :DateTime
|
|
188
|
+
DateTime.parse(value)
|
|
189
|
+
when :Date
|
|
190
|
+
Date.parse(value)
|
|
191
|
+
when :String
|
|
192
|
+
value.to_s
|
|
193
|
+
when :Integer
|
|
194
|
+
value.to_i
|
|
195
|
+
when :Float
|
|
196
|
+
value.to_f
|
|
197
|
+
when :BOOLEAN
|
|
198
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
199
|
+
true
|
|
200
|
+
else
|
|
201
|
+
false
|
|
202
|
+
end
|
|
203
|
+
when :Object
|
|
204
|
+
# generic object (usually a Hash), return directly
|
|
205
|
+
value
|
|
206
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
207
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
208
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
209
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
210
|
+
k_type = Regexp.last_match[:k_type]
|
|
211
|
+
v_type = Regexp.last_match[:v_type]
|
|
212
|
+
{}.tap do |hash|
|
|
213
|
+
value.each do |k, v|
|
|
214
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
215
|
+
end
|
|
216
|
+
end
|
|
217
|
+
else # model
|
|
218
|
+
temp_model = CloudmersiveValidateApiClient.const_get(type).new
|
|
219
|
+
temp_model.build_from_hash(value)
|
|
220
|
+
end
|
|
221
|
+
end
|
|
222
|
+
|
|
223
|
+
# Returns the string representation of the object
|
|
224
|
+
# @return [String] String presentation of the object
|
|
225
|
+
def to_s
|
|
226
|
+
to_hash.to_s
|
|
227
|
+
end
|
|
228
|
+
|
|
229
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
230
|
+
# @return [Hash] Returns the object in the form of hash
|
|
231
|
+
def to_body
|
|
232
|
+
to_hash
|
|
233
|
+
end
|
|
234
|
+
|
|
235
|
+
# Returns the object in the form of hash
|
|
236
|
+
# @return [Hash] Returns the object in the form of hash
|
|
237
|
+
def to_hash
|
|
238
|
+
hash = {}
|
|
239
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
240
|
+
value = self.send(attr)
|
|
241
|
+
next if value.nil?
|
|
242
|
+
hash[param] = _to_hash(value)
|
|
243
|
+
end
|
|
244
|
+
hash
|
|
245
|
+
end
|
|
246
|
+
|
|
247
|
+
# Outputs non-array value in the form of hash
|
|
248
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
249
|
+
# @param [Object] value Any valid value
|
|
250
|
+
# @return [Hash] Returns the value in the form of hash
|
|
251
|
+
def _to_hash(value)
|
|
252
|
+
if value.is_a?(Array)
|
|
253
|
+
value.compact.map { |v| _to_hash(v) }
|
|
254
|
+
elsif value.is_a?(Hash)
|
|
255
|
+
{}.tap do |hash|
|
|
256
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
257
|
+
end
|
|
258
|
+
elsif value.respond_to? :to_hash
|
|
259
|
+
value.to_hash
|
|
260
|
+
else
|
|
261
|
+
value
|
|
262
|
+
end
|
|
263
|
+
end
|
|
264
|
+
|
|
265
|
+
end
|
|
266
|
+
end
|
|
@@ -0,0 +1,186 @@
|
|
|
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 full name string
|
|
17
|
+
class FullNameValidationRequest
|
|
18
|
+
# Full name to process as a free-form string; supports many components such as First Name, Middle Name, Last Name, Title, Nickname, Suffix, and Display Name
|
|
19
|
+
attr_accessor :full_name_string
|
|
20
|
+
|
|
21
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
22
|
+
def self.attribute_map
|
|
23
|
+
{
|
|
24
|
+
:'full_name_string' => :'FullNameString'
|
|
25
|
+
}
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
# Attribute type mapping.
|
|
29
|
+
def self.swagger_types
|
|
30
|
+
{
|
|
31
|
+
:'full_name_string' => :'String'
|
|
32
|
+
}
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
# Initializes the object
|
|
36
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
37
|
+
def initialize(attributes = {})
|
|
38
|
+
return unless attributes.is_a?(Hash)
|
|
39
|
+
|
|
40
|
+
# convert string to symbol for hash key
|
|
41
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
|
42
|
+
|
|
43
|
+
if attributes.has_key?(:'FullNameString')
|
|
44
|
+
self.full_name_string = attributes[:'FullNameString']
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
49
|
+
# @return Array for valid properties with the reasons
|
|
50
|
+
def list_invalid_properties
|
|
51
|
+
invalid_properties = Array.new
|
|
52
|
+
invalid_properties
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
# Check to see if the all the properties in the model are valid
|
|
56
|
+
# @return true if the model is valid
|
|
57
|
+
def valid?
|
|
58
|
+
true
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
# Checks equality by comparing each attribute.
|
|
62
|
+
# @param [Object] Object to be compared
|
|
63
|
+
def ==(o)
|
|
64
|
+
return true if self.equal?(o)
|
|
65
|
+
self.class == o.class &&
|
|
66
|
+
full_name_string == o.full_name_string
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
# @see the `==` method
|
|
70
|
+
# @param [Object] Object to be compared
|
|
71
|
+
def eql?(o)
|
|
72
|
+
self == o
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
# Calculates hash code according to all attributes.
|
|
76
|
+
# @return [Fixnum] Hash code
|
|
77
|
+
def hash
|
|
78
|
+
[full_name_string].hash
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
# Builds the object from hash
|
|
82
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
83
|
+
# @return [Object] Returns the model itself
|
|
84
|
+
def build_from_hash(attributes)
|
|
85
|
+
return nil unless attributes.is_a?(Hash)
|
|
86
|
+
self.class.swagger_types.each_pair do |key, type|
|
|
87
|
+
if type =~ /\AArray<(.*)>/i
|
|
88
|
+
# check to ensure the input is an array given that the attribute
|
|
89
|
+
# is documented as an array but the input is not
|
|
90
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
|
91
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
|
92
|
+
end
|
|
93
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
|
94
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
|
95
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
self
|
|
99
|
+
end
|
|
100
|
+
|
|
101
|
+
# Deserializes the data based on type
|
|
102
|
+
# @param string type Data type
|
|
103
|
+
# @param string value Value to be deserialized
|
|
104
|
+
# @return [Object] Deserialized data
|
|
105
|
+
def _deserialize(type, value)
|
|
106
|
+
case type.to_sym
|
|
107
|
+
when :DateTime
|
|
108
|
+
DateTime.parse(value)
|
|
109
|
+
when :Date
|
|
110
|
+
Date.parse(value)
|
|
111
|
+
when :String
|
|
112
|
+
value.to_s
|
|
113
|
+
when :Integer
|
|
114
|
+
value.to_i
|
|
115
|
+
when :Float
|
|
116
|
+
value.to_f
|
|
117
|
+
when :BOOLEAN
|
|
118
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
119
|
+
true
|
|
120
|
+
else
|
|
121
|
+
false
|
|
122
|
+
end
|
|
123
|
+
when :Object
|
|
124
|
+
# generic object (usually a Hash), return directly
|
|
125
|
+
value
|
|
126
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
127
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
128
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
129
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
130
|
+
k_type = Regexp.last_match[:k_type]
|
|
131
|
+
v_type = Regexp.last_match[:v_type]
|
|
132
|
+
{}.tap do |hash|
|
|
133
|
+
value.each do |k, v|
|
|
134
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
135
|
+
end
|
|
136
|
+
end
|
|
137
|
+
else # model
|
|
138
|
+
temp_model = CloudmersiveValidateApiClient.const_get(type).new
|
|
139
|
+
temp_model.build_from_hash(value)
|
|
140
|
+
end
|
|
141
|
+
end
|
|
142
|
+
|
|
143
|
+
# Returns the string representation of the object
|
|
144
|
+
# @return [String] String presentation of the object
|
|
145
|
+
def to_s
|
|
146
|
+
to_hash.to_s
|
|
147
|
+
end
|
|
148
|
+
|
|
149
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
150
|
+
# @return [Hash] Returns the object in the form of hash
|
|
151
|
+
def to_body
|
|
152
|
+
to_hash
|
|
153
|
+
end
|
|
154
|
+
|
|
155
|
+
# Returns the object in the form of hash
|
|
156
|
+
# @return [Hash] Returns the object in the form of hash
|
|
157
|
+
def to_hash
|
|
158
|
+
hash = {}
|
|
159
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
160
|
+
value = self.send(attr)
|
|
161
|
+
next if value.nil?
|
|
162
|
+
hash[param] = _to_hash(value)
|
|
163
|
+
end
|
|
164
|
+
hash
|
|
165
|
+
end
|
|
166
|
+
|
|
167
|
+
# Outputs non-array value in the form of hash
|
|
168
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
169
|
+
# @param [Object] value Any valid value
|
|
170
|
+
# @return [Hash] Returns the value in the form of hash
|
|
171
|
+
def _to_hash(value)
|
|
172
|
+
if value.is_a?(Array)
|
|
173
|
+
value.compact.map { |v| _to_hash(v) }
|
|
174
|
+
elsif value.is_a?(Hash)
|
|
175
|
+
{}.tap do |hash|
|
|
176
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
177
|
+
end
|
|
178
|
+
elsif value.respond_to? :to_hash
|
|
179
|
+
value.to_hash
|
|
180
|
+
else
|
|
181
|
+
value
|
|
182
|
+
end
|
|
183
|
+
end
|
|
184
|
+
|
|
185
|
+
end
|
|
186
|
+
end
|