Class: Infrawrench::MsteamsWebhooksNamespace
- Inherits:
-
Object
- Object
- Infrawrench::MsteamsWebhooksNamespace
- Defined in:
- lib/infrawrench/client.rb,
sig/infrawrench/sdk.rbs
Overview
client.msteams.webhooks
Instance Method Summary collapse
-
#create(org_id: nil, body: nil, request_options: nil) ⇒ Hash
Connect a Teams channel as an alert destination.
-
#delete(id:, org_id: nil, request_options: nil) ⇒ Hash
Disconnect a Teams channel.
-
#initialize(transport) ⇒ MsteamsWebhooksNamespace
constructor
private
A new instance of MsteamsWebhooksNamespace.
-
#update(id:, org_id: nil, body: nil, request_options: nil) ⇒ Hash
Rename a Teams channel.
Constructor Details
#initialize(transport) ⇒ MsteamsWebhooksNamespace
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of MsteamsWebhooksNamespace.
9652 9653 9654 |
# File 'lib/infrawrench/client.rb', line 9652 def initialize(transport) @transport = transport end |
Instance Method Details
#create(org_id: nil, body: nil, request_options: nil) ⇒ Hash
Connect a Teams channel as an alert destination
Adds a channel by webhook URL, or updates the one already holding that URL. Which alerts reach it is decided by /alert-rules — connecting a channel routes nothing to it on its own. Responds 400 when the URL is not https or its host is not Microsoft-operated.
POST /api/org/orgId/msteams/webhooks
Raises on 400: Bad request
9673 9674 9675 9676 9677 9678 9679 9680 9681 |
# File 'lib/infrawrench/client.rb', line 9673 def create(org_id: nil, body: nil, request_options: nil) @transport.request( http_method: "POST", path: "/api/org/{orgId}/msteams/webhooks", path_params: { "orgId" => org_id }, body: body, request_options: ) end |
#delete(id:, org_id: nil, request_options: nil) ⇒ Hash
Disconnect a Teams channel
DELETE /api/org/orgId/msteams/webhooks/id
Raises on 404: Not found
9695 9696 9697 9698 9699 9700 9701 9702 |
# File 'lib/infrawrench/client.rb', line 9695 def delete(id:, org_id: nil, request_options: nil) @transport.request( http_method: "DELETE", path: "/api/org/{orgId}/msteams/webhooks/{id}", path_params: { "orgId" => org_id, "id" => id }, request_options: ) end |
#update(id:, org_id: nil, body: nil, request_options: nil) ⇒ Hash
Rename a Teams channel
The webhook URL is immutable — remove the channel and re-add it to change it.
PATCH /api/org/orgId/msteams/webhooks/id
Raises on 400: Bad request
Raises on 404: Not found
9722 9723 9724 9725 9726 9727 9728 9729 9730 |
# File 'lib/infrawrench/client.rb', line 9722 def update(id:, org_id: nil, body: nil, request_options: nil) @transport.request( http_method: "PATCH", path: "/api/org/{orgId}/msteams/webhooks/{id}", path_params: { "orgId" => org_id, "id" => id }, body: body, request_options: ) end |