Class: Anthropic::Resources::Beta::Organization::Users
- Inherits:
-
Object
- Object
- Anthropic::Resources::Beta::Organization::Users
- Defined in:
- lib/anthropic/resources/beta/organization/users.rb,
sig/anthropic/resources/beta/organization/users.rbs
Instance Method Summary collapse
-
#initialize(client:) ⇒ Users
constructor
private
A new instance of Users.
-
#list(after_id: nil, before_id: nil, email: nil, limit: nil, roles: nil, request_options: {}) ⇒ Anthropic::Internal::Page<Anthropic::Models::Beta::Organization::BetaOrganizationUser>
List the organization's members.
-
#remove(user_id, request_options: {}) ⇒ Anthropic::Models::Beta::Organization::UserRemoveResponse
Remove a member from the organization.
-
#retrieve(user_id, request_options: {}) ⇒ Anthropic::Models::Beta::Organization::BetaOrganizationUser
Retrieve a member of the organization by user ID.
-
#update(user_id, role:, request_options: {}) ⇒ Anthropic::Models::Beta::Organization::BetaOrganizationUser
Update a member's organization role.
Constructor Details
#initialize(client:) ⇒ Users
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 Users.
113 114 115 |
# File 'lib/anthropic/resources/beta/organization/users.rb', line 113 def initialize(client:) @client = client end |
Instance Method Details
#list(after_id: nil, before_id: nil, email: nil, limit: nil, roles: nil, request_options: {}) ⇒ Anthropic::Internal::Page<Anthropic::Models::Beta::Organization::BetaOrganizationUser>
List the organization's members.
Some parameter documentations has been truncated, see Models::Beta::Organization::UserListParams for more details.
77 78 79 80 81 82 83 84 85 86 87 88 |
# File 'lib/anthropic/resources/beta/organization/users.rb', line 77 def list(params = {}) parsed, = Anthropic::Beta::Organization::UserListParams.dump_request(params) query = Anthropic::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: "v1/organizations/users?beta=true", query: query, page: Anthropic::Internal::Page, model: Anthropic::Beta::Organization::BetaOrganizationUser, options: ) end |
#remove(user_id, request_options: {}) ⇒ Anthropic::Models::Beta::Organization::UserRemoveResponse
Remove a member from the organization.
101 102 103 104 105 106 107 108 |
# File 'lib/anthropic/resources/beta/organization/users.rb', line 101 def remove(user_id, params = {}) @client.request( method: :delete, path: ["v1/organizations/users/%1$s?beta=true", user_id], model: Anthropic::Models::Beta::Organization::UserRemoveResponse, options: params[:request_options] ) end |
#retrieve(user_id, request_options: {}) ⇒ Anthropic::Models::Beta::Organization::BetaOrganizationUser
Retrieve a member of the organization by user ID.
19 20 21 22 23 24 25 26 |
# File 'lib/anthropic/resources/beta/organization/users.rb', line 19 def retrieve(user_id, params = {}) @client.request( method: :get, path: ["v1/organizations/users/%1$s?beta=true", user_id], model: Anthropic::Beta::Organization::BetaOrganizationUser, options: params[:request_options] ) end |
#update(user_id, role:, request_options: {}) ⇒ Anthropic::Models::Beta::Organization::BetaOrganizationUser
Update a member's organization role.
Some parameter documentations has been truncated, see Models::Beta::Organization::UserUpdateParams for more details.
44 45 46 47 48 49 50 51 52 53 |
# File 'lib/anthropic/resources/beta/organization/users.rb', line 44 def update(user_id, params) parsed, = Anthropic::Beta::Organization::UserUpdateParams.dump_request(params) @client.request( method: :post, path: ["v1/organizations/users/%1$s?beta=true", user_id], body: parsed, model: Anthropic::Beta::Organization::BetaOrganizationUser, options: ) end |