=begin
#Lists

#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)

The version of the OpenAPI document: v3

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

=end

require 'cgi'

module Hubspot
  module Crm
    module Lists
      class MappingApi
        attr_accessor :api_client

        def initialize(api_client = ApiClient.default)
          @api_client = api_client
        end
        # Translate Legacy List Id to Modern List Id
        # This API allows translation of legacy list id to list id. This is a temporary API allowed for mapping old id's to new id's and will expire on May 30th, 2025.
        # @param [Hash] opts the optional parameters
        # @option opts [String] :legacy_list_id The legacy list id from lists v1 API.
        # @return [PublicMigrationMapping]
        def translate_legacy_list_id_to_list_id(opts = {})
          data, _status_code, _headers = translate_legacy_list_id_to_list_id_with_http_info(opts)
          data
        end

        # Translate Legacy List Id to Modern List Id
        # This API allows translation of legacy list id to list id. This is a temporary API allowed for mapping old id&#39;s to new id&#39;s and will expire on May 30th, 2025.
        # @param [Hash] opts the optional parameters
        # @option opts [String] :legacy_list_id The legacy list id from lists v1 API.
        # @return [Array<(PublicMigrationMapping, Integer, Hash)>] PublicMigrationMapping data, response status code and response headers
        def translate_legacy_list_id_to_list_id_with_http_info(opts = {})
          if @api_client.config.debugging
            @api_client.config.logger.debug 'Calling API: MappingApi.translate_legacy_list_id_to_list_id ...'
          end
          # resource path
          local_var_path = '/crm/v3/lists/idmapping'

          # query parameters
          query_params = opts[:query_params] || {}
          query_params[:'legacyListId'] = opts[:'legacy_list_id'] if !opts[:'legacy_list_id'].nil?

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

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

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

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

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

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

        # Translate Legacy List Id to Modern List Id in Batch
        # This API allows translation of a batch of legacy list id's to list id's. This allows for a maximum of 10,000 id's. This is a temporary API allowed for mapping old id's to new id's and will expire on May 30th, 2025.
        # @param request_body [Array<String>] 
        # @param [Hash] opts the optional parameters
        # @return [PublicBatchMigrationMapping]
        def translate_legacy_list_id_to_list_id_batch(request_body, opts = {})
          data, _status_code, _headers = translate_legacy_list_id_to_list_id_batch_with_http_info(request_body, opts)
          data
        end

        # Translate Legacy List Id to Modern List Id in Batch
        # This API allows translation of a batch of legacy list id&#39;s to list id&#39;s. This allows for a maximum of 10,000 id&#39;s. This is a temporary API allowed for mapping old id&#39;s to new id&#39;s and will expire on May 30th, 2025.
        # @param request_body [Array<String>] 
        # @param [Hash] opts the optional parameters
        # @return [Array<(PublicBatchMigrationMapping, Integer, Hash)>] PublicBatchMigrationMapping data, response status code and response headers
        def translate_legacy_list_id_to_list_id_batch_with_http_info(request_body, opts = {})
          if @api_client.config.debugging
            @api_client.config.logger.debug 'Calling API: MappingApi.translate_legacy_list_id_to_list_id_batch ...'
          end
          # verify the required parameter 'request_body' is set
          if @api_client.config.client_side_validation && request_body.nil?
            fail ArgumentError, "Missing the required parameter 'request_body' when calling MappingApi.translate_legacy_list_id_to_list_id_batch"
          end
          # resource path
          local_var_path = '/crm/v3/lists/idmapping'

          # 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'])
          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(request_body)

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

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

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