pub struct ProjectAPIKeys<'c, C: Config> {
pub project_id: String,
/* private fields */
}Available on crate feature
administration only.Expand description
Manage API keys for a given project. Supports listing and deleting keys for users. This API does not allow issuing keys for users, as users need to authorize themselves to generate keys.
Fields§
§project_id: StringImplementations§
Source§impl<'c, C: Config> ProjectAPIKeys<'c, C>
impl<'c, C: Config> ProjectAPIKeys<'c, C>
pub fn new(client: &'c Client<C>, project_id: &str) -> Self
Sourcepub async fn list(&self) -> Result<ProjectApiKeyListResponse, OpenAIError>
pub async fn list(&self) -> Result<ProjectApiKeyListResponse, OpenAIError>
Returns a list of API keys in the project. Returns a list of API keys 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 API keys in the project.
Sourcepub async fn retrieve(
&self,
api_key: &str,
) -> Result<ProjectApiKey, OpenAIError>
pub async fn retrieve( &self, api_key: &str, ) -> Result<ProjectApiKey, OpenAIError>
Retrieves an API key in the project. Retrieves an API key in the project.
Sourcepub async fn retrieve_byot<T0: Display, R: DeserializeOwned>(
&self,
api_key: T0,
) -> Result<R, OpenAIError>
pub async fn retrieve_byot<T0: Display, R: DeserializeOwned>( &self, api_key: T0, ) -> Result<R, OpenAIError>
Retrieves an API key in the project.
Sourcepub async fn delete(
&self,
api_key: &str,
) -> Result<ProjectApiKeyDeleteResponse, OpenAIError>
pub async fn delete( &self, api_key: &str, ) -> Result<ProjectApiKeyDeleteResponse, OpenAIError>
Deletes an API key from the project. Deletes an API key from the project.
Sourcepub async fn delete_byot<T0: Display, R: DeserializeOwned>(
&self,
api_key: T0,
) -> Result<R, OpenAIError>
pub async fn delete_byot<T0: Display, R: DeserializeOwned>( &self, api_key: T0, ) -> Result<R, OpenAIError>
Deletes an API key from the project.
Trait Implementations§
Source§impl<'c, C: Config> RequestOptionsBuilder for ProjectAPIKeys<'c, C>
Available on crate feature _api only.
impl<'c, C: Config> RequestOptionsBuilder for ProjectAPIKeys<'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 ProjectAPIKeys<'c, C>
impl<'c, C> !RefUnwindSafe for ProjectAPIKeys<'c, C>
impl<'c, C> Send for ProjectAPIKeys<'c, C>
impl<'c, C> Sync for ProjectAPIKeys<'c, C>
impl<'c, C> Unpin for ProjectAPIKeys<'c, C>
impl<'c, C> !UnwindSafe for ProjectAPIKeys<'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