Class: Anthropic::Resources::Beta::Organization::Invites

Inherits:
Object
  • Object
show all
Defined in:
lib/anthropic/resources/beta/organization/invites.rb,
sig/anthropic/resources/beta/organization/invites.rbs

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Invites

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

Parameters:



122
123
124
# File 'lib/anthropic/resources/beta/organization/invites.rb', line 122

def initialize(client:)
  @client = client
end

Instance Method Details

#create(email:, role:, rbac_group_ids: nil, request_options: {}) ⇒ Anthropic::Models::Beta::Organization::BetaOrganizationInvite

Invite a user to join the organization by email.

On plans that draw members from a finite pool of purchased seats, the invite automatically consumes a seat from the lowest tier with availability; there is no seat-tier parameter. When no seat is free the request fails with a 400 error rather than purchasing a seat.

Some parameter documentations has been truncated, see Models::Beta::Organization::InviteCreateParams for more details.

Parameters:

Returns:

See Also:



31
32
33
34
35
36
37
38
39
40
# File 'lib/anthropic/resources/beta/organization/invites.rb', line 31

def create(params)
  parsed, options = Anthropic::Beta::Organization::InviteCreateParams.dump_request(params)
  @client.request(
    method: :post,
    path: "v1/organizations/invites?beta=true",
    body: parsed,
    model: Anthropic::Beta::Organization::BetaOrganizationInvite,
    options: options
  )
end

#delete(invite_id, request_options: {}) ⇒ Anthropic::Models::Beta::Organization::InviteDeleteResponse

Delete a pending invite.

Parameters:

Returns:

See Also:



110
111
112
113
114
115
116
117
# File 'lib/anthropic/resources/beta/organization/invites.rb', line 110

def delete(invite_id, params = {})
  @client.request(
    method: :delete,
    path: ["v1/organizations/invites/%1$s?beta=true", invite_id],
    model: Anthropic::Models::Beta::Organization::InviteDeleteResponse,
    options: params[:request_options]
  )
end

#list(after_id: nil, before_id: nil, email: nil, limit: nil, roles: nil, statuses: nil, request_options: {}) ⇒ Anthropic::Internal::Page<Anthropic::Models::Beta::Organization::BetaOrganizationInvite>

List the organization's invites.

Some parameter documentations has been truncated, see Models::Beta::Organization::InviteListParams for more details.

Parameters:

  • after_id (String)

    ID of the object to use as a cursor for pagination. When provided, returns the p

  • before_id (String)

    ID of the object to use as a cursor for pagination. When provided, returns the p

  • email (String)

    Filter by the email address the Invite was sent to. Matches the same way as the

  • limit (Integer)

    Number of items to return per page.

  • roles (Array<String>)

    Filter to items whose role equals one of the supplied values. Repeatable; valu

  • statuses (Array<Symbol, Anthropic::Models::Beta::Organization::InviteListParams::Status>)

    Filter by Invite status. Repeatable; values are OR'ed together. Omit to return `

  • request_options (Anthropic::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



86
87
88
89
90
91
92
93
94
95
96
97
# File 'lib/anthropic/resources/beta/organization/invites.rb', line 86

def list(params = {})
  parsed, options = Anthropic::Beta::Organization::InviteListParams.dump_request(params)
  query = Anthropic::Internal::Util.encode_query_params(parsed)
  @client.request(
    method: :get,
    path: "v1/organizations/invites?beta=true",
    query: query,
    page: Anthropic::Internal::Page,
    model: Anthropic::Beta::Organization::BetaOrganizationInvite,
    options: options
  )
end

#retrieve(invite_id, request_options: {}) ⇒ Anthropic::Models::Beta::Organization::BetaOrganizationInvite

Retrieve an invite by ID.

Parameters:

Returns:

See Also:



53
54
55
56
57
58
59
60
# File 'lib/anthropic/resources/beta/organization/invites.rb', line 53

def retrieve(invite_id, params = {})
  @client.request(
    method: :get,
    path: ["v1/organizations/invites/%1$s?beta=true", invite_id],
    model: Anthropic::Beta::Organization::BetaOrganizationInvite,
    options: params[:request_options]
  )
end