class Aws::Plugins::StubResponses::Handler

def apply_stub(resp, stub)

def apply_stub(resp, stub)
  if Exception === stub
    resp.error = stub
  elsif Class === stub && stub.ancestors.include?(Errors::ServiceError)
    resp.error = stub.new(resp.context, 'stubbed error')
  elsif Class === stub && stub.ancestors.include?(Exception)
    resp.error = stub.new
  else
    resp.data = stub
  end
end

def call(context)

def call(context)
  response = Seahorse::Client::Response.new(context: context)
  apply_stub(response, context.client.next_stub(context.operation_name))
  response
end