Class: Infrawrench::TeamMembersNamespace

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

Overview

client.team.members

Instance Method Summary collapse

Constructor Details

#initialize(transport) ⇒ TeamMembersNamespace

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

Parameters:



4004
4005
4006
# File 'lib/infrawrench/client.rb', line 4004

def initialize(transport)
  @transport = transport
end

Instance Method Details

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

Remove a member from the org

Requires permission: team:remove.

DELETE /api/org/orgId/team/members/id

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:



4020
4021
4022
4023
4024
4025
4026
4027
# File 'lib/infrawrench/client.rb', line 4020

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

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

List org members

Requires permission: team:read.

GET /api/org/orgId/team/members

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<OrgMember> — see sig/infrawrench/sdk.rbs.

Raises:



4041
4042
4043
4044
4045
4046
4047
4048
# File 'lib/infrawrench/client.rb', line 4041

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

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

Change a member's role

Requires permission: team:role:write.

PATCH /api/org/orgId/team/members/id/role

Parameters:

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

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

  • id (String)
  • body (Hash)

    Request body, shaped as RoleChangeRequest.

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

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

  • id: (String)
  • body: (role_change_request)
  • 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:



4063
4064
4065
4066
4067
4068
4069
4070
4071
# File 'lib/infrawrench/client.rb', line 4063

def role(id:, body:, org_id: nil, request_options: nil)
  @transport.request(
    http_method: "PATCH",
    path: "/api/org/{orgId}/team/members/{id}/role",
    path_params: { "orgId" => org_id, "id" => id },
    body: body,
    request_options: request_options
  )
end