Google Cloud Storage C++ Client 2.13.0
A C++ Client Library for Google Cloud Storage
Loading...
Searching...
No Matches
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.

Constructor & Destructor Documentation

◆ LifecycleRule()

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

Member Function Documentation

◆ AbortIncompleteMultipartUpload()

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

◆ action()

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

◆ condition()

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

◆ 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
Definition: lifecycle_rule.h:134
static LifecycleRuleCondition ConditionConjunction(Condition &&... condition)
Combines multiple LifecycleRule conditions using conjunction.
Definition: lifecycle_rule.h:317
static LifecycleRuleCondition MatchesStorageClassStandard()
Definition: lifecycle_rule.h:199
static LifecycleRuleCondition NumNewerVersions(std::int32_t days)
Definition: lifecycle_rule.h:228
static LifecycleRuleCondition IsLive(bool value)
Definition: lifecycle_rule.h:168
static LifecycleRuleCondition MaxAge(std::int32_t days)
Definition: lifecycle_rule.h:156
Implement a wrapper for Lifecycle Conditions.
Definition: lifecycle_rule.h:76
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.

◆ CreatedBefore()

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

◆ CustomTimeBefore()

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

◆ DaysSinceCustomTime()

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

◆ DaysSinceNoncurrentTime()

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

◆ Delete()

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

◆ IsLive()

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

◆ MatchesPrefix()

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

◆ MatchesPrefixes()

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

◆ MatchesStorageClass()

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

◆ MatchesStorageClassArchive()

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

◆ MatchesStorageClassColdline()

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

◆ MatchesStorageClassDurableReducedAvailability()

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

◆ MatchesStorageClasses() [1/2]

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

◆ MatchesStorageClasses() [2/2]

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

◆ MatchesStorageClassMultiRegional()

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

◆ MatchesStorageClassNearline()

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

◆ MatchesStorageClassRegional()

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

◆ MatchesStorageClassStandard()

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

◆ MatchesSuffix()

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

◆ MatchesSuffixes()

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

◆ MaxAge()

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

◆ NoncurrentTimeBefore()

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

◆ NumNewerVersions()

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

◆ 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