Class ProjectUsersClient
java.lang.Object
io.github.stefanbratanov.jvm.openai.ProjectUsersClient
Manage users within a project, including adding, updating roles, and removing users. Users cannot
be removed from the Default project, unless they are being removed from the organization.
Based on Project Users
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptioncreateProjectUser
(String projectId, CreateProjectUserRequest request) Adds a user to the project.deleteProjectUser
(String projectId, String userId) Deletes a user from the project.Returns a list of users in the project.modifyProjectUser
(String projectId, String userId, ModifyProjectUserRequest request) Modifies a user's role in the project.retrieveProjectUser
(String projectId, String userId) Retrieves a user in the project.
-
Method Details
-
listProjectUsers
public ProjectUsersClient.PaginatedProjectUsers listProjectUsers(String projectId, Optional<String> after, Optional<Integer> limit) Returns a list of users in the project.- Parameters:
after
- A cursor for use in pagination. after is an object ID that defines your place in the list.limit
- A limit on the number of objects to be returned.- Throws:
OpenAIException
- in case of API errors
-
createProjectUser
Adds a user to the project. Users must already be members of the organization to be added to a project.- Parameters:
projectId
- The ID of the project.- Throws:
OpenAIException
- in case of API errors
-
retrieveProjectUser
Retrieves a user in the project.- Parameters:
projectId
- The ID of the project.userId
- The ID of the user.- Throws:
OpenAIException
- in case of API errors
-
modifyProjectUser
public ProjectUser modifyProjectUser(String projectId, String userId, ModifyProjectUserRequest request) Modifies a user's role in the project.- Parameters:
projectId
- The ID of the project.userId
- The ID of the user.- Throws:
OpenAIException
- in case of API errors
-
deleteProjectUser
Deletes a user from the project.- Parameters:
projectId
- The ID of the project.userId
- The ID of the user.- Throws:
OpenAIException
- in case of API errors
-