pub struct HmacKeyClient<'a>(/* private fields */);
Expand description
Operations on HmacKey
s.
Implementations§
Source§impl<'a> HmacKeyClient<'a>
impl<'a> HmacKeyClient<'a>
Sourcepub async fn create(&self) -> Result<HmacKey>
pub async fn create(&self) -> Result<HmacKey>
Creates a new HMAC key for the specified service account.
The authenticated user must have storage.hmacKeys.create
permission for the project in
which the key will be created.
For general information about HMAC keys in Cloud Storage, see HMAC Keys.
§Example
use cloud_storage::Client;
use cloud_storage::hmac_key::HmacKey;
let client = Client::default();
let hmac_key = client.hmac_key().create().await?;
Sourcepub async fn list(&self) -> Result<Vec<HmacMeta>>
pub async fn list(&self) -> Result<Vec<HmacMeta>>
Retrieves a list of HMAC keys matching the criteria. Since the HmacKey is secret, this does
not return a HmacKey
, but a HmacMeta
. This is a redacted version of a HmacKey
, but
with the secret data omitted.
The authenticated user must have storage.hmacKeys.list
permission for the project in which
the key exists.
For general information about HMAC keys in Cloud Storage, see HMAC Keys.
§Example
use cloud_storage::Client;
use cloud_storage::hmac_key::HmacKey;
let client = Client::default();
let all_hmac_keys = client.hmac_key().list().await?;
Sourcepub async fn read(&self, access_id: &str) -> Result<HmacMeta>
pub async fn read(&self, access_id: &str) -> Result<HmacMeta>
Retrieves an HMAC key’s metadata. Since the HmacKey is secret, this does not return a
HmacKey
, but a HmacMeta
. This is a redacted version of a HmacKey
, but with the secret
data omitted.
The authenticated user must have storage.hmacKeys.get
permission for the project in which
the key exists.
For general information about HMAC keys in Cloud Storage, see HMAC Keys.
§Example
use cloud_storage::Client;
use cloud_storage::hmac_key::HmacKey;
let client = Client::default();
let key = client.hmac_key().read("some identifier").await?;
Sourcepub async fn update(
&self,
access_id: &str,
state: HmacState,
) -> Result<HmacMeta>
pub async fn update( &self, access_id: &str, state: HmacState, ) -> Result<HmacMeta>
Updates the state of an HMAC key. See the HMAC Key resource descriptor for valid states.
Since the HmacKey is secret, this does not return a HmacKey
, but a HmacMeta
. This is a
redacted version of a HmacKey
, but with the secret data omitted.
The authenticated user must have storage.hmacKeys.update
permission for the project in
which the key exists.
For general information about HMAC keys in Cloud Storage, see HMAC Keys.
§Example
use cloud_storage::Client;
use cloud_storage::hmac_key::{HmacKey, HmacState};
let client = Client::default();
let key = client.hmac_key().update("your key", HmacState::Active).await?;
Sourcepub async fn delete(&self, access_id: &str) -> Result<()>
pub async fn delete(&self, access_id: &str) -> Result<()>
Deletes an HMAC key. Note that a key must be set to Inactive
first.
The authenticated user must have storage.hmacKeys.delete permission for the project in which the key exists.
For general information about HMAC keys in Cloud Storage, see HMAC Keys.
§Example
use cloud_storage::Client;
use cloud_storage::hmac_key::{HmacKey, HmacState};
let client = Client::default();
let key = client.hmac_key().update("your key", HmacState::Inactive).await?; // this is required.
client.hmac_key().delete(&key.access_id).await?;
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for HmacKeyClient<'a>
impl<'a> !RefUnwindSafe for HmacKeyClient<'a>
impl<'a> Send for HmacKeyClient<'a>
impl<'a> Sync for HmacKeyClient<'a>
impl<'a> Unpin for HmacKeyClient<'a>
impl<'a> !UnwindSafe for HmacKeyClient<'a>
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more