=begin
#Marketing Events

#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 Marketing
    module Events
      class BatchApi
        attr_accessor :api_client

        def initialize(api_client = ApiClient.default)
          @api_client = api_client
        end
        # Delete Multiple Marketing Events by External Ids
        # Deletes multiple Marketing Events based on externalAccountId, externalEventId, and appId.  Only Marketing Events created by the same apps will be deleted; events from other apps cannot be removed by this endpoint. 
        # @param batch_input_marketing_event_external_unique_identifier [BatchInputMarketingEventExternalUniqueIdentifier] 
        # @param [Hash] opts the optional parameters
        # @return [Error]
        def archive(batch_input_marketing_event_external_unique_identifier, opts = {})
          data, _status_code, _headers = archive_with_http_info(batch_input_marketing_event_external_unique_identifier, opts)
          data
        end

        # Delete Multiple Marketing Events by External Ids
        # Deletes multiple Marketing Events based on externalAccountId, externalEventId, and appId.  Only Marketing Events created by the same apps will be deleted; events from other apps cannot be removed by this endpoint. 
        # @param batch_input_marketing_event_external_unique_identifier [BatchInputMarketingEventExternalUniqueIdentifier] 
        # @param [Hash] opts the optional parameters
        # @return [Array<(Error, Integer, Hash)>] Error data, response status code and response headers
        def archive_with_http_info(batch_input_marketing_event_external_unique_identifier, opts = {})
          if @api_client.config.debugging
            @api_client.config.logger.debug 'Calling API: BatchApi.archive ...'
          end
          # verify the required parameter 'batch_input_marketing_event_external_unique_identifier' is set
          if @api_client.config.client_side_validation && batch_input_marketing_event_external_unique_identifier.nil?
            fail ArgumentError, "Missing the required parameter 'batch_input_marketing_event_external_unique_identifier' when calling BatchApi.archive"
          end
          # resource path
          local_var_path = '/marketing/v3/marketing-events/events/delete'

          # 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(['*/*'])
          # 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(batch_input_marketing_event_external_unique_identifier)

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

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

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

        # Delete Multiple Marketing Events by ObjectId
        # Deletes multiple Marketing Events from the portal based on their objectId, if they exist.  Responses: 204: Returned if all specified Marketing Events were successfully deleted. 207: Returned if some objectIds did not correspond to any existing Marketing Events.
        # @param batch_input_marketing_event_public_object_id_delete_request [BatchInputMarketingEventPublicObjectIdDeleteRequest] 
        # @param [Hash] opts the optional parameters
        # @return [nil]
        def archive_by_object_id(batch_input_marketing_event_public_object_id_delete_request, opts = {})
          archive_by_object_id_with_http_info(batch_input_marketing_event_public_object_id_delete_request, opts)
          nil
        end

        # Delete Multiple Marketing Events by ObjectId
        # Deletes multiple Marketing Events from the portal based on their objectId, if they exist.  Responses: 204: Returned if all specified Marketing Events were successfully deleted. 207: Returned if some objectIds did not correspond to any existing Marketing Events.
        # @param batch_input_marketing_event_public_object_id_delete_request [BatchInputMarketingEventPublicObjectIdDeleteRequest] 
        # @param [Hash] opts the optional parameters
        # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
        def archive_by_object_id_with_http_info(batch_input_marketing_event_public_object_id_delete_request, opts = {})
          if @api_client.config.debugging
            @api_client.config.logger.debug 'Calling API: BatchApi.archive_by_object_id ...'
          end
          # verify the required parameter 'batch_input_marketing_event_public_object_id_delete_request' is set
          if @api_client.config.client_side_validation && batch_input_marketing_event_public_object_id_delete_request.nil?
            fail ArgumentError, "Missing the required parameter 'batch_input_marketing_event_public_object_id_delete_request' when calling BatchApi.archive_by_object_id"
          end
          # resource path
          local_var_path = '/marketing/v3/marketing-events/batch/archive'

          # 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(['*/*'])
          # 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(batch_input_marketing_event_public_object_id_delete_request)

          # return_type
          return_type = opts[:debug_return_type]

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

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

        # Update Multiple Marketing Events by ObjectId
        # Updates multiple Marketing Events on the portal based on their objectId, if they exist.
        # @param batch_input_marketing_event_public_update_request_full_v2 [BatchInputMarketingEventPublicUpdateRequestFullV2] 
        # @param [Hash] opts the optional parameters
        # @return [BatchResponseMarketingEventPublicDefaultResponseV2]
        def update_by_object_id(batch_input_marketing_event_public_update_request_full_v2, opts = {})
          data, _status_code, _headers = update_by_object_id_with_http_info(batch_input_marketing_event_public_update_request_full_v2, opts)
          data
        end

        # Update Multiple Marketing Events by ObjectId
        # Updates multiple Marketing Events on the portal based on their objectId, if they exist.
        # @param batch_input_marketing_event_public_update_request_full_v2 [BatchInputMarketingEventPublicUpdateRequestFullV2] 
        # @param [Hash] opts the optional parameters
        # @return [Array<(BatchResponseMarketingEventPublicDefaultResponseV2, Integer, Hash)>] BatchResponseMarketingEventPublicDefaultResponseV2 data, response status code and response headers
        def update_by_object_id_with_http_info(batch_input_marketing_event_public_update_request_full_v2, opts = {})
          if @api_client.config.debugging
            @api_client.config.logger.debug 'Calling API: BatchApi.update_by_object_id ...'
          end
          # verify the required parameter 'batch_input_marketing_event_public_update_request_full_v2' is set
          if @api_client.config.client_side_validation && batch_input_marketing_event_public_update_request_full_v2.nil?
            fail ArgumentError, "Missing the required parameter 'batch_input_marketing_event_public_update_request_full_v2' when calling BatchApi.update_by_object_id"
          end
          # resource path
          local_var_path = '/marketing/v3/marketing-events/batch/update'

          # 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(batch_input_marketing_event_public_update_request_full_v2)

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

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

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

        # Create or Update Multiple Marketing Events
        # Upserts multiple Marketing Events. If a Marketing Event with the specified ID already exists, it will be updated; otherwise, a new event will be created.  Only Marketing Events originally created by the same app can be updated.
        # @param batch_input_marketing_event_create_request_params [BatchInputMarketingEventCreateRequestParams] 
        # @param [Hash] opts the optional parameters
        # @return [BatchResponseMarketingEventPublicDefaultResponse]
        def upsert(batch_input_marketing_event_create_request_params, opts = {})
          data, _status_code, _headers = upsert_with_http_info(batch_input_marketing_event_create_request_params, opts)
          data
        end

        # Create or Update Multiple Marketing Events
        # Upserts multiple Marketing Events. If a Marketing Event with the specified ID already exists, it will be updated; otherwise, a new event will be created.  Only Marketing Events originally created by the same app can be updated.
        # @param batch_input_marketing_event_create_request_params [BatchInputMarketingEventCreateRequestParams] 
        # @param [Hash] opts the optional parameters
        # @return [Array<(BatchResponseMarketingEventPublicDefaultResponse, Integer, Hash)>] BatchResponseMarketingEventPublicDefaultResponse data, response status code and response headers
        def upsert_with_http_info(batch_input_marketing_event_create_request_params, opts = {})
          if @api_client.config.debugging
            @api_client.config.logger.debug 'Calling API: BatchApi.upsert ...'
          end
          # verify the required parameter 'batch_input_marketing_event_create_request_params' is set
          if @api_client.config.client_side_validation && batch_input_marketing_event_create_request_params.nil?
            fail ArgumentError, "Missing the required parameter 'batch_input_marketing_event_create_request_params' when calling BatchApi.upsert"
          end
          # resource path
          local_var_path = '/marketing/v3/marketing-events/events/upsert'

          # 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(batch_input_marketing_event_create_request_params)

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

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

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