class Google::Apis::StorageV1::Bucket::Lifecycle::Rule::Condition

The condition(s) under which the action will be taken.

Attributes

age[RW]

Age of an object (in days). This condition is satisfied when an object reaches the specified age. Corresponds to the JSON property `age` @return [Fixnum]

created_before[RW]

A date in RFC 3339 format with only the date part (for instance, “2013-01-15”). This condition is satisfied when an object is created before midnight of the specified date in UTC. Corresponds to the JSON property `createdBefore` @return [Date]

custom_time_before[RW]

A date in RFC 3339 format with only the date part (for instance, “2013-01-15”). This condition is satisfied when the custom time on an object is before this date in UTC. Corresponds to the JSON property `customTimeBefore` @return [Date]

days_since_custom_time[RW]

Number of days elapsed since the user-specified timestamp set on an object. The condition is satisfied if the days elapsed is at least this number. If no custom timestamp is specified on an object, the condition does not apply. Corresponds to the JSON property `daysSinceCustomTime` @return [Fixnum]

days_since_noncurrent_time[RW]

Number of days elapsed since the noncurrent timestamp of an object. The condition is satisfied if the days elapsed is at least this number. This condition is relevant only for versioned objects. The value of the field must be a nonnegative integer. If it's zero, the object version will become eligible for Lifecycle action as soon as it becomes noncurrent. Corresponds to the JSON property `daysSinceNoncurrentTime` @return [Fixnum]

is_live[RW]

Relevant only for versioned objects. If the value is true, this condition matches live objects; if the value is false, it matches archived objects. Corresponds to the JSON property `isLive` @return [Boolean]

is_live?[RW]

Relevant only for versioned objects. If the value is true, this condition matches live objects; if the value is false, it matches archived objects. Corresponds to the JSON property `isLive` @return [Boolean]

matches_pattern[RW]

A regular expression that satisfies the RE2 syntax. This condition is satisfied when the name of the object matches the RE2 pattern. Note: This feature is currently in the “Early Access” launch stage and is only available to a whitelisted set of users; that means that this feature may be changed in backward-incompatible ways and that it is not guaranteed to be released. Corresponds to the JSON property `matchesPattern` @return [String]

matches_storage_class[RW]

Objects having any of the storage classes specified by this condition will be matched. Values include MULTI_REGIONAL, REGIONAL, NEARLINE, COLDLINE, ARCHIVE, STANDARD, and DURABLE_REDUCED_AVAILABILITY. Corresponds to the JSON property `matchesStorageClass` @return [Array<String>]

noncurrent_time_before[RW]

A date in RFC 3339 format with only the date part (for instance, “2013-01-15”). This condition is satisfied when the noncurrent time on an object is before this date in UTC. This condition is relevant only for versioned objects. Corresponds to the JSON property `noncurrentTimeBefore` @return [Date]

num_newer_versions[RW]

Relevant only for versioned objects. If the value is N, this condition is satisfied when there are at least N versions (including the live version) newer than this version of the object. Corresponds to the JSON property `numNewerVersions` @return [Fixnum]

Public Class Methods

new(**args) click to toggle source
# File lib/google/apis/storage_v1/classes.rb, line 568
def initialize(**args)
   update!(**args)
end

Public Instance Methods

update!(**args) click to toggle source

Update properties of this object

# File lib/google/apis/storage_v1/classes.rb, line 573
def update!(**args)
  @age = args[:age] if args.key?(:age)
  @created_before = args[:created_before] if args.key?(:created_before)
  @custom_time_before = args[:custom_time_before] if args.key?(:custom_time_before)
  @days_since_custom_time = args[:days_since_custom_time] if args.key?(:days_since_custom_time)
  @days_since_noncurrent_time = args[:days_since_noncurrent_time] if args.key?(:days_since_noncurrent_time)
  @is_live = args[:is_live] if args.key?(:is_live)
  @matches_pattern = args[:matches_pattern] if args.key?(:matches_pattern)
  @matches_storage_class = args[:matches_storage_class] if args.key?(:matches_storage_class)
  @noncurrent_time_before = args[:noncurrent_time_before] if args.key?(:noncurrent_time_before)
  @num_newer_versions = args[:num_newer_versions] if args.key?(:num_newer_versions)
end