Class: AWSCDK::CloudAssemblySchema::FeatureFlag
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::CloudAssemblySchema::FeatureFlag
- Defined in:
- cloud_assembly_schema/feature_flag.rb
Overview
A single feature flag.
Instance Attribute Summary collapse
-
#explanation ⇒ String?
readonly
Explanation about the purpose of this flag that can be shown to the user.
-
#recommended_value ⇒ Object?
readonly
The library-recommended value for this flag, if any.
-
#unconfigured_behaves_like ⇒ AWSCDK::CloudAssemblySchema::UnconfiguredBehavesLike?
readonly
The value of the flag that produces the same behavior as when the flag is not configured at all.
-
#user_value ⇒ Object?
readonly
The value configured by the user.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(explanation: nil, recommended_value: nil, unconfigured_behaves_like: nil, user_value: nil) ⇒ FeatureFlag
constructor
A new instance of FeatureFlag.
- #to_jsii ⇒ Object
Constructor Details
#initialize(explanation: nil, recommended_value: nil, unconfigured_behaves_like: nil, user_value: nil) ⇒ FeatureFlag
Returns a new instance of FeatureFlag.
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
#explanation ⇒ String? (readonly)
Default: - No description
Explanation about the purpose of this flag that can be shown to the user.
26 27 28 |
# File 'cloud_assembly_schema/feature_flag.rb', line 26 def explanation @explanation end |
#recommended_value ⇒ Object? (readonly)
Default: - No recommended value.
The library-recommended value for this flag, if any.
It is possible that there is no recommended value.
33 34 35 |
# File 'cloud_assembly_schema/feature_flag.rb', line 33 def recommended_value @recommended_value end |
#unconfigured_behaves_like ⇒ AWSCDK::CloudAssemblySchema::UnconfiguredBehavesLike? (readonly)
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_value ⇒ Object? (readonly)
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.
55 56 57 |
# File 'cloud_assembly_schema/feature_flag.rb', line 55 def user_value @user_value end |
Class Method Details
.jsii_properties ⇒ Object
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_jsii ⇒ Object
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 |