Class: Svix::IngestSource
- Inherits:
-
Object
- Object
- Svix::IngestSource
- Defined in:
- lib/svix/api/ingest_source.rb
Instance Method Summary collapse
- #create(ingest_source_in, options = {}) ⇒ Object
- #delete(source_id) ⇒ Object
- #get(source_id) ⇒ Object
-
#initialize(client) ⇒ IngestSource
constructor
A new instance of IngestSource.
- #list(options = {}) ⇒ Object
- #rotate_token(source_id, options = {}) ⇒ Object
- #update(source_id, ingest_source_in) ⇒ Object
Constructor Details
#initialize(client) ⇒ IngestSource
Returns a new instance of IngestSource.
8 9 10 |
# File 'lib/svix/api/ingest_source.rb', line 8 def initialize(client) @client = client end |
Instance Method Details
#create(ingest_source_in, options = {}) ⇒ Object
26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/svix/api/ingest_source.rb', line 26 def create(ingest_source_in, = {}) = .transform_keys(&:to_s) res = @client.execute_request( "POST", "/ingest/api/v1/source", headers: { "idempotency-key" => ["idempotency-key"] }, body: ingest_source_in ) IngestSourceOut.deserialize(res) end |
#delete(source_id) ⇒ Object
56 57 58 59 60 61 |
# File 'lib/svix/api/ingest_source.rb', line 56 def delete(source_id) @client.execute_request( "DELETE", "/ingest/api/v1/source/#{source_id}" ) end |
#get(source_id) ⇒ Object
39 40 41 42 43 44 45 |
# File 'lib/svix/api/ingest_source.rb', line 39 def get(source_id) res = @client.execute_request( "GET", "/ingest/api/v1/source/#{source_id}" ) IngestSourceOut.deserialize(res) end |
#list(options = {}) ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/svix/api/ingest_source.rb', line 12 def list( = {}) = .transform_keys(&:to_s) res = @client.execute_request( "GET", "/ingest/api/v1/source", query_params: { "limit" => ["limit"], "iterator" => ["iterator"], "order" => ["order"] } ) ListResponseIngestSourceOut.deserialize(res) end |
#rotate_token(source_id, options = {}) ⇒ Object
63 64 65 66 67 68 69 70 71 72 73 |
# File 'lib/svix/api/ingest_source.rb', line 63 def rotate_token(source_id, = {}) = .transform_keys(&:to_s) res = @client.execute_request( "POST", "/ingest/api/v1/source/#{source_id}/token/rotate", headers: { "idempotency-key" => ["idempotency-key"] } ) RotateTokenOut.deserialize(res) end |
#update(source_id, ingest_source_in) ⇒ Object
47 48 49 50 51 52 53 54 |
# File 'lib/svix/api/ingest_source.rb', line 47 def update(source_id, ingest_source_in) res = @client.execute_request( "PUT", "/ingest/api/v1/source/#{source_id}", body: ingest_source_in ) IngestSourceOut.deserialize(res) end |