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 TermsOfServiceApi < Service
    attr_accessor :service, :version

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

    # Accept Terms of Service
    def accept_terms_of_service(request, id, termsofservicedocumentid, headers: {})
      endpoint = '/legalEntities/{id}/termsOfService/{termsofservicedocumentid}'.gsub(/{.+?}/, '%s')
      endpoint = endpoint.gsub(%r{^/}, '')
      endpoint = format(endpoint, id, termsofservicedocumentid)
      
      action = { method: 'patch', url: endpoint }
      @client.call_adyen_api(@service, action, request, headers, @version)
    end

    # Get accepted Terms of Service document
    def get_accepted_terms_of_service_document(id, termsofserviceacceptancereference, headers: {}, query_params: {})
      endpoint = '/legalEntities/{id}/acceptedTermsOfServiceDocument/{termsofserviceacceptancereference}'.gsub(/{.+?}/, '%s')
      endpoint = endpoint.gsub(%r{^/}, '')
      endpoint = format(endpoint, id, termsofserviceacceptancereference)
      endpoint += create_query_string(query_params)
      action = { method: 'get', url: endpoint }
      @client.call_adyen_api(@service, action, {}, headers, @version)
    end

    # Get Terms of Service document
    def get_terms_of_service_document(request, id, headers: {})
      endpoint = '/legalEntities/{id}/termsOfService'.gsub(/{.+?}/, '%s')
      endpoint = endpoint.gsub(%r{^/}, '')
      endpoint = format(endpoint, id)
      
      action = { method: 'post', url: endpoint }
      @client.call_adyen_api(@service, action, request, headers, @version)
    end

    # Get Terms of Service information for a legal entity
    def get_terms_of_service_information_for_legal_entity(id, headers: {})
      endpoint = '/legalEntities/{id}/termsOfServiceAcceptanceInfos'.gsub(/{.+?}/, '%s')
      endpoint = endpoint.gsub(%r{^/}, '')
      endpoint = format(endpoint, id)
      
      action = { method: 'get', url: endpoint }
      @client.call_adyen_api(@service, action, {}, headers, @version)
    end

    # Get Terms of Service status
    def get_terms_of_service_status(id, headers: {})
      endpoint = '/legalEntities/{id}/termsOfServiceStatus'.gsub(/{.+?}/, '%s')
      endpoint = endpoint.gsub(%r{^/}, '')
      endpoint = format(endpoint, id)
      
      action = { method: 'get', url: endpoint }
      @client.call_adyen_api(@service, action, {}, headers, @version)
    end

  end
end
