Class: AWSCDK::EC2::S3DownloadOptions
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::EC2::S3DownloadOptions
- Defined in:
- ec2/s3_download_options.rb
Overview
Options when downloading files from S3.
Instance Attribute Summary collapse
-
#bucket ⇒ AWSCDK::Interfaces::AWSS3::IBucketRef
readonly
Name of the S3 bucket to download from.
-
#bucket_key ⇒ String
readonly
The key of the file to download.
-
#local_file ⇒ String?
readonly
The name of the local file.
-
#region ⇒ String?
readonly
The region of the S3 Bucket (needed for access via VPC Gateway).
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(bucket:, bucket_key:, local_file: nil, region: nil) ⇒ S3DownloadOptions
constructor
A new instance of S3DownloadOptions.
- #to_jsii ⇒ Object
Constructor Details
#initialize(bucket:, bucket_key:, local_file: nil, region: nil) ⇒ S3DownloadOptions
Returns a new instance of S3DownloadOptions.
11 12 13 14 15 16 17 18 19 20 |
# File 'ec2/s3_download_options.rb', line 11 def initialize(bucket:, bucket_key:, local_file: nil, region: nil) @bucket = bucket Jsii::Type.check_type(@bucket, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5pbnRlcmZhY2VzLmF3c19zMy5JQnVja2V0UmVmIn0=")), "bucket") @bucket_key = bucket_key Jsii::Type.check_type(@bucket_key, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "bucketKey") @local_file = local_file Jsii::Type.check_type(@local_file, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "localFile") unless @local_file.nil? @region = region Jsii::Type.check_type(@region, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "region") unless @region.nil? end |
Instance Attribute Details
#bucket ⇒ AWSCDK::Interfaces::AWSS3::IBucketRef (readonly)
Name of the S3 bucket to download from.
25 26 27 |
# File 'ec2/s3_download_options.rb', line 25 def bucket @bucket end |
#bucket_key ⇒ String (readonly)
The key of the file to download.
29 30 31 |
# File 'ec2/s3_download_options.rb', line 29 def bucket_key @bucket_key end |
#local_file ⇒ String? (readonly)
Note:
Default: Linux - /tmp/bucketKey Windows - %TEMP%/bucketKey
The name of the local file.
34 35 36 |
# File 'ec2/s3_download_options.rb', line 34 def local_file @local_file end |
#region ⇒ String? (readonly)
Note:
Default: none
The region of the S3 Bucket (needed for access via VPC Gateway).
39 40 41 |
# File 'ec2/s3_download_options.rb', line 39 def region @region end |
Class Method Details
.jsii_properties ⇒ Object
41 42 43 44 45 46 47 48 |
# File 'ec2/s3_download_options.rb', line 41 def self.jsii_properties { :bucket => "bucket", :bucket_key => "bucketKey", :local_file => "localFile", :region => "region", } end |
Instance Method Details
#to_jsii ⇒ Object
50 51 52 53 54 55 56 57 58 59 |
# File 'ec2/s3_download_options.rb', line 50 def to_jsii result = {} result.merge!({ "bucket" => @bucket, "bucketKey" => @bucket_key, "localFile" => @local_file, "region" => @region, }) result.compact end |