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

Inherits:
Object
  • Object
show all
Includes:
Core::Hashable, Core::JsonObjectSupport
Defined in:
generated/google/apis/storage_v1/classes.rb,
generated/google/apis/storage_v1/representations.rb,
generated/google/apis/storage_v1/representations.rb

Overview

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ Condition

Returns a new instance of Condition.



561
562
563
# File 'generated/google/apis/storage_v1/classes.rb', line 561

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#ageFixnum

Age of an object (in days). This condition is satisfied when an object reaches the specified age. Corresponds to the JSON property age

Returns:

  • (Fixnum)


492
493
494
# File 'generated/google/apis/storage_v1/classes.rb', line 492

def age
  @age
end

#created_beforeDate

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

Returns:

  • (Date)


499
500
501
# File 'generated/google/apis/storage_v1/classes.rb', line 499

def created_before
  @created_before
end

#custom_time_beforeDate

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

Returns:

  • (Date)


506
507
508
# File 'generated/google/apis/storage_v1/classes.rb', line 506

def custom_time_before
  @custom_time_before
end

#days_since_custom_timeFixnum

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

Returns:

  • (Fixnum)


513
514
515
# File 'generated/google/apis/storage_v1/classes.rb', line 513

def days_since_custom_time
  @days_since_custom_time
end

#days_since_noncurrent_timeFixnum

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

Returns:

  • (Fixnum)


522
523
524
# File 'generated/google/apis/storage_v1/classes.rb', line 522

def days_since_noncurrent_time
  @days_since_noncurrent_time
end

#is_liveBoolean Also known as: is_live?

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

Returns:

  • (Boolean)


528
529
530
# File 'generated/google/apis/storage_v1/classes.rb', line 528

def is_live
  @is_live
end

#matches_patternString

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

Returns:

  • (String)


538
539
540
# File 'generated/google/apis/storage_v1/classes.rb', line 538

def matches_pattern
  @matches_pattern
end

#matches_storage_classArray<String>

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

Returns:

  • (Array<String>)


545
546
547
# File 'generated/google/apis/storage_v1/classes.rb', line 545

def matches_storage_class
  @matches_storage_class
end

#noncurrent_time_beforeDate

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

Returns:

  • (Date)


552
553
554
# File 'generated/google/apis/storage_v1/classes.rb', line 552

def noncurrent_time_before
  @noncurrent_time_before
end

#num_newer_versionsFixnum

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

Returns:

  • (Fixnum)


559
560
561
# File 'generated/google/apis/storage_v1/classes.rb', line 559

def num_newer_versions
  @num_newer_versions
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



566
567
568
569
570
571
572
573
574
575
576
577
# File 'generated/google/apis/storage_v1/classes.rb', line 566

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