Class: Google::Apis::StorageV1::Bucket::RetentionPolicy
- Inherits:
- 
      Object
      
        - Object
- Google::Apis::StorageV1::Bucket::RetentionPolicy
 
- 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
Defines the retention policy for a bucket. The Retention policy enforces a minimum retention time for all objects contained in the bucket, based on their creation time. Any attempt to overwrite or delete objects younger than the retention period will result in a PERMISSION_DENIED error. An unlocked retention policy can be modified or removed from the bucket via the UpdateBucketMetadata RPC. A locked retention policy cannot be removed or shortened in duration for the lifetime of the bucket. Attempting to remove or decrease period of a locked retention policy will result in a PERMISSION_DENIED error.
Instance Attribute Summary collapse
- 
  
    
      #effective_time  ⇒ DateTime 
    
    
  
  
  
  
    
    
  
  
  
  
  
  
    The time from which policy was enforced and effective. 
- 
  
    
      #is_locked  ⇒ Boolean 
    
    
      (also: #is_locked?)
    
  
  
  
  
    
    
  
  
  
  
  
  
    Once locked, an object retention policy cannot be modified. 
- 
  
    
      #retention_period  ⇒ Fixnum 
    
    
  
  
  
  
    
    
  
  
  
  
  
  
    Specifies the duration that objects need to be retained. 
Instance Method Summary collapse
- 
  
    
      #initialize(**args)  ⇒ RetentionPolicy 
    
    
  
  
  
    constructor
  
  
  
  
  
  
  
    A new instance of RetentionPolicy. 
- 
  
    
      #update!(**args)  ⇒ Object 
    
    
  
  
  
  
  
  
  
  
  
    Update properties of this object. 
Methods included from Core::JsonObjectSupport
Methods included from Core::Hashable
Constructor Details
#initialize(**args) ⇒ RetentionPolicy
Returns a new instance of RetentionPolicy
| 497 498 499 | # File 'generated/google/apis/storage_v1/classes.rb', line 497 def initialize(**args) update!(**args) end | 
Instance Attribute Details
#effective_time ⇒ DateTime
The time from which policy was enforced and effective. RFC 3339 format.
Corresponds to the JSON property effectiveTime
| 481 482 483 | # File 'generated/google/apis/storage_v1/classes.rb', line 481 def effective_time @effective_time end | 
#is_locked ⇒ Boolean Also known as: is_locked?
Once locked, an object retention policy cannot be modified.
Corresponds to the JSON property isLocked
| 486 487 488 | # File 'generated/google/apis/storage_v1/classes.rb', line 486 def is_locked @is_locked end | 
#retention_period ⇒ Fixnum
Specifies the duration that objects need to be retained. Retention duration
must be greater than zero and less than 100 years. Note that enforcement of
retention periods less than a day is not guaranteed. Such periods should only
be used for testing purposes.
Corresponds to the JSON property retentionPeriod
| 495 496 497 | # File 'generated/google/apis/storage_v1/classes.rb', line 495 def retention_period @retention_period end | 
Instance Method Details
#update!(**args) ⇒ Object
Update properties of this object
| 502 503 504 505 506 | # File 'generated/google/apis/storage_v1/classes.rb', line 502 def update!(**args) @effective_time = args[:effective_time] if args.key?(:effective_time) @is_locked = args[:is_locked] if args.key?(:is_locked) @retention_period = args[:retention_period] if args.key?(:retention_period) end |