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.
128 129 130 |
# File 'lib/invoance/resources/audit.rb', line 128 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.
134 135 136 137 138 139 |
# File 'lib/invoance/resources/audit.rb', line 134 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
147 148 149 |
# File 'lib/invoance/resources/audit.rb', line 147 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
142 143 144 |
# File 'lib/invoance/resources/audit.rb', line 142 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
152 153 154 |
# File 'lib/invoance/resources/audit.rb', line 152 def test(organization_id, stream_id) @http.post("/audit/orgs/#{organization_id}/streams/#{stream_id}/test") end |