=begin #validateapi #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. OpenAPI spec version: v1 Generated by: https://github.com/swagger-api/swagger-codegen.git Swagger Codegen version: 2.4.14 =end require 'uri' module CloudmersiveValidateApiClient class AddressApi attr_accessor :api_client def initialize(api_client = ApiClient.default) @api_client = api_client end # Check if a country is a member of the European Union (EU) # Checks if the input country is a member of the European Union or not. # @param input Input request # @param [Hash] opts the optional parameters # @return [ValidateCountryResponse] def address_check_eu_membership(input, opts = {}) data, _status_code, _headers = address_check_eu_membership_with_http_info(input, opts) data end # Check if a country is a member of the European Union (EU) # Checks if the input country is a member of the European Union or not. # @param input Input request # @param [Hash] opts the optional parameters # @return [Array<(ValidateCountryResponse, Fixnum, Hash)>] ValidateCountryResponse data, response status code and response headers def address_check_eu_membership_with_http_info(input, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AddressApi.address_check_eu_membership ...' end # verify the required parameter 'input' is set if @api_client.config.client_side_validation && input.nil? fail ArgumentError, "Missing the required parameter 'input' when calling AddressApi.address_check_eu_membership" end # resource path local_var_path = '/validate/address/country/check-eu-membership' # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/json', 'application/xml', 'text/xml']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'text/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(input) auth_names = ['Apikey'] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'ValidateCountryResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: AddressApi#address_check_eu_membership\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Validate and normalize country information, return ISO 3166-1 country codes and country name # Validates and normalizes country information, and returns key information about a country, as well as whether it is a member of the European Union. Also returns distinct time zones in the country. # @param input Input request # @param [Hash] opts the optional parameters # @return [ValidateCountryResponse] def address_country(input, opts = {}) data, _status_code, _headers = address_country_with_http_info(input, opts) data end # Validate and normalize country information, return ISO 3166-1 country codes and country name # Validates and normalizes country information, and returns key information about a country, as well as whether it is a member of the European Union. Also returns distinct time zones in the country. # @param input Input request # @param [Hash] opts the optional parameters # @return [Array<(ValidateCountryResponse, Fixnum, Hash)>] ValidateCountryResponse data, response status code and response headers def address_country_with_http_info(input, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AddressApi.address_country ...' end # verify the required parameter 'input' is set if @api_client.config.client_side_validation && input.nil? fail ArgumentError, "Missing the required parameter 'input' when calling AddressApi.address_country" end # resource path local_var_path = '/validate/address/country' # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/json', 'application/xml', 'text/xml']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'text/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(input) auth_names = ['Apikey'] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'ValidateCountryResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: AddressApi#address_country\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get a list of ISO 3166-1 countries # Enumerates the list of ISO 3166-1 countries, including name, country codes, and more. # @param [Hash] opts the optional parameters # @return [CountryListResult] def address_country_list(opts = {}) data, _status_code, _headers = address_country_list_with_http_info(opts) data end # Get a list of ISO 3166-1 countries # Enumerates the list of ISO 3166-1 countries, including name, country codes, and more. # @param [Hash] opts the optional parameters # @return [Array<(CountryListResult, Fixnum, Hash)>] CountryListResult data, response status code and response headers def address_country_list_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AddressApi.address_country_list ...' end # resource path local_var_path = '/validate/address/country/list' # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/json', 'application/xml', 'text/xml']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['Apikey'] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'CountryListResult') if @api_client.config.debugging @api_client.config.logger.debug "API called: AddressApi#address_country_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Gets IANA/Olsen time zones for a country # Gets the IANA/Olsen time zones for a country. # @param input Input request # @param [Hash] opts the optional parameters # @return [GetTimezonesResponse] def address_get_timezone(input, opts = {}) data, _status_code, _headers = address_get_timezone_with_http_info(input, opts) data end # Gets IANA/Olsen time zones for a country # Gets the IANA/Olsen time zones for a country. # @param input Input request # @param [Hash] opts the optional parameters # @return [Array<(GetTimezonesResponse, Fixnum, Hash)>] GetTimezonesResponse data, response status code and response headers def address_get_timezone_with_http_info(input, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AddressApi.address_get_timezone ...' end # verify the required parameter 'input' is set if @api_client.config.client_side_validation && input.nil? fail ArgumentError, "Missing the required parameter 'input' when calling AddressApi.address_get_timezone" end # resource path local_var_path = '/validate/address/country/get-timezones' # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/json', 'application/xml', 'text/xml']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'text/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(input) auth_names = ['Apikey'] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'GetTimezonesResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: AddressApi#address_get_timezone\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Parse an unstructured input text string into an international, formatted address # 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. # @param input Input parse request # @param [Hash] opts the optional parameters # @return [ParseAddressResponse] def address_parse_string(input, opts = {}) data, _status_code, _headers = address_parse_string_with_http_info(input, opts) data end # Parse an unstructured input text string into an international, formatted address # 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. # @param input Input parse request # @param [Hash] opts the optional parameters # @return [Array<(ParseAddressResponse, Fixnum, Hash)>] ParseAddressResponse data, response status code and response headers def address_parse_string_with_http_info(input, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AddressApi.address_parse_string ...' end # verify the required parameter 'input' is set if @api_client.config.client_side_validation && input.nil? fail ArgumentError, "Missing the required parameter 'input' when calling AddressApi.address_parse_string" end # resource path local_var_path = '/validate/address/parse' # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/json', 'application/xml', 'text/xml']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'text/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(input) auth_names = ['Apikey'] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'ParseAddressResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: AddressApi#address_parse_string\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Validate a street address # Determines if an input structured street address is valid or invalid. If the address is valid, also returns the latitude and longitude of the address. # @param input Input parse request # @param [Hash] opts the optional parameters # @return [ValidateAddressResponse] def address_validate_address(input, opts = {}) data, _status_code, _headers = address_validate_address_with_http_info(input, opts) data end # Validate a street address # Determines if an input structured street address is valid or invalid. If the address is valid, also returns the latitude and longitude of the address. # @param input Input parse request # @param [Hash] opts the optional parameters # @return [Array<(ValidateAddressResponse, Fixnum, Hash)>] ValidateAddressResponse data, response status code and response headers def address_validate_address_with_http_info(input, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AddressApi.address_validate_address ...' end # verify the required parameter 'input' is set if @api_client.config.client_side_validation && input.nil? fail ArgumentError, "Missing the required parameter 'input' when calling AddressApi.address_validate_address" end # resource path local_var_path = '/validate/address/street-address' # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/json', 'application/xml', 'text/xml']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'text/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(input) auth_names = ['Apikey'] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'ValidateAddressResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: AddressApi#address_validate_address\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Validate a City and State/Province combination, get location information about it # Checks if the input city and state name or code is valid, and returns information about it such as normalized City name, State name and more. # @param input Input parse request # @param [Hash] opts the optional parameters # @return [ValidateCityResponse] def address_validate_city(input, opts = {}) data, _status_code, _headers = address_validate_city_with_http_info(input, opts) data end # Validate a City and State/Province combination, get location information about it # Checks if the input city and state name or code is valid, and returns information about it such as normalized City name, State name and more. # @param input Input parse request # @param [Hash] opts the optional parameters # @return [Array<(ValidateCityResponse, Fixnum, Hash)>] ValidateCityResponse data, response status code and response headers def address_validate_city_with_http_info(input, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AddressApi.address_validate_city ...' end # verify the required parameter 'input' is set if @api_client.config.client_side_validation && input.nil? fail ArgumentError, "Missing the required parameter 'input' when calling AddressApi.address_validate_city" end # resource path local_var_path = '/validate/address/city' # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/json', 'application/xml', 'text/xml']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'text/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(input) auth_names = ['Apikey'] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'ValidateCityResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: AddressApi#address_validate_city\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Validate a postal code, get location information about it # Checks if the input postal code is valid, and returns information about it such as City, State and more. # @param input Input parse request # @param [Hash] opts the optional parameters # @return [ValidatePostalCodeResponse] def address_validate_postal_code(input, opts = {}) data, _status_code, _headers = address_validate_postal_code_with_http_info(input, opts) data end # Validate a postal code, get location information about it # Checks if the input postal code is valid, and returns information about it such as City, State and more. # @param input Input parse request # @param [Hash] opts the optional parameters # @return [Array<(ValidatePostalCodeResponse, Fixnum, Hash)>] ValidatePostalCodeResponse data, response status code and response headers def address_validate_postal_code_with_http_info(input, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AddressApi.address_validate_postal_code ...' end # verify the required parameter 'input' is set if @api_client.config.client_side_validation && input.nil? fail ArgumentError, "Missing the required parameter 'input' when calling AddressApi.address_validate_postal_code" end # resource path local_var_path = '/validate/address/postal-code' # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/json', 'application/xml', 'text/xml']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'text/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(input) auth_names = ['Apikey'] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'ValidatePostalCodeResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: AddressApi#address_validate_postal_code\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Validate a state or province, name or abbreviation, get location information about it # Checks if the input state name or code is valid, and returns information about it such as normalized State name and more. # @param input Input parse request # @param [Hash] opts the optional parameters # @return [ValidateStateResponse] def address_validate_state(input, opts = {}) data, _status_code, _headers = address_validate_state_with_http_info(input, opts) data end # Validate a state or province, name or abbreviation, get location information about it # Checks if the input state name or code is valid, and returns information about it such as normalized State name and more. # @param input Input parse request # @param [Hash] opts the optional parameters # @return [Array<(ValidateStateResponse, Fixnum, Hash)>] ValidateStateResponse data, response status code and response headers def address_validate_state_with_http_info(input, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AddressApi.address_validate_state ...' end # verify the required parameter 'input' is set if @api_client.config.client_side_validation && input.nil? fail ArgumentError, "Missing the required parameter 'input' when calling AddressApi.address_validate_state" end # resource path local_var_path = '/validate/address/state' # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/json', 'application/xml', 'text/xml']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'text/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(input) auth_names = ['Apikey'] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'ValidateStateResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: AddressApi#address_validate_state\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end end end