pub struct Users<'c, C: Config> { /* private fields */ }Available on crate feature
administration only.Expand description
Manage users and their role in an organization. Users will be automatically added to the Default project.
Implementations§
Source§impl<'c, C: Config> Users<'c, C>
impl<'c, C: Config> Users<'c, C>
pub fn new(client: &'c Client<C>) -> Self
Sourcepub fn roles(&self, user_id: &str) -> UserRoles<'_, C>
pub fn roles(&self, user_id: &str) -> UserRoles<'_, C>
To call UserRoles group related APIs using this client.
Sourcepub async fn list(&self) -> Result<UserListResponse, OpenAIError>
pub async fn list(&self) -> Result<UserListResponse, OpenAIError>
Lists all of the users in the organization. Lists all of the users in the organization.
Sourcepub async fn list_byot<R: DeserializeOwned>(&self) -> Result<R, OpenAIError>
pub async fn list_byot<R: DeserializeOwned>(&self) -> Result<R, OpenAIError>
Lists all of the users in the organization.
Sourcepub async fn modify(
&self,
user_id: &str,
request: UserRoleUpdateRequest,
) -> Result<User, OpenAIError>
pub async fn modify( &self, user_id: &str, request: UserRoleUpdateRequest, ) -> Result<User, OpenAIError>
Modifies a user’s role in the organization. Modifies a user’s role in the organization.
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 organization.
Sourcepub async fn retrieve(&self, user_id: &str) -> Result<User, OpenAIError>
pub async fn retrieve(&self, user_id: &str) -> Result<User, OpenAIError>
Retrieve a user by their identifier Retrieve a user by their identifier
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>
Retrieve a user by their identifier
Sourcepub async fn delete(
&self,
user_id: &str,
) -> Result<UserDeleteResponse, OpenAIError>
pub async fn delete( &self, user_id: &str, ) -> Result<UserDeleteResponse, OpenAIError>
Deletes a user from the organization. Deletes a user from the organization.
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 organization.
Trait Implementations§
Source§impl<'c, C: Config> RequestOptionsBuilder for Users<'c, C>
Available on crate feature _api only.
impl<'c, C: Config> RequestOptionsBuilder for Users<'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 Users<'c, C>
impl<'c, C> !RefUnwindSafe for Users<'c, C>
impl<'c, C> Send for Users<'c, C>
impl<'c, C> Sync for Users<'c, C>
impl<'c, C> Unpin for Users<'c, C>
impl<'c, C> !UnwindSafe for Users<'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