Class: Infrawrench::MsteamsNamespace

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

Overview

client.msteams

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(transport) ⇒ MsteamsNamespace

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 MsteamsNamespace.

Parameters:



10266
10267
10268
10269
# File 'lib/infrawrench/client.rb', line 10266

def initialize(transport)
  @transport = transport
  @webhooks = MsteamsWebhooksNamespace.new(@transport)
end

Instance Attribute Details

#webhooksMsteamsWebhooksNamespace (readonly)

Returns client.msteams.webhooks.

Returns:



10262
10263
10264
# File 'lib/infrawrench/client.rb', line 10262

def webhooks
  @webhooks
end

Instance Method Details

#status(org_id: nil, request_options: nil) ⇒ Hash

List the organization's Teams channels

Returns the Teams channels alerts can be routed to. Which alerts reach each one is decided by /alert-rules. Webhook URLs are never included.

GET /api/org/orgId/msteams/status

Parameters:

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

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

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

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

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

Returns:

  • (Hash)

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

Raises:



10283
10284
10285
10286
10287
10288
10289
10290
# File 'lib/infrawrench/client.rb', line 10283

def status(org_id: nil, request_options: nil)
  @transport.request(
    http_method: "GET",
    path: "/api/org/{orgId}/msteams/status",
    path_params: { "orgId" => org_id },
    request_options: request_options
  )
end

#test(org_id: nil, request_options: nil) ⇒ Hash

Post a test card to every configured Teams channel

Ignores routing rules — every channel gets the test. Fails with the error Microsoft returned when nothing could be delivered (HTTP 404 usually means the Workflow was deleted or turned off).

POST /api/org/orgId/msteams/test

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.

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

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

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

Returns:

  • (Hash)

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

Raises:



10307
10308
10309
10310
10311
10312
10313
10314
# File 'lib/infrawrench/client.rb', line 10307

def test(org_id: nil, request_options: nil)
  @transport.request(
    http_method: "POST",
    path: "/api/org/{orgId}/msteams/test",
    path_params: { "orgId" => org_id },
    request_options: request_options
  )
end