pub struct ApiKeyBuilder { /* private fields */ }
Expand description
Builder for ApiKeyRequest
.
Implementations§
Source§impl ApiKeyBuilder
impl ApiKeyBuilder
Sourcepub fn api_key_id<VALUE: Into<String>>(self, value: VALUE) -> Self
pub fn api_key_id<VALUE: Into<String>>(self, value: VALUE) -> Self
API key identifier
Sourcepub fn credentials<VALUE: Into<Credentials>>(self, value: VALUE) -> Self
pub fn credentials<VALUE: Into<Credentials>>(self, value: VALUE) -> Self
Credentials for authentication (not serialized)
Sourcepub fn build(self) -> Result<ApiKeyRequest, ApiKeyBuilderError>
pub fn build(self) -> Result<ApiKeyRequest, ApiKeyBuilderError>
Source§impl ApiKeyBuilder
impl ApiKeyBuilder
Sourcepub async fn create(self) -> ApiResponseOrError<ApiKey>
pub async fn create(self) -> ApiResponseOrError<ApiKey>
Creates a new API key request and returns the response.
This is a convenience method that builds the request from the builder and sends it to the API Keys API.
§Example
let credentials = Credentials::from_env();
let api_key = ApiKey::builder("api_key_123456789")
.credentials(credentials)
.create()
.await?;
Trait Implementations§
Source§impl Clone for ApiKeyBuilder
impl Clone for ApiKeyBuilder
Source§fn clone(&self) -> ApiKeyBuilder
fn clone(&self) -> ApiKeyBuilder
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for ApiKeyBuilder
impl Debug for ApiKeyBuilder
Source§impl Default for ApiKeyBuilder
impl Default for ApiKeyBuilder
Source§impl PartialEq for ApiKeyBuilder
impl PartialEq for ApiKeyBuilder
impl StructuralPartialEq for ApiKeyBuilder
Auto Trait Implementations§
impl Freeze for ApiKeyBuilder
impl RefUnwindSafe for ApiKeyBuilder
impl Send for ApiKeyBuilder
impl Sync for ApiKeyBuilder
impl Unpin for ApiKeyBuilder
impl UnwindSafe for ApiKeyBuilder
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