Class: AWSCDK::S3::Inventory

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

Overview

Specifies the inventory configuration of an S3 Bucket.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(destination:, enabled: nil, format: nil, frequency: nil, include_object_versions: nil, inventory_id: nil, objects_prefix: nil, optional_fields: nil) ⇒ Inventory

Returns a new instance of Inventory.

Parameters:

  • destination (AWSCDK::S3::InventoryDestination)

    The destination of the inventory.

  • enabled (Boolean, nil) (defaults to: nil)

    Whether the inventory is enabled or disabled.

  • format (AWSCDK::S3::InventoryFormat, nil) (defaults to: nil)

    The format of the inventory.

  • frequency (AWSCDK::S3::InventoryFrequency, nil) (defaults to: nil)

    Frequency at which the inventory should be generated.

  • include_object_versions (AWSCDK::S3::InventoryObjectVersion, nil) (defaults to: nil)

    If the inventory should contain all the object versions or only the current one.

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

    The inventory configuration ID.

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

    The inventory will only include objects that meet the prefix filter criteria.

  • optional_fields (Array<String>, nil) (defaults to: nil)

    A list of optional fields to be included in the inventory result.



17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 's3/inventory.rb', line 17

def initialize(destination:, enabled: nil, format: nil, frequency: nil, include_object_versions: nil, inventory_id: nil, objects_prefix: nil, optional_fields: nil)
  @destination = destination.is_a?(Hash) ? ::AWSCDK::S3::InventoryDestination.new(**destination.transform_keys(&:to_sym)) : destination
  Jsii::Type.check_type(@destination, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfczMuSW52ZW50b3J5RGVzdGluYXRpb24ifQ==")), "destination")
  @enabled = enabled
  Jsii::Type.check_type(@enabled, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "enabled") unless @enabled.nil?
  @format = format
  Jsii::Type.check_type(@format, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfczMuSW52ZW50b3J5Rm9ybWF0In0=")), "format") unless @format.nil?
  @frequency = frequency
  Jsii::Type.check_type(@frequency, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfczMuSW52ZW50b3J5RnJlcXVlbmN5In0=")), "frequency") unless @frequency.nil?
  @include_object_versions = include_object_versions
  Jsii::Type.check_type(@include_object_versions, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfczMuSW52ZW50b3J5T2JqZWN0VmVyc2lvbiJ9")), "includeObjectVersions") unless @include_object_versions.nil?
  @inventory_id = inventory_id
  Jsii::Type.check_type(@inventory_id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "inventoryId") unless @inventory_id.nil?
  @objects_prefix = objects_prefix
  Jsii::Type.check_type(@objects_prefix, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "objectsPrefix") unless @objects_prefix.nil?
  @optional_fields = optional_fields
  Jsii::Type.check_type(@optional_fields, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "optionalFields") unless @optional_fields.nil?
end

Instance Attribute Details

#destinationAWSCDK::S3::InventoryDestination (readonly)

The destination of the inventory.



39
40
41
# File 's3/inventory.rb', line 39

def destination
  @destination
end

#enabledBoolean? (readonly)

Note:

Default: true

Whether the inventory is enabled or disabled.

Returns:

  • (Boolean, nil)


44
45
46
# File 's3/inventory.rb', line 44

def enabled
  @enabled
end

#formatAWSCDK::S3::InventoryFormat? (readonly)

Note:

Default: InventoryFormat.CSV

The format of the inventory.

Returns:



49
50
51
# File 's3/inventory.rb', line 49

def format
  @format
end

#frequencyAWSCDK::S3::InventoryFrequency? (readonly)

Note:

Default: InventoryFrequency.WEEKLY

Frequency at which the inventory should be generated.



54
55
56
# File 's3/inventory.rb', line 54

def frequency
  @frequency
end

#include_object_versionsAWSCDK::S3::InventoryObjectVersion? (readonly)

Note:

Default: InventoryObjectVersion.ALL

If the inventory should contain all the object versions or only the current one.



59
60
61
# File 's3/inventory.rb', line 59

def include_object_versions
  @include_object_versions
end

#inventory_idString? (readonly)

Note:

Default: - generated ID.

The inventory configuration ID.

Should be limited to 64 characters and can only contain letters, numbers, periods, dashes, and underscores.

Returns:

  • (String, nil)


66
67
68
# File 's3/inventory.rb', line 66

def inventory_id
  @inventory_id
end

#objects_prefixString? (readonly)

Note:

Default: - No objects prefix

The inventory will only include objects that meet the prefix filter criteria.

Returns:

  • (String, nil)


71
72
73
# File 's3/inventory.rb', line 71

def objects_prefix
  @objects_prefix
end

#optional_fieldsArray<String>? (readonly)

Note:

Default: - No optional fields.

A list of optional fields to be included in the inventory result.

Returns:

  • (Array<String>, nil)


76
77
78
# File 's3/inventory.rb', line 76

def optional_fields
  @optional_fields
end

Class Method Details

.jsii_propertiesObject



78
79
80
81
82
83
84
85
86
87
88
89
# File 's3/inventory.rb', line 78

def self.jsii_properties
  {
    :destination => "destination",
    :enabled => "enabled",
    :format => "format",
    :frequency => "frequency",
    :include_object_versions => "includeObjectVersions",
    :inventory_id => "inventoryId",
    :objects_prefix => "objectsPrefix",
    :optional_fields => "optionalFields",
  }
end

Instance Method Details

#to_jsiiObject



91
92
93
94
95
96
97
98
99
100
101
102
103
104
# File 's3/inventory.rb', line 91

def to_jsii
  result = {}
  result.merge!({
    "destination" => @destination,
    "enabled" => @enabled,
    "format" => @format,
    "frequency" => @frequency,
    "includeObjectVersions" => @include_object_versions,
    "inventoryId" => @inventory_id,
    "objectsPrefix" => @objects_prefix,
    "optionalFields" => @optional_fields,
  })
  result.compact
end