Class: AWSCDK::CloudAssemblySchema::FeatureFlag

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
cloud_assembly_schema/feature_flag.rb

Overview

A single feature flag.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(explanation: nil, recommended_value: nil, unconfigured_behaves_like: nil, user_value: nil) ⇒ FeatureFlag

Returns a new instance of FeatureFlag.

Parameters:

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

    Explanation about the purpose of this flag that can be shown to the user.

  • recommended_value (Object, nil) (defaults to: nil)

    The library-recommended value for this flag, if any.

  • unconfigured_behaves_like (AWSCDK::CloudAssemblySchema::UnconfiguredBehavesLike, nil) (defaults to: nil)

    The value of the flag that produces the same behavior as when the flag is not configured at all.

  • user_value (Object, nil) (defaults to: nil)

    The value configured by the user.



11
12
13
14
15
16
17
18
19
20
# File 'cloud_assembly_schema/feature_flag.rb', line 11

def initialize(explanation: nil, recommended_value: nil, unconfigured_behaves_like: nil, user_value: nil)
  @explanation = explanation
  Jsii::Type.check_type(@explanation, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "explanation") unless @explanation.nil?
  @recommended_value = recommended_value
  Jsii::Type.check_type(@recommended_value, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJhbnkifQ==")), "recommendedValue") unless @recommended_value.nil?
  @unconfigured_behaves_like = unconfigured_behaves_like.is_a?(Hash) ? ::AWSCDK::CloudAssemblySchema::UnconfiguredBehavesLike.new(**unconfigured_behaves_like.transform_keys(&:to_sym)) : unconfigured_behaves_like
  Jsii::Type.check_type(@unconfigured_behaves_like, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5jbG91ZF9hc3NlbWJseV9zY2hlbWEuVW5jb25maWd1cmVkQmVoYXZlc0xpa2UifQ==")), "unconfiguredBehavesLike") unless @unconfigured_behaves_like.nil?
  @user_value = user_value
  Jsii::Type.check_type(@user_value, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJhbnkifQ==")), "userValue") unless @user_value.nil?
end

Instance Attribute Details

#explanationString? (readonly)

Note:

Default: - No description

Explanation about the purpose of this flag that can be shown to the user.

Returns:

  • (String, nil)


26
27
28
# File 'cloud_assembly_schema/feature_flag.rb', line 26

def explanation
  @explanation
end
Note:

Default: - No recommended value.

The library-recommended value for this flag, if any.

It is possible that there is no recommended value.

Returns:

  • (Object, nil)


33
34
35
# File 'cloud_assembly_schema/feature_flag.rb', line 33

def recommended_value
  @recommended_value
end

#unconfigured_behaves_likeAWSCDK::CloudAssemblySchema::UnconfiguredBehavesLike? (readonly)

Note:

Default: false

The value of the flag that produces the same behavior as when the flag is not configured at all.

The structure of this field is a historical accident. The type of this field should have been boolean, which should have contained the default value for the flag appropriate for the current version of the CDK library. We are not rectifying this accident because doing so

Instead, the canonical way to access this value is by evaluating unconfiguredBehavesLike?.v2 ?? false.



46
47
48
# File 'cloud_assembly_schema/feature_flag.rb', line 46

def unconfigured_behaves_like
  @unconfigured_behaves_like
end

#user_valueObject? (readonly)

Note:

Default: - Not configured by the user

The value configured by the user.

This is the value configured at the root of the tree. Users may also have configured values at specific locations in the tree; we don't report on those.

Returns:

  • (Object, nil)


55
56
57
# File 'cloud_assembly_schema/feature_flag.rb', line 55

def user_value
  @user_value
end

Class Method Details

.jsii_propertiesObject



57
58
59
60
61
62
63
64
# File 'cloud_assembly_schema/feature_flag.rb', line 57

def self.jsii_properties
  {
    :explanation => "explanation",
    :recommended_value => "recommendedValue",
    :unconfigured_behaves_like => "unconfiguredBehavesLike",
    :user_value => "userValue",
  }
end

Instance Method Details

#to_jsiiObject



66
67
68
69
70
71
72
73
74
75
# File 'cloud_assembly_schema/feature_flag.rb', line 66

def to_jsii
  result = {}
  result.merge!({
    "explanation" => @explanation,
    "recommendedValue" => @recommended_value,
    "unconfiguredBehavesLike" => @unconfigured_behaves_like,
    "userValue" => @user_value,
  })
  result.compact
end