Google Cloud Storage C++ Client  2.5.0
A C++ Client Library for Google Cloud Storage
Public Member Functions | Static Public Member Functions | List of all members
google::cloud::storage::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

template<typename... Condition>
static LifecycleRuleCondition ConditionConjunction (Condition &&... condition)
 Combines multiple LifecycleRule conditions using conjunction. More...
 
Creates different types of LifecycleRule actions.
static LifecycleRuleAction Delete ()
 
static LifecycleRuleAction AbortIncompleteMultipartUpload ()
 
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)
 
static LifecycleRuleCondition CreatedBefore (absl::CivilDay date)
 
static LifecycleRuleCondition IsLive (bool value)
 
static LifecycleRuleCondition MatchesStorageClass (std::string storage_class)
 
static LifecycleRuleCondition MatchesStorageClasses (std::initializer_list< std::string > list)
 
template<typename Iterator >
static LifecycleRuleCondition MatchesStorageClasses (Iterator begin, Iterator end)
 
static LifecycleRuleCondition MatchesStorageClassStandard ()
 
static LifecycleRuleCondition MatchesStorageClassMultiRegional ()
 
static LifecycleRuleCondition MatchesStorageClassRegional ()
 
static LifecycleRuleCondition MatchesStorageClassNearline ()
 
static LifecycleRuleCondition MatchesStorageClassColdline ()
 
static LifecycleRuleCondition MatchesStorageClassDurableReducedAvailability ()
 
static LifecycleRuleCondition MatchesStorageClassArchive ()
 
static LifecycleRuleCondition NumNewerVersions (std::int32_t days)
 
static LifecycleRuleCondition DaysSinceNoncurrentTime (std::int32_t days)
 
static LifecycleRuleCondition NoncurrentTimeBefore (absl::CivilDay date)
 
static LifecycleRuleCondition DaysSinceCustomTime (std::int32_t days)
 
static LifecycleRuleCondition CustomTimeBefore (absl::CivilDay date)
 
static LifecycleRuleCondition MatchesPrefix (std::string prefix)
 
static LifecycleRuleCondition MatchesPrefixes (std::initializer_list< std::string > list)
 
static LifecycleRuleCondition MatchesSuffix (std::string suffix)
 
static LifecycleRuleCondition MatchesSuffixes (std::initializer_list< std::string > list)
 

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 127 of file lifecycle_rule.h.

Constructor & Destructor Documentation

◆ LifecycleRule()

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

Definition at line 129 of file lifecycle_rule.h.

Member Function Documentation

◆ AbortIncompleteMultipartUpload()

static LifecycleRuleAction google::cloud::storage::LifecycleRule::AbortIncompleteMultipartUpload ( )
static

◆ action()

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

Definition at line 133 of file lifecycle_rule.h.

◆ condition()

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

Definition at line 134 of file lifecycle_rule.h.

◆ ConditionConjunction()

template<typename... Condition>
static LifecycleRuleCondition google::cloud::storage::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.
LifecycleRuleCondition const & condition() const
static LifecycleRuleCondition ConditionConjunction(Condition &&... condition)
Combines multiple LifecycleRule conditions using conjunction.
static LifecycleRuleCondition MatchesStorageClassStandard()
static LifecycleRuleCondition NumNewerVersions(std::int32_t days)
static LifecycleRuleCondition IsLive(bool value)
static LifecycleRuleCondition MaxAge(std::int32_t days)
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 317 of file lifecycle_rule.h.

◆ CreatedBefore()

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

Definition at line 162 of file lifecycle_rule.h.

◆ CustomTimeBefore()

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

Definition at line 252 of file lifecycle_rule.h.

◆ DaysSinceCustomTime()

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

Definition at line 246 of file lifecycle_rule.h.

◆ DaysSinceNoncurrentTime()

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

Definition at line 234 of file lifecycle_rule.h.

◆ Delete()

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

◆ IsLive()

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

Definition at line 168 of file lifecycle_rule.h.

◆ MatchesPrefix()

static LifecycleRuleCondition google::cloud::storage::LifecycleRule::MatchesPrefix ( std::string  prefix)
inlinestatic

Definition at line 258 of file lifecycle_rule.h.

◆ MatchesPrefixes()

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

Definition at line 266 of file lifecycle_rule.h.

◆ MatchesStorageClass()

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

Definition at line 174 of file lifecycle_rule.h.

◆ MatchesStorageClassArchive()

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

Definition at line 224 of file lifecycle_rule.h.

◆ MatchesStorageClassColdline()

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

Definition at line 215 of file lifecycle_rule.h.

◆ MatchesStorageClassDurableReducedAvailability()

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

Definition at line 220 of file lifecycle_rule.h.

◆ MatchesStorageClasses() [1/2]

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

Definition at line 191 of file lifecycle_rule.h.

◆ MatchesStorageClasses() [2/2]

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

Definition at line 182 of file lifecycle_rule.h.

◆ MatchesStorageClassMultiRegional()

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

Definition at line 203 of file lifecycle_rule.h.

◆ MatchesStorageClassNearline()

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

Definition at line 211 of file lifecycle_rule.h.

◆ MatchesStorageClassRegional()

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

Definition at line 207 of file lifecycle_rule.h.

◆ MatchesStorageClassStandard()

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

Definition at line 199 of file lifecycle_rule.h.

◆ MatchesSuffix()

static LifecycleRuleCondition google::cloud::storage::LifecycleRule::MatchesSuffix ( std::string  suffix)
inlinestatic

Definition at line 274 of file lifecycle_rule.h.

◆ MatchesSuffixes()

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

Definition at line 282 of file lifecycle_rule.h.

◆ MaxAge()

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

Definition at line 156 of file lifecycle_rule.h.

◆ NoncurrentTimeBefore()

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

Definition at line 240 of file lifecycle_rule.h.

◆ NumNewerVersions()

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

Definition at line 228 of file lifecycle_rule.h.

◆ SetStorageClass()

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

◆ SetStorageClassArchive()

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

◆ SetStorageClassColdline()

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

◆ SetStorageClassDurableReducedAvailability()

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

◆ SetStorageClassMultiRegional()

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

◆ SetStorageClassNearline()

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

◆ SetStorageClassRegional()

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

◆ SetStorageClassStandard()

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