Class: Svix::StreamingSink
- Inherits:
-
Object
- Object
- Svix::StreamingSink
- Defined in:
- lib/svix/api/streaming_sink.rb
Instance Attribute Summary collapse
-
#transformation ⇒ Object
Returns the value of attribute transformation.
Instance Method Summary collapse
- #create(stream_id, stream_sink_in, options = {}) ⇒ Object
- #delete(stream_id, sink_id) ⇒ Object
- #get(stream_id, sink_id) ⇒ Object
- #get_secret(stream_id, sink_id) ⇒ Object
-
#initialize(client) ⇒ StreamingSink
constructor
A new instance of StreamingSink.
- #list(stream_id, options = {}) ⇒ Object
- #patch(stream_id, sink_id, stream_sink_patch) ⇒ Object
- #rotate_secret(stream_id, sink_id, endpoint_secret_rotate_in, options = {}) ⇒ Object
- #upsert(stream_id, sink_id, stream_sink_in) ⇒ Object
Constructor Details
#initialize(client) ⇒ StreamingSink
Returns a new instance of StreamingSink.
9 10 11 12 |
# File 'lib/svix/api/streaming_sink.rb', line 9 def initialize(client) @client = client @transformation = StreamingSinkTransformation.new(client) end |
Instance Attribute Details
#transformation ⇒ Object
Returns the value of attribute transformation.
8 9 10 |
# File 'lib/svix/api/streaming_sink.rb', line 8 def transformation @transformation end |
Instance Method Details
#create(stream_id, stream_sink_in, options = {}) ⇒ Object
28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/svix/api/streaming_sink.rb', line 28 def create(stream_id, stream_sink_in, = {}) = .transform_keys(&:to_s) res = @client.execute_request( "POST", "/api/v1/stream/#{stream_id}/sink", headers: { "idempotency-key" => ["idempotency-key"] }, body: stream_sink_in ) StreamSinkOut.deserialize(res) end |
#delete(stream_id, sink_id) ⇒ Object
58 59 60 61 62 63 |
# File 'lib/svix/api/streaming_sink.rb', line 58 def delete(stream_id, sink_id) @client.execute_request( "DELETE", "/api/v1/stream/#{stream_id}/sink/#{sink_id}" ) end |
#get(stream_id, sink_id) ⇒ Object
41 42 43 44 45 46 47 |
# File 'lib/svix/api/streaming_sink.rb', line 41 def get(stream_id, sink_id) res = @client.execute_request( "GET", "/api/v1/stream/#{stream_id}/sink/#{sink_id}" ) StreamSinkOut.deserialize(res) end |
#get_secret(stream_id, sink_id) ⇒ Object
74 75 76 77 78 79 80 |
# File 'lib/svix/api/streaming_sink.rb', line 74 def get_secret(stream_id, sink_id) res = @client.execute_request( "GET", "/api/v1/stream/#{stream_id}/sink/#{sink_id}/secret" ) SinkSecretOut.deserialize(res) end |
#list(stream_id, options = {}) ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/svix/api/streaming_sink.rb', line 14 def list(stream_id, = {}) = .transform_keys(&:to_s) res = @client.execute_request( "GET", "/api/v1/stream/#{stream_id}/sink", query_params: { "limit" => ["limit"], "iterator" => ["iterator"], "order" => ["order"] } ) ListResponseStreamSinkOut.deserialize(res) end |
#patch(stream_id, sink_id, stream_sink_patch) ⇒ Object
65 66 67 68 69 70 71 72 |
# File 'lib/svix/api/streaming_sink.rb', line 65 def patch(stream_id, sink_id, stream_sink_patch) res = @client.execute_request( "PATCH", "/api/v1/stream/#{stream_id}/sink/#{sink_id}", body: stream_sink_patch ) StreamSinkOut.deserialize(res) end |
#rotate_secret(stream_id, sink_id, endpoint_secret_rotate_in, options = {}) ⇒ Object
82 83 84 85 86 87 88 89 90 91 92 93 |
# File 'lib/svix/api/streaming_sink.rb', line 82 def rotate_secret(stream_id, sink_id, endpoint_secret_rotate_in, = {}) = .transform_keys(&:to_s) res = @client.execute_request( "POST", "/api/v1/stream/#{stream_id}/sink/#{sink_id}/secret/rotate", headers: { "idempotency-key" => ["idempotency-key"] }, body: endpoint_secret_rotate_in ) EmptyResponse.deserialize(res) end |
#upsert(stream_id, sink_id, stream_sink_in) ⇒ Object
49 50 51 52 53 54 55 56 |
# File 'lib/svix/api/streaming_sink.rb', line 49 def upsert(stream_id, sink_id, stream_sink_in) res = @client.execute_request( "PUT", "/api/v1/stream/#{stream_id}/sink/#{sink_id}", body: stream_sink_in ) StreamSinkOut.deserialize(res) end |