Skip to main content

ListKeysRequest

Struct ListKeysRequest 

Source
pub struct ListKeysRequest {
    pub api_id: String,
    pub owner_id: Option<String>,
    pub limit: Option<usize>,
    pub cursor: Option<String>,
    pub revalidate_cache: Option<bool>,
}
Expand description

An outgoing paginated list keys request.

Fields§

§api_id: String

The id of the api to list keys for.

§owner_id: Option<String>

The optional owner id used to filter keys by owner.

§limit: Option<usize>

The optional number of keys to return, up to 100.

§cursor: Option<String>

The pagination cursor indicating the last key that was returned.

§revalidate_cache: Option<bool>

Whether to revalidate the cache for this request.

Implementations§

Source§

impl ListKeysRequest

Source

pub fn new<T: Into<String>>(api_id: T) -> Self

Creates a new list keys request.

§Arguments
  • api_id: The id of the api to list keys for.
§Returns

The new list keys request.

§Example
let r = ListKeysRequest::new("test");

assert_eq!(r.api_id, String::from("test"));
assert_eq!(r.limit, None);
assert_eq!(r.cursor, None);
assert_eq!(r.owner_id, None);
assert_eq!(r.revalidate_cache, None);
Source

pub fn set_limit(self, limit: usize) -> Self

Sets the limit for the request.

§Arguments
  • limit: The limit to set.
§Returns

Self for chained calls.

§Example
let r = ListKeysRequest::new("test").set_limit(50);

assert_eq!(r.limit.unwrap(), 50);
Source

pub fn set_cursor<T: Into<String>>(self, cursor: T) -> Self

Sets the pagination offset for the request.

§Arguments
  • cursor: The pagination offset cursor to set.
§Returns

Self for chained calls.

§Example
let r = ListKeysRequest::new("test").set_cursor("abcabc");

assert_eq!(r.cursor.unwrap(), String::from("abcabc"));
Source

pub fn set_owner_id<T: Into<String>>(self, owner_id: T) -> Self

Sets the owner id for filtering the listed keys by owner.

§Arguments
  • owner_id: The owner id to set.
§Returns

Self for chained calls.

§Example
let r = ListKeysRequest::new("test").set_owner_id("WilfredAlmeida");

assert_eq!(r.owner_id.unwrap(), String::from("WilfredAlmeida"));
Source

pub fn set_revalidate_cache(self, revalidate_cache: bool) -> Self

Sets the flag for revalidating the cache for this request.

§Arguments
  • revalidate_cache: Whether to revalidate the cache with this request.
§Returns

Self for chained calls.

§Example
let r = ListKeysRequest::new("test").set_revalidate_cache(true);

assert_eq!(r.revalidate_cache.unwrap(), true);

Trait Implementations§

Source§

impl Clone for ListKeysRequest

Source§

fn clone(&self) -> ListKeysRequest

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ListKeysRequest

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Serialize for ListKeysRequest

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

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

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

fn in_current_span(self) -> Instrumented<Self>

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

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more