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-03-21 UTC."],[[["This page details the `LifecycleRule` class, which is used to manage Object Lifecycle Rules in Google Cloud Storage, allowing for automatic deletion or storage class changes based on lifecycle events."],["The `LifecycleRule` class offers constructors and various static functions to create different types of actions, such as `Delete()`, `AbortIncompleteMultipartUpload()`, and `SetStorageClassXXX()` methods."],["There are many static functions available for generating diverse rule conditions, such as `MaxAge()`, `CreatedBefore()`, `IsLive()`, `MatchesStorageClass()`, and various other criteria that specify when a rule is triggered."],["The `ConditionConjunction` function allows for combining multiple conditions into one, which requires all sub-conditions to be met before the rule's actions are executed, with an error thrown if the conditions are contradictory."],["The documentations spans many versions of the service from `2.37.0-rc` down to version `2.11.0`, all referencing the same Class with version `2.27.0` as the main version."]]],[]]