=begin
#Vehicle Enquiry API

#Interface specification for the DVLA Vehicle Enquiry API

The version of the OpenAPI document: 1.1.0
Contact: DvlaAPIAccess@dvla.gov.uk
Generated by: https://openapi-generator.tech
OpenAPI Generator version: 4.3.1

=end

require 'cgi'

module VesAPIClient
  class VehicleApi
    attr_accessor :api_client

    def initialize(api_client = ApiClient.default)
      @api_client = api_client
    end
    # Get vehicle details by registration number
    # Returns vehicle details based on registration number
    # @param x_api_key [String] Client Specific API Key
    # @param vehicle_request [VehicleRequest] Registration number of the vehicle to find details for
    # @param [Hash] opts the optional parameters
    # @option opts [String] :x_correlation_id Consumer Correlation ID
    # @return [Vehicle]
    def get_vehicle_details_by_registration_number(x_api_key, vehicle_request, opts = {})
      data, _status_code, _headers = get_vehicle_details_by_registration_number_with_http_info(x_api_key, vehicle_request, opts)
      data
    end

    # Get vehicle details by registration number
    # Returns vehicle details based on registration number
    # @param x_api_key [String] Client Specific API Key
    # @param vehicle_request [VehicleRequest] Registration number of the vehicle to find details for
    # @param [Hash] opts the optional parameters
    # @option opts [String] :x_correlation_id Consumer Correlation ID
    # @return [Array<(Vehicle, Integer, Hash)>] Vehicle data, response status code and response headers
    def get_vehicle_details_by_registration_number_with_http_info(x_api_key, vehicle_request, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: VehicleApi.get_vehicle_details_by_registration_number ...'
      end
      # verify the required parameter 'x_api_key' is set
      if @api_client.config.client_side_validation && x_api_key.nil?
        fail ArgumentError, "Missing the required parameter 'x_api_key' when calling VehicleApi.get_vehicle_details_by_registration_number"
      end
      # verify the required parameter 'vehicle_request' is set
      if @api_client.config.client_side_validation && vehicle_request.nil?
        fail ArgumentError, "Missing the required parameter 'vehicle_request' when calling VehicleApi.get_vehicle_details_by_registration_number"
      end
      # resource path
      local_var_path = '/v1/vehicles'

      # 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'
      header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
      header_params[:'x-api-key'] = x_api_key
      header_params[:'X-Correlation-Id'] = opts[:'x_correlation_id'] if !opts[:'x_correlation_id'].nil?

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

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

      # return_type
      return_type = opts[:return_type] || 'Vehicle' 

      # auth_names
      auth_names = opts[:auth_names] || []

      new_options = opts.merge(
        :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: VehicleApi#get_vehicle_details_by_registration_number\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end
  end
end
