=begin
#IPGeolocation.io - IP intelligence products

#Ipgeolocation provides a set of APIs to make ip based decisions.

The version of the OpenAPI document: 2.0

Generated by: https://openapi-generator.tech
Generator version: 7.13.0

=end

require 'cgi'

module IpgeolocationSdk
  class TimeConversionApi
    attr_accessor :api_client

    def initialize(api_client = ApiClient.default)
      @api_client = api_client
    end
    # You can convert a timestamp provided as a query paramter time from one time zone to another time zone.
    # @param [Hash] opts the optional parameters
    # @option opts [String] :time time parameter takes the input in the following two formats: i) &#39;yyyy-MM-dd HH:mm&#39;, and ii) &#39;yyyy-MM-dd HH:mm:ss&#39;. This parameter is optional and you can omit it to convert the current time between two coordinates, time zones or locations.
    # @option opts [String] :tz_from timezone to convert from
    # @option opts [String] :tz_to timezone to convert to
    # @option opts [Float] :lat_from latitude to convert from
    # @option opts [Float] :long_from longitude to convert from
    # @option opts [Float] :lat_to latitude to convert to
    # @option opts [Float] :long_to longitude to convert to
    # @option opts [String] :location_from location to convert from
    # @option opts [String] :location_to location to convert to
    # @option opts [String] :icao_from location to convert from
    # @option opts [String] :icao_to location to convert to
    # @option opts [String] :iata_from location to convert from
    # @option opts [String] :iata_to location to convert to
    # @option opts [String] :locode_from location to convert from
    # @option opts [String] :locode_to location to convert to
    # @return [TimeConversionResponse]
    def convert_time_between_timezones(opts = {})
      data, _status_code, _headers = convert_time_between_timezones_with_http_info(opts)
      data
    end

    # You can convert a timestamp provided as a query paramter time from one time zone to another time zone.
    # @param [Hash] opts the optional parameters
    # @option opts [String] :time time parameter takes the input in the following two formats: i) &#39;yyyy-MM-dd HH:mm&#39;, and ii) &#39;yyyy-MM-dd HH:mm:ss&#39;. This parameter is optional and you can omit it to convert the current time between two coordinates, time zones or locations.
    # @option opts [String] :tz_from timezone to convert from
    # @option opts [String] :tz_to timezone to convert to
    # @option opts [Float] :lat_from latitude to convert from
    # @option opts [Float] :long_from longitude to convert from
    # @option opts [Float] :lat_to latitude to convert to
    # @option opts [Float] :long_to longitude to convert to
    # @option opts [String] :location_from location to convert from
    # @option opts [String] :location_to location to convert to
    # @option opts [String] :icao_from location to convert from
    # @option opts [String] :icao_to location to convert to
    # @option opts [String] :iata_from location to convert from
    # @option opts [String] :iata_to location to convert to
    # @option opts [String] :locode_from location to convert from
    # @option opts [String] :locode_to location to convert to
    # @return [Array<(TimeConversionResponse, Integer, Hash)>] TimeConversionResponse data, response status code and response headers
    def convert_time_between_timezones_with_http_info(opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: TimeConversionApi.convert_time_between_timezones ...'
      end
      # resource path
      local_var_path = '/timezone/convert'

      # query parameters
      query_params = opts[:query_params] || {}
      query_params[:'time'] = opts[:'time'] if !opts[:'time'].nil?
      query_params[:'tz_from'] = opts[:'tz_from'] if !opts[:'tz_from'].nil?
      query_params[:'tz_to'] = opts[:'tz_to'] if !opts[:'tz_to'].nil?
      query_params[:'lat_from'] = opts[:'lat_from'] if !opts[:'lat_from'].nil?
      query_params[:'long_from'] = opts[:'long_from'] if !opts[:'long_from'].nil?
      query_params[:'lat_to'] = opts[:'lat_to'] if !opts[:'lat_to'].nil?
      query_params[:'long_to'] = opts[:'long_to'] if !opts[:'long_to'].nil?
      query_params[:'location_from'] = opts[:'location_from'] if !opts[:'location_from'].nil?
      query_params[:'location_to'] = opts[:'location_to'] if !opts[:'location_to'].nil?
      query_params[:'icao_from'] = opts[:'icao_from'] if !opts[:'icao_from'].nil?
      query_params[:'icao_to'] = opts[:'icao_to'] if !opts[:'icao_to'].nil?
      query_params[:'iata_from'] = opts[:'iata_from'] if !opts[:'iata_from'].nil?
      query_params[:'iata_to'] = opts[:'iata_to'] if !opts[:'iata_to'].nil?
      query_params[:'locode_from'] = opts[:'locode_from'] if !opts[:'locode_from'].nil?
      query_params[:'locode_to'] = opts[:'locode_to'] if !opts[:'locode_to'].nil?

      # header parameters
      header_params = opts[:header_params] || {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/xml']) unless header_params['Accept']

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

      # http body (model)
      post_body = opts[:debug_body]

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

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

      new_options = opts.merge(
        :operation => :"TimeConversionApi.convert_time_between_timezones",
        :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(:GET, local_var_path, new_options)
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: TimeConversionApi#convert_time_between_timezones\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end
  end
end
