Class: Infrawrench::MsteamsWebhooksNamespace

Inherits:
Object
  • Object
show all
Defined in:
lib/infrawrench/client.rb,
sig/infrawrench/sdk.rbs

Overview

client.msteams.webhooks

Instance Method Summary collapse

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.

Parameters:



2918
2919
2920
# File 'lib/infrawrench/client.rb', line 2918

def initialize(transport)
  @transport = transport
end

Instance Method Details

#create(org_id: nil, body: nil, request_options: nil) ⇒ Hash

Route alerts to a Teams channel

Adds a channel by webhook URL, or updates the one already holding that URL. Each trigger defaults to enabled. 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

Parameters:

  • org_id (String, nil) (defaults to: nil)

    Organization id. Defaults to the org_id the client was constructed with.

  • body (Hash, nil) (defaults to: nil)

    Request body, shaped as MsTeamsWebhookCreate.

  • request_options (Hash, nil) (defaults to: nil)

    Per-call :headers, :timeout and :open_timeout.

  • org_id: (String, nil) (defaults to: nil)
  • body: (ms_teams_webhook_create, nil) (defaults to: nil)
  • request_options: (Hash[Symbol, untyped], nil) (defaults to: nil)

Returns:

  • (Hash)

    Parsed JSON, shaped as MsTeamsWebhook — see sig/infrawrench/sdk.rbs.

Raises:



2938
2939
2940
2941
2942
2943
2944
2945
2946
# File 'lib/infrawrench/client.rb', line 2938

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: request_options
  )
end

#delete(id:, org_id: nil, request_options: nil) ⇒ Hash

Stop routing alerts to a Teams channel

DELETE /api/org/orgId/msteams/webhooks/id

Raises on 404: Not found

Parameters:

  • org_id (String, nil) (defaults to: nil)

    Organization id. Defaults to the org_id the client was constructed with.

  • id (String)
  • request_options (Hash, nil) (defaults to: nil)

    Per-call :headers, :timeout and :open_timeout.

  • id: (String)
  • org_id: (String, nil) (defaults to: nil)
  • request_options: (Hash[Symbol, untyped], nil) (defaults to: nil)

Returns:

  • (Hash)

    Parsed JSON, shaped as Ok — see sig/infrawrench/sdk.rbs.

Raises:



2960
2961
2962
2963
2964
2965
2966
2967
# File 'lib/infrawrench/client.rb', line 2960

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: request_options
  )
end

#update(id:, org_id: nil, body: nil, request_options: nil) ⇒ Hash

Rename a Teams channel or change which alerts it receives

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

Parameters:

  • org_id (String, nil) (defaults to: nil)

    Organization id. Defaults to the org_id the client was constructed with.

  • id (String)
  • body (Hash, nil) (defaults to: nil)

    Request body, shaped as MsTeamsWebhookUpdate.

  • request_options (Hash, nil) (defaults to: nil)

    Per-call :headers, :timeout and :open_timeout.

  • id: (String)
  • org_id: (String, nil) (defaults to: nil)
  • body: (ms_teams_webhook_update, nil) (defaults to: nil)
  • request_options: (Hash[Symbol, untyped], nil) (defaults to: nil)

Returns:

  • (Hash)

    Parsed JSON, shaped as MsTeamsWebhook — see sig/infrawrench/sdk.rbs.

Raises:



2987
2988
2989
2990
2991
2992
2993
2994
2995
# File 'lib/infrawrench/client.rb', line 2987

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: request_options
  )
end