Class: AWSCDK::EC2::MultipartBodyOptions

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
ec2/multipart_body_options.rb

Overview

Options when creating MultipartBody.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(content_type:, body: nil, transfer_encoding: nil) ⇒ MultipartBodyOptions

Returns a new instance of MultipartBodyOptions.

Parameters:

  • content_type (String)

    Content-Type header of this part.

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

    The body of message.

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

    Content-Transfer-Encoding header specifying part encoding.



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

def initialize(content_type:, body: nil, transfer_encoding: nil)
  @content_type = content_type
  Jsii::Type.check_type(@content_type, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "contentType")
  @body = body
  Jsii::Type.check_type(@body, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "body") unless @body.nil?
  @transfer_encoding = transfer_encoding
  Jsii::Type.check_type(@transfer_encoding, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "transferEncoding") unless @transfer_encoding.nil?
end

Instance Attribute Details

#bodyString? (readonly)

Note:

Default: undefined - body will not be added to part

The body of message.

Returns:

  • (String, nil)


34
35
36
# File 'ec2/multipart_body_options.rb', line 34

def body
  @body
end

#content_typeString (readonly)

Content-Type header of this part.

Some examples of content types:

  • text/x-shellscript; charset="utf-8" (shell script)
  • text/cloud-boothook; charset="utf-8" (shell script executed during boot phase)

For Linux shell scripts use text/x-shellscript.

Returns:

  • (String)


29
30
31
# File 'ec2/multipart_body_options.rb', line 29

def content_type
  @content_type
end

#transfer_encodingString? (readonly)

Note:

Default: undefined - body is not encoded

Content-Transfer-Encoding header specifying part encoding.

Returns:

  • (String, nil)


39
40
41
# File 'ec2/multipart_body_options.rb', line 39

def transfer_encoding
  @transfer_encoding
end

Class Method Details

.jsii_propertiesObject



41
42
43
44
45
46
47
# File 'ec2/multipart_body_options.rb', line 41

def self.jsii_properties
  {
    :content_type => "contentType",
    :body => "body",
    :transfer_encoding => "transferEncoding",
  }
end

Instance Method Details

#to_jsiiObject



49
50
51
52
53
54
55
56
57
# File 'ec2/multipart_body_options.rb', line 49

def to_jsii
  result = {}
  result.merge!({
    "contentType" => @content_type,
    "body" => @body,
    "transferEncoding" => @transfer_encoding,
  })
  result.compact
end