Class ProjectUsersClient

java.lang.Object
io.github.stefanbratanov.jvm.openai.ProjectUsersClient

public final class ProjectUsersClient extends Object
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

  • 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

      public ProjectUser createProjectUser(String projectId, CreateProjectUserRequest request)
      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

      public ProjectUser retrieveProjectUser(String projectId, String userId)
      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

      public DeletionStatus deleteProjectUser(String projectId, String userId)
      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