pub struct ProjectUsers<'c, C: Config> {
pub project_id: String,
/* private fields */
}Available on crate feature
administration only.Expand description
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.
Fields§
§project_id: StringImplementations§
Source§impl<'c, C: Config> ProjectUsers<'c, C>
impl<'c, C: Config> ProjectUsers<'c, C>
pub fn new(client: &'c Client<C>, project_id: &str) -> Self
Sourcepub async fn list(&self) -> Result<ProjectUserListResponse, OpenAIError>
pub async fn list(&self) -> Result<ProjectUserListResponse, OpenAIError>
Returns a list of users in the project.
Sourcepub async fn list_byot<R: DeserializeOwned>(&self) -> Result<R, OpenAIError>
pub async fn list_byot<R: DeserializeOwned>(&self) -> Result<R, OpenAIError>
Returns a list of users in the project.
Sourcepub async fn create(
&self,
request: ProjectUserCreateRequest,
) -> Result<ProjectUser, OpenAIError>
pub async fn create( &self, request: ProjectUserCreateRequest, ) -> Result<ProjectUser, OpenAIError>
Adds a user to the project. Users must already be members of the organization to be added to a project.
Sourcepub async fn create_byot<T0: Serialize, R: DeserializeOwned>(
&self,
request: T0,
) -> Result<R, OpenAIError>
pub async fn create_byot<T0: Serialize, R: DeserializeOwned>( &self, request: T0, ) -> Result<R, OpenAIError>
Adds a user to the project. Users must already be members of the organization to be added to a project.
Sourcepub async fn retrieve(&self, user_id: &str) -> Result<ProjectUser, OpenAIError>
pub async fn retrieve(&self, user_id: &str) -> Result<ProjectUser, OpenAIError>
Retrieves a user in the project.
Sourcepub async fn retrieve_byot<T0: Display, R: DeserializeOwned>(
&self,
user_id: T0,
) -> Result<R, OpenAIError>
pub async fn retrieve_byot<T0: Display, R: DeserializeOwned>( &self, user_id: T0, ) -> Result<R, OpenAIError>
Retrieves a user in the project.
Sourcepub async fn modify(
&self,
user_id: &str,
request: ProjectUserUpdateRequest,
) -> Result<ProjectUser, OpenAIError>
pub async fn modify( &self, user_id: &str, request: ProjectUserUpdateRequest, ) -> Result<ProjectUser, OpenAIError>
Modifies a user’s role in the project.
Sourcepub async fn modify_byot<T0: Display, T1: Serialize, R: DeserializeOwned>(
&self,
user_id: T0,
request: T1,
) -> Result<R, OpenAIError>
pub async fn modify_byot<T0: Display, T1: Serialize, R: DeserializeOwned>( &self, user_id: T0, request: T1, ) -> Result<R, OpenAIError>
Modifies a user’s role in the project.
Sourcepub async fn delete(
&self,
user_id: &str,
) -> Result<ProjectUserDeleteResponse, OpenAIError>
pub async fn delete( &self, user_id: &str, ) -> Result<ProjectUserDeleteResponse, OpenAIError>
Deletes a user from the project.
Sourcepub async fn delete_byot<T0: Display, R: DeserializeOwned>(
&self,
user_id: T0,
) -> Result<R, OpenAIError>
pub async fn delete_byot<T0: Display, R: DeserializeOwned>( &self, user_id: T0, ) -> Result<R, OpenAIError>
Deletes a user from the project.
Trait Implementations§
Source§impl<'c, C: Config> RequestOptionsBuilder for ProjectUsers<'c, C>
Available on crate feature _api only.
impl<'c, C: Config> RequestOptionsBuilder for ProjectUsers<'c, C>
Available on crate feature
_api only.Source§fn options_mut(&mut self) -> &mut RequestOptions
fn options_mut(&mut self) -> &mut RequestOptions
Get mutable reference to RequestOptions (for building)
Source§fn options(&self) -> &RequestOptions
fn options(&self) -> &RequestOptions
Get reference to RequestOptions
Source§fn header<K, V>(self, key: K, value: V) -> Result<Self, OpenAIError>
fn header<K, V>(self, key: K, value: V) -> Result<Self, OpenAIError>
Add a single header to RequestOptions
Auto Trait Implementations§
impl<'c, C> Freeze for ProjectUsers<'c, C>
impl<'c, C> !RefUnwindSafe for ProjectUsers<'c, C>
impl<'c, C> Send for ProjectUsers<'c, C>
impl<'c, C> Sync for ProjectUsers<'c, C>
impl<'c, C> Unpin for ProjectUsers<'c, C>
impl<'c, C> !UnwindSafe for ProjectUsers<'c, C>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more