pub struct Roles<'c, C: Config> { /* private fields */ }Available on crate feature
administration only.Expand description
Manage custom roles that can be assigned to groups and users at the organization or project level.
Implementations§
Source§impl<'c, C: Config> Roles<'c, C>
impl<'c, C: Config> Roles<'c, C>
pub fn new(client: &'c Client<C>) -> Self
Sourcepub async fn list(&self) -> Result<PublicRoleListResource, OpenAIError>
pub async fn list(&self) -> Result<PublicRoleListResource, OpenAIError>
Lists the roles configured for the organization. Lists the roles configured for 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 the roles configured for the organization.
Sourcepub async fn create(
&self,
request: PublicCreateOrganizationRoleBody,
) -> Result<Role, OpenAIError>
pub async fn create( &self, request: PublicCreateOrganizationRoleBody, ) -> Result<Role, OpenAIError>
Creates a custom role for the organization. Creates a custom role for the organization.
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>
Creates a custom role for the organization.
Sourcepub async fn update(
&self,
role_id: &str,
request: PublicUpdateOrganizationRoleBody,
) -> Result<Role, OpenAIError>
pub async fn update( &self, role_id: &str, request: PublicUpdateOrganizationRoleBody, ) -> Result<Role, OpenAIError>
Updates an existing organization role. Updates an existing organization role.
Sourcepub async fn update_byot<T0: Display, T1: Serialize, R: DeserializeOwned>(
&self,
role_id: T0,
request: T1,
) -> Result<R, OpenAIError>
pub async fn update_byot<T0: Display, T1: Serialize, R: DeserializeOwned>( &self, role_id: T0, request: T1, ) -> Result<R, OpenAIError>
Updates an existing organization role.
Sourcepub async fn delete(
&self,
role_id: &str,
) -> Result<RoleDeletedResource, OpenAIError>
pub async fn delete( &self, role_id: &str, ) -> Result<RoleDeletedResource, OpenAIError>
Deletes a custom role from the organization. Deletes a custom role from the organization.
Sourcepub async fn delete_byot<T0: Display, R: DeserializeOwned>(
&self,
role_id: T0,
) -> Result<R, OpenAIError>
pub async fn delete_byot<T0: Display, R: DeserializeOwned>( &self, role_id: T0, ) -> Result<R, OpenAIError>
Deletes a custom role from the organization.
Trait Implementations§
Source§impl<'c, C: Config> RequestOptionsBuilder for Roles<'c, C>
Available on crate feature _api only.
impl<'c, C: Config> RequestOptionsBuilder for Roles<'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 Roles<'c, C>
impl<'c, C> !RefUnwindSafe for Roles<'c, C>
impl<'c, C> Send for Roles<'c, C>
impl<'c, C> Sync for Roles<'c, C>
impl<'c, C> Unpin for Roles<'c, C>
impl<'c, C> !UnwindSafe for Roles<'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