Google Cloud Storage C++ Client  1.32.1
A C++ Client Library for Google Cloud Storage
Public Member Functions | List of all members
google::cloud::storage::v1::LifecycleRule Class Reference

Defines objects to read, create, and modify Object Lifecycle Rules. More...

#include <google/cloud/storage/lifecycle_rule.h>

Public Member Functions

 LifecycleRule (LifecycleRuleCondition condition, LifecycleRuleAction action)
 
LifecycleRuleAction const & action () const
 
LifecycleRuleCondition const & condition () const
 

Static Public Member Functions

Creates different types of LifecycleRule actions.
static LifecycleRuleAction Delete ()
 
static LifecycleRuleAction SetStorageClassStandard ()
 
static LifecycleRuleAction SetStorageClassMultiRegional ()
 
static LifecycleRuleAction SetStorageClassRegional ()
 
static LifecycleRuleAction SetStorageClassNearline ()
 
static LifecycleRuleAction SetStorageClassColdline ()
 
static LifecycleRuleAction SetStorageClassDurableReducedAvailability ()
 
static LifecycleRuleAction SetStorageClassArchive ()
 
static LifecycleRuleAction SetStorageClass (std::string storage_class)
 

Creates different types of LifecycleRule rules.

static LifecycleRuleCondition MaxAge (std::int32_t days)
 Combines multiple LifecycleRule conditions using conjunction. More...
 
static LifecycleRuleCondition CreatedBefore (absl::CivilDay date)
 Combines multiple LifecycleRule conditions using conjunction. More...
 
static LifecycleRuleCondition IsLive (bool value)
 Combines multiple LifecycleRule conditions using conjunction. More...
 
static LifecycleRuleCondition MatchesStorageClass (std::string storage_class)
 Combines multiple LifecycleRule conditions using conjunction. More...
 
static LifecycleRuleCondition MatchesStorageClasses (std::initializer_list< std::string > list)
 Combines multiple LifecycleRule conditions using conjunction. More...
 
template<typename Iterator >
static LifecycleRuleCondition MatchesStorageClasses (Iterator begin, Iterator end)
 Combines multiple LifecycleRule conditions using conjunction. More...
 
static LifecycleRuleCondition MatchesStorageClassStandard ()
 Combines multiple LifecycleRule conditions using conjunction. More...
 
static LifecycleRuleCondition MatchesStorageClassMultiRegional ()
 Combines multiple LifecycleRule conditions using conjunction. More...
 
static LifecycleRuleCondition MatchesStorageClassRegional ()
 Combines multiple LifecycleRule conditions using conjunction. More...
 
static LifecycleRuleCondition MatchesStorageClassNearline ()
 Combines multiple LifecycleRule conditions using conjunction. More...
 
static LifecycleRuleCondition MatchesStorageClassColdline ()
 Combines multiple LifecycleRule conditions using conjunction. More...
 
static LifecycleRuleCondition MatchesStorageClassDurableReducedAvailability ()
 Combines multiple LifecycleRule conditions using conjunction. More...
 
static LifecycleRuleCondition MatchesStorageClassArchive ()
 Combines multiple LifecycleRule conditions using conjunction. More...
 
static LifecycleRuleCondition NumNewerVersions (std::int32_t days)
 Combines multiple LifecycleRule conditions using conjunction. More...
 
static LifecycleRuleCondition DaysSinceNoncurrentTime (std::int32_t days)
 Combines multiple LifecycleRule conditions using conjunction. More...
 
static LifecycleRuleCondition NoncurrentTimeBefore (absl::CivilDay date)
 Combines multiple LifecycleRule conditions using conjunction. More...
 
static LifecycleRuleCondition DaysSinceCustomTime (std::int32_t days)
 Combines multiple LifecycleRule conditions using conjunction. More...
 
static LifecycleRuleCondition CustomTimeBefore (absl::CivilDay date)
 Combines multiple LifecycleRule conditions using conjunction. More...
 
template<typename... Condition>
static LifecycleRuleCondition ConditionConjunction (Condition &&... condition)
 Combines multiple LifecycleRule conditions using conjunction. More...
 

Detailed Description

Defines objects to read, create, and modify Object Lifecycle Rules.

Object Lifecycle Rules allow to configure a Bucket to automatically delete or change the storage class of objects as they go through lifecycle events.

See also
https://cloud.google.com/storage/docs/lifecycle for general information on Object Lifecycle Management in Google Cloud Storage.

Definition at line 147 of file lifecycle_rule.h.

Constructor & Destructor Documentation

◆ LifecycleRule()

google::cloud::storage::v1::LifecycleRule::LifecycleRule ( LifecycleRuleCondition  condition,
LifecycleRuleAction  action 
)
inlineexplicit

Definition at line 149 of file lifecycle_rule.h.

Member Function Documentation

◆ action()

LifecycleRuleAction const& google::cloud::storage::v1::LifecycleRule::action ( ) const
inline

Definition at line 153 of file lifecycle_rule.h.

◆ condition()

LifecycleRuleCondition const& google::cloud::storage::v1::LifecycleRule::condition ( ) const
inline

Definition at line 154 of file lifecycle_rule.h.

◆ ConditionConjunction()

template<typename... Condition>
static LifecycleRuleCondition google::cloud::storage::v1::LifecycleRule::ConditionConjunction ( Condition &&...  condition)
inlinestatic

Combines multiple LifecycleRule conditions using conjunction.

Create a condition that require all the condition parameters to be met to take effect.

Example
// Affect objects that are in the STANDARD storage class, have at
// least 2 new versions, are at least 7 days old, and are alive.
static LifecycleRuleCondition MatchesStorageClassStandard()
Combines multiple LifecycleRule conditions using conjunction.
static LifecycleRuleCondition NumNewerVersions(std::int32_t days)
Combines multiple LifecycleRule conditions using conjunction.
static LifecycleRuleCondition IsLive(bool value)
Combines multiple LifecycleRule conditions using conjunction.
LifecycleRuleCondition const & condition() const
static LifecycleRuleCondition ConditionConjunction(Condition &&... condition)
Combines multiple LifecycleRule conditions using conjunction.
static LifecycleRuleCondition MaxAge(std::int32_t days)
Combines multiple LifecycleRule conditions using conjunction.
Exceptions
std::invalid_argumentif the list of parameters is contradictory, for example, IsLive(true) and IsLive(false) are in the condition list.
Returns
a LifecycleRuleCondition that is satisfied when all the condition conditions are satisfied.
Template Parameters
Conditionthe types of the conditions, they must all be convertible to LifecycleRuleCondition.

Definition at line 304 of file lifecycle_rule.h.

◆ CreatedBefore()

static LifecycleRuleCondition google::cloud::storage::v1::LifecycleRule::CreatedBefore ( absl::CivilDay  date)
inlinestatic

Combines multiple LifecycleRule conditions using conjunction.

Create a condition that require all the condition parameters to be met to take effect.

Example
// Affect objects that are in the STANDARD storage class, have at
// least 2 new versions, are at least 7 days old, and are alive.
Exceptions
std::invalid_argumentif the list of parameters is contradictory, for example, IsLive(true) and IsLive(false) are in the condition list.
Returns
a LifecycleRuleCondition that is satisfied when all the condition conditions are satisfied.
Template Parameters
Conditionthe types of the conditions, they must all be convertible to LifecycleRuleCondition.

Definition at line 181 of file lifecycle_rule.h.

◆ CustomTimeBefore()

static LifecycleRuleCondition google::cloud::storage::v1::LifecycleRule::CustomTimeBefore ( absl::CivilDay  date)
inlinestatic

Combines multiple LifecycleRule conditions using conjunction.

Create a condition that require all the condition parameters to be met to take effect.

Example
// Affect objects that are in the STANDARD storage class, have at
// least 2 new versions, are at least 7 days old, and are alive.
Exceptions
std::invalid_argumentif the list of parameters is contradictory, for example, IsLive(true) and IsLive(false) are in the condition list.
Returns
a LifecycleRuleCondition that is satisfied when all the condition conditions are satisfied.
Template Parameters
Conditionthe types of the conditions, they must all be convertible to LifecycleRuleCondition.

Definition at line 271 of file lifecycle_rule.h.

◆ DaysSinceCustomTime()

static LifecycleRuleCondition google::cloud::storage::v1::LifecycleRule::DaysSinceCustomTime ( std::int32_t  days)
inlinestatic

Combines multiple LifecycleRule conditions using conjunction.

Create a condition that require all the condition parameters to be met to take effect.

Example
// Affect objects that are in the STANDARD storage class, have at
// least 2 new versions, are at least 7 days old, and are alive.
Exceptions
std::invalid_argumentif the list of parameters is contradictory, for example, IsLive(true) and IsLive(false) are in the condition list.
Returns
a LifecycleRuleCondition that is satisfied when all the condition conditions are satisfied.
Template Parameters
Conditionthe types of the conditions, they must all be convertible to LifecycleRuleCondition.

Definition at line 265 of file lifecycle_rule.h.

◆ DaysSinceNoncurrentTime()

static LifecycleRuleCondition google::cloud::storage::v1::LifecycleRule::DaysSinceNoncurrentTime ( std::int32_t  days)
inlinestatic

Combines multiple LifecycleRule conditions using conjunction.

Create a condition that require all the condition parameters to be met to take effect.

Example
// Affect objects that are in the STANDARD storage class, have at
// least 2 new versions, are at least 7 days old, and are alive.
Exceptions
std::invalid_argumentif the list of parameters is contradictory, for example, IsLive(true) and IsLive(false) are in the condition list.
Returns
a LifecycleRuleCondition that is satisfied when all the condition conditions are satisfied.
Template Parameters
Conditionthe types of the conditions, they must all be convertible to LifecycleRuleCondition.

Definition at line 253 of file lifecycle_rule.h.

◆ Delete()

LifecycleRuleAction google::cloud::storage::v1::LifecycleRule::Delete ( )
static

Definition at line 29 of file lifecycle_rule.cc.

◆ IsLive()

static LifecycleRuleCondition google::cloud::storage::v1::LifecycleRule::IsLive ( bool  value)
inlinestatic

Combines multiple LifecycleRule conditions using conjunction.

Create a condition that require all the condition parameters to be met to take effect.

Example
// Affect objects that are in the STANDARD storage class, have at
// least 2 new versions, are at least 7 days old, and are alive.
Exceptions
std::invalid_argumentif the list of parameters is contradictory, for example, IsLive(true) and IsLive(false) are in the condition list.
Returns
a LifecycleRuleCondition that is satisfied when all the condition conditions are satisfied.
Template Parameters
Conditionthe types of the conditions, they must all be convertible to LifecycleRuleCondition.

Definition at line 187 of file lifecycle_rule.h.

◆ MatchesStorageClass()

static LifecycleRuleCondition google::cloud::storage::v1::LifecycleRule::MatchesStorageClass ( std::string  storage_class)
inlinestatic

Combines multiple LifecycleRule conditions using conjunction.

Create a condition that require all the condition parameters to be met to take effect.

Example
// Affect objects that are in the STANDARD storage class, have at
// least 2 new versions, are at least 7 days old, and are alive.
Exceptions
std::invalid_argumentif the list of parameters is contradictory, for example, IsLive(true) and IsLive(false) are in the condition list.
Returns
a LifecycleRuleCondition that is satisfied when all the condition conditions are satisfied.
Template Parameters
Conditionthe types of the conditions, they must all be convertible to LifecycleRuleCondition.

Definition at line 193 of file lifecycle_rule.h.

◆ MatchesStorageClassArchive()

static LifecycleRuleCondition google::cloud::storage::v1::LifecycleRule::MatchesStorageClassArchive ( )
inlinestatic

Combines multiple LifecycleRule conditions using conjunction.

Create a condition that require all the condition parameters to be met to take effect.

Example
// Affect objects that are in the STANDARD storage class, have at
// least 2 new versions, are at least 7 days old, and are alive.
Exceptions
std::invalid_argumentif the list of parameters is contradictory, for example, IsLive(true) and IsLive(false) are in the condition list.
Returns
a LifecycleRuleCondition that is satisfied when all the condition conditions are satisfied.
Template Parameters
Conditionthe types of the conditions, they must all be convertible to LifecycleRuleCondition.

Definition at line 243 of file lifecycle_rule.h.

◆ MatchesStorageClassColdline()

static LifecycleRuleCondition google::cloud::storage::v1::LifecycleRule::MatchesStorageClassColdline ( )
inlinestatic

Combines multiple LifecycleRule conditions using conjunction.

Create a condition that require all the condition parameters to be met to take effect.

Example
// Affect objects that are in the STANDARD storage class, have at
// least 2 new versions, are at least 7 days old, and are alive.
Exceptions
std::invalid_argumentif the list of parameters is contradictory, for example, IsLive(true) and IsLive(false) are in the condition list.
Returns
a LifecycleRuleCondition that is satisfied when all the condition conditions are satisfied.
Template Parameters
Conditionthe types of the conditions, they must all be convertible to LifecycleRuleCondition.

Definition at line 234 of file lifecycle_rule.h.

◆ MatchesStorageClassDurableReducedAvailability()

static LifecycleRuleCondition google::cloud::storage::v1::LifecycleRule::MatchesStorageClassDurableReducedAvailability ( )
inlinestatic

Combines multiple LifecycleRule conditions using conjunction.

Create a condition that require all the condition parameters to be met to take effect.

Example
// Affect objects that are in the STANDARD storage class, have at
// least 2 new versions, are at least 7 days old, and are alive.
Exceptions
std::invalid_argumentif the list of parameters is contradictory, for example, IsLive(true) and IsLive(false) are in the condition list.
Returns
a LifecycleRuleCondition that is satisfied when all the condition conditions are satisfied.
Template Parameters
Conditionthe types of the conditions, they must all be convertible to LifecycleRuleCondition.

Definition at line 239 of file lifecycle_rule.h.

◆ MatchesStorageClasses() [1/2]

template<typename Iterator >
static LifecycleRuleCondition google::cloud::storage::v1::LifecycleRule::MatchesStorageClasses ( Iterator  begin,
Iterator  end 
)
inlinestatic

Combines multiple LifecycleRule conditions using conjunction.

Create a condition that require all the condition parameters to be met to take effect.

Example
// Affect objects that are in the STANDARD storage class, have at
// least 2 new versions, are at least 7 days old, and are alive.
Exceptions
std::invalid_argumentif the list of parameters is contradictory, for example, IsLive(true) and IsLive(false) are in the condition list.
Returns
a LifecycleRuleCondition that is satisfied when all the condition conditions are satisfied.
Template Parameters
Conditionthe types of the conditions, they must all be convertible to LifecycleRuleCondition.

Definition at line 210 of file lifecycle_rule.h.

◆ MatchesStorageClasses() [2/2]

static LifecycleRuleCondition google::cloud::storage::v1::LifecycleRule::MatchesStorageClasses ( std::initializer_list< std::string >  list)
inlinestatic

Combines multiple LifecycleRule conditions using conjunction.

Create a condition that require all the condition parameters to be met to take effect.

Example
// Affect objects that are in the STANDARD storage class, have at
// least 2 new versions, are at least 7 days old, and are alive.
Exceptions
std::invalid_argumentif the list of parameters is contradictory, for example, IsLive(true) and IsLive(false) are in the condition list.
Returns
a LifecycleRuleCondition that is satisfied when all the condition conditions are satisfied.
Template Parameters
Conditionthe types of the conditions, they must all be convertible to LifecycleRuleCondition.

Definition at line 201 of file lifecycle_rule.h.

◆ MatchesStorageClassMultiRegional()

static LifecycleRuleCondition google::cloud::storage::v1::LifecycleRule::MatchesStorageClassMultiRegional ( )
inlinestatic

Combines multiple LifecycleRule conditions using conjunction.

Create a condition that require all the condition parameters to be met to take effect.

Example
// Affect objects that are in the STANDARD storage class, have at
// least 2 new versions, are at least 7 days old, and are alive.
Exceptions
std::invalid_argumentif the list of parameters is contradictory, for example, IsLive(true) and IsLive(false) are in the condition list.
Returns
a LifecycleRuleCondition that is satisfied when all the condition conditions are satisfied.
Template Parameters
Conditionthe types of the conditions, they must all be convertible to LifecycleRuleCondition.

Definition at line 222 of file lifecycle_rule.h.

◆ MatchesStorageClassNearline()

static LifecycleRuleCondition google::cloud::storage::v1::LifecycleRule::MatchesStorageClassNearline ( )
inlinestatic

Combines multiple LifecycleRule conditions using conjunction.

Create a condition that require all the condition parameters to be met to take effect.

Example
// Affect objects that are in the STANDARD storage class, have at
// least 2 new versions, are at least 7 days old, and are alive.
Exceptions
std::invalid_argumentif the list of parameters is contradictory, for example, IsLive(true) and IsLive(false) are in the condition list.
Returns
a LifecycleRuleCondition that is satisfied when all the condition conditions are satisfied.
Template Parameters
Conditionthe types of the conditions, they must all be convertible to LifecycleRuleCondition.

Definition at line 230 of file lifecycle_rule.h.

◆ MatchesStorageClassRegional()

static LifecycleRuleCondition google::cloud::storage::v1::LifecycleRule::MatchesStorageClassRegional ( )
inlinestatic

Combines multiple LifecycleRule conditions using conjunction.

Create a condition that require all the condition parameters to be met to take effect.

Example
// Affect objects that are in the STANDARD storage class, have at
// least 2 new versions, are at least 7 days old, and are alive.
Exceptions
std::invalid_argumentif the list of parameters is contradictory, for example, IsLive(true) and IsLive(false) are in the condition list.
Returns
a LifecycleRuleCondition that is satisfied when all the condition conditions are satisfied.
Template Parameters
Conditionthe types of the conditions, they must all be convertible to LifecycleRuleCondition.

Definition at line 226 of file lifecycle_rule.h.

◆ MatchesStorageClassStandard()

static LifecycleRuleCondition google::cloud::storage::v1::LifecycleRule::MatchesStorageClassStandard ( )
inlinestatic

Combines multiple LifecycleRule conditions using conjunction.

Create a condition that require all the condition parameters to be met to take effect.

Example
// Affect objects that are in the STANDARD storage class, have at
// least 2 new versions, are at least 7 days old, and are alive.
Exceptions
std::invalid_argumentif the list of parameters is contradictory, for example, IsLive(true) and IsLive(false) are in the condition list.
Returns
a LifecycleRuleCondition that is satisfied when all the condition conditions are satisfied.
Template Parameters
Conditionthe types of the conditions, they must all be convertible to LifecycleRuleCondition.

Definition at line 218 of file lifecycle_rule.h.

◆ MaxAge()

static LifecycleRuleCondition google::cloud::storage::v1::LifecycleRule::MaxAge ( std::int32_t  days)
inlinestatic

Combines multiple LifecycleRule conditions using conjunction.

Create a condition that require all the condition parameters to be met to take effect.

Example
// Affect objects that are in the STANDARD storage class, have at
// least 2 new versions, are at least 7 days old, and are alive.
Exceptions
std::invalid_argumentif the list of parameters is contradictory, for example, IsLive(true) and IsLive(false) are in the condition list.
Returns
a LifecycleRuleCondition that is satisfied when all the condition conditions are satisfied.
Template Parameters
Conditionthe types of the conditions, they must all be convertible to LifecycleRuleCondition.

Definition at line 175 of file lifecycle_rule.h.

◆ NoncurrentTimeBefore()

static LifecycleRuleCondition google::cloud::storage::v1::LifecycleRule::NoncurrentTimeBefore ( absl::CivilDay  date)
inlinestatic

Combines multiple LifecycleRule conditions using conjunction.

Create a condition that require all the condition parameters to be met to take effect.

Example
// Affect objects that are in the STANDARD storage class, have at
// least 2 new versions, are at least 7 days old, and are alive.
Exceptions
std::invalid_argumentif the list of parameters is contradictory, for example, IsLive(true) and IsLive(false) are in the condition list.
Returns
a LifecycleRuleCondition that is satisfied when all the condition conditions are satisfied.
Template Parameters
Conditionthe types of the conditions, they must all be convertible to LifecycleRuleCondition.

Definition at line 259 of file lifecycle_rule.h.

◆ NumNewerVersions()

static LifecycleRuleCondition google::cloud::storage::v1::LifecycleRule::NumNewerVersions ( std::int32_t  days)
inlinestatic

Combines multiple LifecycleRule conditions using conjunction.

Create a condition that require all the condition parameters to be met to take effect.

Example
// Affect objects that are in the STANDARD storage class, have at
// least 2 new versions, are at least 7 days old, and are alive.
Exceptions
std::invalid_argumentif the list of parameters is contradictory, for example, IsLive(true) and IsLive(false) are in the condition list.
Returns
a LifecycleRuleCondition that is satisfied when all the condition conditions are satisfied.
Template Parameters
Conditionthe types of the conditions, they must all be convertible to LifecycleRuleCondition.

Definition at line 247 of file lifecycle_rule.h.

◆ SetStorageClass()

LifecycleRuleAction google::cloud::storage::v1::LifecycleRule::SetStorageClass ( std::string  storage_class)
static

Definition at line 61 of file lifecycle_rule.cc.

◆ SetStorageClassArchive()

LifecycleRuleAction google::cloud::storage::v1::LifecycleRule::SetStorageClassArchive ( )
static

Definition at line 57 of file lifecycle_rule.cc.

◆ SetStorageClassColdline()

LifecycleRuleAction google::cloud::storage::v1::LifecycleRule::SetStorageClassColdline ( )
static

Definition at line 49 of file lifecycle_rule.cc.

◆ SetStorageClassDurableReducedAvailability()

LifecycleRuleAction google::cloud::storage::v1::LifecycleRule::SetStorageClassDurableReducedAvailability ( )
static

Definition at line 53 of file lifecycle_rule.cc.

◆ SetStorageClassMultiRegional()

LifecycleRuleAction google::cloud::storage::v1::LifecycleRule::SetStorageClassMultiRegional ( )
static

Definition at line 37 of file lifecycle_rule.cc.

◆ SetStorageClassNearline()

LifecycleRuleAction google::cloud::storage::v1::LifecycleRule::SetStorageClassNearline ( )
static

Definition at line 45 of file lifecycle_rule.cc.

◆ SetStorageClassRegional()

LifecycleRuleAction google::cloud::storage::v1::LifecycleRule::SetStorageClassRegional ( )
static

Definition at line 41 of file lifecycle_rule.cc.

◆ SetStorageClassStandard()

LifecycleRuleAction google::cloud::storage::v1::LifecycleRule::SetStorageClassStandard ( )
static

Definition at line 33 of file lifecycle_rule.cc.