cloudmersive-validate-api-client 2.0.3 → 2.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile +7 -0
- data/README.md +177 -0
- data/Rakefile +8 -0
- data/cloudmersive-validate-api-client.gemspec +45 -0
- data/docs/AddressApi.md +607 -0
- data/docs/AddressGetServersResponse.md +9 -0
- data/docs/AddressVerifySyntaxOnlyResponse.md +11 -0
- data/docs/CheckResponse.md +8 -0
- data/docs/CountryDetails.md +16 -0
- data/docs/CountryListResult.md +9 -0
- data/docs/DomainApi.md +228 -0
- data/docs/EmailApi.md +173 -0
- data/docs/FirstNameValidationRequest.md +8 -0
- data/docs/FirstNameValidationResponse.md +9 -0
- data/docs/FullEmailValidationResponse.md +16 -0
- data/docs/FullNameValidationRequest.md +8 -0
- data/docs/FullNameValidationResponse.md +17 -0
- data/docs/GeolocateResponse.md +16 -0
- data/docs/GetGenderRequest.md +9 -0
- data/docs/GetGenderResponse.md +9 -0
- data/docs/GetTimezonesRequest.md +8 -0
- data/docs/GetTimezonesResponse.md +13 -0
- data/docs/IPAddressApi.md +173 -0
- data/docs/IPThreatResponse.md +9 -0
- data/docs/LastNameValidationRequest.md +8 -0
- data/docs/LastNameValidationResponse.md +9 -0
- data/docs/LeadEnrichmentApi.md +61 -0
- data/docs/LeadEnrichmentRequest.md +21 -0
- data/docs/LeadEnrichmentResponse.md +25 -0
- data/docs/NameApi.md +283 -0
- data/docs/ParseAddressRequest.md +9 -0
- data/docs/ParseAddressResponse.md +16 -0
- data/docs/PhoneNumberApi.md +63 -0
- data/docs/PhoneNumberValidateRequest.md +9 -0
- data/docs/PhoneNumberValidationResponse.md +15 -0
- data/docs/Timezone.md +10 -0
- data/docs/TorNodeResponse.md +8 -0
- data/docs/UserAgentApi.md +63 -0
- data/docs/UserAgentValidateRequest.md +8 -0
- data/docs/UserAgentValidateResponse.md +21 -0
- data/docs/ValidateAddressRequest.md +13 -0
- data/docs/ValidateAddressResponse.md +10 -0
- data/docs/ValidateCityRequest.md +11 -0
- data/docs/ValidateCityResponse.md +12 -0
- data/docs/ValidateCountryRequest.md +8 -0
- data/docs/ValidateCountryResponse.md +19 -0
- data/docs/ValidateIdentifierRequest.md +15 -0
- data/docs/ValidateIdentifierResponse.md +9 -0
- data/docs/ValidatePostalCodeRequest.md +10 -0
- data/docs/ValidatePostalCodeResponse.md +12 -0
- data/docs/ValidateStateRequest.md +10 -0
- data/docs/ValidateStateResponse.md +11 -0
- data/docs/ValidateUrlRequestFull.md +8 -0
- data/docs/ValidateUrlRequestSyntaxOnly.md +8 -0
- data/docs/ValidateUrlResponseFull.md +12 -0
- data/docs/ValidateUrlResponseSyntaxOnly.md +9 -0
- data/docs/VatApi.md +63 -0
- data/docs/VatLookupRequest.md +8 -0
- data/docs/VatLookupResponse.md +19 -0
- data/docs/WhoisResponse.md +22 -0
- data/git_push.sh +55 -0
- data/lib/cloudmersive-validate-api-client.rb +95 -0
- data/lib/cloudmersive-validate-api-client/api/address_api.rb +609 -0
- data/lib/cloudmersive-validate-api-client/api/domain_api.rb +239 -0
- data/lib/cloudmersive-validate-api-client/api/email_api.rb +185 -0
- data/lib/cloudmersive-validate-api-client/api/ip_address_api.rb +185 -0
- data/lib/cloudmersive-validate-api-client/api/lead_enrichment_api.rb +75 -0
- data/lib/cloudmersive-validate-api-client/api/name_api.rb +293 -0
- data/lib/cloudmersive-validate-api-client/api/phone_number_api.rb +77 -0
- data/lib/cloudmersive-validate-api-client/api/user_agent_api.rb +77 -0
- data/lib/cloudmersive-validate-api-client/api/vat_api.rb +77 -0
- data/lib/cloudmersive-validate-api-client/api_client.rb +391 -0
- data/lib/cloudmersive-validate-api-client/api_error.rb +38 -0
- data/lib/cloudmersive-validate-api-client/configuration.rb +209 -0
- data/lib/cloudmersive-validate-api-client/models/address_get_servers_response.rb +198 -0
- data/lib/cloudmersive-validate-api-client/models/address_verify_syntax_only_response.rb +216 -0
- data/lib/cloudmersive-validate-api-client/models/check_response.rb +186 -0
- data/lib/cloudmersive-validate-api-client/models/country_details.rb +266 -0
- data/lib/cloudmersive-validate-api-client/models/country_list_result.rb +198 -0
- data/lib/cloudmersive-validate-api-client/models/first_name_validation_request.rb +186 -0
- data/lib/cloudmersive-validate-api-client/models/first_name_validation_response.rb +196 -0
- data/lib/cloudmersive-validate-api-client/models/full_email_validation_response.rb +266 -0
- data/lib/cloudmersive-validate-api-client/models/full_name_validation_request.rb +186 -0
- data/lib/cloudmersive-validate-api-client/models/full_name_validation_response.rb +276 -0
- data/lib/cloudmersive-validate-api-client/models/geolocate_response.rb +266 -0
- data/lib/cloudmersive-validate-api-client/models/get_gender_request.rb +196 -0
- data/lib/cloudmersive-validate-api-client/models/get_gender_response.rb +196 -0
- data/lib/cloudmersive-validate-api-client/models/get_timezones_request.rb +186 -0
- data/lib/cloudmersive-validate-api-client/models/get_timezones_response.rb +238 -0
- data/lib/cloudmersive-validate-api-client/models/ip_threat_response.rb +196 -0
- data/lib/cloudmersive-validate-api-client/models/last_name_validation_request.rb +186 -0
- data/lib/cloudmersive-validate-api-client/models/last_name_validation_response.rb +196 -0
- data/lib/cloudmersive-validate-api-client/models/lead_enrichment_request.rb +316 -0
- data/lib/cloudmersive-validate-api-client/models/lead_enrichment_response.rb +356 -0
- data/lib/cloudmersive-validate-api-client/models/parse_address_request.rb +196 -0
- data/lib/cloudmersive-validate-api-client/models/parse_address_response.rb +266 -0
- data/lib/cloudmersive-validate-api-client/models/phone_number_validate_request.rb +196 -0
- data/lib/cloudmersive-validate-api-client/models/phone_number_validation_response.rb +256 -0
- data/lib/cloudmersive-validate-api-client/models/timezone.rb +206 -0
- data/lib/cloudmersive-validate-api-client/models/tor_node_response.rb +186 -0
- data/lib/cloudmersive-validate-api-client/models/user_agent_validate_request.rb +186 -0
- data/lib/cloudmersive-validate-api-client/models/user_agent_validate_response.rb +316 -0
- data/lib/cloudmersive-validate-api-client/models/validate_address_request.rb +236 -0
- data/lib/cloudmersive-validate-api-client/models/validate_address_response.rb +206 -0
- data/lib/cloudmersive-validate-api-client/models/validate_city_request.rb +216 -0
- data/lib/cloudmersive-validate-api-client/models/validate_city_response.rb +226 -0
- data/lib/cloudmersive-validate-api-client/models/validate_country_request.rb +186 -0
- data/lib/cloudmersive-validate-api-client/models/validate_country_response.rb +298 -0
- data/lib/cloudmersive-validate-api-client/models/validate_identifier_request.rb +256 -0
- data/lib/cloudmersive-validate-api-client/models/validate_identifier_response.rb +196 -0
- data/lib/cloudmersive-validate-api-client/models/validate_postal_code_request.rb +206 -0
- data/lib/cloudmersive-validate-api-client/models/validate_postal_code_response.rb +226 -0
- data/lib/cloudmersive-validate-api-client/models/validate_state_request.rb +206 -0
- data/lib/cloudmersive-validate-api-client/models/validate_state_response.rb +216 -0
- data/lib/cloudmersive-validate-api-client/models/validate_url_request_full.rb +186 -0
- data/lib/cloudmersive-validate-api-client/models/validate_url_request_syntax_only.rb +186 -0
- data/lib/cloudmersive-validate-api-client/models/validate_url_response_full.rb +226 -0
- data/lib/cloudmersive-validate-api-client/models/validate_url_response_syntax_only.rb +196 -0
- data/lib/cloudmersive-validate-api-client/models/vat_lookup_request.rb +186 -0
- data/lib/cloudmersive-validate-api-client/models/vat_lookup_response.rb +295 -0
- data/lib/cloudmersive-validate-api-client/models/whois_response.rb +326 -0
- data/lib/cloudmersive-validate-api-client/version.rb +15 -0
- data/spec/api/address_api_spec.rb +166 -0
- data/spec/api/domain_api_spec.rb +83 -0
- data/spec/api/email_api_spec.rb +71 -0
- data/spec/api/ip_address_api_spec.rb +71 -0
- data/spec/api/lead_enrichment_api_spec.rb +46 -0
- data/spec/api/name_api_spec.rb +95 -0
- data/spec/api/phone_number_api_spec.rb +47 -0
- data/spec/api/user_agent_api_spec.rb +47 -0
- data/spec/api/vat_api_spec.rb +47 -0
- data/spec/api_client_spec.rb +243 -0
- data/spec/configuration_spec.rb +42 -0
- data/spec/models/address_get_servers_response_spec.rb +47 -0
- data/spec/models/address_verify_syntax_only_response_spec.rb +59 -0
- data/spec/models/check_response_spec.rb +41 -0
- data/spec/models/country_details_spec.rb +89 -0
- data/spec/models/country_list_result_spec.rb +47 -0
- data/spec/models/first_name_validation_request_spec.rb +41 -0
- data/spec/models/first_name_validation_response_spec.rb +47 -0
- data/spec/models/full_email_validation_response_spec.rb +89 -0
- data/spec/models/full_name_validation_request_spec.rb +41 -0
- data/spec/models/full_name_validation_response_spec.rb +95 -0
- data/spec/models/geolocate_response_spec.rb +89 -0
- data/spec/models/get_gender_request_spec.rb +47 -0
- data/spec/models/get_gender_response_spec.rb +47 -0
- data/spec/models/get_timezones_request_spec.rb +41 -0
- data/spec/models/get_timezones_response_spec.rb +71 -0
- data/spec/models/ip_threat_response_spec.rb +47 -0
- data/spec/models/last_name_validation_request_spec.rb +41 -0
- data/spec/models/last_name_validation_response_spec.rb +47 -0
- data/spec/models/lead_enrichment_request_spec.rb +119 -0
- data/spec/models/lead_enrichment_response_spec.rb +143 -0
- data/spec/models/parse_address_request_spec.rb +47 -0
- data/spec/models/parse_address_response_spec.rb +89 -0
- data/spec/models/phone_number_validate_request_spec.rb +47 -0
- data/spec/models/phone_number_validation_response_spec.rb +83 -0
- data/spec/models/timezone_spec.rb +53 -0
- data/spec/models/tor_node_response_spec.rb +41 -0
- data/spec/models/user_agent_validate_request_spec.rb +41 -0
- data/spec/models/user_agent_validate_response_spec.rb +119 -0
- data/spec/models/validate_address_request_spec.rb +71 -0
- data/spec/models/validate_address_response_spec.rb +53 -0
- data/spec/models/validate_city_request_spec.rb +59 -0
- data/spec/models/validate_city_response_spec.rb +65 -0
- data/spec/models/validate_country_request_spec.rb +41 -0
- data/spec/models/validate_country_response_spec.rb +107 -0
- data/spec/models/validate_identifier_request_spec.rb +83 -0
- data/spec/models/validate_identifier_response_spec.rb +47 -0
- data/spec/models/validate_postal_code_request_spec.rb +53 -0
- data/spec/models/validate_postal_code_response_spec.rb +65 -0
- data/spec/models/validate_state_request_spec.rb +53 -0
- data/spec/models/validate_state_response_spec.rb +59 -0
- data/spec/models/validate_url_request_full_spec.rb +41 -0
- data/spec/models/validate_url_request_syntax_only_spec.rb +41 -0
- data/spec/models/validate_url_response_full_spec.rb +65 -0
- data/spec/models/validate_url_response_syntax_only_spec.rb +47 -0
- data/spec/models/vat_lookup_request_spec.rb +41 -0
- data/spec/models/vat_lookup_response_spec.rb +107 -0
- data/spec/models/whois_response_spec.rb +125 -0
- data/spec/spec_helper.rb +111 -0
- metadata +184 -3
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#validateapi
|
|
3
|
+
|
|
4
|
+
#The validation APIs help you validate data. Check if an E-mail address is real. Check if a domain is real. Check up on an IP address, and even where it is located. All this and much more is available in the validation API.
|
|
5
|
+
|
|
6
|
+
OpenAPI spec version: v1
|
|
7
|
+
|
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
|
9
|
+
Swagger Codegen version: 2.4.14
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'spec_helper'
|
|
14
|
+
require 'json'
|
|
15
|
+
|
|
16
|
+
# Unit tests for CloudmersiveValidateApiClient::NameApi
|
|
17
|
+
# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen)
|
|
18
|
+
# Please update as you see appropriate
|
|
19
|
+
describe 'NameApi' do
|
|
20
|
+
before do
|
|
21
|
+
# run before each test
|
|
22
|
+
@instance = CloudmersiveValidateApiClient::NameApi.new
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
after do
|
|
26
|
+
# run after each test
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
describe 'test an instance of NameApi' do
|
|
30
|
+
it 'should create an instance of NameApi' do
|
|
31
|
+
expect(@instance).to be_instance_of(CloudmersiveValidateApiClient::NameApi)
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
# unit tests for name_get_gender
|
|
36
|
+
# Get the gender of a first name
|
|
37
|
+
# Determines the gender of a first name (given name)
|
|
38
|
+
# @param input Gender request information
|
|
39
|
+
# @param [Hash] opts the optional parameters
|
|
40
|
+
# @return [GetGenderResponse]
|
|
41
|
+
describe 'name_get_gender test' do
|
|
42
|
+
it 'should work' do
|
|
43
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
# unit tests for name_identifier
|
|
48
|
+
# Validate a code identifier
|
|
49
|
+
# Determines if the input name is a valid technical / code identifier. Configure input rules such as whether whitespace, hyphens, underscores, etc. are allowed. For example, a valid identifier might be \"helloWorld\" but not \"hello*World\".
|
|
50
|
+
# @param input Identifier validation request information
|
|
51
|
+
# @param [Hash] opts the optional parameters
|
|
52
|
+
# @return [ValidateIdentifierResponse]
|
|
53
|
+
describe 'name_identifier test' do
|
|
54
|
+
it 'should work' do
|
|
55
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
56
|
+
end
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
# unit tests for name_validate_first_name
|
|
60
|
+
# Validate a first name
|
|
61
|
+
# Determines if a string is a valid first name (given name)
|
|
62
|
+
# @param input Validation request information
|
|
63
|
+
# @param [Hash] opts the optional parameters
|
|
64
|
+
# @return [FirstNameValidationResponse]
|
|
65
|
+
describe 'name_validate_first_name test' 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
|
+
# unit tests for name_validate_full_name
|
|
72
|
+
# Parse and validate a full name
|
|
73
|
+
# Parses a full name string (e.g. \"Mr. Jon van der Waal Jr.\") into its component parts (and returns these component parts), and then validates whether it is a valid name string or not
|
|
74
|
+
# @param input Validation request information
|
|
75
|
+
# @param [Hash] opts the optional parameters
|
|
76
|
+
# @return [FullNameValidationResponse]
|
|
77
|
+
describe 'name_validate_full_name test' 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
|
+
# unit tests for name_validate_last_name
|
|
84
|
+
# Validate a last name
|
|
85
|
+
# Determines if a string is a valid last name (surname)
|
|
86
|
+
# @param input Validation request information
|
|
87
|
+
# @param [Hash] opts the optional parameters
|
|
88
|
+
# @return [LastNameValidationResponse]
|
|
89
|
+
describe 'name_validate_last_name test' do
|
|
90
|
+
it 'should work' do
|
|
91
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
92
|
+
end
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
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: 2.4.14
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'spec_helper'
|
|
14
|
+
require 'json'
|
|
15
|
+
|
|
16
|
+
# Unit tests for CloudmersiveValidateApiClient::PhoneNumberApi
|
|
17
|
+
# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen)
|
|
18
|
+
# Please update as you see appropriate
|
|
19
|
+
describe 'PhoneNumberApi' do
|
|
20
|
+
before do
|
|
21
|
+
# run before each test
|
|
22
|
+
@instance = CloudmersiveValidateApiClient::PhoneNumberApi.new
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
after do
|
|
26
|
+
# run after each test
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
describe 'test an instance of PhoneNumberApi' do
|
|
30
|
+
it 'should create an instance of PhoneNumberApi' do
|
|
31
|
+
expect(@instance).to be_instance_of(CloudmersiveValidateApiClient::PhoneNumberApi)
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
# unit tests for phone_number_syntax_only
|
|
36
|
+
# Validate phone number (basic)
|
|
37
|
+
# Validate a phone number by analyzing the syntax
|
|
38
|
+
# @param value Phone number to validate in a PhoneNumberValidateRequest object. Try a phone number such as \"1.800.463.3339\", and either leave DefaultCountryCode blank or use \"US\".
|
|
39
|
+
# @param [Hash] opts the optional parameters
|
|
40
|
+
# @return [PhoneNumberValidationResponse]
|
|
41
|
+
describe 'phone_number_syntax_only 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,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: 2.4.14
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'spec_helper'
|
|
14
|
+
require 'json'
|
|
15
|
+
|
|
16
|
+
# Unit tests for CloudmersiveValidateApiClient::UserAgentApi
|
|
17
|
+
# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen)
|
|
18
|
+
# Please update as you see appropriate
|
|
19
|
+
describe 'UserAgentApi' do
|
|
20
|
+
before do
|
|
21
|
+
# run before each test
|
|
22
|
+
@instance = CloudmersiveValidateApiClient::UserAgentApi.new
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
after do
|
|
26
|
+
# run after each test
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
describe 'test an instance of UserAgentApi' do
|
|
30
|
+
it 'should create an instance of UserAgentApi' do
|
|
31
|
+
expect(@instance).to be_instance_of(CloudmersiveValidateApiClient::UserAgentApi)
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
# unit tests for user_agent_parse
|
|
36
|
+
# Parse an HTTP User-Agent string, identify robots
|
|
37
|
+
# Uses a parsing system and database to parse the User-Agent into its structured component parts, such as Browser, Browser Version, Browser Engine, Operating System, and importantly, Robot identification.
|
|
38
|
+
# @param request Input parse request
|
|
39
|
+
# @param [Hash] opts the optional parameters
|
|
40
|
+
# @return [UserAgentValidateResponse]
|
|
41
|
+
describe 'user_agent_parse 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,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: 2.4.14
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'spec_helper'
|
|
14
|
+
require 'json'
|
|
15
|
+
|
|
16
|
+
# Unit tests for CloudmersiveValidateApiClient::VatApi
|
|
17
|
+
# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen)
|
|
18
|
+
# Please update as you see appropriate
|
|
19
|
+
describe 'VatApi' do
|
|
20
|
+
before do
|
|
21
|
+
# run before each test
|
|
22
|
+
@instance = CloudmersiveValidateApiClient::VatApi.new
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
after do
|
|
26
|
+
# run after each test
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
describe 'test an instance of VatApi' do
|
|
30
|
+
it 'should create an instance of VatApi' do
|
|
31
|
+
expect(@instance).to be_instance_of(CloudmersiveValidateApiClient::VatApi)
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
# unit tests for vat_vat_lookup
|
|
36
|
+
# Validate a VAT number
|
|
37
|
+
# Checks if a VAT code is valid, and if it is, returns more information about it. The first two letters of the VAT number must be letters that indicate the country, such as LU20260743. Possible country codes include Austria (AT), Belgium (BE), Bulgaria (BG), Cyprus (CY), Czech Republic (CZ), Germany (DE), Denmark (DK), Estonia (EE), Greece (EL), Spain (ES), Finland (FI), France (FR), United Kingdom (GB), Croatia (HR), Hungary (HU), Ireland (IE), Italy (IT), Lithuania (LT), Luxembourg (LU), Latvia (LV), Malta (MT), The Netherlands (NL), Poland (PL), Portugal (PT), Romania (RO), Sweden (SE), Slovenia (SI), Slovakia (SK).
|
|
38
|
+
# @param input Input VAT code
|
|
39
|
+
# @param [Hash] opts the optional parameters
|
|
40
|
+
# @return [VatLookupResponse]
|
|
41
|
+
describe 'vat_vat_lookup 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,243 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#validateapi
|
|
3
|
+
|
|
4
|
+
#The validation APIs help you validate data. Check if an E-mail address is real. Check if a domain is real. Check up on an IP address, and even where it is located. All this and much more is available in the validation API.
|
|
5
|
+
|
|
6
|
+
OpenAPI spec version: v1
|
|
7
|
+
|
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
|
9
|
+
Swagger Codegen version: 2.4.14
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'spec_helper'
|
|
14
|
+
|
|
15
|
+
describe CloudmersiveValidateApiClient::ApiClient do
|
|
16
|
+
context 'initialization' do
|
|
17
|
+
context 'URL stuff' do
|
|
18
|
+
context 'host' do
|
|
19
|
+
it 'removes http from host' do
|
|
20
|
+
CloudmersiveValidateApiClient.configure { |c| c.host = 'http://example.com' }
|
|
21
|
+
expect(CloudmersiveValidateApiClient::Configuration.default.host).to eq('example.com')
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
it 'removes https from host' do
|
|
25
|
+
CloudmersiveValidateApiClient.configure { |c| c.host = 'https://wookiee.com' }
|
|
26
|
+
expect(CloudmersiveValidateApiClient::ApiClient.default.config.host).to eq('wookiee.com')
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
it 'removes trailing path from host' do
|
|
30
|
+
CloudmersiveValidateApiClient.configure { |c| c.host = 'hobo.com/v4' }
|
|
31
|
+
expect(CloudmersiveValidateApiClient::Configuration.default.host).to eq('hobo.com')
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
context 'base_path' do
|
|
36
|
+
it "prepends a slash to base_path" do
|
|
37
|
+
CloudmersiveValidateApiClient.configure { |c| c.base_path = 'v4/dog' }
|
|
38
|
+
expect(CloudmersiveValidateApiClient::Configuration.default.base_path).to eq('/v4/dog')
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
it "doesn't prepend a slash if one is already there" do
|
|
42
|
+
CloudmersiveValidateApiClient.configure { |c| c.base_path = '/v4/dog' }
|
|
43
|
+
expect(CloudmersiveValidateApiClient::Configuration.default.base_path).to eq('/v4/dog')
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
it "ends up as a blank string if nil" do
|
|
47
|
+
CloudmersiveValidateApiClient.configure { |c| c.base_path = nil }
|
|
48
|
+
expect(CloudmersiveValidateApiClient::Configuration.default.base_path).to eq('')
|
|
49
|
+
end
|
|
50
|
+
end
|
|
51
|
+
end
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
describe 'params_encoding in #build_request' do
|
|
55
|
+
let(:config) { CloudmersiveValidateApiClient::Configuration.new }
|
|
56
|
+
let(:api_client) { CloudmersiveValidateApiClient::ApiClient.new(config) }
|
|
57
|
+
|
|
58
|
+
it 'defaults to nil' do
|
|
59
|
+
expect(CloudmersiveValidateApiClient::Configuration.default.params_encoding).to eq(nil)
|
|
60
|
+
expect(config.params_encoding).to eq(nil)
|
|
61
|
+
|
|
62
|
+
request = api_client.build_request(:get, '/test')
|
|
63
|
+
expect(request.options[:params_encoding]).to eq(nil)
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
it 'can be customized' do
|
|
67
|
+
config.params_encoding = :multi
|
|
68
|
+
request = api_client.build_request(:get, '/test')
|
|
69
|
+
expect(request.options[:params_encoding]).to eq(:multi)
|
|
70
|
+
end
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
describe 'timeout in #build_request' do
|
|
74
|
+
let(:config) { CloudmersiveValidateApiClient::Configuration.new }
|
|
75
|
+
let(:api_client) { CloudmersiveValidateApiClient::ApiClient.new(config) }
|
|
76
|
+
|
|
77
|
+
it 'defaults to 0' do
|
|
78
|
+
expect(CloudmersiveValidateApiClient::Configuration.default.timeout).to eq(0)
|
|
79
|
+
expect(config.timeout).to eq(0)
|
|
80
|
+
|
|
81
|
+
request = api_client.build_request(:get, '/test')
|
|
82
|
+
expect(request.options[:timeout]).to eq(0)
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
it 'can be customized' do
|
|
86
|
+
config.timeout = 100
|
|
87
|
+
request = api_client.build_request(:get, '/test')
|
|
88
|
+
expect(request.options[:timeout]).to eq(100)
|
|
89
|
+
end
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
describe '#build_request' do
|
|
93
|
+
let(:config) { CloudmersiveValidateApiClient::Configuration.new }
|
|
94
|
+
let(:api_client) { CloudmersiveValidateApiClient::ApiClient.new(config) }
|
|
95
|
+
|
|
96
|
+
it 'does not send multipart to request' do
|
|
97
|
+
expect(Typhoeus::Request).to receive(:new).with(anything, hash_not_including(:multipart))
|
|
98
|
+
api_client.build_request(:get, '/test')
|
|
99
|
+
end
|
|
100
|
+
|
|
101
|
+
context 'when the content type is multipart' do
|
|
102
|
+
it 'sends multipart to request' do
|
|
103
|
+
expect(Typhoeus::Request).to receive(:new).with(anything, hash_including(multipart: true))
|
|
104
|
+
api_client.build_request(:get, '/test', {header_params: { 'Content-Type' => 'multipart/form-data'}})
|
|
105
|
+
end
|
|
106
|
+
end
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
describe '#deserialize' do
|
|
110
|
+
it "handles Array<Integer>" do
|
|
111
|
+
api_client = CloudmersiveValidateApiClient::ApiClient.new
|
|
112
|
+
headers = { 'Content-Type' => 'application/json' }
|
|
113
|
+
response = double('response', headers: headers, body: '[12, 34]')
|
|
114
|
+
data = api_client.deserialize(response, 'Array<Integer>')
|
|
115
|
+
expect(data).to be_instance_of(Array)
|
|
116
|
+
expect(data).to eq([12, 34])
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
it 'handles Array<Array<Integer>>' do
|
|
120
|
+
api_client = CloudmersiveValidateApiClient::ApiClient.new
|
|
121
|
+
headers = { 'Content-Type' => 'application/json' }
|
|
122
|
+
response = double('response', headers: headers, body: '[[12, 34], [56]]')
|
|
123
|
+
data = api_client.deserialize(response, 'Array<Array<Integer>>')
|
|
124
|
+
expect(data).to be_instance_of(Array)
|
|
125
|
+
expect(data).to eq([[12, 34], [56]])
|
|
126
|
+
end
|
|
127
|
+
|
|
128
|
+
it 'handles Hash<String, String>' do
|
|
129
|
+
api_client = CloudmersiveValidateApiClient::ApiClient.new
|
|
130
|
+
headers = { 'Content-Type' => 'application/json' }
|
|
131
|
+
response = double('response', headers: headers, body: '{"message": "Hello"}')
|
|
132
|
+
data = api_client.deserialize(response, 'Hash<String, String>')
|
|
133
|
+
expect(data).to be_instance_of(Hash)
|
|
134
|
+
expect(data).to eq(:message => 'Hello')
|
|
135
|
+
end
|
|
136
|
+
end
|
|
137
|
+
|
|
138
|
+
describe "#object_to_hash" do
|
|
139
|
+
it 'ignores nils and includes empty arrays' do
|
|
140
|
+
# uncomment below to test object_to_hash for model
|
|
141
|
+
# api_client = CloudmersiveValidateApiClient::ApiClient.new
|
|
142
|
+
# _model = CloudmersiveValidateApiClient::ModelName.new
|
|
143
|
+
# update the model attribute below
|
|
144
|
+
# _model.id = 1
|
|
145
|
+
# update the expected value (hash) below
|
|
146
|
+
# expected = {id: 1, name: '', tags: []}
|
|
147
|
+
# expect(api_client.object_to_hash(_model)).to eq(expected)
|
|
148
|
+
end
|
|
149
|
+
end
|
|
150
|
+
|
|
151
|
+
describe '#build_collection_param' do
|
|
152
|
+
let(:param) { ['aa', 'bb', 'cc'] }
|
|
153
|
+
let(:api_client) { CloudmersiveValidateApiClient::ApiClient.new }
|
|
154
|
+
|
|
155
|
+
it 'works for csv' do
|
|
156
|
+
expect(api_client.build_collection_param(param, :csv)).to eq('aa,bb,cc')
|
|
157
|
+
end
|
|
158
|
+
|
|
159
|
+
it 'works for ssv' do
|
|
160
|
+
expect(api_client.build_collection_param(param, :ssv)).to eq('aa bb cc')
|
|
161
|
+
end
|
|
162
|
+
|
|
163
|
+
it 'works for tsv' do
|
|
164
|
+
expect(api_client.build_collection_param(param, :tsv)).to eq("aa\tbb\tcc")
|
|
165
|
+
end
|
|
166
|
+
|
|
167
|
+
it 'works for pipes' do
|
|
168
|
+
expect(api_client.build_collection_param(param, :pipes)).to eq('aa|bb|cc')
|
|
169
|
+
end
|
|
170
|
+
|
|
171
|
+
it 'works for multi' do
|
|
172
|
+
expect(api_client.build_collection_param(param, :multi)).to eq(['aa', 'bb', 'cc'])
|
|
173
|
+
end
|
|
174
|
+
|
|
175
|
+
it 'fails for invalid collection format' do
|
|
176
|
+
expect(proc { api_client.build_collection_param(param, :INVALID) }).to raise_error(RuntimeError, 'unknown collection format: :INVALID')
|
|
177
|
+
end
|
|
178
|
+
end
|
|
179
|
+
|
|
180
|
+
describe '#json_mime?' do
|
|
181
|
+
let(:api_client) { CloudmersiveValidateApiClient::ApiClient.new }
|
|
182
|
+
|
|
183
|
+
it 'works' do
|
|
184
|
+
expect(api_client.json_mime?(nil)).to eq false
|
|
185
|
+
expect(api_client.json_mime?('')).to eq false
|
|
186
|
+
|
|
187
|
+
expect(api_client.json_mime?('application/json')).to eq true
|
|
188
|
+
expect(api_client.json_mime?('application/json; charset=UTF8')).to eq true
|
|
189
|
+
expect(api_client.json_mime?('APPLICATION/JSON')).to eq true
|
|
190
|
+
|
|
191
|
+
expect(api_client.json_mime?('application/xml')).to eq false
|
|
192
|
+
expect(api_client.json_mime?('text/plain')).to eq false
|
|
193
|
+
expect(api_client.json_mime?('application/jsonp')).to eq false
|
|
194
|
+
end
|
|
195
|
+
end
|
|
196
|
+
|
|
197
|
+
describe '#select_header_accept' do
|
|
198
|
+
let(:api_client) { CloudmersiveValidateApiClient::ApiClient.new }
|
|
199
|
+
|
|
200
|
+
it 'works' do
|
|
201
|
+
expect(api_client.select_header_accept(nil)).to be_nil
|
|
202
|
+
expect(api_client.select_header_accept([])).to be_nil
|
|
203
|
+
|
|
204
|
+
expect(api_client.select_header_accept(['application/json'])).to eq('application/json')
|
|
205
|
+
expect(api_client.select_header_accept(['application/xml', 'application/json; charset=UTF8'])).to eq('application/json; charset=UTF8')
|
|
206
|
+
expect(api_client.select_header_accept(['APPLICATION/JSON', 'text/html'])).to eq('APPLICATION/JSON')
|
|
207
|
+
|
|
208
|
+
expect(api_client.select_header_accept(['application/xml'])).to eq('application/xml')
|
|
209
|
+
expect(api_client.select_header_accept(['text/html', 'application/xml'])).to eq('text/html,application/xml')
|
|
210
|
+
end
|
|
211
|
+
end
|
|
212
|
+
|
|
213
|
+
describe '#select_header_content_type' do
|
|
214
|
+
let(:api_client) { CloudmersiveValidateApiClient::ApiClient.new }
|
|
215
|
+
|
|
216
|
+
it 'works' do
|
|
217
|
+
expect(api_client.select_header_content_type(nil)).to eq('application/json')
|
|
218
|
+
expect(api_client.select_header_content_type([])).to eq('application/json')
|
|
219
|
+
|
|
220
|
+
expect(api_client.select_header_content_type(['application/json'])).to eq('application/json')
|
|
221
|
+
expect(api_client.select_header_content_type(['application/xml', 'application/json; charset=UTF8'])).to eq('application/json; charset=UTF8')
|
|
222
|
+
expect(api_client.select_header_content_type(['APPLICATION/JSON', 'text/html'])).to eq('APPLICATION/JSON')
|
|
223
|
+
expect(api_client.select_header_content_type(['application/xml'])).to eq('application/xml')
|
|
224
|
+
expect(api_client.select_header_content_type(['text/plain', 'application/xml'])).to eq('text/plain')
|
|
225
|
+
end
|
|
226
|
+
end
|
|
227
|
+
|
|
228
|
+
describe '#sanitize_filename' do
|
|
229
|
+
let(:api_client) { CloudmersiveValidateApiClient::ApiClient.new }
|
|
230
|
+
|
|
231
|
+
it 'works' do
|
|
232
|
+
expect(api_client.sanitize_filename('sun')).to eq('sun')
|
|
233
|
+
expect(api_client.sanitize_filename('sun.gif')).to eq('sun.gif')
|
|
234
|
+
expect(api_client.sanitize_filename('../sun.gif')).to eq('sun.gif')
|
|
235
|
+
expect(api_client.sanitize_filename('/var/tmp/sun.gif')).to eq('sun.gif')
|
|
236
|
+
expect(api_client.sanitize_filename('./sun.gif')).to eq('sun.gif')
|
|
237
|
+
expect(api_client.sanitize_filename('..\sun.gif')).to eq('sun.gif')
|
|
238
|
+
expect(api_client.sanitize_filename('\var\tmp\sun.gif')).to eq('sun.gif')
|
|
239
|
+
expect(api_client.sanitize_filename('c:\var\tmp\sun.gif')).to eq('sun.gif')
|
|
240
|
+
expect(api_client.sanitize_filename('.\sun.gif')).to eq('sun.gif')
|
|
241
|
+
end
|
|
242
|
+
end
|
|
243
|
+
end
|