Class: Infrawrench::TeamInvitationsNamespace

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

Overview

client.team.invitations

Instance Method Summary collapse

Constructor Details

#initialize(transport) ⇒ TeamInvitationsNamespace

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

Parameters:



3929
3930
3931
# File 'lib/infrawrench/client.rb', line 3929

def initialize(transport)
  @transport = transport
end

Instance Method Details

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

Create an invitation (token valid for 7 days)

Requires permission: team:invite.

POST /api/org/orgId/team/invitations

Parameters:

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

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

  • body (Hash)

    Request body, shaped as InviteRequest.

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

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

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

Returns:

  • (Hash)

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

Raises:



3945
3946
3947
3948
3949
3950
3951
3952
3953
# File 'lib/infrawrench/client.rb', line 3945

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

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

Revoke a pending invitation

Requires permission: team:invite.

DELETE /api/org/orgId/team/invitations/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:



3969
3970
3971
3972
3973
3974
3975
3976
# File 'lib/infrawrench/client.rb', line 3969

def delete(id:, org_id: nil, request_options: nil)
  @transport.request(
    http_method: "DELETE",
    path: "/api/org/{orgId}/team/invitations/{id}",
    path_params: { "orgId" => org_id, "id" => id },
    request_options: request_options
  )
end

#list(org_id: nil, request_options: nil) ⇒ Array<Hash>

List pending and historical invitations

Requires permission: team:read.

GET /api/org/orgId/team/invitations

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:

  • (Array<Hash>)

    Parsed JSON, shaped as Array<Invitation> — see sig/infrawrench/sdk.rbs.

Raises:



3990
3991
3992
3993
3994
3995
3996
3997
# File 'lib/infrawrench/client.rb', line 3990

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