Class: AWSCDK::S3::Filter

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

Overview

A filter that identifies the subset of objects to which the replication rule applies.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(prefix: nil, tags: nil) ⇒ Filter

Returns a new instance of Filter.

Parameters:

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

    An object key name prefix that identifies the object or objects to which the rule applies.

  • tags (Array<AWSCDK::S3::Tag>, nil) (defaults to: nil)

    The tag array used for tag filters.



9
10
11
12
13
14
# File 's3/filter.rb', line 9

def initialize(prefix: nil, tags: nil)
  @prefix = prefix
  Jsii::Type.check_type(@prefix, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "prefix") unless @prefix.nil?
  @tags = tags.is_a?(Array) ? tags.map { |jsii_v0| jsii_v0.is_a?(Hash) ? ::AWSCDK::S3::Tag.new(**jsii_v0.transform_keys(&:to_sym)) : jsii_v0 } : tags
  Jsii::Type.check_type(@tags, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19zMy5UYWcifSwia2luZCI6ImFycmF5In19")), "tags") unless @tags.nil?
end

Instance Attribute Details

#prefixString? (readonly)

Note:

Default: - applies to all objects

An object key name prefix that identifies the object or objects to which the rule applies.

Returns:

  • (String, nil)


20
21
22
# File 's3/filter.rb', line 20

def prefix
  @prefix
end

#tagsArray<AWSCDK::S3::Tag>? (readonly)

Note:

Default: - applies to all objects

The tag array used for tag filters.

The rule applies only to objects that have the tag in this set.

Returns:



27
28
29
# File 's3/filter.rb', line 27

def tags
  @tags
end

Class Method Details

.jsii_propertiesObject



29
30
31
32
33
34
# File 's3/filter.rb', line 29

def self.jsii_properties
  {
    :prefix => "prefix",
    :tags => "tags",
  }
end

Instance Method Details

#to_jsiiObject



36
37
38
39
40
41
42
43
# File 's3/filter.rb', line 36

def to_jsii
  result = {}
  result.merge!({
    "prefix" => @prefix,
    "tags" => @tags,
  })
  result.compact
end