Struct cloud_storage::sync::HmacKeyClient[][src]

pub struct HmacKeyClient<'a>(_);
Expand description

Operations on HmacKeys.

Implementations

impl<'a> HmacKeyClient<'a>[src]

pub fn create(&self) -> Result<HmacKey>[src]

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::sync::Client;
use cloud_storage::hmac_key::HmacKey;

let client = Client::new()?;
let hmac_key = client.hmac_key().create()?;

pub fn list(&self) -> Result<Vec<HmacMeta>>[src]

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::sync::Client;
use cloud_storage::hmac_key::HmacKey;

let client = Client::new()?;
let all_hmac_keys = client.hmac_key().list()?;

pub fn read(&self, access_id: &str) -> Result<HmacMeta>[src]

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::sync::Client;
use cloud_storage::hmac_key::HmacKey;

let client = Client::new()?;
let key = client.hmac_key().read("some identifier")?;

pub fn update(&self, access_id: &str, state: HmacState) -> Result<HmacMeta>[src]

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::sync::Client;
use cloud_storage::hmac_key::{HmacKey, HmacState};

let client = Client::new()?;
let key = client.hmac_key().update("your key", HmacState::Active)?;

pub fn delete(&self, access_id: &str) -> Result<()>[src]

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::sync::Client;
use cloud_storage::hmac_key::{HmacKey, HmacState};

let client = Client::new()?;
let key = client.hmac_key().update("your key", HmacState::Inactive)?; // this is required.
client.hmac_key().delete(&key.access_id)?;

Trait Implementations

impl<'a> Debug for HmacKeyClient<'a>[src]

fn fmt(&self, f: &mut Formatter<'_>) -> Result[src]

Formats the value using the given formatter. Read more

Auto Trait Implementations

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

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T> Instrument for T[src]

fn instrument(self, span: Span) -> Instrumented<Self>[src]

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

fn in_current_span(self) -> Instrumented<Self>[src]

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.