Class: Svix::StreamingEvents
- Inherits:
-
Object
- Object
- Svix::StreamingEvents
- Defined in:
- lib/svix/api/streaming_events.rb
Instance Method Summary collapse
- #create(stream_id, create_stream_events_in, options = {}) ⇒ Object
- #get(stream_id, sink_id, options = {}) ⇒ Object
-
#initialize(client) ⇒ StreamingEvents
constructor
A new instance of StreamingEvents.
Constructor Details
#initialize(client) ⇒ StreamingEvents
Returns a new instance of StreamingEvents.
8 9 10 |
# File 'lib/svix/api/streaming_events.rb', line 8 def initialize(client) @client = client end |
Instance Method Details
#create(stream_id, create_stream_events_in, options = {}) ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/svix/api/streaming_events.rb', line 12 def create(stream_id, create_stream_events_in, = {}) = .transform_keys(&:to_s) res = @client.execute_request( "POST", "/api/v1/stream/#{stream_id}/events", headers: { "idempotency-key" => ["idempotency-key"] }, body: create_stream_events_in ) CreateStreamEventsOut.deserialize(res) end |
#get(stream_id, sink_id, options = {}) ⇒ Object
25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/svix/api/streaming_events.rb', line 25 def get(stream_id, sink_id, = {}) = .transform_keys(&:to_s) res = @client.execute_request( "GET", "/api/v1/stream/#{stream_id}/sink/#{sink_id}/events", query_params: { "limit" => ["limit"], "iterator" => ["iterator"], "after" => ["after"] } ) EventStreamOut.deserialize(res) end |