class Aws::Plugins::StubResponses::Handler
def apply_stub(stub, response)
def apply_stub(stub, response) http_resp = response.context.http_response case when stub[:error] then signal_error(stub[:error], http_resp) when stub[:http] then signal_http(stub[:http], http_resp) when stub[:data] then response.data = stub[:data] end end
def call(context)
def call(context) stub = context.client.next_stub(context) resp = Seahorse::Client::Response.new(context: context) apply_stub(stub, resp) resp end
def signal_error(error, http_resp)
def signal_error(error, http_resp) if Exception === error http_resp.signal_error(error) else http_resp.signal_error(error.new) end end
def signal_http(stub, http_resp)
-
http_resp
(Seahorse::Client::Http::Response
) -- -
stub
(Seahorse::Client::Http::Response
) --
def signal_http(stub, http_resp) http_resp.signal_headers(stub.status_code, stub.headers.to_h) while chunk = stub.body.read(1024 * 1024) http_resp.signal_data(chunk) end stub.body.rewind http_resp.signal_done end