Class: AWSCDK::Synthetics::CodeConfig

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
synthetics/code_config.rb

Overview

Configuration of the code class.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(inline_code: nil, s3_location: nil) ⇒ CodeConfig

Returns a new instance of CodeConfig.

Parameters:

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

    Inline code (mutually exclusive with s3Location).

  • s3_location (AWSCDK::S3::Location, nil) (defaults to: nil)

    The location of the code in S3 (mutually exclusive with inlineCode).



9
10
11
12
13
14
# File 'synthetics/code_config.rb', line 9

def initialize(inline_code: nil, s3_location: nil)
  @inline_code = inline_code
  Jsii::Type.check_type(@inline_code, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "inlineCode") unless @inline_code.nil?
  @s3_location = s3_location.is_a?(Hash) ? ::AWSCDK::S3::Location.new(**s3_location.transform_keys(&:to_sym)) : s3_location
  Jsii::Type.check_type(@s3_location, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfczMuTG9jYXRpb24ifQ==")), "s3Location") unless @s3_location.nil?
end

Instance Attribute Details

#inline_codeString? (readonly)

Note:

Default: - none

Inline code (mutually exclusive with s3Location).

Returns:

  • (String, nil)


20
21
22
# File 'synthetics/code_config.rb', line 20

def inline_code
  @inline_code
end

#s3_locationAWSCDK::S3::Location? (readonly)

Note:

Default: - none

The location of the code in S3 (mutually exclusive with inlineCode).

Returns:



25
26
27
# File 'synthetics/code_config.rb', line 25

def s3_location
  @s3_location
end

Class Method Details

.jsii_propertiesObject



27
28
29
30
31
32
# File 'synthetics/code_config.rb', line 27

def self.jsii_properties
  {
    :inline_code => "inlineCode",
    :s3_location => "s3Location",
  }
end

Instance Method Details

#to_jsiiObject



34
35
36
37
38
39
40
41
# File 'synthetics/code_config.rb', line 34

def to_jsii
  result = {}
  result.merge!({
    "inlineCode" => @inline_code,
    "s3Location" => @s3_location,
  })
  result.compact
end