Module: Castle::API::EndImpersonation

Defined in:
lib/castle/api/end_impersonation.rb

Overview

Sends DELETE impersonate request

Class Method Summary collapse

Class Method Details

.call(options = {}) ⇒ Object

Parameters:

  • options (Hash) (defaults to: {})


9
10
11
12
13
14
15
16
17
18
# File 'lib/castle/api/end_impersonation.rb', line 9

def call(options = {})
  options = Castle::Utils::DeepSymbolizeKeys.call(options || {}) unless options[:no_symbolize]
  options.delete(:no_symbolize)
  http = options.delete(:http)
  config = options.delete(:config) || Castle.config

  Castle::API
    .call(Castle::Commands::EndImpersonation.build(options), {}, http, config)
    .tap { |response| raise Castle::ImpersonationFailed unless response[:success] }
end