Condition

Struct Condition 

Source
#[non_exhaustive]
pub struct Condition { pub age_days: Option<i32>, pub created_before: Option<Date>, pub is_live: Option<bool>, pub num_newer_versions: Option<i32>, pub matches_storage_class: Vec<String>, pub days_since_custom_time: Option<i32>, pub custom_time_before: Option<Date>, pub days_since_noncurrent_time: Option<i32>, pub noncurrent_time_before: Option<Date>, pub matches_prefix: Vec<String>, pub matches_suffix: Vec<String>, /* private fields */ }
Expand description

A condition of an object which triggers some action.

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§age_days: Option<i32>

Age of an object (in days). This condition is satisfied when an object reaches the specified age. A value of 0 indicates that all objects immediately match this condition.

§created_before: Option<Date>

Optional. This condition is satisfied when an object is created before midnight of the specified date in UTC.

§is_live: Option<bool>

Relevant only for versioned objects. If the value is true, this condition matches live objects; if the value is false, it matches archived objects.

§num_newer_versions: Option<i32>

Relevant only for versioned objects. If the value is N, this condition is satisfied when there are at least N versions (including the live version) newer than this version of the object.

§matches_storage_class: Vec<String>

Optional. Objects having any of the storage classes specified by this condition are matched. Values include MULTI_REGIONAL, REGIONAL, NEARLINE, COLDLINE, STANDARD, and DURABLE_REDUCED_AVAILABILITY.

§days_since_custom_time: Option<i32>

Number of days that have elapsed since the custom timestamp set on an object. The value of the field must be a nonnegative integer.

§custom_time_before: Option<Date>

Optional. An object matches this condition if the custom timestamp set on the object is before the specified date in UTC.

§days_since_noncurrent_time: Option<i32>

This condition is relevant only for versioned objects. An object version satisfies this condition only if these many days have been passed since it became noncurrent. The value of the field must be a nonnegative integer. If it’s zero, the object version becomes eligible for Lifecycle action as soon as it becomes noncurrent.

§noncurrent_time_before: Option<Date>

Optional. This condition is relevant only for versioned objects. An object version satisfies this condition only if it became noncurrent before the specified date in UTC.

§matches_prefix: Vec<String>

Optional. List of object name prefixes. If any prefix exactly matches the beginning of the object name, the condition evaluates to true.

§matches_suffix: Vec<String>

Optional. List of object name suffixes. If any suffix exactly matches the end of the object name, the condition evaluates to true.

Implementations§

Source§

impl Condition

Source

pub fn new() -> Self

Source

pub fn set_age_days<T>(self, v: T) -> Self
where T: Into<i32>,

Sets the value of age_days.

§Example
let x = Condition::new().set_age_days(42);
Source

pub fn set_or_clear_age_days<T>(self, v: Option<T>) -> Self
where T: Into<i32>,

Sets or clears the value of age_days.

§Example
let x = Condition::new().set_or_clear_age_days(Some(42));
let x = Condition::new().set_or_clear_age_days(None::<i32>);
Source

pub fn set_created_before<T>(self, v: T) -> Self
where T: Into<Date>,

Sets the value of created_before.

§Example
use gtype::model::Date;
let x = Condition::new().set_created_before(Date::default()/* use setters */);
Source

pub fn set_or_clear_created_before<T>(self, v: Option<T>) -> Self
where T: Into<Date>,

Sets or clears the value of created_before.

§Example
use gtype::model::Date;
let x = Condition::new().set_or_clear_created_before(Some(Date::default()/* use setters */));
let x = Condition::new().set_or_clear_created_before(None::<Date>);
Source

pub fn set_is_live<T>(self, v: T) -> Self
where T: Into<bool>,

Sets the value of is_live.

§Example
let x = Condition::new().set_is_live(true);
Source

pub fn set_or_clear_is_live<T>(self, v: Option<T>) -> Self
where T: Into<bool>,

Sets or clears the value of is_live.

§Example
let x = Condition::new().set_or_clear_is_live(Some(false));
let x = Condition::new().set_or_clear_is_live(None::<bool>);
Source

pub fn set_num_newer_versions<T>(self, v: T) -> Self
where T: Into<i32>,

Sets the value of num_newer_versions.

§Example
let x = Condition::new().set_num_newer_versions(42);
Source

pub fn set_or_clear_num_newer_versions<T>(self, v: Option<T>) -> Self
where T: Into<i32>,

Sets or clears the value of num_newer_versions.

§Example
let x = Condition::new().set_or_clear_num_newer_versions(Some(42));
let x = Condition::new().set_or_clear_num_newer_versions(None::<i32>);
Source

pub fn set_matches_storage_class<T, V>(self, v: T) -> Self
where T: IntoIterator<Item = V>, V: Into<String>,

Sets the value of matches_storage_class.

§Example
let x = Condition::new().set_matches_storage_class(["a", "b", "c"]);
Source

pub fn set_days_since_custom_time<T>(self, v: T) -> Self
where T: Into<i32>,

Sets the value of days_since_custom_time.

§Example
let x = Condition::new().set_days_since_custom_time(42);
Source

pub fn set_or_clear_days_since_custom_time<T>(self, v: Option<T>) -> Self
where T: Into<i32>,

Sets or clears the value of days_since_custom_time.

§Example
let x = Condition::new().set_or_clear_days_since_custom_time(Some(42));
let x = Condition::new().set_or_clear_days_since_custom_time(None::<i32>);
Source

pub fn set_custom_time_before<T>(self, v: T) -> Self
where T: Into<Date>,

Sets the value of custom_time_before.

§Example
use gtype::model::Date;
let x = Condition::new().set_custom_time_before(Date::default()/* use setters */);
Source

pub fn set_or_clear_custom_time_before<T>(self, v: Option<T>) -> Self
where T: Into<Date>,

Sets or clears the value of custom_time_before.

§Example
use gtype::model::Date;
let x = Condition::new().set_or_clear_custom_time_before(Some(Date::default()/* use setters */));
let x = Condition::new().set_or_clear_custom_time_before(None::<Date>);
Source

pub fn set_days_since_noncurrent_time<T>(self, v: T) -> Self
where T: Into<i32>,

Sets the value of days_since_noncurrent_time.

§Example
let x = Condition::new().set_days_since_noncurrent_time(42);
Source

pub fn set_or_clear_days_since_noncurrent_time<T>(self, v: Option<T>) -> Self
where T: Into<i32>,

Sets or clears the value of days_since_noncurrent_time.

§Example
let x = Condition::new().set_or_clear_days_since_noncurrent_time(Some(42));
let x = Condition::new().set_or_clear_days_since_noncurrent_time(None::<i32>);
Source

pub fn set_noncurrent_time_before<T>(self, v: T) -> Self
where T: Into<Date>,

Sets the value of noncurrent_time_before.

§Example
use gtype::model::Date;
let x = Condition::new().set_noncurrent_time_before(Date::default()/* use setters */);
Source

pub fn set_or_clear_noncurrent_time_before<T>(self, v: Option<T>) -> Self
where T: Into<Date>,

Sets or clears the value of noncurrent_time_before.

§Example
use gtype::model::Date;
let x = Condition::new().set_or_clear_noncurrent_time_before(Some(Date::default()/* use setters */));
let x = Condition::new().set_or_clear_noncurrent_time_before(None::<Date>);
Source

pub fn set_matches_prefix<T, V>(self, v: T) -> Self
where T: IntoIterator<Item = V>, V: Into<String>,

Sets the value of matches_prefix.

§Example
let x = Condition::new().set_matches_prefix(["a", "b", "c"]);
Source

pub fn set_matches_suffix<T, V>(self, v: T) -> Self
where T: IntoIterator<Item = V>, V: Into<String>,

Sets the value of matches_suffix.

§Example
let x = Condition::new().set_matches_suffix(["a", "b", "c"]);

Trait Implementations§

Source§

impl Clone for Condition

Source§

fn clone(&self) -> Condition

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for Condition

Source§

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

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

impl Default for Condition

Source§

fn default() -> Condition

Returns the “default value” for a type. Read more
Source§

impl Message for Condition

Source§

fn typename() -> &'static str

The typename of this message.
Source§

impl PartialEq for Condition

Source§

fn eq(&self, other: &Condition) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for Condition

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> IntoRequest<T> for T

Source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
Source§

impl<L> LayerExt<L> for L

Source§

fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>
where L: Layer<S>,

Applies the layer to a service and wraps it in Layered.
Source§

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

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

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
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,