cloudmersive-validate-api-client 1.3.3 → 1.3.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 651df94b49985ee194b2b4f98a807122b77ccc2229f16e755b3e57eaa6a41f67
4
- data.tar.gz: 8b0a5a3632a2b263c8ada9924f64048586a1b52732a7f48df51d1b30ddc9c77f
3
+ metadata.gz: 817501887749af476acdf5fa424e2f4a66cddbec55b12cedb09b7febb7cb99ff
4
+ data.tar.gz: 7f824dd84a04036e83f4b715797d9e269680c937e03ebca9568dcc3631aa6f87
5
5
  SHA512:
6
- metadata.gz: a8582002ca7fae01d888e84a6e22c6dc5f4c6f11db9201f257d8e381723bd047b012aa869f9201a6ab2183dcb654796b1baeb363d4dfc0ce700911d67005e2ea
7
- data.tar.gz: 42d02589332c71c7f26197019c9ca7099866d0fa9a1ac5cfbf703261d86345c0a89b0fbf928d79a13c6dd19f8efd3e6c343d4a54d2928f651ab66515ec794f7c
6
+ metadata.gz: 283010bb8a35b2b6cf0d94aa4373a91343f4bf566d475a6395502cce880d79a7caf1476114298dd9b17f3208ffbcae7f7738fa62af8ac85eb81cfba9ef0847fe
7
+ data.tar.gz: ae34deb3ad3397ff0291fe81f2b88a367f78c6fd3b1e5480c8ecb9bbd1e3eaacf1b1773af569937902951d4de58092115b92269c8e19d76e4ff2c974e4ca5626
data/README.md CHANGED
@@ -7,7 +7,7 @@ The validation APIs help you validate data. Check if an E-mail address is real.
7
7
  This SDK is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project:
8
8
 
9
9
  - API version: v1
10
- - Package version: 1.3.3
10
+ - Package version: 1.3.4
11
11
  - Build package: io.swagger.codegen.languages.RubyClientCodegen
12
12
 
13
13
  ## Installation
@@ -23,15 +23,15 @@ gem build cloudmersive-validate-api-client.gemspec
23
23
  Then either install the gem locally:
24
24
 
25
25
  ```shell
26
- gem install ./cloudmersive-validate-api-client-1.3.3.gem
26
+ gem install ./cloudmersive-validate-api-client-1.3.4.gem
27
27
  ```
28
- (for development, run `gem install --dev ./cloudmersive-validate-api-client-1.3.3.gem` to install the development dependencies)
28
+ (for development, run `gem install --dev ./cloudmersive-validate-api-client-1.3.4.gem` to install the development dependencies)
29
29
 
30
30
  or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/).
31
31
 
32
32
  Finally add this to the Gemfile:
33
33
 
34
- gem 'cloudmersive-validate-api-client', '~> 1.3.3'
34
+ gem 'cloudmersive-validate-api-client', '~> 1.3.4'
35
35
 
36
36
  ### Install from Git
37
37
 
@@ -62,17 +62,17 @@ CloudmersiveValidateApiClient.configure do |config|
62
62
  #config.api_key_prefix['Apikey'] = 'Bearer'
63
63
  end
64
64
 
65
- api_instance = CloudmersiveValidateApiClient::DomainApi.new
65
+ api_instance = CloudmersiveValidateApiClient::AddressApi.new
66
66
 
67
- domain = "domain_example" # String | Domain name to check, for example \"cloudmersive.com\". The input is a string so be sure to enclose it in double-quotes.
67
+ input = CloudmersiveValidateApiClient::ParseAddressRequest.new # ParseAddressRequest | Input parse request
68
68
 
69
69
 
70
70
  begin
71
- #Validate a domain name
72
- result = api_instance.domain_check(domain)
71
+ #Parse an unstructured input text string into an international, formatted address
72
+ result = api_instance.address_parse_string(input)
73
73
  p result
74
74
  rescue CloudmersiveValidateApiClient::ApiError => e
75
- puts "Exception when calling DomainApi->domain_check: #{e}"
75
+ puts "Exception when calling AddressApi->address_parse_string: #{e}"
76
76
  end
77
77
 
78
78
  ```
@@ -83,6 +83,7 @@ All URIs are relative to *https://api.cloudmersive.com*
83
83
 
84
84
  Class | Method | HTTP request | Description
85
85
  ------------ | ------------- | ------------- | -------------
86
+ *CloudmersiveValidateApiClient::AddressApi* | [**address_parse_string**](docs/AddressApi.md#address_parse_string) | **POST** /validate/address/parse | Parse an unstructured input text string into an international, formatted address
86
87
  *CloudmersiveValidateApiClient::DomainApi* | [**domain_check**](docs/DomainApi.md#domain_check) | **POST** /validate/domain/check | Validate a domain name
87
88
  *CloudmersiveValidateApiClient::DomainApi* | [**domain_post**](docs/DomainApi.md#domain_post) | **POST** /validate/domain/whois | Get WHOIS information for a domain
88
89
  *CloudmersiveValidateApiClient::EmailApi* | [**email_address_get_servers**](docs/EmailApi.md#email_address_get_servers) | **POST** /validate/email/address/servers | Partially check whether an email address is valid
@@ -112,6 +113,8 @@ Class | Method | HTTP request | Description
112
113
  - [CloudmersiveValidateApiClient::GetGenderResponse](docs/GetGenderResponse.md)
113
114
  - [CloudmersiveValidateApiClient::LastNameValidationRequest](docs/LastNameValidationRequest.md)
114
115
  - [CloudmersiveValidateApiClient::LastNameValidationResponse](docs/LastNameValidationResponse.md)
116
+ - [CloudmersiveValidateApiClient::ParseAddressRequest](docs/ParseAddressRequest.md)
117
+ - [CloudmersiveValidateApiClient::ParseAddressResponse](docs/ParseAddressResponse.md)
115
118
  - [CloudmersiveValidateApiClient::PhoneNumberValidateRequest](docs/PhoneNumberValidateRequest.md)
116
119
  - [CloudmersiveValidateApiClient::PhoneNumberValidationResponse](docs/PhoneNumberValidationResponse.md)
117
120
  - [CloudmersiveValidateApiClient::VatLookupRequest](docs/VatLookupRequest.md)
@@ -0,0 +1,63 @@
1
+ # CloudmersiveValidateApiClient::AddressApi
2
+
3
+ All URIs are relative to *https://api.cloudmersive.com*
4
+
5
+ Method | HTTP request | Description
6
+ ------------- | ------------- | -------------
7
+ [**address_parse_string**](AddressApi.md#address_parse_string) | **POST** /validate/address/parse | Parse an unstructured input text string into an international, formatted address
8
+
9
+
10
+ # **address_parse_string**
11
+ > ParseAddressResponse address_parse_string(input)
12
+
13
+ Parse an unstructured input text string into an international, formatted address
14
+
15
+ 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.
16
+
17
+ ### Example
18
+ ```ruby
19
+ # load the gem
20
+ require 'cloudmersive-validate-api-client'
21
+ # setup authorization
22
+ CloudmersiveValidateApiClient.configure do |config|
23
+ # Configure API key authorization: Apikey
24
+ config.api_key['Apikey'] = 'YOUR API KEY'
25
+ # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
26
+ #config.api_key_prefix['Apikey'] = 'Bearer'
27
+ end
28
+
29
+ api_instance = CloudmersiveValidateApiClient::AddressApi.new
30
+
31
+ input = CloudmersiveValidateApiClient::ParseAddressRequest.new # ParseAddressRequest | Input parse request
32
+
33
+
34
+ begin
35
+ #Parse an unstructured input text string into an international, formatted address
36
+ result = api_instance.address_parse_string(input)
37
+ p result
38
+ rescue CloudmersiveValidateApiClient::ApiError => e
39
+ puts "Exception when calling AddressApi->address_parse_string: #{e}"
40
+ end
41
+ ```
42
+
43
+ ### Parameters
44
+
45
+ Name | Type | Description | Notes
46
+ ------------- | ------------- | ------------- | -------------
47
+ **input** | [**ParseAddressRequest**](ParseAddressRequest.md)| Input parse request |
48
+
49
+ ### Return type
50
+
51
+ [**ParseAddressResponse**](ParseAddressResponse.md)
52
+
53
+ ### Authorization
54
+
55
+ [Apikey](../README.md#Apikey)
56
+
57
+ ### HTTP request headers
58
+
59
+ - **Content-Type**: application/json, text/json, application/xml, text/xml, application/x-www-form-urlencoded
60
+ - **Accept**: application/json, text/json, application/xml, text/xml
61
+
62
+
63
+
@@ -0,0 +1,9 @@
1
+ # CloudmersiveValidateApiClient::ParseAddressRequest
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **address_string** | **String** | A mailing address or street address formatted as a single text string; this will be parsed into its components | [optional]
7
+ **capitalization_mode** | **String** | Optional; indicates how the parsed output should be capitalized; default is Title Case; possible values are: \"Uppercase\" will set the capitalization to UPPER CASE; \"Lowercase\" will set the capitalization to lower case; \"Titlecase\" will set the capitalization to Title Case; and \"Originalcase\" will preserve the original casing as much as possible | [optional]
8
+
9
+
@@ -0,0 +1,15 @@
1
+ # CloudmersiveValidateApiClient::ParseAddressResponse
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **successful** | **BOOLEAN** | True if the parsing operation was successful, false otherwise | [optional]
7
+ **building** | **String** | The name of the building, house or structure if applicable, such as \"Cloudmersive Building 2\". This will often by null. | [optional]
8
+ **street_number** | **String** | The street number or house number of the address. For example, in the address \"1600 Pennsylvania Avenue NW\" the street number would be \"1600\". This value will typically be populated for most addresses. | [optional]
9
+ **street** | **String** | The name of the street or road of the address. For example, in the address \"1600 Pennsylvania Avenue NW\" the street number would be \"Pennsylvania Avenue NW\". | [optional]
10
+ **city** | **String** | The city of the address. | [optional]
11
+ **state_or_province** | **String** | The state or province of the address. | [optional]
12
+ **postal_code** | **String** | The postal code or zip code of the address. | [optional]
13
+ **country** | **String** | Country of the address, if present in the address. If not included in the address it will be null. | [optional]
14
+
15
+
@@ -30,6 +30,8 @@ require 'cloudmersive-validate-api-client/models/get_gender_request'
30
30
  require 'cloudmersive-validate-api-client/models/get_gender_response'
31
31
  require 'cloudmersive-validate-api-client/models/last_name_validation_request'
32
32
  require 'cloudmersive-validate-api-client/models/last_name_validation_response'
33
+ require 'cloudmersive-validate-api-client/models/parse_address_request'
34
+ require 'cloudmersive-validate-api-client/models/parse_address_response'
33
35
  require 'cloudmersive-validate-api-client/models/phone_number_validate_request'
34
36
  require 'cloudmersive-validate-api-client/models/phone_number_validation_response'
35
37
  require 'cloudmersive-validate-api-client/models/vat_lookup_request'
@@ -37,6 +39,7 @@ require 'cloudmersive-validate-api-client/models/vat_lookup_response'
37
39
  require 'cloudmersive-validate-api-client/models/whois_response'
38
40
 
39
41
  # APIs
42
+ require 'cloudmersive-validate-api-client/api/address_api'
40
43
  require 'cloudmersive-validate-api-client/api/domain_api'
41
44
  require 'cloudmersive-validate-api-client/api/email_api'
42
45
  require 'cloudmersive-validate-api-client/api/ip_address_api'
@@ -0,0 +1,78 @@
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: unset
10
+
11
+ =end
12
+
13
+ require "uri"
14
+
15
+ module CloudmersiveValidateApiClient
16
+ class AddressApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+
23
+ # Parse an unstructured input text string into an international, formatted address
24
+ # 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.
25
+ # @param input Input parse request
26
+ # @param [Hash] opts the optional parameters
27
+ # @return [ParseAddressResponse]
28
+ def address_parse_string(input, opts = {})
29
+ data, _status_code, _headers = address_parse_string_with_http_info(input, opts)
30
+ return data
31
+ end
32
+
33
+ # Parse an unstructured input text string into an international, formatted address
34
+ # 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.
35
+ # @param input Input parse request
36
+ # @param [Hash] opts the optional parameters
37
+ # @return [Array<(ParseAddressResponse, Fixnum, Hash)>] ParseAddressResponse data, response status code and response headers
38
+ def address_parse_string_with_http_info(input, opts = {})
39
+ if @api_client.config.debugging
40
+ @api_client.config.logger.debug "Calling API: AddressApi.address_parse_string ..."
41
+ end
42
+ # verify the required parameter 'input' is set
43
+ if @api_client.config.client_side_validation && input.nil?
44
+ fail ArgumentError, "Missing the required parameter 'input' when calling AddressApi.address_parse_string"
45
+ end
46
+ # resource path
47
+ local_var_path = "/validate/address/parse"
48
+
49
+ # query parameters
50
+ query_params = {}
51
+
52
+ # header parameters
53
+ header_params = {}
54
+ # HTTP header 'Accept' (if needed)
55
+ header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/json', 'application/xml', 'text/xml'])
56
+ # HTTP header 'Content-Type'
57
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'text/json', 'application/xml', 'text/xml', 'application/x-www-form-urlencoded'])
58
+
59
+ # form parameters
60
+ form_params = {}
61
+
62
+ # http body (model)
63
+ post_body = @api_client.object_to_http_body(input)
64
+ auth_names = ['Apikey']
65
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
66
+ :header_params => header_params,
67
+ :query_params => query_params,
68
+ :form_params => form_params,
69
+ :body => post_body,
70
+ :auth_names => auth_names,
71
+ :return_type => 'ParseAddressResponse')
72
+ if @api_client.config.debugging
73
+ @api_client.config.logger.debug "API called: AddressApi#address_parse_string\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
74
+ end
75
+ return data, status_code, headers
76
+ end
77
+ end
78
+ end
@@ -0,0 +1,199 @@
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: unset
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module CloudmersiveValidateApiClient
16
+ # Request to parse an address formatted as a string/free text into a structured address
17
+ class ParseAddressRequest
18
+ # A mailing address or street address formatted as a single text string; this will be parsed into its components
19
+ attr_accessor :address_string
20
+
21
+ # Optional; indicates how the parsed output should be capitalized; default is Title Case; possible values are: \"Uppercase\" will set the capitalization to UPPER CASE; \"Lowercase\" will set the capitalization to lower case; \"Titlecase\" will set the capitalization to Title Case; and \"Originalcase\" will preserve the original casing as much as possible
22
+ attr_accessor :capitalization_mode
23
+
24
+
25
+ # Attribute mapping from ruby-style variable name to JSON key.
26
+ def self.attribute_map
27
+ {
28
+ :'address_string' => :'AddressString',
29
+ :'capitalization_mode' => :'CapitalizationMode'
30
+ }
31
+ end
32
+
33
+ # Attribute type mapping.
34
+ def self.swagger_types
35
+ {
36
+ :'address_string' => :'String',
37
+ :'capitalization_mode' => :'String'
38
+ }
39
+ end
40
+
41
+ # Initializes the object
42
+ # @param [Hash] attributes Model attributes in the form of hash
43
+ def initialize(attributes = {})
44
+ return unless attributes.is_a?(Hash)
45
+
46
+ # convert string to symbol for hash key
47
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
48
+
49
+ if attributes.has_key?(:'AddressString')
50
+ self.address_string = attributes[:'AddressString']
51
+ end
52
+
53
+ if attributes.has_key?(:'CapitalizationMode')
54
+ self.capitalization_mode = attributes[:'CapitalizationMode']
55
+ end
56
+
57
+ end
58
+
59
+ # Show invalid properties with the reasons. Usually used together with valid?
60
+ # @return Array for valid properties with the reasons
61
+ def list_invalid_properties
62
+ invalid_properties = Array.new
63
+ return invalid_properties
64
+ end
65
+
66
+ # Check to see if the all the properties in the model are valid
67
+ # @return true if the model is valid
68
+ def valid?
69
+ return true
70
+ end
71
+
72
+ # Checks equality by comparing each attribute.
73
+ # @param [Object] Object to be compared
74
+ def ==(o)
75
+ return true if self.equal?(o)
76
+ self.class == o.class &&
77
+ address_string == o.address_string &&
78
+ capitalization_mode == o.capitalization_mode
79
+ end
80
+
81
+ # @see the `==` method
82
+ # @param [Object] Object to be compared
83
+ def eql?(o)
84
+ self == o
85
+ end
86
+
87
+ # Calculates hash code according to all attributes.
88
+ # @return [Fixnum] Hash code
89
+ def hash
90
+ [address_string, capitalization_mode].hash
91
+ end
92
+
93
+ # Builds the object from hash
94
+ # @param [Hash] attributes Model attributes in the form of hash
95
+ # @return [Object] Returns the model itself
96
+ def build_from_hash(attributes)
97
+ return nil unless attributes.is_a?(Hash)
98
+ self.class.swagger_types.each_pair do |key, type|
99
+ if type =~ /\AArray<(.*)>/i
100
+ # check to ensure the input is an array given that the the attribute
101
+ # is documented as an array but the input is not
102
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
103
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
104
+ end
105
+ elsif !attributes[self.class.attribute_map[key]].nil?
106
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
107
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
108
+ end
109
+
110
+ self
111
+ end
112
+
113
+ # Deserializes the data based on type
114
+ # @param string type Data type
115
+ # @param string value Value to be deserialized
116
+ # @return [Object] Deserialized data
117
+ def _deserialize(type, value)
118
+ case type.to_sym
119
+ when :DateTime
120
+ DateTime.parse(value)
121
+ when :Date
122
+ Date.parse(value)
123
+ when :String
124
+ value.to_s
125
+ when :Integer
126
+ value.to_i
127
+ when :Float
128
+ value.to_f
129
+ when :BOOLEAN
130
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
131
+ true
132
+ else
133
+ false
134
+ end
135
+ when :Object
136
+ # generic object (usually a Hash), return directly
137
+ value
138
+ when /\AArray<(?<inner_type>.+)>\z/
139
+ inner_type = Regexp.last_match[:inner_type]
140
+ value.map { |v| _deserialize(inner_type, v) }
141
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
142
+ k_type = Regexp.last_match[:k_type]
143
+ v_type = Regexp.last_match[:v_type]
144
+ {}.tap do |hash|
145
+ value.each do |k, v|
146
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
147
+ end
148
+ end
149
+ else # model
150
+ temp_model = CloudmersiveValidateApiClient.const_get(type).new
151
+ temp_model.build_from_hash(value)
152
+ end
153
+ end
154
+
155
+ # Returns the string representation of the object
156
+ # @return [String] String presentation of the object
157
+ def to_s
158
+ to_hash.to_s
159
+ end
160
+
161
+ # to_body is an alias to to_hash (backward compatibility)
162
+ # @return [Hash] Returns the object in the form of hash
163
+ def to_body
164
+ to_hash
165
+ end
166
+
167
+ # Returns the object in the form of hash
168
+ # @return [Hash] Returns the object in the form of hash
169
+ def to_hash
170
+ hash = {}
171
+ self.class.attribute_map.each_pair do |attr, param|
172
+ value = self.send(attr)
173
+ next if value.nil?
174
+ hash[param] = _to_hash(value)
175
+ end
176
+ hash
177
+ end
178
+
179
+ # Outputs non-array value in the form of hash
180
+ # For object, use to_hash. Otherwise, just return the value
181
+ # @param [Object] value Any valid value
182
+ # @return [Hash] Returns the value in the form of hash
183
+ def _to_hash(value)
184
+ if value.is_a?(Array)
185
+ value.compact.map{ |v| _to_hash(v) }
186
+ elsif value.is_a?(Hash)
187
+ {}.tap do |hash|
188
+ value.each { |k, v| hash[k] = _to_hash(v) }
189
+ end
190
+ elsif value.respond_to? :to_hash
191
+ value.to_hash
192
+ else
193
+ value
194
+ end
195
+ end
196
+
197
+ end
198
+
199
+ end
@@ -0,0 +1,259 @@
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: unset
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module CloudmersiveValidateApiClient
16
+ # Result of parsing an address into its component parts
17
+ class ParseAddressResponse
18
+ # True if the parsing operation was successful, false otherwise
19
+ attr_accessor :successful
20
+
21
+ # The name of the building, house or structure if applicable, such as \"Cloudmersive Building 2\". This will often by null.
22
+ attr_accessor :building
23
+
24
+ # The street number or house number of the address. For example, in the address \"1600 Pennsylvania Avenue NW\" the street number would be \"1600\". This value will typically be populated for most addresses.
25
+ attr_accessor :street_number
26
+
27
+ # The name of the street or road of the address. For example, in the address \"1600 Pennsylvania Avenue NW\" the street number would be \"Pennsylvania Avenue NW\".
28
+ attr_accessor :street
29
+
30
+ # The city of the address.
31
+ attr_accessor :city
32
+
33
+ # The state or province of the address.
34
+ attr_accessor :state_or_province
35
+
36
+ # The postal code or zip code of the address.
37
+ attr_accessor :postal_code
38
+
39
+ # Country of the address, if present in the address. If not included in the address it will be null.
40
+ attr_accessor :country
41
+
42
+
43
+ # Attribute mapping from ruby-style variable name to JSON key.
44
+ def self.attribute_map
45
+ {
46
+ :'successful' => :'Successful',
47
+ :'building' => :'Building',
48
+ :'street_number' => :'StreetNumber',
49
+ :'street' => :'Street',
50
+ :'city' => :'City',
51
+ :'state_or_province' => :'StateOrProvince',
52
+ :'postal_code' => :'PostalCode',
53
+ :'country' => :'Country'
54
+ }
55
+ end
56
+
57
+ # Attribute type mapping.
58
+ def self.swagger_types
59
+ {
60
+ :'successful' => :'BOOLEAN',
61
+ :'building' => :'String',
62
+ :'street_number' => :'String',
63
+ :'street' => :'String',
64
+ :'city' => :'String',
65
+ :'state_or_province' => :'String',
66
+ :'postal_code' => :'String',
67
+ :'country' => :'String'
68
+ }
69
+ end
70
+
71
+ # Initializes the object
72
+ # @param [Hash] attributes Model attributes in the form of hash
73
+ def initialize(attributes = {})
74
+ return unless attributes.is_a?(Hash)
75
+
76
+ # convert string to symbol for hash key
77
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
78
+
79
+ if attributes.has_key?(:'Successful')
80
+ self.successful = attributes[:'Successful']
81
+ end
82
+
83
+ if attributes.has_key?(:'Building')
84
+ self.building = attributes[:'Building']
85
+ end
86
+
87
+ if attributes.has_key?(:'StreetNumber')
88
+ self.street_number = attributes[:'StreetNumber']
89
+ end
90
+
91
+ if attributes.has_key?(:'Street')
92
+ self.street = attributes[:'Street']
93
+ end
94
+
95
+ if attributes.has_key?(:'City')
96
+ self.city = attributes[:'City']
97
+ end
98
+
99
+ if attributes.has_key?(:'StateOrProvince')
100
+ self.state_or_province = attributes[:'StateOrProvince']
101
+ end
102
+
103
+ if attributes.has_key?(:'PostalCode')
104
+ self.postal_code = attributes[:'PostalCode']
105
+ end
106
+
107
+ if attributes.has_key?(:'Country')
108
+ self.country = attributes[:'Country']
109
+ end
110
+
111
+ end
112
+
113
+ # Show invalid properties with the reasons. Usually used together with valid?
114
+ # @return Array for valid properties with the reasons
115
+ def list_invalid_properties
116
+ invalid_properties = Array.new
117
+ return invalid_properties
118
+ end
119
+
120
+ # Check to see if the all the properties in the model are valid
121
+ # @return true if the model is valid
122
+ def valid?
123
+ return true
124
+ end
125
+
126
+ # Checks equality by comparing each attribute.
127
+ # @param [Object] Object to be compared
128
+ def ==(o)
129
+ return true if self.equal?(o)
130
+ self.class == o.class &&
131
+ successful == o.successful &&
132
+ building == o.building &&
133
+ street_number == o.street_number &&
134
+ street == o.street &&
135
+ city == o.city &&
136
+ state_or_province == o.state_or_province &&
137
+ postal_code == o.postal_code &&
138
+ country == o.country
139
+ end
140
+
141
+ # @see the `==` method
142
+ # @param [Object] Object to be compared
143
+ def eql?(o)
144
+ self == o
145
+ end
146
+
147
+ # Calculates hash code according to all attributes.
148
+ # @return [Fixnum] Hash code
149
+ def hash
150
+ [successful, building, street_number, street, city, state_or_province, postal_code, country].hash
151
+ end
152
+
153
+ # Builds the object from hash
154
+ # @param [Hash] attributes Model attributes in the form of hash
155
+ # @return [Object] Returns the model itself
156
+ def build_from_hash(attributes)
157
+ return nil unless attributes.is_a?(Hash)
158
+ self.class.swagger_types.each_pair do |key, type|
159
+ if type =~ /\AArray<(.*)>/i
160
+ # check to ensure the input is an array given that the the attribute
161
+ # is documented as an array but the input is not
162
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
163
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
164
+ end
165
+ elsif !attributes[self.class.attribute_map[key]].nil?
166
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
167
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
168
+ end
169
+
170
+ self
171
+ end
172
+
173
+ # Deserializes the data based on type
174
+ # @param string type Data type
175
+ # @param string value Value to be deserialized
176
+ # @return [Object] Deserialized data
177
+ def _deserialize(type, value)
178
+ case type.to_sym
179
+ when :DateTime
180
+ DateTime.parse(value)
181
+ when :Date
182
+ Date.parse(value)
183
+ when :String
184
+ value.to_s
185
+ when :Integer
186
+ value.to_i
187
+ when :Float
188
+ value.to_f
189
+ when :BOOLEAN
190
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
191
+ true
192
+ else
193
+ false
194
+ end
195
+ when :Object
196
+ # generic object (usually a Hash), return directly
197
+ value
198
+ when /\AArray<(?<inner_type>.+)>\z/
199
+ inner_type = Regexp.last_match[:inner_type]
200
+ value.map { |v| _deserialize(inner_type, v) }
201
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
202
+ k_type = Regexp.last_match[:k_type]
203
+ v_type = Regexp.last_match[:v_type]
204
+ {}.tap do |hash|
205
+ value.each do |k, v|
206
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
207
+ end
208
+ end
209
+ else # model
210
+ temp_model = CloudmersiveValidateApiClient.const_get(type).new
211
+ temp_model.build_from_hash(value)
212
+ end
213
+ end
214
+
215
+ # Returns the string representation of the object
216
+ # @return [String] String presentation of the object
217
+ def to_s
218
+ to_hash.to_s
219
+ end
220
+
221
+ # to_body is an alias to to_hash (backward compatibility)
222
+ # @return [Hash] Returns the object in the form of hash
223
+ def to_body
224
+ to_hash
225
+ end
226
+
227
+ # Returns the object in the form of hash
228
+ # @return [Hash] Returns the object in the form of hash
229
+ def to_hash
230
+ hash = {}
231
+ self.class.attribute_map.each_pair do |attr, param|
232
+ value = self.send(attr)
233
+ next if value.nil?
234
+ hash[param] = _to_hash(value)
235
+ end
236
+ hash
237
+ end
238
+
239
+ # Outputs non-array value in the form of hash
240
+ # For object, use to_hash. Otherwise, just return the value
241
+ # @param [Object] value Any valid value
242
+ # @return [Hash] Returns the value in the form of hash
243
+ def _to_hash(value)
244
+ if value.is_a?(Array)
245
+ value.compact.map{ |v| _to_hash(v) }
246
+ elsif value.is_a?(Hash)
247
+ {}.tap do |hash|
248
+ value.each { |k, v| hash[k] = _to_hash(v) }
249
+ end
250
+ elsif value.respond_to? :to_hash
251
+ value.to_hash
252
+ else
253
+ value
254
+ end
255
+ end
256
+
257
+ end
258
+
259
+ end
@@ -11,5 +11,5 @@ Swagger Codegen version: unset
11
11
  =end
12
12
 
13
13
  module CloudmersiveValidateApiClient
14
- VERSION = "1.3.3"
14
+ VERSION = "1.3.4"
15
15
  end
@@ -0,0 +1,47 @@
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: unset
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_parse_string
36
+ # Parse an unstructured input text string into an international, formatted address
37
+ # 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.
38
+ # @param input Input parse request
39
+ # @param [Hash] opts the optional parameters
40
+ # @return [ParseAddressResponse]
41
+ describe 'address_parse_string 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
+ end
@@ -0,0 +1,48 @@
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: unset
10
+
11
+ =end
12
+
13
+ require 'spec_helper'
14
+ require 'json'
15
+ require 'date'
16
+
17
+ # Unit tests for CloudmersiveValidateApiClient::ParseAddressRequest
18
+ # Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen)
19
+ # Please update as you see appropriate
20
+ describe 'ParseAddressRequest' do
21
+ before do
22
+ # run before each test
23
+ @instance = CloudmersiveValidateApiClient::ParseAddressRequest.new
24
+ end
25
+
26
+ after do
27
+ # run after each test
28
+ end
29
+
30
+ describe 'test an instance of ParseAddressRequest' do
31
+ it 'should create an instance of ParseAddressRequest' do
32
+ expect(@instance).to be_instance_of(CloudmersiveValidateApiClient::ParseAddressRequest)
33
+ end
34
+ end
35
+ describe 'test attribute "address_string"' do
36
+ it 'should work' do
37
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
38
+ end
39
+ end
40
+
41
+ describe 'test attribute "capitalization_mode"' 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
+ end
48
+
@@ -0,0 +1,84 @@
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: unset
10
+
11
+ =end
12
+
13
+ require 'spec_helper'
14
+ require 'json'
15
+ require 'date'
16
+
17
+ # Unit tests for CloudmersiveValidateApiClient::ParseAddressResponse
18
+ # Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen)
19
+ # Please update as you see appropriate
20
+ describe 'ParseAddressResponse' do
21
+ before do
22
+ # run before each test
23
+ @instance = CloudmersiveValidateApiClient::ParseAddressResponse.new
24
+ end
25
+
26
+ after do
27
+ # run after each test
28
+ end
29
+
30
+ describe 'test an instance of ParseAddressResponse' do
31
+ it 'should create an instance of ParseAddressResponse' do
32
+ expect(@instance).to be_instance_of(CloudmersiveValidateApiClient::ParseAddressResponse)
33
+ end
34
+ end
35
+ describe 'test attribute "successful"' do
36
+ it 'should work' do
37
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
38
+ end
39
+ end
40
+
41
+ describe 'test attribute "building"' 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
+ describe 'test attribute "street_number"' do
48
+ it 'should work' do
49
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
50
+ end
51
+ end
52
+
53
+ describe 'test attribute "street"' 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
+ describe 'test attribute "city"' do
60
+ it 'should work' do
61
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
62
+ end
63
+ end
64
+
65
+ describe 'test attribute "state_or_province"' do
66
+ it 'should work' do
67
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
68
+ end
69
+ end
70
+
71
+ describe 'test attribute "postal_code"' do
72
+ it 'should work' do
73
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
74
+ end
75
+ end
76
+
77
+ describe 'test attribute "country"' do
78
+ it 'should work' do
79
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
80
+ end
81
+ end
82
+
83
+ end
84
+
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cloudmersive-validate-api-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.3
4
+ version: 1.3.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cloudmersive
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-07-05 00:00:00.000000000 Z
11
+ date: 2019-07-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: typhoeus
@@ -203,6 +203,7 @@ files:
203
203
  - "./README.md"
204
204
  - "./Rakefile"
205
205
  - "./cloudmersive-validate-api-client.gemspec"
206
+ - "./docs/AddressApi.md"
206
207
  - "./docs/AddressGetServersResponse.md"
207
208
  - "./docs/AddressVerifySyntaxOnlyResponse.md"
208
209
  - "./docs/CheckResponse.md"
@@ -220,6 +221,8 @@ files:
220
221
  - "./docs/LastNameValidationRequest.md"
221
222
  - "./docs/LastNameValidationResponse.md"
222
223
  - "./docs/NameApi.md"
224
+ - "./docs/ParseAddressRequest.md"
225
+ - "./docs/ParseAddressResponse.md"
223
226
  - "./docs/PhoneNumberApi.md"
224
227
  - "./docs/PhoneNumberValidateRequest.md"
225
228
  - "./docs/PhoneNumberValidationResponse.md"
@@ -229,6 +232,7 @@ files:
229
232
  - "./docs/WhoisResponse.md"
230
233
  - "./git_push.sh"
231
234
  - "./lib/cloudmersive-validate-api-client.rb"
235
+ - "./lib/cloudmersive-validate-api-client/api/address_api.rb"
232
236
  - "./lib/cloudmersive-validate-api-client/api/domain_api.rb"
233
237
  - "./lib/cloudmersive-validate-api-client/api/email_api.rb"
234
238
  - "./lib/cloudmersive-validate-api-client/api/ip_address_api.rb"
@@ -251,12 +255,15 @@ files:
251
255
  - "./lib/cloudmersive-validate-api-client/models/get_gender_response.rb"
252
256
  - "./lib/cloudmersive-validate-api-client/models/last_name_validation_request.rb"
253
257
  - "./lib/cloudmersive-validate-api-client/models/last_name_validation_response.rb"
258
+ - "./lib/cloudmersive-validate-api-client/models/parse_address_request.rb"
259
+ - "./lib/cloudmersive-validate-api-client/models/parse_address_response.rb"
254
260
  - "./lib/cloudmersive-validate-api-client/models/phone_number_validate_request.rb"
255
261
  - "./lib/cloudmersive-validate-api-client/models/phone_number_validation_response.rb"
256
262
  - "./lib/cloudmersive-validate-api-client/models/vat_lookup_request.rb"
257
263
  - "./lib/cloudmersive-validate-api-client/models/vat_lookup_response.rb"
258
264
  - "./lib/cloudmersive-validate-api-client/models/whois_response.rb"
259
265
  - "./lib/cloudmersive-validate-api-client/version.rb"
266
+ - "./spec/api/address_api_spec.rb"
260
267
  - "./spec/api/domain_api_spec.rb"
261
268
  - "./spec/api/email_api_spec.rb"
262
269
  - "./spec/api/ip_address_api_spec.rb"
@@ -278,6 +285,8 @@ files:
278
285
  - "./spec/models/get_gender_response_spec.rb"
279
286
  - "./spec/models/last_name_validation_request_spec.rb"
280
287
  - "./spec/models/last_name_validation_response_spec.rb"
288
+ - "./spec/models/parse_address_request_spec.rb"
289
+ - "./spec/models/parse_address_response_spec.rb"
281
290
  - "./spec/models/phone_number_validate_request_spec.rb"
282
291
  - "./spec/models/phone_number_validation_response_spec.rb"
283
292
  - "./spec/models/vat_lookup_request_spec.rb"