Class: Invoance::Resources::Audit::Streams
- Inherits:
-
Object
- Object
- Invoance::Resources::Audit::Streams
- Defined in:
- lib/invoance/resources/audit.rb
Overview
audit.streams.*
Instance Method Summary collapse
-
#create(organization_id, url:, type: "webhook") ⇒ Object
POST /audit/orgs/:org_id/streams — create a webhook stream.
-
#delete(organization_id, stream_id) ⇒ Object
DELETE /audit/orgs/:org_id/streams/:stream_id.
-
#initialize(http) ⇒ Streams
constructor
A new instance of Streams.
-
#list(organization_id) ⇒ Object
GET /audit/orgs/:org_id/streams.
-
#test(organization_id, stream_id) ⇒ Object
POST /audit/orgs/:org_id/streams/:stream_id/test.
Constructor Details
#initialize(http) ⇒ Streams
Returns a new instance of Streams.
155 156 157 |
# File 'lib/invoance/resources/audit.rb', line 155 def initialize(http) @http = http end |
Instance Method Details
#create(organization_id, url:, type: "webhook") ⇒ Object
POST /audit/orgs/:org_id/streams — create a webhook stream. The signing secret is returned ONCE.
161 162 163 164 165 166 |
# File 'lib/invoance/resources/audit.rb', line 161 def create(organization_id, url:, type: "webhook") @http.post("/audit/orgs/#{organization_id}/streams", { "type" => type, "url" => url }) end |
#delete(organization_id, stream_id) ⇒ Object
DELETE /audit/orgs/:org_id/streams/:stream_id
174 175 176 |
# File 'lib/invoance/resources/audit.rb', line 174 def delete(organization_id, stream_id) @http.delete("/audit/orgs/#{organization_id}/streams/#{stream_id}") end |
#list(organization_id) ⇒ Object
GET /audit/orgs/:org_id/streams
169 170 171 |
# File 'lib/invoance/resources/audit.rb', line 169 def list(organization_id) @http.get("/audit/orgs/#{organization_id}/streams") end |
#test(organization_id, stream_id) ⇒ Object
POST /audit/orgs/:org_id/streams/:stream_id/test
179 180 181 |
# File 'lib/invoance/resources/audit.rb', line 179 def test(organization_id, stream_id) @http.post("/audit/orgs/#{organization_id}/streams/#{stream_id}/test") end |