Class: AWSCDK::ResolveOptions

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
resolve_options.rb

Overview

Options to the resolve() operation.

NOT the same as the ResolveContext; ResolveContext is exposed to Token implementors and resolution hooks, whereas this struct is just to bundle a number of things that would otherwise be arguments to resolve() in a readable way.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(resolver:, scope:, preparing: nil, remove_empty: nil) ⇒ ResolveOptions

Returns a new instance of ResolveOptions.

Parameters:

  • resolver (AWSCDK::ITokenResolver)

    The resolver to apply to any resolvable tokens found.

  • scope (Constructs::IConstruct)

    The scope from which resolution is performed.

  • preparing (Boolean, nil) (defaults to: nil)

    Whether the resolution is being executed during the prepare phase or not.

  • remove_empty (Boolean, nil) (defaults to: nil)

    Whether to remove undefined elements from arrays and objects when resolving.



16
17
18
19
20
21
22
23
24
25
# File 'resolve_options.rb', line 16

def initialize(resolver:, scope:, preparing: nil, remove_empty: nil)
  @resolver = resolver
  Jsii::Type.check_type(@resolver, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5JVG9rZW5SZXNvbHZlciJ9")), "resolver")
  @scope = scope
  Jsii::Type.check_type(@scope, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJjb25zdHJ1Y3RzLklDb25zdHJ1Y3QifQ==")), "scope")
  @preparing = preparing
  Jsii::Type.check_type(@preparing, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "preparing") unless @preparing.nil?
  @remove_empty = remove_empty
  Jsii::Type.check_type(@remove_empty, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "removeEmpty") unless @remove_empty.nil?
end

Instance Attribute Details

#preparingBoolean? (readonly)

Note:

Default: false

Whether the resolution is being executed during the prepare phase or not.

Returns:

  • (Boolean, nil)


39
40
41
# File 'resolve_options.rb', line 39

def preparing
  @preparing
end

#remove_emptyBoolean? (readonly)

Note:

Default: true

Whether to remove undefined elements from arrays and objects when resolving.

Returns:

  • (Boolean, nil)


44
45
46
# File 'resolve_options.rb', line 44

def remove_empty
  @remove_empty
end

#resolverAWSCDK::ITokenResolver (readonly)

The resolver to apply to any resolvable tokens found.



30
31
32
# File 'resolve_options.rb', line 30

def resolver
  @resolver
end

#scopeConstructs::IConstruct (readonly)

The scope from which resolution is performed.

Returns:

  • (Constructs::IConstruct)


34
35
36
# File 'resolve_options.rb', line 34

def scope
  @scope
end

Class Method Details

.jsii_propertiesObject



46
47
48
49
50
51
52
53
# File 'resolve_options.rb', line 46

def self.jsii_properties
  {
    :resolver => "resolver",
    :scope => "scope",
    :preparing => "preparing",
    :remove_empty => "removeEmpty",
  }
end

Instance Method Details

#to_jsiiObject



55
56
57
58
59
60
61
62
63
64
# File 'resolve_options.rb', line 55

def to_jsii
  result = {}
  result.merge!({
    "resolver" => @resolver,
    "scope" => @scope,
    "preparing" => @preparing,
    "removeEmpty" => @remove_empty,
  })
  result.compact
end