cloudmersive-validate-api-client 1.3.9 → 1.4.0
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/README.md +8 -4
- data/docs/AddressApi.md +56 -1
- data/docs/GetTimezonesRequest.md +8 -0
- data/docs/GetTimezonesResponse.md +13 -0
- data/docs/Timezone.md +9 -0
- data/docs/ValidateCountryResponse.md +1 -0
- data/lib/cloudmersive-validate-api-client.rb +3 -0
- data/lib/cloudmersive-validate-api-client/api/address_api.rb +57 -2
- data/lib/cloudmersive-validate-api-client/models/get_timezones_request.rb +189 -0
- data/lib/cloudmersive-validate-api-client/models/get_timezones_response.rb +241 -0
- data/lib/cloudmersive-validate-api-client/models/timezone.rb +199 -0
- data/lib/cloudmersive-validate-api-client/models/validate_country_response.rb +16 -4
- data/lib/cloudmersive-validate-api-client/version.rb +1 -1
- data/spec/api/address_api_spec.rb +13 -1
- data/spec/models/get_timezones_request_spec.rb +42 -0
- data/spec/models/get_timezones_response_spec.rb +72 -0
- data/spec/models/timezone_spec.rb +48 -0
- data/spec/models/validate_country_response_spec.rb +6 -0
- metadata +11 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dc5529a8142a06ca5d15ef6382d54736acc2c22004af85d065d3ed26a945c327
|
4
|
+
data.tar.gz: 59a82afaedabfb92bf3bc96eae3fb87d056d903fabf60c5eef60eb806ad12fc2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ff8276b238119d817300753e042248eb30ef4a0398845eaf7153369deeb280b753d0beab5ebff4c8697a843794228042c857bb033176ece81c95990279cccb79
|
7
|
+
data.tar.gz: 9480dc1e21242308dcd640c4e2d443794ada968a985fe35056940b2de35640ba4d75e963092cd860ee55fe1bdcf3383f83655752a2c0ef34356827ab9533b910
|
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.
|
10
|
+
- Package version: 1.4.0
|
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.
|
26
|
+
gem install ./cloudmersive-validate-api-client-1.4.0.gem
|
27
27
|
```
|
28
|
-
(for development, run `gem install --dev ./cloudmersive-validate-api-client-1.
|
28
|
+
(for development, run `gem install --dev ./cloudmersive-validate-api-client-1.4.0.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.
|
34
|
+
gem 'cloudmersive-validate-api-client', '~> 1.4.0'
|
35
35
|
|
36
36
|
### Install from Git
|
37
37
|
|
@@ -84,6 +84,7 @@ All URIs are relative to *https://api.cloudmersive.com*
|
|
84
84
|
Class | Method | HTTP request | Description
|
85
85
|
------------ | ------------- | ------------- | -------------
|
86
86
|
*CloudmersiveValidateApiClient::AddressApi* | [**address_country**](docs/AddressApi.md#address_country) | **POST** /validate/address/country | Validate and normalize country information, return ISO 3166-1 country codes and country name
|
87
|
+
*CloudmersiveValidateApiClient::AddressApi* | [**address_get_timezone**](docs/AddressApi.md#address_get_timezone) | **POST** /validate/address/country/get-timezones | Gets IANA/Olsen time zones for a country
|
87
88
|
*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
|
88
89
|
*CloudmersiveValidateApiClient::DomainApi* | [**domain_check**](docs/DomainApi.md#domain_check) | **POST** /validate/domain/check | Validate a domain name
|
89
90
|
*CloudmersiveValidateApiClient::DomainApi* | [**domain_post**](docs/DomainApi.md#domain_post) | **POST** /validate/domain/whois | Get WHOIS information for a domain
|
@@ -117,6 +118,8 @@ Class | Method | HTTP request | Description
|
|
117
118
|
- [CloudmersiveValidateApiClient::GeolocateResponse](docs/GeolocateResponse.md)
|
118
119
|
- [CloudmersiveValidateApiClient::GetGenderRequest](docs/GetGenderRequest.md)
|
119
120
|
- [CloudmersiveValidateApiClient::GetGenderResponse](docs/GetGenderResponse.md)
|
121
|
+
- [CloudmersiveValidateApiClient::GetTimezonesRequest](docs/GetTimezonesRequest.md)
|
122
|
+
- [CloudmersiveValidateApiClient::GetTimezonesResponse](docs/GetTimezonesResponse.md)
|
120
123
|
- [CloudmersiveValidateApiClient::LastNameValidationRequest](docs/LastNameValidationRequest.md)
|
121
124
|
- [CloudmersiveValidateApiClient::LastNameValidationResponse](docs/LastNameValidationResponse.md)
|
122
125
|
- [CloudmersiveValidateApiClient::LeadEnrichmentRequest](docs/LeadEnrichmentRequest.md)
|
@@ -125,6 +128,7 @@ Class | Method | HTTP request | Description
|
|
125
128
|
- [CloudmersiveValidateApiClient::ParseAddressResponse](docs/ParseAddressResponse.md)
|
126
129
|
- [CloudmersiveValidateApiClient::PhoneNumberValidateRequest](docs/PhoneNumberValidateRequest.md)
|
127
130
|
- [CloudmersiveValidateApiClient::PhoneNumberValidationResponse](docs/PhoneNumberValidationResponse.md)
|
131
|
+
- [CloudmersiveValidateApiClient::Timezone](docs/Timezone.md)
|
128
132
|
- [CloudmersiveValidateApiClient::UserAgentValidateRequest](docs/UserAgentValidateRequest.md)
|
129
133
|
- [CloudmersiveValidateApiClient::UserAgentValidateResponse](docs/UserAgentValidateResponse.md)
|
130
134
|
- [CloudmersiveValidateApiClient::ValidateCountryRequest](docs/ValidateCountryRequest.md)
|
data/docs/AddressApi.md
CHANGED
@@ -5,6 +5,7 @@ All URIs are relative to *https://api.cloudmersive.com*
|
|
5
5
|
Method | HTTP request | Description
|
6
6
|
------------- | ------------- | -------------
|
7
7
|
[**address_country**](AddressApi.md#address_country) | **POST** /validate/address/country | Validate and normalize country information, return ISO 3166-1 country codes and country name
|
8
|
+
[**address_get_timezone**](AddressApi.md#address_get_timezone) | **POST** /validate/address/country/get-timezones | Gets IANA/Olsen time zones for a country
|
8
9
|
[**address_parse_string**](AddressApi.md#address_parse_string) | **POST** /validate/address/parse | Parse an unstructured input text string into an international, formatted address
|
9
10
|
|
10
11
|
|
@@ -13,7 +14,7 @@ Method | HTTP request | Description
|
|
13
14
|
|
14
15
|
Validate and normalize country information, return ISO 3166-1 country codes and country name
|
15
16
|
|
16
|
-
Validates and normalizes country information, and returns key information about a country.
|
17
|
+
Validates and normalizes country information, and returns key information about a country. Also returns distinct time zones in the country.
|
17
18
|
|
18
19
|
### Example
|
19
20
|
```ruby
|
@@ -62,6 +63,60 @@ Name | Type | Description | Notes
|
|
62
63
|
|
63
64
|
|
64
65
|
|
66
|
+
# **address_get_timezone**
|
67
|
+
> GetTimezonesResponse address_get_timezone(input)
|
68
|
+
|
69
|
+
Gets IANA/Olsen time zones for a country
|
70
|
+
|
71
|
+
Gets the IANA/Olsen time zones for a country.
|
72
|
+
|
73
|
+
### Example
|
74
|
+
```ruby
|
75
|
+
# load the gem
|
76
|
+
require 'cloudmersive-validate-api-client'
|
77
|
+
# setup authorization
|
78
|
+
CloudmersiveValidateApiClient.configure do |config|
|
79
|
+
# Configure API key authorization: Apikey
|
80
|
+
config.api_key['Apikey'] = 'YOUR API KEY'
|
81
|
+
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
82
|
+
#config.api_key_prefix['Apikey'] = 'Bearer'
|
83
|
+
end
|
84
|
+
|
85
|
+
api_instance = CloudmersiveValidateApiClient::AddressApi.new
|
86
|
+
|
87
|
+
input = CloudmersiveValidateApiClient::GetTimezonesRequest.new # GetTimezonesRequest | Input request
|
88
|
+
|
89
|
+
|
90
|
+
begin
|
91
|
+
#Gets IANA/Olsen time zones for a country
|
92
|
+
result = api_instance.address_get_timezone(input)
|
93
|
+
p result
|
94
|
+
rescue CloudmersiveValidateApiClient::ApiError => e
|
95
|
+
puts "Exception when calling AddressApi->address_get_timezone: #{e}"
|
96
|
+
end
|
97
|
+
```
|
98
|
+
|
99
|
+
### Parameters
|
100
|
+
|
101
|
+
Name | Type | Description | Notes
|
102
|
+
------------- | ------------- | ------------- | -------------
|
103
|
+
**input** | [**GetTimezonesRequest**](GetTimezonesRequest.md)| Input request |
|
104
|
+
|
105
|
+
### Return type
|
106
|
+
|
107
|
+
[**GetTimezonesResponse**](GetTimezonesResponse.md)
|
108
|
+
|
109
|
+
### Authorization
|
110
|
+
|
111
|
+
[Apikey](../README.md#Apikey)
|
112
|
+
|
113
|
+
### HTTP request headers
|
114
|
+
|
115
|
+
- **Content-Type**: application/json, text/json
|
116
|
+
- **Accept**: application/json, text/json, application/xml, text/xml
|
117
|
+
|
118
|
+
|
119
|
+
|
65
120
|
# **address_parse_string**
|
66
121
|
> ParseAddressResponse address_parse_string(input)
|
67
122
|
|
@@ -0,0 +1,8 @@
|
|
1
|
+
# CloudmersiveValidateApiClient::GetTimezonesRequest
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
Name | Type | Description | Notes
|
5
|
+
------------ | ------------- | ------------- | -------------
|
6
|
+
**country_code_or_name** | **String** | Can be the two-letter, three-letter country codes or country name | [optional]
|
7
|
+
|
8
|
+
|
@@ -0,0 +1,13 @@
|
|
1
|
+
# CloudmersiveValidateApiClient::GetTimezonesResponse
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
Name | Type | Description | Notes
|
5
|
+
------------ | ------------- | ------------- | -------------
|
6
|
+
**successful** | **BOOLEAN** | True if successful, false otherwise | [optional]
|
7
|
+
**country_full_name** | **String** | Full name of the country | [optional]
|
8
|
+
**iso_two_letter_code** | **String** | Two-letter ISO 3166-1 country code | [optional]
|
9
|
+
**fips_two_letter_code** | **String** | Two-letter FIPS 10-4 country code | [optional]
|
10
|
+
**three_letter_code** | **String** | Three-letter ISO 3166-1 country code | [optional]
|
11
|
+
**timezones** | [**Array<Timezone>**](Timezone.md) | Time zones (IANA/Olsen) in the country | [optional]
|
12
|
+
|
13
|
+
|
data/docs/Timezone.md
ADDED
@@ -0,0 +1,9 @@
|
|
1
|
+
# CloudmersiveValidateApiClient::Timezone
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
Name | Type | Description | Notes
|
5
|
+
------------ | ------------- | ------------- | -------------
|
6
|
+
**name** | **String** | Name of the Time Zone | [optional]
|
7
|
+
**base_utc_offset** | **String** | UTC offset for this time zone | [optional]
|
8
|
+
|
9
|
+
|
@@ -8,5 +8,6 @@ Name | Type | Description | Notes
|
|
8
8
|
**iso_two_letter_code** | **String** | Two-letter ISO 3166-1 country code | [optional]
|
9
9
|
**fips_two_letter_code** | **String** | Two-letter FIPS 10-4 country code | [optional]
|
10
10
|
**three_letter_code** | **String** | Three-letter ISO 3166-1 country code | [optional]
|
11
|
+
**timezones** | [**Array<Timezone>**](Timezone.md) | Time zones (IANA/Olsen) in the country | [optional]
|
11
12
|
|
12
13
|
|
@@ -28,6 +28,8 @@ require 'cloudmersive-validate-api-client/models/full_name_validation_response'
|
|
28
28
|
require 'cloudmersive-validate-api-client/models/geolocate_response'
|
29
29
|
require 'cloudmersive-validate-api-client/models/get_gender_request'
|
30
30
|
require 'cloudmersive-validate-api-client/models/get_gender_response'
|
31
|
+
require 'cloudmersive-validate-api-client/models/get_timezones_request'
|
32
|
+
require 'cloudmersive-validate-api-client/models/get_timezones_response'
|
31
33
|
require 'cloudmersive-validate-api-client/models/last_name_validation_request'
|
32
34
|
require 'cloudmersive-validate-api-client/models/last_name_validation_response'
|
33
35
|
require 'cloudmersive-validate-api-client/models/lead_enrichment_request'
|
@@ -36,6 +38,7 @@ require 'cloudmersive-validate-api-client/models/parse_address_request'
|
|
36
38
|
require 'cloudmersive-validate-api-client/models/parse_address_response'
|
37
39
|
require 'cloudmersive-validate-api-client/models/phone_number_validate_request'
|
38
40
|
require 'cloudmersive-validate-api-client/models/phone_number_validation_response'
|
41
|
+
require 'cloudmersive-validate-api-client/models/timezone'
|
39
42
|
require 'cloudmersive-validate-api-client/models/user_agent_validate_request'
|
40
43
|
require 'cloudmersive-validate-api-client/models/user_agent_validate_response'
|
41
44
|
require 'cloudmersive-validate-api-client/models/validate_country_request'
|
@@ -21,7 +21,7 @@ module CloudmersiveValidateApiClient
|
|
21
21
|
end
|
22
22
|
|
23
23
|
# Validate and normalize country information, return ISO 3166-1 country codes and country name
|
24
|
-
# Validates and normalizes country information, and returns key information about a country.
|
24
|
+
# Validates and normalizes country information, and returns key information about a country. Also returns distinct time zones in the country.
|
25
25
|
# @param input Input request
|
26
26
|
# @param [Hash] opts the optional parameters
|
27
27
|
# @return [ValidateCountryResponse]
|
@@ -31,7 +31,7 @@ module CloudmersiveValidateApiClient
|
|
31
31
|
end
|
32
32
|
|
33
33
|
# Validate and normalize country information, return ISO 3166-1 country codes and country name
|
34
|
-
# Validates and normalizes country information, and returns key information about a country.
|
34
|
+
# Validates and normalizes country information, and returns key information about a country. Also returns distinct time zones in the country.
|
35
35
|
# @param input Input request
|
36
36
|
# @param [Hash] opts the optional parameters
|
37
37
|
# @return [Array<(ValidateCountryResponse, Fixnum, Hash)>] ValidateCountryResponse data, response status code and response headers
|
@@ -75,6 +75,61 @@ module CloudmersiveValidateApiClient
|
|
75
75
|
return data, status_code, headers
|
76
76
|
end
|
77
77
|
|
78
|
+
# Gets IANA/Olsen time zones for a country
|
79
|
+
# Gets the IANA/Olsen time zones for a country.
|
80
|
+
# @param input Input request
|
81
|
+
# @param [Hash] opts the optional parameters
|
82
|
+
# @return [GetTimezonesResponse]
|
83
|
+
def address_get_timezone(input, opts = {})
|
84
|
+
data, _status_code, _headers = address_get_timezone_with_http_info(input, opts)
|
85
|
+
return data
|
86
|
+
end
|
87
|
+
|
88
|
+
# Gets IANA/Olsen time zones for a country
|
89
|
+
# Gets the IANA/Olsen time zones for a country.
|
90
|
+
# @param input Input request
|
91
|
+
# @param [Hash] opts the optional parameters
|
92
|
+
# @return [Array<(GetTimezonesResponse, Fixnum, Hash)>] GetTimezonesResponse data, response status code and response headers
|
93
|
+
def address_get_timezone_with_http_info(input, opts = {})
|
94
|
+
if @api_client.config.debugging
|
95
|
+
@api_client.config.logger.debug "Calling API: AddressApi.address_get_timezone ..."
|
96
|
+
end
|
97
|
+
# verify the required parameter 'input' is set
|
98
|
+
if @api_client.config.client_side_validation && input.nil?
|
99
|
+
fail ArgumentError, "Missing the required parameter 'input' when calling AddressApi.address_get_timezone"
|
100
|
+
end
|
101
|
+
# resource path
|
102
|
+
local_var_path = "/validate/address/country/get-timezones"
|
103
|
+
|
104
|
+
# query parameters
|
105
|
+
query_params = {}
|
106
|
+
|
107
|
+
# header parameters
|
108
|
+
header_params = {}
|
109
|
+
# HTTP header 'Accept' (if needed)
|
110
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/json', 'application/xml', 'text/xml'])
|
111
|
+
# HTTP header 'Content-Type'
|
112
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'text/json'])
|
113
|
+
|
114
|
+
# form parameters
|
115
|
+
form_params = {}
|
116
|
+
|
117
|
+
# http body (model)
|
118
|
+
post_body = @api_client.object_to_http_body(input)
|
119
|
+
auth_names = ['Apikey']
|
120
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
121
|
+
:header_params => header_params,
|
122
|
+
:query_params => query_params,
|
123
|
+
:form_params => form_params,
|
124
|
+
:body => post_body,
|
125
|
+
:auth_names => auth_names,
|
126
|
+
:return_type => 'GetTimezonesResponse')
|
127
|
+
if @api_client.config.debugging
|
128
|
+
@api_client.config.logger.debug "API called: AddressApi#address_get_timezone\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
129
|
+
end
|
130
|
+
return data, status_code, headers
|
131
|
+
end
|
132
|
+
|
78
133
|
# Parse an unstructured input text string into an international, formatted address
|
79
134
|
# 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.
|
80
135
|
# @param input Input parse request
|
@@ -0,0 +1,189 @@
|
|
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.3.1
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
|
15
|
+
module CloudmersiveValidateApiClient
|
16
|
+
# Request to get time zones for a country
|
17
|
+
class GetTimezonesRequest
|
18
|
+
# Can be the two-letter, three-letter country codes or country name
|
19
|
+
attr_accessor :country_code_or_name
|
20
|
+
|
21
|
+
|
22
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
23
|
+
def self.attribute_map
|
24
|
+
{
|
25
|
+
:'country_code_or_name' => :'CountryCodeOrName'
|
26
|
+
}
|
27
|
+
end
|
28
|
+
|
29
|
+
# Attribute type mapping.
|
30
|
+
def self.swagger_types
|
31
|
+
{
|
32
|
+
:'country_code_or_name' => :'String'
|
33
|
+
}
|
34
|
+
end
|
35
|
+
|
36
|
+
# Initializes the object
|
37
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
38
|
+
def initialize(attributes = {})
|
39
|
+
return unless attributes.is_a?(Hash)
|
40
|
+
|
41
|
+
# convert string to symbol for hash key
|
42
|
+
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
43
|
+
|
44
|
+
if attributes.has_key?(:'CountryCodeOrName')
|
45
|
+
self.country_code_or_name = attributes[:'CountryCodeOrName']
|
46
|
+
end
|
47
|
+
|
48
|
+
end
|
49
|
+
|
50
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
51
|
+
# @return Array for valid properties with the reasons
|
52
|
+
def list_invalid_properties
|
53
|
+
invalid_properties = Array.new
|
54
|
+
return invalid_properties
|
55
|
+
end
|
56
|
+
|
57
|
+
# Check to see if the all the properties in the model are valid
|
58
|
+
# @return true if the model is valid
|
59
|
+
def valid?
|
60
|
+
return true
|
61
|
+
end
|
62
|
+
|
63
|
+
# Checks equality by comparing each attribute.
|
64
|
+
# @param [Object] Object to be compared
|
65
|
+
def ==(o)
|
66
|
+
return true if self.equal?(o)
|
67
|
+
self.class == o.class &&
|
68
|
+
country_code_or_name == o.country_code_or_name
|
69
|
+
end
|
70
|
+
|
71
|
+
# @see the `==` method
|
72
|
+
# @param [Object] Object to be compared
|
73
|
+
def eql?(o)
|
74
|
+
self == o
|
75
|
+
end
|
76
|
+
|
77
|
+
# Calculates hash code according to all attributes.
|
78
|
+
# @return [Fixnum] Hash code
|
79
|
+
def hash
|
80
|
+
[country_code_or_name].hash
|
81
|
+
end
|
82
|
+
|
83
|
+
# Builds the object from hash
|
84
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
85
|
+
# @return [Object] Returns the model itself
|
86
|
+
def build_from_hash(attributes)
|
87
|
+
return nil unless attributes.is_a?(Hash)
|
88
|
+
self.class.swagger_types.each_pair do |key, type|
|
89
|
+
if type =~ /\AArray<(.*)>/i
|
90
|
+
# check to ensure the input is an array given that the the attribute
|
91
|
+
# is documented as an array but the input is not
|
92
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
93
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
|
94
|
+
end
|
95
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
96
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
97
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
98
|
+
end
|
99
|
+
|
100
|
+
self
|
101
|
+
end
|
102
|
+
|
103
|
+
# Deserializes the data based on type
|
104
|
+
# @param string type Data type
|
105
|
+
# @param string value Value to be deserialized
|
106
|
+
# @return [Object] Deserialized data
|
107
|
+
def _deserialize(type, value)
|
108
|
+
case type.to_sym
|
109
|
+
when :DateTime
|
110
|
+
DateTime.parse(value)
|
111
|
+
when :Date
|
112
|
+
Date.parse(value)
|
113
|
+
when :String
|
114
|
+
value.to_s
|
115
|
+
when :Integer
|
116
|
+
value.to_i
|
117
|
+
when :Float
|
118
|
+
value.to_f
|
119
|
+
when :BOOLEAN
|
120
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
121
|
+
true
|
122
|
+
else
|
123
|
+
false
|
124
|
+
end
|
125
|
+
when :Object
|
126
|
+
# generic object (usually a Hash), return directly
|
127
|
+
value
|
128
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
129
|
+
inner_type = Regexp.last_match[:inner_type]
|
130
|
+
value.map { |v| _deserialize(inner_type, v) }
|
131
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
132
|
+
k_type = Regexp.last_match[:k_type]
|
133
|
+
v_type = Regexp.last_match[:v_type]
|
134
|
+
{}.tap do |hash|
|
135
|
+
value.each do |k, v|
|
136
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
137
|
+
end
|
138
|
+
end
|
139
|
+
else # model
|
140
|
+
temp_model = CloudmersiveValidateApiClient.const_get(type).new
|
141
|
+
temp_model.build_from_hash(value)
|
142
|
+
end
|
143
|
+
end
|
144
|
+
|
145
|
+
# Returns the string representation of the object
|
146
|
+
# @return [String] String presentation of the object
|
147
|
+
def to_s
|
148
|
+
to_hash.to_s
|
149
|
+
end
|
150
|
+
|
151
|
+
# to_body is an alias to to_hash (backward compatibility)
|
152
|
+
# @return [Hash] Returns the object in the form of hash
|
153
|
+
def to_body
|
154
|
+
to_hash
|
155
|
+
end
|
156
|
+
|
157
|
+
# Returns the object in the form of hash
|
158
|
+
# @return [Hash] Returns the object in the form of hash
|
159
|
+
def to_hash
|
160
|
+
hash = {}
|
161
|
+
self.class.attribute_map.each_pair do |attr, param|
|
162
|
+
value = self.send(attr)
|
163
|
+
next if value.nil?
|
164
|
+
hash[param] = _to_hash(value)
|
165
|
+
end
|
166
|
+
hash
|
167
|
+
end
|
168
|
+
|
169
|
+
# Outputs non-array value in the form of hash
|
170
|
+
# For object, use to_hash. Otherwise, just return the value
|
171
|
+
# @param [Object] value Any valid value
|
172
|
+
# @return [Hash] Returns the value in the form of hash
|
173
|
+
def _to_hash(value)
|
174
|
+
if value.is_a?(Array)
|
175
|
+
value.compact.map{ |v| _to_hash(v) }
|
176
|
+
elsif value.is_a?(Hash)
|
177
|
+
{}.tap do |hash|
|
178
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
179
|
+
end
|
180
|
+
elsif value.respond_to? :to_hash
|
181
|
+
value.to_hash
|
182
|
+
else
|
183
|
+
value
|
184
|
+
end
|
185
|
+
end
|
186
|
+
|
187
|
+
end
|
188
|
+
|
189
|
+
end
|
@@ -0,0 +1,241 @@
|
|
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.3.1
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
|
15
|
+
module CloudmersiveValidateApiClient
|
16
|
+
# Result of performing a get time zones operation
|
17
|
+
class GetTimezonesResponse
|
18
|
+
# True if successful, false otherwise
|
19
|
+
attr_accessor :successful
|
20
|
+
|
21
|
+
# Full name of the country
|
22
|
+
attr_accessor :country_full_name
|
23
|
+
|
24
|
+
# Two-letter ISO 3166-1 country code
|
25
|
+
attr_accessor :iso_two_letter_code
|
26
|
+
|
27
|
+
# Two-letter FIPS 10-4 country code
|
28
|
+
attr_accessor :fips_two_letter_code
|
29
|
+
|
30
|
+
# Three-letter ISO 3166-1 country code
|
31
|
+
attr_accessor :three_letter_code
|
32
|
+
|
33
|
+
# Time zones (IANA/Olsen) in the country
|
34
|
+
attr_accessor :timezones
|
35
|
+
|
36
|
+
|
37
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
38
|
+
def self.attribute_map
|
39
|
+
{
|
40
|
+
:'successful' => :'Successful',
|
41
|
+
:'country_full_name' => :'CountryFullName',
|
42
|
+
:'iso_two_letter_code' => :'ISOTwoLetterCode',
|
43
|
+
:'fips_two_letter_code' => :'FIPSTwoLetterCode',
|
44
|
+
:'three_letter_code' => :'ThreeLetterCode',
|
45
|
+
:'timezones' => :'Timezones'
|
46
|
+
}
|
47
|
+
end
|
48
|
+
|
49
|
+
# Attribute type mapping.
|
50
|
+
def self.swagger_types
|
51
|
+
{
|
52
|
+
:'successful' => :'BOOLEAN',
|
53
|
+
:'country_full_name' => :'String',
|
54
|
+
:'iso_two_letter_code' => :'String',
|
55
|
+
:'fips_two_letter_code' => :'String',
|
56
|
+
:'three_letter_code' => :'String',
|
57
|
+
:'timezones' => :'Array<Timezone>'
|
58
|
+
}
|
59
|
+
end
|
60
|
+
|
61
|
+
# Initializes the object
|
62
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
63
|
+
def initialize(attributes = {})
|
64
|
+
return unless attributes.is_a?(Hash)
|
65
|
+
|
66
|
+
# convert string to symbol for hash key
|
67
|
+
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
68
|
+
|
69
|
+
if attributes.has_key?(:'Successful')
|
70
|
+
self.successful = attributes[:'Successful']
|
71
|
+
end
|
72
|
+
|
73
|
+
if attributes.has_key?(:'CountryFullName')
|
74
|
+
self.country_full_name = attributes[:'CountryFullName']
|
75
|
+
end
|
76
|
+
|
77
|
+
if attributes.has_key?(:'ISOTwoLetterCode')
|
78
|
+
self.iso_two_letter_code = attributes[:'ISOTwoLetterCode']
|
79
|
+
end
|
80
|
+
|
81
|
+
if attributes.has_key?(:'FIPSTwoLetterCode')
|
82
|
+
self.fips_two_letter_code = attributes[:'FIPSTwoLetterCode']
|
83
|
+
end
|
84
|
+
|
85
|
+
if attributes.has_key?(:'ThreeLetterCode')
|
86
|
+
self.three_letter_code = attributes[:'ThreeLetterCode']
|
87
|
+
end
|
88
|
+
|
89
|
+
if attributes.has_key?(:'Timezones')
|
90
|
+
if (value = attributes[:'Timezones']).is_a?(Array)
|
91
|
+
self.timezones = value
|
92
|
+
end
|
93
|
+
end
|
94
|
+
|
95
|
+
end
|
96
|
+
|
97
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
98
|
+
# @return Array for valid properties with the reasons
|
99
|
+
def list_invalid_properties
|
100
|
+
invalid_properties = Array.new
|
101
|
+
return invalid_properties
|
102
|
+
end
|
103
|
+
|
104
|
+
# Check to see if the all the properties in the model are valid
|
105
|
+
# @return true if the model is valid
|
106
|
+
def valid?
|
107
|
+
return true
|
108
|
+
end
|
109
|
+
|
110
|
+
# Checks equality by comparing each attribute.
|
111
|
+
# @param [Object] Object to be compared
|
112
|
+
def ==(o)
|
113
|
+
return true if self.equal?(o)
|
114
|
+
self.class == o.class &&
|
115
|
+
successful == o.successful &&
|
116
|
+
country_full_name == o.country_full_name &&
|
117
|
+
iso_two_letter_code == o.iso_two_letter_code &&
|
118
|
+
fips_two_letter_code == o.fips_two_letter_code &&
|
119
|
+
three_letter_code == o.three_letter_code &&
|
120
|
+
timezones == o.timezones
|
121
|
+
end
|
122
|
+
|
123
|
+
# @see the `==` method
|
124
|
+
# @param [Object] Object to be compared
|
125
|
+
def eql?(o)
|
126
|
+
self == o
|
127
|
+
end
|
128
|
+
|
129
|
+
# Calculates hash code according to all attributes.
|
130
|
+
# @return [Fixnum] Hash code
|
131
|
+
def hash
|
132
|
+
[successful, country_full_name, iso_two_letter_code, fips_two_letter_code, three_letter_code, timezones].hash
|
133
|
+
end
|
134
|
+
|
135
|
+
# Builds the object from hash
|
136
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
137
|
+
# @return [Object] Returns the model itself
|
138
|
+
def build_from_hash(attributes)
|
139
|
+
return nil unless attributes.is_a?(Hash)
|
140
|
+
self.class.swagger_types.each_pair do |key, type|
|
141
|
+
if type =~ /\AArray<(.*)>/i
|
142
|
+
# check to ensure the input is an array given that the the attribute
|
143
|
+
# is documented as an array but the input is not
|
144
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
145
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
|
146
|
+
end
|
147
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
148
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
149
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
150
|
+
end
|
151
|
+
|
152
|
+
self
|
153
|
+
end
|
154
|
+
|
155
|
+
# Deserializes the data based on type
|
156
|
+
# @param string type Data type
|
157
|
+
# @param string value Value to be deserialized
|
158
|
+
# @return [Object] Deserialized data
|
159
|
+
def _deserialize(type, value)
|
160
|
+
case type.to_sym
|
161
|
+
when :DateTime
|
162
|
+
DateTime.parse(value)
|
163
|
+
when :Date
|
164
|
+
Date.parse(value)
|
165
|
+
when :String
|
166
|
+
value.to_s
|
167
|
+
when :Integer
|
168
|
+
value.to_i
|
169
|
+
when :Float
|
170
|
+
value.to_f
|
171
|
+
when :BOOLEAN
|
172
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
173
|
+
true
|
174
|
+
else
|
175
|
+
false
|
176
|
+
end
|
177
|
+
when :Object
|
178
|
+
# generic object (usually a Hash), return directly
|
179
|
+
value
|
180
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
181
|
+
inner_type = Regexp.last_match[:inner_type]
|
182
|
+
value.map { |v| _deserialize(inner_type, v) }
|
183
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
184
|
+
k_type = Regexp.last_match[:k_type]
|
185
|
+
v_type = Regexp.last_match[:v_type]
|
186
|
+
{}.tap do |hash|
|
187
|
+
value.each do |k, v|
|
188
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
189
|
+
end
|
190
|
+
end
|
191
|
+
else # model
|
192
|
+
temp_model = CloudmersiveValidateApiClient.const_get(type).new
|
193
|
+
temp_model.build_from_hash(value)
|
194
|
+
end
|
195
|
+
end
|
196
|
+
|
197
|
+
# Returns the string representation of the object
|
198
|
+
# @return [String] String presentation of the object
|
199
|
+
def to_s
|
200
|
+
to_hash.to_s
|
201
|
+
end
|
202
|
+
|
203
|
+
# to_body is an alias to to_hash (backward compatibility)
|
204
|
+
# @return [Hash] Returns the object in the form of hash
|
205
|
+
def to_body
|
206
|
+
to_hash
|
207
|
+
end
|
208
|
+
|
209
|
+
# Returns the object in the form of hash
|
210
|
+
# @return [Hash] Returns the object in the form of hash
|
211
|
+
def to_hash
|
212
|
+
hash = {}
|
213
|
+
self.class.attribute_map.each_pair do |attr, param|
|
214
|
+
value = self.send(attr)
|
215
|
+
next if value.nil?
|
216
|
+
hash[param] = _to_hash(value)
|
217
|
+
end
|
218
|
+
hash
|
219
|
+
end
|
220
|
+
|
221
|
+
# Outputs non-array value in the form of hash
|
222
|
+
# For object, use to_hash. Otherwise, just return the value
|
223
|
+
# @param [Object] value Any valid value
|
224
|
+
# @return [Hash] Returns the value in the form of hash
|
225
|
+
def _to_hash(value)
|
226
|
+
if value.is_a?(Array)
|
227
|
+
value.compact.map{ |v| _to_hash(v) }
|
228
|
+
elsif value.is_a?(Hash)
|
229
|
+
{}.tap do |hash|
|
230
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
231
|
+
end
|
232
|
+
elsif value.respond_to? :to_hash
|
233
|
+
value.to_hash
|
234
|
+
else
|
235
|
+
value
|
236
|
+
end
|
237
|
+
end
|
238
|
+
|
239
|
+
end
|
240
|
+
|
241
|
+
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: 2.3.1
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
|
15
|
+
module CloudmersiveValidateApiClient
|
16
|
+
# IANA/Olsen time zone
|
17
|
+
class Timezone
|
18
|
+
# Name of the Time Zone
|
19
|
+
attr_accessor :name
|
20
|
+
|
21
|
+
# UTC offset for this time zone
|
22
|
+
attr_accessor :base_utc_offset
|
23
|
+
|
24
|
+
|
25
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
26
|
+
def self.attribute_map
|
27
|
+
{
|
28
|
+
:'name' => :'Name',
|
29
|
+
:'base_utc_offset' => :'BaseUTCOffset'
|
30
|
+
}
|
31
|
+
end
|
32
|
+
|
33
|
+
# Attribute type mapping.
|
34
|
+
def self.swagger_types
|
35
|
+
{
|
36
|
+
:'name' => :'String',
|
37
|
+
:'base_utc_offset' => :'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?(:'Name')
|
50
|
+
self.name = attributes[:'Name']
|
51
|
+
end
|
52
|
+
|
53
|
+
if attributes.has_key?(:'BaseUTCOffset')
|
54
|
+
self.base_utc_offset = attributes[:'BaseUTCOffset']
|
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
|
+
name == o.name &&
|
78
|
+
base_utc_offset == o.base_utc_offset
|
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
|
+
[name, base_utc_offset].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
|
@@ -30,6 +30,9 @@ module CloudmersiveValidateApiClient
|
|
30
30
|
# Three-letter ISO 3166-1 country code
|
31
31
|
attr_accessor :three_letter_code
|
32
32
|
|
33
|
+
# Time zones (IANA/Olsen) in the country
|
34
|
+
attr_accessor :timezones
|
35
|
+
|
33
36
|
|
34
37
|
# Attribute mapping from ruby-style variable name to JSON key.
|
35
38
|
def self.attribute_map
|
@@ -38,7 +41,8 @@ module CloudmersiveValidateApiClient
|
|
38
41
|
:'country_full_name' => :'CountryFullName',
|
39
42
|
:'iso_two_letter_code' => :'ISOTwoLetterCode',
|
40
43
|
:'fips_two_letter_code' => :'FIPSTwoLetterCode',
|
41
|
-
:'three_letter_code' => :'ThreeLetterCode'
|
44
|
+
:'three_letter_code' => :'ThreeLetterCode',
|
45
|
+
:'timezones' => :'Timezones'
|
42
46
|
}
|
43
47
|
end
|
44
48
|
|
@@ -49,7 +53,8 @@ module CloudmersiveValidateApiClient
|
|
49
53
|
:'country_full_name' => :'String',
|
50
54
|
:'iso_two_letter_code' => :'String',
|
51
55
|
:'fips_two_letter_code' => :'String',
|
52
|
-
:'three_letter_code' => :'String'
|
56
|
+
:'three_letter_code' => :'String',
|
57
|
+
:'timezones' => :'Array<Timezone>'
|
53
58
|
}
|
54
59
|
end
|
55
60
|
|
@@ -81,6 +86,12 @@ module CloudmersiveValidateApiClient
|
|
81
86
|
self.three_letter_code = attributes[:'ThreeLetterCode']
|
82
87
|
end
|
83
88
|
|
89
|
+
if attributes.has_key?(:'Timezones')
|
90
|
+
if (value = attributes[:'Timezones']).is_a?(Array)
|
91
|
+
self.timezones = value
|
92
|
+
end
|
93
|
+
end
|
94
|
+
|
84
95
|
end
|
85
96
|
|
86
97
|
# Show invalid properties with the reasons. Usually used together with valid?
|
@@ -105,7 +116,8 @@ module CloudmersiveValidateApiClient
|
|
105
116
|
country_full_name == o.country_full_name &&
|
106
117
|
iso_two_letter_code == o.iso_two_letter_code &&
|
107
118
|
fips_two_letter_code == o.fips_two_letter_code &&
|
108
|
-
three_letter_code == o.three_letter_code
|
119
|
+
three_letter_code == o.three_letter_code &&
|
120
|
+
timezones == o.timezones
|
109
121
|
end
|
110
122
|
|
111
123
|
# @see the `==` method
|
@@ -117,7 +129,7 @@ module CloudmersiveValidateApiClient
|
|
117
129
|
# Calculates hash code according to all attributes.
|
118
130
|
# @return [Fixnum] Hash code
|
119
131
|
def hash
|
120
|
-
[successful, country_full_name, iso_two_letter_code, fips_two_letter_code, three_letter_code].hash
|
132
|
+
[successful, country_full_name, iso_two_letter_code, fips_two_letter_code, three_letter_code, timezones].hash
|
121
133
|
end
|
122
134
|
|
123
135
|
# Builds the object from hash
|
@@ -34,7 +34,7 @@ describe 'AddressApi' do
|
|
34
34
|
|
35
35
|
# unit tests for address_country
|
36
36
|
# Validate and normalize country information, return ISO 3166-1 country codes and country name
|
37
|
-
# Validates and normalizes country information, and returns key information about a country.
|
37
|
+
# Validates and normalizes country information, and returns key information about a country. Also returns distinct time zones in the country.
|
38
38
|
# @param input Input request
|
39
39
|
# @param [Hash] opts the optional parameters
|
40
40
|
# @return [ValidateCountryResponse]
|
@@ -44,6 +44,18 @@ describe 'AddressApi' do
|
|
44
44
|
end
|
45
45
|
end
|
46
46
|
|
47
|
+
# unit tests for address_get_timezone
|
48
|
+
# Gets IANA/Olsen time zones for a country
|
49
|
+
# Gets the IANA/Olsen time zones for a country.
|
50
|
+
# @param input Input request
|
51
|
+
# @param [Hash] opts the optional parameters
|
52
|
+
# @return [GetTimezonesResponse]
|
53
|
+
describe 'address_get_timezone test' do
|
54
|
+
it "should work" do
|
55
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
47
59
|
# unit tests for address_parse_string
|
48
60
|
# Parse an unstructured input text string into an international, formatted address
|
49
61
|
# 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.
|
@@ -0,0 +1,42 @@
|
|
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.3.1
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'spec_helper'
|
14
|
+
require 'json'
|
15
|
+
require 'date'
|
16
|
+
|
17
|
+
# Unit tests for CloudmersiveValidateApiClient::GetTimezonesRequest
|
18
|
+
# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen)
|
19
|
+
# Please update as you see appropriate
|
20
|
+
describe 'GetTimezonesRequest' do
|
21
|
+
before do
|
22
|
+
# run before each test
|
23
|
+
@instance = CloudmersiveValidateApiClient::GetTimezonesRequest.new
|
24
|
+
end
|
25
|
+
|
26
|
+
after do
|
27
|
+
# run after each test
|
28
|
+
end
|
29
|
+
|
30
|
+
describe 'test an instance of GetTimezonesRequest' do
|
31
|
+
it 'should create an instance of GetTimezonesRequest' do
|
32
|
+
expect(@instance).to be_instance_of(CloudmersiveValidateApiClient::GetTimezonesRequest)
|
33
|
+
end
|
34
|
+
end
|
35
|
+
describe 'test attribute "country_code_or_name"' 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
|
+
end
|
42
|
+
|
@@ -0,0 +1,72 @@
|
|
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.3.1
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'spec_helper'
|
14
|
+
require 'json'
|
15
|
+
require 'date'
|
16
|
+
|
17
|
+
# Unit tests for CloudmersiveValidateApiClient::GetTimezonesResponse
|
18
|
+
# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen)
|
19
|
+
# Please update as you see appropriate
|
20
|
+
describe 'GetTimezonesResponse' do
|
21
|
+
before do
|
22
|
+
# run before each test
|
23
|
+
@instance = CloudmersiveValidateApiClient::GetTimezonesResponse.new
|
24
|
+
end
|
25
|
+
|
26
|
+
after do
|
27
|
+
# run after each test
|
28
|
+
end
|
29
|
+
|
30
|
+
describe 'test an instance of GetTimezonesResponse' do
|
31
|
+
it 'should create an instance of GetTimezonesResponse' do
|
32
|
+
expect(@instance).to be_instance_of(CloudmersiveValidateApiClient::GetTimezonesResponse)
|
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 "country_full_name"' 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 "iso_two_letter_code"' 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 "fips_two_letter_code"' 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 "three_letter_code"' 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 "timezones"' 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
|
+
end
|
72
|
+
|
@@ -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: 2.3.1
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'spec_helper'
|
14
|
+
require 'json'
|
15
|
+
require 'date'
|
16
|
+
|
17
|
+
# Unit tests for CloudmersiveValidateApiClient::Timezone
|
18
|
+
# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen)
|
19
|
+
# Please update as you see appropriate
|
20
|
+
describe 'Timezone' do
|
21
|
+
before do
|
22
|
+
# run before each test
|
23
|
+
@instance = CloudmersiveValidateApiClient::Timezone.new
|
24
|
+
end
|
25
|
+
|
26
|
+
after do
|
27
|
+
# run after each test
|
28
|
+
end
|
29
|
+
|
30
|
+
describe 'test an instance of Timezone' do
|
31
|
+
it 'should create an instance of Timezone' do
|
32
|
+
expect(@instance).to be_instance_of(CloudmersiveValidateApiClient::Timezone)
|
33
|
+
end
|
34
|
+
end
|
35
|
+
describe 'test attribute "name"' 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 "base_utc_offset"' 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
|
+
|
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.
|
4
|
+
version: 1.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Cloudmersive
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-12-
|
11
|
+
date: 2019-12-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: typhoeus
|
@@ -217,6 +217,8 @@ files:
|
|
217
217
|
- "./docs/GeolocateResponse.md"
|
218
218
|
- "./docs/GetGenderRequest.md"
|
219
219
|
- "./docs/GetGenderResponse.md"
|
220
|
+
- "./docs/GetTimezonesRequest.md"
|
221
|
+
- "./docs/GetTimezonesResponse.md"
|
220
222
|
- "./docs/IPAddressApi.md"
|
221
223
|
- "./docs/LastNameValidationRequest.md"
|
222
224
|
- "./docs/LastNameValidationResponse.md"
|
@@ -229,6 +231,7 @@ files:
|
|
229
231
|
- "./docs/PhoneNumberApi.md"
|
230
232
|
- "./docs/PhoneNumberValidateRequest.md"
|
231
233
|
- "./docs/PhoneNumberValidationResponse.md"
|
234
|
+
- "./docs/Timezone.md"
|
232
235
|
- "./docs/UserAgentApi.md"
|
233
236
|
- "./docs/UserAgentValidateRequest.md"
|
234
237
|
- "./docs/UserAgentValidateResponse.md"
|
@@ -269,6 +272,8 @@ files:
|
|
269
272
|
- "./lib/cloudmersive-validate-api-client/models/geolocate_response.rb"
|
270
273
|
- "./lib/cloudmersive-validate-api-client/models/get_gender_request.rb"
|
271
274
|
- "./lib/cloudmersive-validate-api-client/models/get_gender_response.rb"
|
275
|
+
- "./lib/cloudmersive-validate-api-client/models/get_timezones_request.rb"
|
276
|
+
- "./lib/cloudmersive-validate-api-client/models/get_timezones_response.rb"
|
272
277
|
- "./lib/cloudmersive-validate-api-client/models/last_name_validation_request.rb"
|
273
278
|
- "./lib/cloudmersive-validate-api-client/models/last_name_validation_response.rb"
|
274
279
|
- "./lib/cloudmersive-validate-api-client/models/lead_enrichment_request.rb"
|
@@ -277,6 +282,7 @@ files:
|
|
277
282
|
- "./lib/cloudmersive-validate-api-client/models/parse_address_response.rb"
|
278
283
|
- "./lib/cloudmersive-validate-api-client/models/phone_number_validate_request.rb"
|
279
284
|
- "./lib/cloudmersive-validate-api-client/models/phone_number_validation_response.rb"
|
285
|
+
- "./lib/cloudmersive-validate-api-client/models/timezone.rb"
|
280
286
|
- "./lib/cloudmersive-validate-api-client/models/user_agent_validate_request.rb"
|
281
287
|
- "./lib/cloudmersive-validate-api-client/models/user_agent_validate_response.rb"
|
282
288
|
- "./lib/cloudmersive-validate-api-client/models/validate_country_request.rb"
|
@@ -313,6 +319,8 @@ files:
|
|
313
319
|
- "./spec/models/geolocate_response_spec.rb"
|
314
320
|
- "./spec/models/get_gender_request_spec.rb"
|
315
321
|
- "./spec/models/get_gender_response_spec.rb"
|
322
|
+
- "./spec/models/get_timezones_request_spec.rb"
|
323
|
+
- "./spec/models/get_timezones_response_spec.rb"
|
316
324
|
- "./spec/models/last_name_validation_request_spec.rb"
|
317
325
|
- "./spec/models/last_name_validation_response_spec.rb"
|
318
326
|
- "./spec/models/lead_enrichment_request_spec.rb"
|
@@ -321,6 +329,7 @@ files:
|
|
321
329
|
- "./spec/models/parse_address_response_spec.rb"
|
322
330
|
- "./spec/models/phone_number_validate_request_spec.rb"
|
323
331
|
- "./spec/models/phone_number_validation_response_spec.rb"
|
332
|
+
- "./spec/models/timezone_spec.rb"
|
324
333
|
- "./spec/models/user_agent_validate_request_spec.rb"
|
325
334
|
- "./spec/models/user_agent_validate_response_spec.rb"
|
326
335
|
- "./spec/models/validate_country_request_spec.rb"
|