pub struct UserRoles<'c, C: Config> {
pub user_id: String,
/* private fields */
}Available on crate feature
administration only.Expand description
Manage role assignments for users in the organization.
Fields§
§user_id: StringImplementations§
Source§impl<'c, C: Config> UserRoles<'c, C>
impl<'c, C: Config> UserRoles<'c, C>
pub fn new(client: &'c Client<C>, user_id: &str) -> Self
Sourcepub async fn list(&self) -> Result<RoleListResource, OpenAIError>
pub async fn list(&self) -> Result<RoleListResource, OpenAIError>
Lists all role assignments for a user. Lists all role assignments for a user.
Sourcepub async fn list_byot<R: DeserializeOwned>(&self) -> Result<R, OpenAIError>
pub async fn list_byot<R: DeserializeOwned>(&self) -> Result<R, OpenAIError>
Lists all role assignments for a user.
Sourcepub async fn assign(
&self,
request: PublicAssignOrganizationUserRoleBody,
) -> Result<UserRoleAssignment, OpenAIError>
pub async fn assign( &self, request: PublicAssignOrganizationUserRoleBody, ) -> Result<UserRoleAssignment, OpenAIError>
Assigns a role to a user. Assigns a role to a user.
Sourcepub async fn assign_byot<T0: Serialize, R: DeserializeOwned>(
&self,
request: T0,
) -> Result<R, OpenAIError>
pub async fn assign_byot<T0: Serialize, R: DeserializeOwned>( &self, request: T0, ) -> Result<R, OpenAIError>
Assigns a role to a user.
Sourcepub async fn unassign(
&self,
role_id: &str,
) -> Result<DeletedRoleAssignmentResource, OpenAIError>
pub async fn unassign( &self, role_id: &str, ) -> Result<DeletedRoleAssignmentResource, OpenAIError>
Unassigns a role from a user. Unassigns a role from a user.
Sourcepub async fn unassign_byot<T0: Display, R: DeserializeOwned>(
&self,
role_id: T0,
) -> Result<R, OpenAIError>
pub async fn unassign_byot<T0: Display, R: DeserializeOwned>( &self, role_id: T0, ) -> Result<R, OpenAIError>
Unassigns a role from a user.
Trait Implementations§
Source§impl<'c, C: Config> RequestOptionsBuilder for UserRoles<'c, C>
Available on crate feature _api only.
impl<'c, C: Config> RequestOptionsBuilder for UserRoles<'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 UserRoles<'c, C>
impl<'c, C> !RefUnwindSafe for UserRoles<'c, C>
impl<'c, C> Send for UserRoles<'c, C>
impl<'c, C> Sync for UserRoles<'c, C>
impl<'c, C> Unpin for UserRoles<'c, C>
impl<'c, C> !UnwindSafe for UserRoles<'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