Class: Google::Apis::StorageV1::Bucket::Lifecycle::Rule::Condition
- Inherits:
-
Object
- Object
- Google::Apis::StorageV1::Bucket::Lifecycle::Rule::Condition
- Includes:
- Core::Hashable, Core::JsonObjectSupport
- Defined in:
- lib/google/apis/storage_v1/classes.rb,
lib/google/apis/storage_v1/representations.rb,
lib/google/apis/storage_v1/representations.rb
Overview
The condition(s) under which the action will be taken.
Instance Attribute Summary collapse
-
#age ⇒ Fixnum
Age of an object (in days).
-
#created_before ⇒ Date
A date in RFC 3339 format with only the date part (for instance, "2013-01-15").
-
#custom_time_before ⇒ Date
A date in RFC 3339 format with only the date part (for instance, "2013-01-15").
-
#days_since_custom_time ⇒ Fixnum
Number of days elapsed since the user-specified timestamp set on an object.
-
#days_since_noncurrent_time ⇒ Fixnum
Number of days elapsed since the noncurrent timestamp of an object.
-
#is_live ⇒ Boolean
(also: #is_live?)
Relevant only for versioned objects.
-
#matches_pattern ⇒ String
A regular expression that satisfies the RE2 syntax.
-
#matches_prefix ⇒ Array<String>
List of object name prefixes.
-
#matches_storage_class ⇒ Array<String>
Objects having any of the storage classes specified by this condition will be matched.
-
#matches_suffix ⇒ Array<String>
List of object name suffixes.
-
#noncurrent_time_before ⇒ Date
A date in RFC 3339 format with only the date part (for instance, "2013-01-15").
-
#num_newer_versions ⇒ Fixnum
Relevant only for versioned objects.
Instance Method Summary collapse
-
#initialize(**args) ⇒ Condition
constructor
A new instance of Condition.
-
#update!(**args) ⇒ Object
Update properties of this object.
Constructor Details
#initialize(**args) ⇒ Condition
Returns a new instance of Condition.
926 927 928 |
# File 'lib/google/apis/storage_v1/classes.rb', line 926 def initialize(**args) update!(**args) end |
Instance Attribute Details
#age ⇒ Fixnum
Age of an object (in days). This condition is satisfied when an object reaches
the specified age.
Corresponds to the JSON property age
845 846 847 |
# File 'lib/google/apis/storage_v1/classes.rb', line 845 def age @age end |
#created_before ⇒ Date
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
852 853 854 |
# File 'lib/google/apis/storage_v1/classes.rb', line 852 def created_before @created_before end |
#custom_time_before ⇒ Date
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
859 860 861 |
# File 'lib/google/apis/storage_v1/classes.rb', line 859 def custom_time_before @custom_time_before end |
#days_since_custom_time ⇒ Fixnum
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
866 867 868 |
# File 'lib/google/apis/storage_v1/classes.rb', line 866 def days_since_custom_time @days_since_custom_time end |
#days_since_noncurrent_time ⇒ Fixnum
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
875 876 877 |
# File 'lib/google/apis/storage_v1/classes.rb', line 875 def days_since_noncurrent_time @days_since_noncurrent_time end |
#is_live ⇒ Boolean 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
881 882 883 |
# File 'lib/google/apis/storage_v1/classes.rb', line 881 def is_live @is_live end |
#matches_pattern ⇒ String
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
891 892 893 |
# File 'lib/google/apis/storage_v1/classes.rb', line 891 def matches_pattern @matches_pattern end |
#matches_prefix ⇒ Array<String>
List of object name prefixes. This condition will be satisfied when at least
one of the prefixes exactly matches the beginning of the object name.
Corresponds to the JSON property matchesPrefix
897 898 899 |
# File 'lib/google/apis/storage_v1/classes.rb', line 897 def matches_prefix @matches_prefix end |
#matches_storage_class ⇒ Array<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
904 905 906 |
# File 'lib/google/apis/storage_v1/classes.rb', line 904 def matches_storage_class @matches_storage_class end |
#matches_suffix ⇒ Array<String>
List of object name suffixes. This condition will be satisfied when at least
one of the suffixes exactly matches the end of the object name.
Corresponds to the JSON property matchesSuffix
910 911 912 |
# File 'lib/google/apis/storage_v1/classes.rb', line 910 def matches_suffix @matches_suffix end |
#noncurrent_time_before ⇒ Date
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
917 918 919 |
# File 'lib/google/apis/storage_v1/classes.rb', line 917 def noncurrent_time_before @noncurrent_time_before end |
#num_newer_versions ⇒ Fixnum
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
924 925 926 |
# File 'lib/google/apis/storage_v1/classes.rb', line 924 def num_newer_versions @num_newer_versions end |
Instance Method Details
#update!(**args) ⇒ Object
Update properties of this object
931 932 933 934 935 936 937 938 939 940 941 942 943 944 |
# File 'lib/google/apis/storage_v1/classes.rb', line 931 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_prefix = args[:matches_prefix] if args.key?(:matches_prefix) @matches_storage_class = args[:matches_storage_class] if args.key?(:matches_storage_class) @matches_suffix = args[:matches_suffix] if args.key?(:matches_suffix) @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 |