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

Methods included from Core::JsonObjectSupport

#to_json

Methods included from Core::Hashable

process_value, #to_h

Constructor Details

#initialize(**args) ⇒ Condition

Returns a new instance of Condition.


311
312
313
# File 'generated/google/apis/storage_v1/classes.rb', line 311

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)

281
282
283
# File 'generated/google/apis/storage_v1/classes.rb', line 281

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)

288
289
290
# File 'generated/google/apis/storage_v1/classes.rb', line 288

def created_before
  @created_before
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)

294
295
296
# File 'generated/google/apis/storage_v1/classes.rb', line 294

def is_live
  @is_live
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, STANDARD, and DURABLE_REDUCED_AVAILABILITY. Corresponds to the JSON property matchesStorageClass

Returns:

  • (Array<String>)

302
303
304
# File 'generated/google/apis/storage_v1/classes.rb', line 302

def matches_storage_class
  @matches_storage_class
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)

309
310
311
# File 'generated/google/apis/storage_v1/classes.rb', line 309

def num_newer_versions
  @num_newer_versions
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object


316
317
318
319
320
321
322
# File 'generated/google/apis/storage_v1/classes.rb', line 316

def update!(**args)
  @age = args[:age] if args.key?(:age)
  @created_before = args[:created_before] if args.key?(:created_before)
  @is_live = args[:is_live] if args.key?(:is_live)
  @matches_storage_class = args[:matches_storage_class] if args.key?(:matches_storage_class)
  @num_newer_versions = args[:num_newer_versions] if args.key?(:num_newer_versions)
end