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