pub struct ProjectAPIKeys<'c, C: Config> {
pub project_id: String,
/* private fields */
}
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: String
Implementations§
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<Q>(
&self,
query: &Q,
) -> Result<ProjectApiKeyListResponse, OpenAIError>
pub async fn list<Q>( &self, query: &Q, ) -> 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<T0: Serialize, R: DeserializeOwned>(
&self,
query: T0,
) -> Result<R, OpenAIError>
pub async fn list_byot<T0: Serialize, R: DeserializeOwned>( &self, query: T0, ) -> 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.
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>where
C: Sync,
impl<'c, C> Sync for ProjectAPIKeys<'c, C>where
C: Sync,
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