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 condition = LifecycleRule::ConditionConjunction(
LifecycleRule::NumNewerVersions(2),
LifecycleRule::MatchesStorageClassStandard(),
LifecycleRule::MaxAge(7), LifecycleRule::IsLive(true));
Parameters
Name
Description
condition
Condition &&...
typename...
Exceptions
Type
Description
std::invalid_argument
if the list of parameters is contradictory, for example, `IsLive(true)` and `IsLive(false)` are in the `condition` list.
Returns
Type
Description
LifecycleRuleCondition
a LifecycleRuleCondition that is satisfied when all the condition conditions are satisfied.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-04-01 UTC."],[[["This page details the `LifecycleRule` class within the Google Cloud Storage C++ library, which defines rules for managing object lifecycles in storage buckets."],["Object Lifecycle Rules automate actions like deletion or storage class changes of objects based on specified lifecycle events."],["The library provides a wide range of static functions to define `LifecycleRuleAction` and `LifecycleRuleCondition`, such as setting storage classes (e.g., Standard, Nearline, Coldline), or defining conditions based on object age, creation date, or storage class."],["`ConditionConjunction` allows combining multiple conditions to create complex rules that are only met when all sub-conditions are met, providing more granular control over lifecycle management."],["The latest version documented is 2.37.0-rc and there are multiple other versions from 2.11.0 onward that are available for review."]]],[]]