=begin
#Lob

#The Lob API is organized around REST. Our API is designed to have predictable, resource-oriented URLs and uses HTTP response codes to indicate any API errors. <p> Looking for our [previous documentation](https://lob.github.io/legacy-docs/)? 

The version of the OpenAPI document: 1.3.0
Contact: lob-openapi@lob.com
Generated by: https://openapi-generator.tech
OpenAPI Generator version: 5.2.1

=end

require 'cgi'

module Lob
  class IntlVerificationsApi
    attr_accessor :api_client

    def initialize(api_client = ApiClient.default)
      @api_client = api_client
    end
    # verifyBulk
    # Verify a list of international (except US or US territories) address with a live API key.
    # @param intl_verifications_payload [IntlVerificationsPayload] 
    # @param [Hash] opts the optional parameters
    # @return [IntlVerifications]
    def verifyBulk(intl_verifications_payload, opts = {})
      data, _status_code, _headers = bulk_intl_verifications_with_http_info(intl_verifications_payload, opts)
      data
    end

    # verifyBulk
    # Verify a list of international (except US or US territories) address with a live API key.
    # @param intl_verifications_payload [IntlVerificationsPayload] 
    # @param [Hash] opts the optional parameters
    # @return [Array<(IntlVerifications, Integer, Hash)>] IntlVerifications data, response status code and response headers
    def bulk_intl_verifications_with_http_info(intl_verifications_payload, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: IntlVerificationsApi.bulk_intl_verifications ...'
      end
      # verify the required parameter 'intl_verifications_payload' is set
      if @api_client.config.client_side_validation && intl_verifications_payload.nil?
        fail ArgumentError, "Missing the required parameter 'intl_verifications_payload' when calling IntlVerificationsApi.bulk_intl_verifications"
      end
      # resource path
      local_var_path = '/bulk/intl_verifications'

      # query parameters
      query_params = opts[:query_params] || {}

      # header parameters
      header_params = opts[:header_params] || {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json'])
      # HTTP header 'Content-Type'
      content_type = @api_client.select_header_content_type(['application/json', 'multipart/form-data'])
      if !content_type.nil?
          header_params['Content-Type'] = content_type
      end

      # form parameters
      form_params = opts[:form_params] || {}

      # http body (model)
      post_body = opts[:debug_body] || @api_client.object_to_http_body(intl_verifications_payload)

      # return_type
      return_type = opts[:debug_return_type] || 'IntlVerifications'

      # auth_names
      auth_names = opts[:debug_auth_names] || ['basicAuth']

      new_options = opts.merge(
        :operation => :"IntlVerificationsApi.bulk_intl_verifications",
        :header_params => header_params,
        :query_params => query_params,
        :form_params => form_params,
        :body => post_body,
        :auth_names => auth_names,
        :return_type => return_type
      )

      data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: IntlVerificationsApi#bulk_intl_verifications\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # verifySingle
    # Verify an international (except US or US territories) address with a live API key.
    # @param intl_verification_writable [IntlVerificationWritable] 
    # @param [Hash] opts the optional parameters
    # @option opts [String] :x_lang_output * &#x60;native&#x60; - Translate response to the native language of the country in the request * &#x60;match&#x60; - match the response to the language in the request  Default response is in English. 
    # @return [IntlVerification]
    def verifySingle(intl_verification_writable, opts = {})
      data, _status_code, _headers = intl_verification_with_http_info(intl_verification_writable, opts)
      data
    end

    # verifySingle
    # Verify an international (except US or US territories) address with a live API key.
    # @param intl_verification_writable [IntlVerificationWritable] 
    # @param [Hash] opts the optional parameters
    # @option opts [String] :x_lang_output * &#x60;native&#x60; - Translate response to the native language of the country in the request * &#x60;match&#x60; - match the response to the language in the request  Default response is in English. 
    # @return [Array<(IntlVerification, Integer, Hash)>] IntlVerification data, response status code and response headers
    def intl_verification_with_http_info(intl_verification_writable, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: IntlVerificationsApi.intl_verification ...'
      end
      # verify the required parameter 'intl_verification_writable' is set
      if @api_client.config.client_side_validation && intl_verification_writable.nil?
        fail ArgumentError, "Missing the required parameter 'intl_verification_writable' when calling IntlVerificationsApi.intl_verification"
      end
      allowable_values = ["native", "match"]
      if @api_client.config.client_side_validation && opts[:'x_lang_output'] && !allowable_values.include?(opts[:'x_lang_output'])
        fail ArgumentError, "invalid value for \"x_lang_output\", must be one of #{allowable_values}"
      end
      # resource path
      local_var_path = '/intl_verifications'

      # query parameters
      query_params = opts[:query_params] || {}

      # header parameters
      header_params = opts[:header_params] || {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json'])
      # HTTP header 'Content-Type'
      content_type = @api_client.select_header_content_type(['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])
      if !content_type.nil?
          header_params['Content-Type'] = content_type
      end
      header_params[:'x-lang-output'] = opts[:'x_lang_output'] if !opts[:'x_lang_output'].nil?

      # form parameters
      form_params = opts[:form_params] || {}

      # http body (model)
      post_body = opts[:debug_body] || @api_client.object_to_http_body(intl_verification_writable)

      # return_type
      return_type = opts[:debug_return_type] || 'IntlVerification'

      # auth_names
      auth_names = opts[:debug_auth_names] || ['basicAuth']

      new_options = opts.merge(
        :operation => :"IntlVerificationsApi.intl_verification",
        :header_params => header_params,
        :query_params => query_params,
        :form_params => form_params,
        :body => post_body,
        :auth_names => auth_names,
        :return_type => return_type
      )

      data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: IntlVerificationsApi#intl_verification\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end
  end
end
