Sha256: ceea80778126aa4f11341d6eebfe566ad3ba3e3c8abe577141ab538bb1fb2072
Contents?: true
Size: 1.18 KB
Versions: 35
Compression:
Stored size: 1.18 KB
Contents
module Aws module Binary # @api private class DecodeHandler < Seahorse::Client::Handler def call(context) if eventstream_member = eventstream?(context) attach_eventstream_listeners(context, eventstream_member) end @handler.call(context) end private def eventstream?(ctx) ctx.operation.output.shape.members.each do |_, ref| return ref if ref.eventstream end end def attach_eventstream_listeners(context, rules) context.http_response.on_headers(200) do protocol = context.config.api.metadata['protocol'] context.http_response.body = EventStreamDecoder.new( protocol, rules, context.http_response.body, context[:event_stream_handler]) end context.http_response.on_success(200) do context.http_response.body = context.http_response.body.events end context.http_response.on_error do # Potential enhancement to made # since we don't want to track raw bytes in memory context.http_response.body = StringIO.new end end end end end
Version data entries
35 entries across 35 versions & 1 rubygems