Class: AWSCDK::S3::Location

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

Overview

An interface that represents the location of a specific object in an S3 Bucket.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(bucket_name:, object_key:, object_version: nil) ⇒ Location

Returns a new instance of Location.

Parameters:

  • bucket_name (String)

    The name of the S3 Bucket the object is in.

  • object_key (String)

    The path inside the Bucket where the object is located at.

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

    The S3 object version.



10
11
12
13
14
15
16
17
# File 's3/location.rb', line 10

def initialize(bucket_name:, object_key:, object_version: nil)
  @bucket_name = bucket_name
  Jsii::Type.check_type(@bucket_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "bucketName")
  @object_key = object_key
  Jsii::Type.check_type(@object_key, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "objectKey")
  @object_version = object_version
  Jsii::Type.check_type(@object_version, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "objectVersion") unless @object_version.nil?
end

Instance Attribute Details

#bucket_nameString (readonly)

The name of the S3 Bucket the object is in.

Returns:

  • (String)


22
23
24
# File 's3/location.rb', line 22

def bucket_name
  @bucket_name
end

#object_keyString (readonly)

The path inside the Bucket where the object is located at.

Returns:

  • (String)


26
27
28
# File 's3/location.rb', line 26

def object_key
  @object_key
end

#object_versionString? (readonly)

The S3 object version.

Returns:

  • (String, nil)


30
31
32
# File 's3/location.rb', line 30

def object_version
  @object_version
end

Class Method Details

.jsii_propertiesObject



32
33
34
35
36
37
38
# File 's3/location.rb', line 32

def self.jsii_properties
  {
    :bucket_name => "bucketName",
    :object_key => "objectKey",
    :object_version => "objectVersion",
  }
end

Instance Method Details

#to_jsiiObject



40
41
42
43
44
45
46
47
48
# File 's3/location.rb', line 40

def to_jsii
  result = {}
  result.merge!({
    "bucketName" => @bucket_name,
    "objectKey" => @object_key,
    "objectVersion" => @object_version,
  })
  result.compact
end