require_relative './service'
module Adyen

  # NOTE: This class is auto generated by OpenAPI Generator
  # Ref: https://openapi-generator.tech
  #
  # Do not edit the class manually.
  class Disputes < Service
    attr_accessor :service, :version

    DEFAULT_VERSION = 30
    def initialize(client, version = DEFAULT_VERSION)
      super(client, version, 'Disputes')
    end

    # Accept a dispute
    def accept_dispute(request, headers: {})
      endpoint = '/acceptDispute'.gsub(/{.+?}/, '%s')
      endpoint = endpoint.gsub(%r{^/}, '')
      endpoint = format(endpoint)
      
      action = { method: 'post', url: endpoint }
      @client.call_adyen_api(@service, action, request, headers, @version)
    end

    # Defend a dispute
    def defend_dispute(request, headers: {})
      endpoint = '/defendDispute'.gsub(/{.+?}/, '%s')
      endpoint = endpoint.gsub(%r{^/}, '')
      endpoint = format(endpoint)
      
      action = { method: 'post', url: endpoint }
      @client.call_adyen_api(@service, action, request, headers, @version)
    end

    # Delete a defense document
    def delete_dispute_defense_document(request, headers: {})
      endpoint = '/deleteDisputeDefenseDocument'.gsub(/{.+?}/, '%s')
      endpoint = endpoint.gsub(%r{^/}, '')
      endpoint = format(endpoint)
      
      action = { method: 'post', url: endpoint }
      @client.call_adyen_api(@service, action, request, headers, @version)
    end

    # Get applicable defense reasons
    def retrieve_applicable_defense_reasons(request, headers: {})
      endpoint = '/retrieveApplicableDefenseReasons'.gsub(/{.+?}/, '%s')
      endpoint = endpoint.gsub(%r{^/}, '')
      endpoint = format(endpoint)
      
      action = { method: 'post', url: endpoint }
      @client.call_adyen_api(@service, action, request, headers, @version)
    end

    # Supply a defense document
    def supply_defense_document(request, headers: {})
      endpoint = '/supplyDefenseDocument'.gsub(/{.+?}/, '%s')
      endpoint = endpoint.gsub(%r{^/}, '')
      endpoint = format(endpoint)
      
      action = { method: 'post', url: endpoint }
      @client.call_adyen_api(@service, action, request, headers, @version)
    end

  end
end
