Class: AWSCDK::Evidently::CfnFeatureProps

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
evidently/cfn_feature_props.rb

Overview

Properties for defining a CfnFeature.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name:, project:, variations:, default_variation: nil, description: nil, entity_overrides: nil, evaluation_strategy: nil, tags: nil) ⇒ CfnFeatureProps

Returns a new instance of CfnFeatureProps.

Parameters:



17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'evidently/cfn_feature_props.rb', line 17

def initialize(name:, project:, variations:, default_variation: nil, description: nil, entity_overrides: nil, evaluation_strategy: nil, tags: nil)
  @name = name
  Jsii::Type.check_type(@name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "name")
  @project = project
  Jsii::Type.check_type(@project, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3sicHJpbWl0aXZlIjoic3RyaW5nIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5pbnRlcmZhY2VzLmF3c19ldmlkZW50bHkuSVByb2plY3RSZWYifV19fQ==")), "project")
  @variations = variations
  Jsii::Type.check_type(@variations, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImNvbGxlY3Rpb24iOnsiZWxlbWVudHR5cGUiOnsidW5pb24iOnsidHlwZXMiOlt7ImZxbiI6ImF3cy1jZGstbGliLklSZXNvbHZhYmxlIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZXZpZGVudGx5LkNmbkZlYXR1cmUuVmFyaWF0aW9uT2JqZWN0UHJvcGVydHkifV19fSwia2luZCI6ImFycmF5In19XX19")), "variations")
  @default_variation = default_variation
  Jsii::Type.check_type(@default_variation, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "defaultVariation") unless @default_variation.nil?
  @description = description
  Jsii::Type.check_type(@description, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "description") unless @description.nil?
  @entity_overrides = entity_overrides
  Jsii::Type.check_type(@entity_overrides, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImNvbGxlY3Rpb24iOnsiZWxlbWVudHR5cGUiOnsidW5pb24iOnsidHlwZXMiOlt7ImZxbiI6ImF3cy1jZGstbGliLklSZXNvbHZhYmxlIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZXZpZGVudGx5LkNmbkZlYXR1cmUuRW50aXR5T3ZlcnJpZGVQcm9wZXJ0eSJ9XX19LCJraW5kIjoiYXJyYXkifX1dfX0=")), "entityOverrides") unless @entity_overrides.nil?
  @evaluation_strategy = evaluation_strategy
  Jsii::Type.check_type(@evaluation_strategy, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "evaluationStrategy") unless @evaluation_strategy.nil?
  @tags = tags.is_a?(Array) ? tags.map { |jsii_v0| jsii_v0.is_a?(Hash) ? ::AWSCDK::CfnTag.new(**jsii_v0.transform_keys(&:to_sym)) : jsii_v0 } : tags
  Jsii::Type.check_type(@tags, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLkNmblRhZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "tags") unless @tags.nil?
end

Instance Attribute Details

#default_variationString? (readonly)

The name of the variation to use as the default variation.

The default variation is served to users who are not allocated to any ongoing launches or experiments of this feature.

This variation must also be listed in the Variations structure.

If you omit DefaultVariation , the first variation listed in the Variations structure is used as the default variation.



65
66
67
# File 'evidently/cfn_feature_props.rb', line 65

def default_variation
  @default_variation
end

#descriptionString? (readonly)

An optional description of the feature.



70
71
72
# File 'evidently/cfn_feature_props.rb', line 70

def description
  @description
end

#entity_overridesAWSCDK::IResolvable, ... (readonly)

Specify users that should always be served a specific variation of a feature.

Each user is specified by a key-value pair . For each key, specify a user by entering their user ID, account ID, or some other identifier. For the value, specify the name of the variation that they are to be served.



77
78
79
# File 'evidently/cfn_feature_props.rb', line 77

def entity_overrides
  @entity_overrides
end

#evaluation_strategyString? (readonly)

Specify ALL_RULES to activate the traffic allocation specified by any ongoing launches or experiments.

Specify DEFAULT_VARIATION to serve the default variation to all users instead.



84
85
86
# File 'evidently/cfn_feature_props.rb', line 84

def evaluation_strategy
  @evaluation_strategy
end

#nameString (readonly)

The name for the feature.

It can include up to 127 characters.



42
43
44
# File 'evidently/cfn_feature_props.rb', line 42

def name
  @name
end

#projectString, AWSCDK::Interfaces::AWSEvidently::IProjectRef (readonly)

The name or ARN of the project that is to contain the new feature.



47
48
49
# File 'evidently/cfn_feature_props.rb', line 47

def project
  @project
end

#tagsArray<AWSCDK::CfnTag>? (readonly)

Assigns one or more tags (key-value pairs) to the feature.

Tags can help you organize and categorize your resources. You can also use them to scope user permissions by granting a user permission to access or change only resources with certain tag values.

Tags don't have any semantic meaning to AWS and are interpreted strictly as strings of characters.

You can associate as many as 50 tags with a feature.

For more information, see Tagging AWS resources .



97
98
99
# File 'evidently/cfn_feature_props.rb', line 97

def tags
  @tags
end

#variationsAWSCDK::IResolvable, Array<AWSCDK::IResolvable, AWSCDK::Evidently::CfnFeature::VariationObjectProperty> (readonly)

An array of structures that contain the configuration of the feature's different variations.

Each VariationObject in the Variations array for a feature must have the same type of value ( BooleanValue , DoubleValue , LongValue or StringValue ).



54
55
56
# File 'evidently/cfn_feature_props.rb', line 54

def variations
  @variations
end

Class Method Details

.jsii_propertiesObject



99
100
101
102
103
104
105
106
107
108
109
110
# File 'evidently/cfn_feature_props.rb', line 99

def self.jsii_properties
  {
    :name => "name",
    :project => "project",
    :variations => "variations",
    :default_variation => "defaultVariation",
    :description => "description",
    :entity_overrides => "entityOverrides",
    :evaluation_strategy => "evaluationStrategy",
    :tags => "tags",
  }
end

Instance Method Details

#to_jsiiObject



112
113
114
115
116
117
118
119
120
121
122
123
124
125
# File 'evidently/cfn_feature_props.rb', line 112

def to_jsii
  result = {}
  result.merge!({
    "name" => @name,
    "project" => @project,
    "variations" => @variations,
    "defaultVariation" => @default_variation,
    "description" => @description,
    "entityOverrides" => @entity_overrides,
    "evaluationStrategy" => @evaluation_strategy,
    "tags" => @tags,
  })
  result.compact
end