Class: AWSCDK::S3::CfnBucket::DefaultRetentionProperty

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
s3/cfn_bucket.rb

Overview

The container element for optionally specifying the default Object Lock retention settings for new objects placed in the specified bucket.

  • The DefaultRetention settings require both a mode and a period.
  • The DefaultRetention period can be either Days or Years but you must select one. You cannot specify Days and Years at the same time.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(days: nil, mode: nil, years: nil) ⇒ DefaultRetentionProperty

Returns a new instance of DefaultRetentionProperty.

Parameters:

  • days (Numeric, nil) (defaults to: nil)

    The number of days that you want to specify for the default retention period.

  • mode (String, nil) (defaults to: nil)

    The default Object Lock retention mode you want to apply to new objects placed in the specified bucket.

  • years (Numeric, nil) (defaults to: nil)

    The number of years that you want to specify for the default retention period.



1491
1492
1493
1494
1495
1496
1497
1498
# File 's3/cfn_bucket.rb', line 1491

def initialize(days: nil, mode: nil, years: nil)
  @days = days
  Jsii::Type.check_type(@days, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "days") unless @days.nil?
  @mode = mode
  Jsii::Type.check_type(@mode, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "mode") unless @mode.nil?
  @years = years
  Jsii::Type.check_type(@years, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "years") unless @years.nil?
end

Instance Attribute Details

#daysNumeric? (readonly)

The number of days that you want to specify for the default retention period.

If Object Lock is turned on, you must specify Mode and specify either Days or Years .



1506
1507
1508
# File 's3/cfn_bucket.rb', line 1506

def days
  @days
end

#modeString? (readonly)

The default Object Lock retention mode you want to apply to new objects placed in the specified bucket.

If Object Lock is turned on, you must specify Mode and specify either Days or Years .



1513
1514
1515
# File 's3/cfn_bucket.rb', line 1513

def mode
  @mode
end

#yearsNumeric? (readonly)

The number of years that you want to specify for the default retention period.

If Object Lock is turned on, you must specify Mode and specify either Days or Years .



1520
1521
1522
# File 's3/cfn_bucket.rb', line 1520

def years
  @years
end

Class Method Details

.jsii_propertiesObject



1522
1523
1524
1525
1526
1527
1528
# File 's3/cfn_bucket.rb', line 1522

def self.jsii_properties
  {
    :days => "days",
    :mode => "mode",
    :years => "years",
  }
end

Instance Method Details

#to_jsiiObject



1530
1531
1532
1533
1534
1535
1536
1537
1538
# File 's3/cfn_bucket.rb', line 1530

def to_jsii
  result = {}
  result.merge!({
    "days" => @days,
    "mode" => @mode,
    "years" => @years,
  })
  result.compact
end