Class: Aws::Binary::EventStreamEncoder Private
- Inherits:
-
Object
- Object
- Aws::Binary::EventStreamEncoder
- Defined in:
- lib/aws-sdk-core/binary/event_stream_encoder.rb
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Instance Attribute Summary collapse
- #prior_signature ⇒ Object private
- #rules ⇒ Object readonly private
Instance Method Summary collapse
- #encode(event_type, params) ⇒ Object private
-
#initialize(protocol, rules, input_ref, signer) ⇒ EventStreamEncoder
constructor
private
A new instance of EventStreamEncoder.
Constructor Details
#initialize(protocol, rules, input_ref, signer) ⇒ EventStreamEncoder
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of EventStreamEncoder.
14 15 16 17 18 19 20 21 |
# File 'lib/aws-sdk-core/binary/event_stream_encoder.rb', line 14 def initialize(protocol, rules, input_ref, signer) @encoder = Aws::EventStream::Encoder.new @event_builder = EventBuilder.new(serializer_class(protocol), rules) @input_ref = input_ref @rules = rules @signer = signer @prior_signature = nil end |
Instance Attribute Details
#prior_signature ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
25 26 27 |
# File 'lib/aws-sdk-core/binary/event_stream_encoder.rb', line 25 def prior_signature @prior_signature end |
#rules ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
23 24 25 |
# File 'lib/aws-sdk-core/binary/event_stream_encoder.rb', line 23 def rules @rules end |
Instance Method Details
#encode(event_type, params) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/aws-sdk-core/binary/event_stream_encoder.rb', line 27 def encode(event_type, params) if event_type == :end_stream payload = '' else payload = @encoder.encode(@event_builder.apply(event_type, params)) end headers, signature = @signer.sign_event(@prior_signature, payload, @encoder) @prior_signature = signature = Aws::EventStream::Message.new( headers: headers, payload: StringIO.new(payload) ) @encoder.encode() end |