cloudmersive-validate-api-client 2.0.2 → 2.0.7

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 (183) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +7 -0
  3. data/README.md +176 -0
  4. data/Rakefile +8 -0
  5. data/cloudmersive-validate-api-client.gemspec +45 -0
  6. data/docs/AddressApi.md +552 -0
  7. data/docs/AddressGetServersResponse.md +9 -0
  8. data/docs/AddressVerifySyntaxOnlyResponse.md +11 -0
  9. data/docs/CheckResponse.md +8 -0
  10. data/docs/CountryDetails.md +14 -0
  11. data/docs/CountryListResult.md +9 -0
  12. data/docs/DomainApi.md +228 -0
  13. data/docs/EmailApi.md +173 -0
  14. data/docs/FirstNameValidationRequest.md +8 -0
  15. data/docs/FirstNameValidationResponse.md +9 -0
  16. data/docs/FullEmailValidationResponse.md +16 -0
  17. data/docs/FullNameValidationRequest.md +8 -0
  18. data/docs/FullNameValidationResponse.md +17 -0
  19. data/docs/GeolocateResponse.md +16 -0
  20. data/docs/GetGenderRequest.md +9 -0
  21. data/docs/GetGenderResponse.md +9 -0
  22. data/docs/GetTimezonesRequest.md +8 -0
  23. data/docs/GetTimezonesResponse.md +13 -0
  24. data/docs/IPAddressApi.md +173 -0
  25. data/docs/IPThreatResponse.md +9 -0
  26. data/docs/LastNameValidationRequest.md +8 -0
  27. data/docs/LastNameValidationResponse.md +9 -0
  28. data/docs/LeadEnrichmentApi.md +61 -0
  29. data/docs/LeadEnrichmentRequest.md +21 -0
  30. data/docs/LeadEnrichmentResponse.md +25 -0
  31. data/docs/NameApi.md +283 -0
  32. data/docs/ParseAddressRequest.md +9 -0
  33. data/docs/ParseAddressResponse.md +16 -0
  34. data/docs/PhoneNumberApi.md +63 -0
  35. data/docs/PhoneNumberValidateRequest.md +9 -0
  36. data/docs/PhoneNumberValidationResponse.md +15 -0
  37. data/docs/Timezone.md +10 -0
  38. data/docs/TorNodeResponse.md +8 -0
  39. data/docs/UserAgentApi.md +63 -0
  40. data/docs/UserAgentValidateRequest.md +8 -0
  41. data/docs/UserAgentValidateResponse.md +21 -0
  42. data/docs/ValidateAddressRequest.md +13 -0
  43. data/docs/ValidateAddressResponse.md +10 -0
  44. data/docs/ValidateCityRequest.md +11 -0
  45. data/docs/ValidateCityResponse.md +12 -0
  46. data/docs/ValidateCountryRequest.md +8 -0
  47. data/docs/ValidateCountryResponse.md +17 -0
  48. data/docs/ValidateIdentifierRequest.md +15 -0
  49. data/docs/ValidateIdentifierResponse.md +9 -0
  50. data/docs/ValidatePostalCodeRequest.md +10 -0
  51. data/docs/ValidatePostalCodeResponse.md +12 -0
  52. data/docs/ValidateStateRequest.md +10 -0
  53. data/docs/ValidateStateResponse.md +11 -0
  54. data/docs/ValidateUrlRequestFull.md +8 -0
  55. data/docs/ValidateUrlRequestSyntaxOnly.md +8 -0
  56. data/docs/ValidateUrlResponseFull.md +12 -0
  57. data/docs/ValidateUrlResponseSyntaxOnly.md +9 -0
  58. data/docs/VatApi.md +63 -0
  59. data/docs/VatLookupRequest.md +8 -0
  60. data/docs/VatLookupResponse.md +19 -0
  61. data/docs/WhoisResponse.md +22 -0
  62. data/git_push.sh +55 -0
  63. data/lib/cloudmersive-validate-api-client.rb +95 -0
  64. data/lib/cloudmersive-validate-api-client/api/address_api.rb +555 -0
  65. data/lib/cloudmersive-validate-api-client/api/domain_api.rb +239 -0
  66. data/lib/cloudmersive-validate-api-client/api/email_api.rb +185 -0
  67. data/lib/cloudmersive-validate-api-client/api/ip_address_api.rb +185 -0
  68. data/lib/cloudmersive-validate-api-client/api/lead_enrichment_api.rb +75 -0
  69. data/lib/cloudmersive-validate-api-client/api/name_api.rb +293 -0
  70. data/lib/cloudmersive-validate-api-client/api/phone_number_api.rb +77 -0
  71. data/lib/cloudmersive-validate-api-client/api/user_agent_api.rb +77 -0
  72. data/lib/cloudmersive-validate-api-client/api/vat_api.rb +77 -0
  73. data/lib/cloudmersive-validate-api-client/api_client.rb +391 -0
  74. data/lib/cloudmersive-validate-api-client/api_error.rb +38 -0
  75. data/lib/cloudmersive-validate-api-client/configuration.rb +209 -0
  76. data/lib/cloudmersive-validate-api-client/models/address_get_servers_response.rb +198 -0
  77. data/lib/cloudmersive-validate-api-client/models/address_verify_syntax_only_response.rb +216 -0
  78. data/lib/cloudmersive-validate-api-client/models/check_response.rb +186 -0
  79. data/lib/cloudmersive-validate-api-client/models/country_details.rb +246 -0
  80. data/lib/cloudmersive-validate-api-client/models/country_list_result.rb +198 -0
  81. data/lib/cloudmersive-validate-api-client/models/first_name_validation_request.rb +186 -0
  82. data/lib/cloudmersive-validate-api-client/models/first_name_validation_response.rb +196 -0
  83. data/lib/cloudmersive-validate-api-client/models/full_email_validation_response.rb +266 -0
  84. data/lib/cloudmersive-validate-api-client/models/full_name_validation_request.rb +186 -0
  85. data/lib/cloudmersive-validate-api-client/models/full_name_validation_response.rb +276 -0
  86. data/lib/cloudmersive-validate-api-client/models/geolocate_response.rb +266 -0
  87. data/lib/cloudmersive-validate-api-client/models/get_gender_request.rb +196 -0
  88. data/lib/cloudmersive-validate-api-client/models/get_gender_response.rb +196 -0
  89. data/lib/cloudmersive-validate-api-client/models/get_timezones_request.rb +186 -0
  90. data/lib/cloudmersive-validate-api-client/models/get_timezones_response.rb +238 -0
  91. data/lib/cloudmersive-validate-api-client/models/ip_threat_response.rb +196 -0
  92. data/lib/cloudmersive-validate-api-client/models/last_name_validation_request.rb +186 -0
  93. data/lib/cloudmersive-validate-api-client/models/last_name_validation_response.rb +196 -0
  94. data/lib/cloudmersive-validate-api-client/models/lead_enrichment_request.rb +316 -0
  95. data/lib/cloudmersive-validate-api-client/models/lead_enrichment_response.rb +356 -0
  96. data/lib/cloudmersive-validate-api-client/models/parse_address_request.rb +196 -0
  97. data/lib/cloudmersive-validate-api-client/models/parse_address_response.rb +266 -0
  98. data/lib/cloudmersive-validate-api-client/models/phone_number_validate_request.rb +196 -0
  99. data/lib/cloudmersive-validate-api-client/models/phone_number_validation_response.rb +256 -0
  100. data/lib/cloudmersive-validate-api-client/models/timezone.rb +206 -0
  101. data/lib/cloudmersive-validate-api-client/models/tor_node_response.rb +186 -0
  102. data/lib/cloudmersive-validate-api-client/models/user_agent_validate_request.rb +186 -0
  103. data/lib/cloudmersive-validate-api-client/models/user_agent_validate_response.rb +316 -0
  104. data/lib/cloudmersive-validate-api-client/models/validate_address_request.rb +236 -0
  105. data/lib/cloudmersive-validate-api-client/models/validate_address_response.rb +206 -0
  106. data/lib/cloudmersive-validate-api-client/models/validate_city_request.rb +216 -0
  107. data/lib/cloudmersive-validate-api-client/models/validate_city_response.rb +226 -0
  108. data/lib/cloudmersive-validate-api-client/models/validate_country_request.rb +186 -0
  109. data/lib/cloudmersive-validate-api-client/models/validate_country_response.rb +278 -0
  110. data/lib/cloudmersive-validate-api-client/models/validate_identifier_request.rb +256 -0
  111. data/lib/cloudmersive-validate-api-client/models/validate_identifier_response.rb +196 -0
  112. data/lib/cloudmersive-validate-api-client/models/validate_postal_code_request.rb +206 -0
  113. data/lib/cloudmersive-validate-api-client/models/validate_postal_code_response.rb +226 -0
  114. data/lib/cloudmersive-validate-api-client/models/validate_state_request.rb +206 -0
  115. data/lib/cloudmersive-validate-api-client/models/validate_state_response.rb +216 -0
  116. data/lib/cloudmersive-validate-api-client/models/validate_url_request_full.rb +186 -0
  117. data/lib/cloudmersive-validate-api-client/models/validate_url_request_syntax_only.rb +186 -0
  118. data/lib/cloudmersive-validate-api-client/models/validate_url_response_full.rb +226 -0
  119. data/lib/cloudmersive-validate-api-client/models/validate_url_response_syntax_only.rb +196 -0
  120. data/lib/cloudmersive-validate-api-client/models/vat_lookup_request.rb +186 -0
  121. data/lib/cloudmersive-validate-api-client/models/vat_lookup_response.rb +295 -0
  122. data/lib/cloudmersive-validate-api-client/models/whois_response.rb +326 -0
  123. data/lib/cloudmersive-validate-api-client/version.rb +15 -0
  124. data/spec/api/address_api_spec.rb +154 -0
  125. data/spec/api/domain_api_spec.rb +83 -0
  126. data/spec/api/email_api_spec.rb +71 -0
  127. data/spec/api/ip_address_api_spec.rb +71 -0
  128. data/spec/api/lead_enrichment_api_spec.rb +46 -0
  129. data/spec/api/name_api_spec.rb +95 -0
  130. data/spec/api/phone_number_api_spec.rb +47 -0
  131. data/spec/api/user_agent_api_spec.rb +47 -0
  132. data/spec/api/vat_api_spec.rb +47 -0
  133. data/spec/api_client_spec.rb +243 -0
  134. data/spec/configuration_spec.rb +42 -0
  135. data/spec/models/address_get_servers_response_spec.rb +47 -0
  136. data/spec/models/address_verify_syntax_only_response_spec.rb +59 -0
  137. data/spec/models/check_response_spec.rb +41 -0
  138. data/spec/models/country_details_spec.rb +77 -0
  139. data/spec/models/country_list_result_spec.rb +47 -0
  140. data/spec/models/first_name_validation_request_spec.rb +41 -0
  141. data/spec/models/first_name_validation_response_spec.rb +47 -0
  142. data/spec/models/full_email_validation_response_spec.rb +89 -0
  143. data/spec/models/full_name_validation_request_spec.rb +41 -0
  144. data/spec/models/full_name_validation_response_spec.rb +95 -0
  145. data/spec/models/geolocate_response_spec.rb +89 -0
  146. data/spec/models/get_gender_request_spec.rb +47 -0
  147. data/spec/models/get_gender_response_spec.rb +47 -0
  148. data/spec/models/get_timezones_request_spec.rb +41 -0
  149. data/spec/models/get_timezones_response_spec.rb +71 -0
  150. data/spec/models/ip_threat_response_spec.rb +47 -0
  151. data/spec/models/last_name_validation_request_spec.rb +41 -0
  152. data/spec/models/last_name_validation_response_spec.rb +47 -0
  153. data/spec/models/lead_enrichment_request_spec.rb +119 -0
  154. data/spec/models/lead_enrichment_response_spec.rb +143 -0
  155. data/spec/models/parse_address_request_spec.rb +47 -0
  156. data/spec/models/parse_address_response_spec.rb +89 -0
  157. data/spec/models/phone_number_validate_request_spec.rb +47 -0
  158. data/spec/models/phone_number_validation_response_spec.rb +83 -0
  159. data/spec/models/timezone_spec.rb +53 -0
  160. data/spec/models/tor_node_response_spec.rb +41 -0
  161. data/spec/models/user_agent_validate_request_spec.rb +41 -0
  162. data/spec/models/user_agent_validate_response_spec.rb +119 -0
  163. data/spec/models/validate_address_request_spec.rb +71 -0
  164. data/spec/models/validate_address_response_spec.rb +53 -0
  165. data/spec/models/validate_city_request_spec.rb +59 -0
  166. data/spec/models/validate_city_response_spec.rb +65 -0
  167. data/spec/models/validate_country_request_spec.rb +41 -0
  168. data/spec/models/validate_country_response_spec.rb +95 -0
  169. data/spec/models/validate_identifier_request_spec.rb +83 -0
  170. data/spec/models/validate_identifier_response_spec.rb +47 -0
  171. data/spec/models/validate_postal_code_request_spec.rb +53 -0
  172. data/spec/models/validate_postal_code_response_spec.rb +65 -0
  173. data/spec/models/validate_state_request_spec.rb +53 -0
  174. data/spec/models/validate_state_response_spec.rb +59 -0
  175. data/spec/models/validate_url_request_full_spec.rb +41 -0
  176. data/spec/models/validate_url_request_syntax_only_spec.rb +41 -0
  177. data/spec/models/validate_url_response_full_spec.rb +65 -0
  178. data/spec/models/validate_url_response_syntax_only_spec.rb +47 -0
  179. data/spec/models/vat_lookup_request_spec.rb +41 -0
  180. data/spec/models/vat_lookup_response_spec.rb +107 -0
  181. data/spec/models/whois_response_spec.rb +125 -0
  182. data/spec/spec_helper.rb +111 -0
  183. metadata +184 -3
@@ -0,0 +1,316 @@
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
+ # Input lead contact; fill in known fields to extend them with matched field values
17
+ class LeadEnrichmentRequest
18
+ # The person's business email address for the lead
19
+ attr_accessor :contact_business_email
20
+
21
+ # The person's first name for the lead
22
+ attr_accessor :contact_first_name
23
+
24
+ # The person's last name for the lead
25
+ attr_accessor :contact_last_name
26
+
27
+ # Name of the company for the lead
28
+ attr_accessor :company_name
29
+
30
+ # Domain name / website for the lead
31
+ attr_accessor :company_domain_name
32
+
33
+ # House number of the address of the company for the lead
34
+ attr_accessor :company_house_number
35
+
36
+ # Street name of the address of the company for the lead
37
+ attr_accessor :company_street
38
+
39
+ # City of the address of the company for the lead
40
+ attr_accessor :company_city
41
+
42
+ # State or Province of the address of the company for the lead
43
+ attr_accessor :company_state_or_province
44
+
45
+ # Postal Code of the address of the company for the lead
46
+ attr_accessor :company_postal_code
47
+
48
+ # Country of the address of the company for the lead
49
+ attr_accessor :company_country
50
+
51
+ # Country Code (2-letter ISO 3166-1) of the address of the company for the lead
52
+ attr_accessor :company_country_code
53
+
54
+ # Telephone of the company office for the lead
55
+ attr_accessor :company_telephone
56
+
57
+ # VAT number of the company for the lead
58
+ attr_accessor :company_vat_number
59
+
60
+ # Attribute mapping from ruby-style variable name to JSON key.
61
+ def self.attribute_map
62
+ {
63
+ :'contact_business_email' => :'ContactBusinessEmail',
64
+ :'contact_first_name' => :'ContactFirstName',
65
+ :'contact_last_name' => :'ContactLastName',
66
+ :'company_name' => :'CompanyName',
67
+ :'company_domain_name' => :'CompanyDomainName',
68
+ :'company_house_number' => :'CompanyHouseNumber',
69
+ :'company_street' => :'CompanyStreet',
70
+ :'company_city' => :'CompanyCity',
71
+ :'company_state_or_province' => :'CompanyStateOrProvince',
72
+ :'company_postal_code' => :'CompanyPostalCode',
73
+ :'company_country' => :'CompanyCountry',
74
+ :'company_country_code' => :'CompanyCountryCode',
75
+ :'company_telephone' => :'CompanyTelephone',
76
+ :'company_vat_number' => :'CompanyVATNumber'
77
+ }
78
+ end
79
+
80
+ # Attribute type mapping.
81
+ def self.swagger_types
82
+ {
83
+ :'contact_business_email' => :'String',
84
+ :'contact_first_name' => :'String',
85
+ :'contact_last_name' => :'String',
86
+ :'company_name' => :'String',
87
+ :'company_domain_name' => :'String',
88
+ :'company_house_number' => :'String',
89
+ :'company_street' => :'String',
90
+ :'company_city' => :'String',
91
+ :'company_state_or_province' => :'String',
92
+ :'company_postal_code' => :'String',
93
+ :'company_country' => :'String',
94
+ :'company_country_code' => :'String',
95
+ :'company_telephone' => :'String',
96
+ :'company_vat_number' => :'String'
97
+ }
98
+ end
99
+
100
+ # Initializes the object
101
+ # @param [Hash] attributes Model attributes in the form of hash
102
+ def initialize(attributes = {})
103
+ return unless attributes.is_a?(Hash)
104
+
105
+ # convert string to symbol for hash key
106
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
107
+
108
+ if attributes.has_key?(:'ContactBusinessEmail')
109
+ self.contact_business_email = attributes[:'ContactBusinessEmail']
110
+ end
111
+
112
+ if attributes.has_key?(:'ContactFirstName')
113
+ self.contact_first_name = attributes[:'ContactFirstName']
114
+ end
115
+
116
+ if attributes.has_key?(:'ContactLastName')
117
+ self.contact_last_name = attributes[:'ContactLastName']
118
+ end
119
+
120
+ if attributes.has_key?(:'CompanyName')
121
+ self.company_name = attributes[:'CompanyName']
122
+ end
123
+
124
+ if attributes.has_key?(:'CompanyDomainName')
125
+ self.company_domain_name = attributes[:'CompanyDomainName']
126
+ end
127
+
128
+ if attributes.has_key?(:'CompanyHouseNumber')
129
+ self.company_house_number = attributes[:'CompanyHouseNumber']
130
+ end
131
+
132
+ if attributes.has_key?(:'CompanyStreet')
133
+ self.company_street = attributes[:'CompanyStreet']
134
+ end
135
+
136
+ if attributes.has_key?(:'CompanyCity')
137
+ self.company_city = attributes[:'CompanyCity']
138
+ end
139
+
140
+ if attributes.has_key?(:'CompanyStateOrProvince')
141
+ self.company_state_or_province = attributes[:'CompanyStateOrProvince']
142
+ end
143
+
144
+ if attributes.has_key?(:'CompanyPostalCode')
145
+ self.company_postal_code = attributes[:'CompanyPostalCode']
146
+ end
147
+
148
+ if attributes.has_key?(:'CompanyCountry')
149
+ self.company_country = attributes[:'CompanyCountry']
150
+ end
151
+
152
+ if attributes.has_key?(:'CompanyCountryCode')
153
+ self.company_country_code = attributes[:'CompanyCountryCode']
154
+ end
155
+
156
+ if attributes.has_key?(:'CompanyTelephone')
157
+ self.company_telephone = attributes[:'CompanyTelephone']
158
+ end
159
+
160
+ if attributes.has_key?(:'CompanyVATNumber')
161
+ self.company_vat_number = attributes[:'CompanyVATNumber']
162
+ end
163
+ end
164
+
165
+ # Show invalid properties with the reasons. Usually used together with valid?
166
+ # @return Array for valid properties with the reasons
167
+ def list_invalid_properties
168
+ invalid_properties = Array.new
169
+ invalid_properties
170
+ end
171
+
172
+ # Check to see if the all the properties in the model are valid
173
+ # @return true if the model is valid
174
+ def valid?
175
+ true
176
+ end
177
+
178
+ # Checks equality by comparing each attribute.
179
+ # @param [Object] Object to be compared
180
+ def ==(o)
181
+ return true if self.equal?(o)
182
+ self.class == o.class &&
183
+ contact_business_email == o.contact_business_email &&
184
+ contact_first_name == o.contact_first_name &&
185
+ contact_last_name == o.contact_last_name &&
186
+ company_name == o.company_name &&
187
+ company_domain_name == o.company_domain_name &&
188
+ company_house_number == o.company_house_number &&
189
+ company_street == o.company_street &&
190
+ company_city == o.company_city &&
191
+ company_state_or_province == o.company_state_or_province &&
192
+ company_postal_code == o.company_postal_code &&
193
+ company_country == o.company_country &&
194
+ company_country_code == o.company_country_code &&
195
+ company_telephone == o.company_telephone &&
196
+ company_vat_number == o.company_vat_number
197
+ end
198
+
199
+ # @see the `==` method
200
+ # @param [Object] Object to be compared
201
+ def eql?(o)
202
+ self == o
203
+ end
204
+
205
+ # Calculates hash code according to all attributes.
206
+ # @return [Fixnum] Hash code
207
+ def hash
208
+ [contact_business_email, contact_first_name, contact_last_name, company_name, company_domain_name, company_house_number, company_street, company_city, company_state_or_province, company_postal_code, company_country, company_country_code, company_telephone, company_vat_number].hash
209
+ end
210
+
211
+ # Builds the object from hash
212
+ # @param [Hash] attributes Model attributes in the form of hash
213
+ # @return [Object] Returns the model itself
214
+ def build_from_hash(attributes)
215
+ return nil unless attributes.is_a?(Hash)
216
+ self.class.swagger_types.each_pair do |key, type|
217
+ if type =~ /\AArray<(.*)>/i
218
+ # check to ensure the input is an array given that the attribute
219
+ # is documented as an array but the input is not
220
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
221
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
222
+ end
223
+ elsif !attributes[self.class.attribute_map[key]].nil?
224
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
225
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
226
+ end
227
+
228
+ self
229
+ end
230
+
231
+ # Deserializes the data based on type
232
+ # @param string type Data type
233
+ # @param string value Value to be deserialized
234
+ # @return [Object] Deserialized data
235
+ def _deserialize(type, value)
236
+ case type.to_sym
237
+ when :DateTime
238
+ DateTime.parse(value)
239
+ when :Date
240
+ Date.parse(value)
241
+ when :String
242
+ value.to_s
243
+ when :Integer
244
+ value.to_i
245
+ when :Float
246
+ value.to_f
247
+ when :BOOLEAN
248
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
249
+ true
250
+ else
251
+ false
252
+ end
253
+ when :Object
254
+ # generic object (usually a Hash), return directly
255
+ value
256
+ when /\AArray<(?<inner_type>.+)>\z/
257
+ inner_type = Regexp.last_match[:inner_type]
258
+ value.map { |v| _deserialize(inner_type, v) }
259
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
260
+ k_type = Regexp.last_match[:k_type]
261
+ v_type = Regexp.last_match[:v_type]
262
+ {}.tap do |hash|
263
+ value.each do |k, v|
264
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
265
+ end
266
+ end
267
+ else # model
268
+ temp_model = CloudmersiveValidateApiClient.const_get(type).new
269
+ temp_model.build_from_hash(value)
270
+ end
271
+ end
272
+
273
+ # Returns the string representation of the object
274
+ # @return [String] String presentation of the object
275
+ def to_s
276
+ to_hash.to_s
277
+ end
278
+
279
+ # to_body is an alias to to_hash (backward compatibility)
280
+ # @return [Hash] Returns the object in the form of hash
281
+ def to_body
282
+ to_hash
283
+ end
284
+
285
+ # Returns the object in the form of hash
286
+ # @return [Hash] Returns the object in the form of hash
287
+ def to_hash
288
+ hash = {}
289
+ self.class.attribute_map.each_pair do |attr, param|
290
+ value = self.send(attr)
291
+ next if value.nil?
292
+ hash[param] = _to_hash(value)
293
+ end
294
+ hash
295
+ end
296
+
297
+ # Outputs non-array value in the form of hash
298
+ # For object, use to_hash. Otherwise, just return the value
299
+ # @param [Object] value Any valid value
300
+ # @return [Hash] Returns the value in the form of hash
301
+ def _to_hash(value)
302
+ if value.is_a?(Array)
303
+ value.compact.map { |v| _to_hash(v) }
304
+ elsif value.is_a?(Hash)
305
+ {}.tap do |hash|
306
+ value.each { |k, v| hash[k] = _to_hash(v) }
307
+ end
308
+ elsif value.respond_to? :to_hash
309
+ value.to_hash
310
+ else
311
+ value
312
+ end
313
+ end
314
+
315
+ end
316
+ end
@@ -0,0 +1,356 @@
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 the lead enrichment process
17
+ class LeadEnrichmentResponse
18
+ # True if the operation was successful, false otherwise
19
+ attr_accessor :successful
20
+
21
+ # The type of the lead; possible types are Junk (a single individual using a disposable/throwaway email address); Individual (a single individual, typically a consumer, not purchasing on behalf of a business); SmallBusiness (a small business, typically with fewer than 100 employees); MediumBusiness (a medium business, larger than 100 employees but fewer than 1000 employees); Enterprise (a large business with greater than 1000 employees); Business (a business customer of unknown size)
22
+ attr_accessor :lead_type
23
+
24
+ # The person's business email address for the lead
25
+ attr_accessor :contact_business_email
26
+
27
+ # The person's first name for the lead
28
+ attr_accessor :contact_first_name
29
+
30
+ # The person's last name for the lead
31
+ attr_accessor :contact_last_name
32
+
33
+ # Gender for contact name; possible values are Male, Female, and Neutral (can be applied to Male or Female). Requires ContactFirstName.
34
+ attr_accessor :contact_gender
35
+
36
+ # Name of the company for the lead
37
+ attr_accessor :company_name
38
+
39
+ # Domain name / website for the lead
40
+ attr_accessor :company_domain_name
41
+
42
+ # House number of the address of the company for the lead
43
+ attr_accessor :company_house_number
44
+
45
+ # Street name of the address of the company for the lead
46
+ attr_accessor :company_street
47
+
48
+ # City of the address of the company for the lead
49
+ attr_accessor :company_city
50
+
51
+ # State or Province of the address of the company for the lead
52
+ attr_accessor :company_state_or_province
53
+
54
+ # Postal Code of the address of the company for the lead
55
+ attr_accessor :company_postal_code
56
+
57
+ # Country Name of the address of the company for the lead
58
+ attr_accessor :company_country
59
+
60
+ # Country Code (2-letter ISO 3166-1) of the address of the company for the lead
61
+ attr_accessor :company_country_code
62
+
63
+ # Telephone of the company office for the lead
64
+ attr_accessor :company_telephone
65
+
66
+ # VAT number of the company for the lead
67
+ attr_accessor :company_vat_number
68
+
69
+ # Count of employees at the company (estimated), if available
70
+ attr_accessor :employee_count
71
+
72
+ # Attribute mapping from ruby-style variable name to JSON key.
73
+ def self.attribute_map
74
+ {
75
+ :'successful' => :'Successful',
76
+ :'lead_type' => :'LeadType',
77
+ :'contact_business_email' => :'ContactBusinessEmail',
78
+ :'contact_first_name' => :'ContactFirstName',
79
+ :'contact_last_name' => :'ContactLastName',
80
+ :'contact_gender' => :'ContactGender',
81
+ :'company_name' => :'CompanyName',
82
+ :'company_domain_name' => :'CompanyDomainName',
83
+ :'company_house_number' => :'CompanyHouseNumber',
84
+ :'company_street' => :'CompanyStreet',
85
+ :'company_city' => :'CompanyCity',
86
+ :'company_state_or_province' => :'CompanyStateOrProvince',
87
+ :'company_postal_code' => :'CompanyPostalCode',
88
+ :'company_country' => :'CompanyCountry',
89
+ :'company_country_code' => :'CompanyCountryCode',
90
+ :'company_telephone' => :'CompanyTelephone',
91
+ :'company_vat_number' => :'CompanyVATNumber',
92
+ :'employee_count' => :'EmployeeCount'
93
+ }
94
+ end
95
+
96
+ # Attribute type mapping.
97
+ def self.swagger_types
98
+ {
99
+ :'successful' => :'BOOLEAN',
100
+ :'lead_type' => :'String',
101
+ :'contact_business_email' => :'String',
102
+ :'contact_first_name' => :'String',
103
+ :'contact_last_name' => :'String',
104
+ :'contact_gender' => :'String',
105
+ :'company_name' => :'String',
106
+ :'company_domain_name' => :'String',
107
+ :'company_house_number' => :'String',
108
+ :'company_street' => :'String',
109
+ :'company_city' => :'String',
110
+ :'company_state_or_province' => :'String',
111
+ :'company_postal_code' => :'String',
112
+ :'company_country' => :'String',
113
+ :'company_country_code' => :'String',
114
+ :'company_telephone' => :'String',
115
+ :'company_vat_number' => :'String',
116
+ :'employee_count' => :'Integer'
117
+ }
118
+ end
119
+
120
+ # Initializes the object
121
+ # @param [Hash] attributes Model attributes in the form of hash
122
+ def initialize(attributes = {})
123
+ return unless attributes.is_a?(Hash)
124
+
125
+ # convert string to symbol for hash key
126
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
127
+
128
+ if attributes.has_key?(:'Successful')
129
+ self.successful = attributes[:'Successful']
130
+ end
131
+
132
+ if attributes.has_key?(:'LeadType')
133
+ self.lead_type = attributes[:'LeadType']
134
+ end
135
+
136
+ if attributes.has_key?(:'ContactBusinessEmail')
137
+ self.contact_business_email = attributes[:'ContactBusinessEmail']
138
+ end
139
+
140
+ if attributes.has_key?(:'ContactFirstName')
141
+ self.contact_first_name = attributes[:'ContactFirstName']
142
+ end
143
+
144
+ if attributes.has_key?(:'ContactLastName')
145
+ self.contact_last_name = attributes[:'ContactLastName']
146
+ end
147
+
148
+ if attributes.has_key?(:'ContactGender')
149
+ self.contact_gender = attributes[:'ContactGender']
150
+ end
151
+
152
+ if attributes.has_key?(:'CompanyName')
153
+ self.company_name = attributes[:'CompanyName']
154
+ end
155
+
156
+ if attributes.has_key?(:'CompanyDomainName')
157
+ self.company_domain_name = attributes[:'CompanyDomainName']
158
+ end
159
+
160
+ if attributes.has_key?(:'CompanyHouseNumber')
161
+ self.company_house_number = attributes[:'CompanyHouseNumber']
162
+ end
163
+
164
+ if attributes.has_key?(:'CompanyStreet')
165
+ self.company_street = attributes[:'CompanyStreet']
166
+ end
167
+
168
+ if attributes.has_key?(:'CompanyCity')
169
+ self.company_city = attributes[:'CompanyCity']
170
+ end
171
+
172
+ if attributes.has_key?(:'CompanyStateOrProvince')
173
+ self.company_state_or_province = attributes[:'CompanyStateOrProvince']
174
+ end
175
+
176
+ if attributes.has_key?(:'CompanyPostalCode')
177
+ self.company_postal_code = attributes[:'CompanyPostalCode']
178
+ end
179
+
180
+ if attributes.has_key?(:'CompanyCountry')
181
+ self.company_country = attributes[:'CompanyCountry']
182
+ end
183
+
184
+ if attributes.has_key?(:'CompanyCountryCode')
185
+ self.company_country_code = attributes[:'CompanyCountryCode']
186
+ end
187
+
188
+ if attributes.has_key?(:'CompanyTelephone')
189
+ self.company_telephone = attributes[:'CompanyTelephone']
190
+ end
191
+
192
+ if attributes.has_key?(:'CompanyVATNumber')
193
+ self.company_vat_number = attributes[:'CompanyVATNumber']
194
+ end
195
+
196
+ if attributes.has_key?(:'EmployeeCount')
197
+ self.employee_count = attributes[:'EmployeeCount']
198
+ end
199
+ end
200
+
201
+ # Show invalid properties with the reasons. Usually used together with valid?
202
+ # @return Array for valid properties with the reasons
203
+ def list_invalid_properties
204
+ invalid_properties = Array.new
205
+ invalid_properties
206
+ end
207
+
208
+ # Check to see if the all the properties in the model are valid
209
+ # @return true if the model is valid
210
+ def valid?
211
+ true
212
+ end
213
+
214
+ # Checks equality by comparing each attribute.
215
+ # @param [Object] Object to be compared
216
+ def ==(o)
217
+ return true if self.equal?(o)
218
+ self.class == o.class &&
219
+ successful == o.successful &&
220
+ lead_type == o.lead_type &&
221
+ contact_business_email == o.contact_business_email &&
222
+ contact_first_name == o.contact_first_name &&
223
+ contact_last_name == o.contact_last_name &&
224
+ contact_gender == o.contact_gender &&
225
+ company_name == o.company_name &&
226
+ company_domain_name == o.company_domain_name &&
227
+ company_house_number == o.company_house_number &&
228
+ company_street == o.company_street &&
229
+ company_city == o.company_city &&
230
+ company_state_or_province == o.company_state_or_province &&
231
+ company_postal_code == o.company_postal_code &&
232
+ company_country == o.company_country &&
233
+ company_country_code == o.company_country_code &&
234
+ company_telephone == o.company_telephone &&
235
+ company_vat_number == o.company_vat_number &&
236
+ employee_count == o.employee_count
237
+ end
238
+
239
+ # @see the `==` method
240
+ # @param [Object] Object to be compared
241
+ def eql?(o)
242
+ self == o
243
+ end
244
+
245
+ # Calculates hash code according to all attributes.
246
+ # @return [Fixnum] Hash code
247
+ def hash
248
+ [successful, lead_type, contact_business_email, contact_first_name, contact_last_name, contact_gender, company_name, company_domain_name, company_house_number, company_street, company_city, company_state_or_province, company_postal_code, company_country, company_country_code, company_telephone, company_vat_number, employee_count].hash
249
+ end
250
+
251
+ # Builds the object from hash
252
+ # @param [Hash] attributes Model attributes in the form of hash
253
+ # @return [Object] Returns the model itself
254
+ def build_from_hash(attributes)
255
+ return nil unless attributes.is_a?(Hash)
256
+ self.class.swagger_types.each_pair do |key, type|
257
+ if type =~ /\AArray<(.*)>/i
258
+ # check to ensure the input is an array given that the attribute
259
+ # is documented as an array but the input is not
260
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
261
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
262
+ end
263
+ elsif !attributes[self.class.attribute_map[key]].nil?
264
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
265
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
266
+ end
267
+
268
+ self
269
+ end
270
+
271
+ # Deserializes the data based on type
272
+ # @param string type Data type
273
+ # @param string value Value to be deserialized
274
+ # @return [Object] Deserialized data
275
+ def _deserialize(type, value)
276
+ case type.to_sym
277
+ when :DateTime
278
+ DateTime.parse(value)
279
+ when :Date
280
+ Date.parse(value)
281
+ when :String
282
+ value.to_s
283
+ when :Integer
284
+ value.to_i
285
+ when :Float
286
+ value.to_f
287
+ when :BOOLEAN
288
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
289
+ true
290
+ else
291
+ false
292
+ end
293
+ when :Object
294
+ # generic object (usually a Hash), return directly
295
+ value
296
+ when /\AArray<(?<inner_type>.+)>\z/
297
+ inner_type = Regexp.last_match[:inner_type]
298
+ value.map { |v| _deserialize(inner_type, v) }
299
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
300
+ k_type = Regexp.last_match[:k_type]
301
+ v_type = Regexp.last_match[:v_type]
302
+ {}.tap do |hash|
303
+ value.each do |k, v|
304
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
305
+ end
306
+ end
307
+ else # model
308
+ temp_model = CloudmersiveValidateApiClient.const_get(type).new
309
+ temp_model.build_from_hash(value)
310
+ end
311
+ end
312
+
313
+ # Returns the string representation of the object
314
+ # @return [String] String presentation of the object
315
+ def to_s
316
+ to_hash.to_s
317
+ end
318
+
319
+ # to_body is an alias to to_hash (backward compatibility)
320
+ # @return [Hash] Returns the object in the form of hash
321
+ def to_body
322
+ to_hash
323
+ end
324
+
325
+ # Returns the object in the form of hash
326
+ # @return [Hash] Returns the object in the form of hash
327
+ def to_hash
328
+ hash = {}
329
+ self.class.attribute_map.each_pair do |attr, param|
330
+ value = self.send(attr)
331
+ next if value.nil?
332
+ hash[param] = _to_hash(value)
333
+ end
334
+ hash
335
+ end
336
+
337
+ # Outputs non-array value in the form of hash
338
+ # For object, use to_hash. Otherwise, just return the value
339
+ # @param [Object] value Any valid value
340
+ # @return [Hash] Returns the value in the form of hash
341
+ def _to_hash(value)
342
+ if value.is_a?(Array)
343
+ value.compact.map { |v| _to_hash(v) }
344
+ elsif value.is_a?(Hash)
345
+ {}.tap do |hash|
346
+ value.each { |k, v| hash[k] = _to_hash(v) }
347
+ end
348
+ elsif value.respond_to? :to_hash
349
+ value.to_hash
350
+ else
351
+ value
352
+ end
353
+ end
354
+
355
+ end
356
+ end