Class: Anthropic::Resources::Organization::Invites
- Inherits:
-
Object
- Object
- Anthropic::Resources::Organization::Invites
- Defined in:
- lib/anthropic/resources/organization/invites.rb,
sig/anthropic/resources/organization/invites.rbs
Instance Method Summary collapse
-
#create(email:, role:, rbac_group_ids: nil, request_options: {}) ⇒ Anthropic::Models::Organization::OrganizationInvite
Invite a user to join the organization by email.
-
#delete(invite_id, request_options: {}) ⇒ Anthropic::Models::Organization::InviteDeleteResponse
Delete a pending invite.
-
#initialize(client:) ⇒ Invites
constructor
private
A new instance of Invites.
-
#list(after_id: nil, before_id: nil, email: nil, limit: nil, roles: nil, statuses: nil, request_options: {}) ⇒ Anthropic::Internal::Page<Anthropic::Models::Organization::OrganizationInvite>
List the organization's invites.
-
#retrieve(invite_id, request_options: {}) ⇒ Anthropic::Models::Organization::OrganizationInvite
Retrieve an invite by ID.
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.
144 145 146 |
# File 'lib/anthropic/resources/organization/invites.rb', line 144 def initialize(client:) @client = client end |
Instance Method Details
#create(email:, role:, rbac_group_ids: nil, request_options: {}) ⇒ Anthropic::Models::Organization::OrganizationInvite
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::Organization::InviteCreateParams for more details.
39 40 41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/anthropic/resources/organization/invites.rb', line 39 def create(params) parsed, = Anthropic::Organization::InviteCreateParams.dump_request(params) @client.request( span_name: Anthropic::Internal::Tracing::SpanName::ORGANIZATION_INVITES_CREATE, span_created_id: "anthropic.organization.invite.id", span_route: "/v1/organizations/invites", method: :post, path: "v1/organizations/invites", body: parsed, model: Anthropic::Organization::OrganizationInvite, options: ) end |
#delete(invite_id, request_options: {}) ⇒ Anthropic::Models::Organization::InviteDeleteResponse
Delete a pending invite.
129 130 131 132 133 134 135 136 137 138 139 |
# File 'lib/anthropic/resources/organization/invites.rb', line 129 def delete(invite_id, params = {}) @client.request( span_name: Anthropic::Internal::Tracing::SpanName::ORGANIZATION_INVITES_DELETE, span_attributes: {"anthropic.organization.invite.id" => invite_id}, span_route: "/v1/organizations/invites/{invite_id}", method: :delete, path: ["v1/organizations/invites/%1$s", invite_id], model: Anthropic::Models::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::Organization::OrganizationInvite>
List the organization's invites.
Some parameter documentations has been truncated, see Models::Organization::InviteListParams for more details.
100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 |
# File 'lib/anthropic/resources/organization/invites.rb', line 100 def list(params = {}) parsed, = Anthropic::Organization::InviteListParams.dump_request(params) query = Anthropic::Internal::Util.encode_query_params(parsed) @client.request( span_name: Anthropic::Internal::Tracing::SpanName::ORGANIZATION_INVITES_LIST, span_route: "/v1/organizations/invites", span_query: %w[after_id before_id email limit roles statuses], method: :get, path: "v1/organizations/invites", query: query, page: Anthropic::Internal::Page, model: Anthropic::Organization::OrganizationInvite, options: ) end |
#retrieve(invite_id, request_options: {}) ⇒ Anthropic::Models::Organization::OrganizationInvite
Retrieve an invite by ID.
64 65 66 67 68 69 70 71 72 73 74 |
# File 'lib/anthropic/resources/organization/invites.rb', line 64 def retrieve(invite_id, params = {}) @client.request( span_name: Anthropic::Internal::Tracing::SpanName::ORGANIZATION_INVITES_RETRIEVE, span_attributes: {"anthropic.organization.invite.id" => invite_id}, span_route: "/v1/organizations/invites/{invite_id}", method: :get, path: ["v1/organizations/invites/%1$s", invite_id], model: Anthropic::Organization::OrganizationInvite, options: params[:request_options] ) end |