Class: Infrawrench::SlackInstallationsNamespace

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

Overview

client.slack.installations

Instance Method Summary collapse

Constructor Details

#initialize(transport) ⇒ SlackInstallationsNamespace

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

Parameters:



3316
3317
3318
# File 'lib/infrawrench/client.rb', line 3316

def initialize(transport)
  @transport = transport
end

Instance Method Details

#available_channels(installation_id:, org_id: nil, request_options: nil) ⇒ Hash

List channels the connected workspace can see

Live call to Slack's conversations.list, for populating a channel picker. Returns non-archived public and private channels visible to the bot.

GET /api/org/orgId/slack/installations/installationId/available-channels

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.

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

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

  • installation_id: (String)
  • 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:



3336
3337
3338
3339
3340
3341
3342
3343
# File 'lib/infrawrench/client.rb', line 3336

def available_channels(installation_id:, org_id: nil, request_options: nil)
  @transport.request(
    http_method: "GET",
    path: "/api/org/{orgId}/slack/installations/{installationId}/available-channels",
    path_params: { "orgId" => org_id, "installationId" => installation_id },
    request_options: request_options
  )
end

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

Disconnect a Slack workspace

Stops all delivery to this workspace. The channel routing is retained, so re-installing restores it.

DELETE /api/org/orgId/slack/installations/installationId

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.

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

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

  • installation_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:



3360
3361
3362
3363
3364
3365
3366
3367
# File 'lib/infrawrench/client.rb', line 3360

def delete(installation_id:, org_id: nil, request_options: nil)
  @transport.request(
    http_method: "DELETE",
    path: "/api/org/{orgId}/slack/installations/{installationId}",
    path_params: { "orgId" => org_id, "installationId" => installation_id },
    request_options: request_options
  )
end