Class: AWSCDK::AmplifyUIBuilder::CfnForm::FileUploaderFieldConfigProperty

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
amplify_ui_builder/cfn_form.rb

Overview

Describes the configuration for the file uploader field.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(accepted_file_types:, access_level:, is_resumable: nil, max_file_count: nil, max_size: nil, show_thumbnails: nil) ⇒ FileUploaderFieldConfigProperty

Returns a new instance of FileUploaderFieldConfigProperty.

Parameters:

  • accepted_file_types (Array<String>)

    The file types that are allowed to be uploaded by the file uploader.

  • access_level (String)

    The access level to assign to the uploaded files in the Amazon S3 bucket where they are stored.

  • is_resumable (Boolean, AWSCDK::IResolvable, nil) (defaults to: nil)

    Allows the file upload operation to be paused and resumed. The default value is false .

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

    Specifies the maximum number of files that can be selected to upload.

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

    The maximum file size in bytes that the file uploader will accept.

  • show_thumbnails (Boolean, AWSCDK::IResolvable, nil) (defaults to: nil)

    Specifies whether to display or hide the image preview after selecting a file for upload.



1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
# File 'amplify_ui_builder/cfn_form.rb', line 1036

def initialize(accepted_file_types:, access_level:, is_resumable: nil, max_file_count: nil, max_size: nil, show_thumbnails: nil)
  @accepted_file_types = accepted_file_types
  Jsii::Type.check_type(@accepted_file_types, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "acceptedFileTypes")
  @access_level = access_level
  Jsii::Type.check_type(@access_level, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "accessLevel")
  @is_resumable = is_resumable
  Jsii::Type.check_type(@is_resumable, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3sicHJpbWl0aXZlIjoiYm9vbGVhbiJ9LHsiZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifV19fQ==")), "isResumable") unless @is_resumable.nil?
  @max_file_count = max_file_count
  Jsii::Type.check_type(@max_file_count, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "maxFileCount") unless @max_file_count.nil?
  @max_size = max_size
  Jsii::Type.check_type(@max_size, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "maxSize") unless @max_size.nil?
  @show_thumbnails = show_thumbnails
  Jsii::Type.check_type(@show_thumbnails, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3sicHJpbWl0aXZlIjoiYm9vbGVhbiJ9LHsiZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifV19fQ==")), "showThumbnails") unless @show_thumbnails.nil?
end

Instance Attribute Details

#accepted_file_typesArray<String> (readonly)

The file types that are allowed to be uploaded by the file uploader.

Provide this information in an array of strings specifying the valid file extensions.



1057
1058
1059
# File 'amplify_ui_builder/cfn_form.rb', line 1057

def accepted_file_types
  @accepted_file_types
end

#access_levelString (readonly)

The access level to assign to the uploaded files in the Amazon S3 bucket where they are stored.

The valid values for this property are private , protected , or public . For detailed information about the permissions associated with each access level, see File access levels in the Amplify documentation .



1064
1065
1066
# File 'amplify_ui_builder/cfn_form.rb', line 1064

def access_level
  @access_level
end

#is_resumableBoolean, ... (readonly)

Allows the file upload operation to be paused and resumed. The default value is false .

When is_resumable is set to true , the file uploader uses a multipart upload to break the files into chunks before upload. The progress of the upload isn't continuous, because the file uploader uploads a chunk at a time.



1071
1072
1073
# File 'amplify_ui_builder/cfn_form.rb', line 1071

def is_resumable
  @is_resumable
end

#max_file_countNumeric? (readonly)

Specifies the maximum number of files that can be selected to upload.

The default value is an unlimited number of files.



1078
1079
1080
# File 'amplify_ui_builder/cfn_form.rb', line 1078

def max_file_count
  @max_file_count
end

#max_sizeNumeric? (readonly)

The maximum file size in bytes that the file uploader will accept.

The default value is an unlimited file size.



1085
1086
1087
# File 'amplify_ui_builder/cfn_form.rb', line 1085

def max_size
  @max_size
end

#show_thumbnailsBoolean, ... (readonly)

Specifies whether to display or hide the image preview after selecting a file for upload.

The default value is true to display the image preview.



1092
1093
1094
# File 'amplify_ui_builder/cfn_form.rb', line 1092

def show_thumbnails
  @show_thumbnails
end

Class Method Details

.jsii_propertiesObject



1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
# File 'amplify_ui_builder/cfn_form.rb', line 1094

def self.jsii_properties
  {
    :accepted_file_types => "acceptedFileTypes",
    :access_level => "accessLevel",
    :is_resumable => "isResumable",
    :max_file_count => "maxFileCount",
    :max_size => "maxSize",
    :show_thumbnails => "showThumbnails",
  }
end

Instance Method Details

#to_jsiiObject



1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
# File 'amplify_ui_builder/cfn_form.rb', line 1105

def to_jsii
  result = {}
  result.merge!({
    "acceptedFileTypes" => @accepted_file_types,
    "accessLevel" => @access_level,
    "isResumable" => @is_resumable,
    "maxFileCount" => @max_file_count,
    "maxSize" => @max_size,
    "showThumbnails" => @show_thumbnails,
  })
  result.compact
end