Class: AWSCDK::Evidently::CfnExperimentProps

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

Overview

Properties for defining a CfnExperiment.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(metric_goals:, name:, online_ab_config:, project:, treatments:, description: nil, randomization_salt: nil, remove_segment: nil, running_status: nil, sampling_rate: nil, segment: nil, tags: nil) ⇒ CfnExperimentProps

Returns a new instance of CfnExperimentProps.

Parameters:



21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# File 'evidently/cfn_experiment_props.rb', line 21

def initialize(metric_goals:, name:, online_ab_config:, project:, treatments:, description: nil, randomization_salt: nil, remove_segment: nil, running_status: nil, sampling_rate: nil, segment: nil, tags: nil)
  @metric_goals = metric_goals
  Jsii::Type.check_type(@metric_goals, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImNvbGxlY3Rpb24iOnsiZWxlbWVudHR5cGUiOnsidW5pb24iOnsidHlwZXMiOlt7ImZxbiI6ImF3cy1jZGstbGliLklSZXNvbHZhYmxlIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZXZpZGVudGx5LkNmbkV4cGVyaW1lbnQuTWV0cmljR29hbE9iamVjdFByb3BlcnR5In1dfX0sImtpbmQiOiJhcnJheSJ9fV19fQ==")), "metricGoals")
  @name = name
  Jsii::Type.check_type(@name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "name")
  @online_ab_config = online_ab_config.is_a?(Hash) ? ::AWSCDK::Evidently::CfnExperiment::OnlineAbConfigObjectProperty.new(**online_ab_config.transform_keys(&:to_sym)) : online_ab_config
  Jsii::Type.check_type(@online_ab_config, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19ldmlkZW50bHkuQ2ZuRXhwZXJpbWVudC5PbmxpbmVBYkNvbmZpZ09iamVjdFByb3BlcnR5In1dfX0=")), "onlineAbConfig")
  @project = project
  Jsii::Type.check_type(@project, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "project")
  @treatments = treatments
  Jsii::Type.check_type(@treatments, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImNvbGxlY3Rpb24iOnsiZWxlbWVudHR5cGUiOnsidW5pb24iOnsidHlwZXMiOlt7ImZxbiI6ImF3cy1jZGstbGliLklSZXNvbHZhYmxlIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZXZpZGVudGx5LkNmbkV4cGVyaW1lbnQuVHJlYXRtZW50T2JqZWN0UHJvcGVydHkifV19fSwia2luZCI6ImFycmF5In19XX19")), "treatments")
  @description = description
  Jsii::Type.check_type(@description, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "description") unless @description.nil?
  @randomization_salt = randomization_salt
  Jsii::Type.check_type(@randomization_salt, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "randomizationSalt") unless @randomization_salt.nil?
  @remove_segment = remove_segment
  Jsii::Type.check_type(@remove_segment, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3sicHJpbWl0aXZlIjoiYm9vbGVhbiJ9LHsiZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifV19fQ==")), "removeSegment") unless @remove_segment.nil?
  @running_status = running_status.is_a?(Hash) ? ::AWSCDK::Evidently::CfnExperiment::RunningStatusObjectProperty.new(**running_status.transform_keys(&:to_sym)) : running_status
  Jsii::Type.check_type(@running_status, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19ldmlkZW50bHkuQ2ZuRXhwZXJpbWVudC5SdW5uaW5nU3RhdHVzT2JqZWN0UHJvcGVydHkifV19fQ==")), "runningStatus") unless @running_status.nil?
  @sampling_rate = sampling_rate
  Jsii::Type.check_type(@sampling_rate, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "samplingRate") unless @sampling_rate.nil?
  @segment = segment
  Jsii::Type.check_type(@segment, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "segment") unless @segment.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

#descriptionString? (readonly)

An optional description of the experiment.



81
82
83
# File 'evidently/cfn_experiment_props.rb', line 81

def description
  @description
end

#metric_goalsAWSCDK::IResolvable, Array<AWSCDK::IResolvable, AWSCDK::Evidently::CfnExperiment::MetricGoalObjectProperty> (readonly)

An array of structures that defines the metrics used for the experiment, and whether a higher or lower value for each metric is the goal.

You can use up to three metrics in an experiment.



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

def metric_goals
  @metric_goals
end

#nameString (readonly)

A name for the new experiment.



59
60
61
# File 'evidently/cfn_experiment_props.rb', line 59

def name
  @name
end

#online_ab_configAWSCDK::IResolvable, AWSCDK::Evidently::CfnExperiment::OnlineAbConfigObjectProperty (readonly)

A structure that contains the configuration of which variation to use as the "control" version.

The "control" version is used for comparison with other variations. This structure also specifies how much experiment traffic is allocated to each variation.



66
67
68
# File 'evidently/cfn_experiment_props.rb', line 66

def online_ab_config
  @online_ab_config
end

#projectString (readonly)

The name or the ARN of the project where this experiment is to be created.



71
72
73
# File 'evidently/cfn_experiment_props.rb', line 71

def project
  @project
end

#randomization_saltString? (readonly)

When Evidently assigns a particular user session to an experiment, it must use a randomization ID to determine which variation the user session is served.

This randomization ID is a combination of the entity ID and randomization_salt . If you omit randomization_salt , Evidently uses the experiment name as the randomization_salt .



88
89
90
# File 'evidently/cfn_experiment_props.rb', line 88

def randomization_salt
  @randomization_salt
end

#remove_segmentBoolean, ... (readonly)

Set this to true to remove the segment that is associated with this experiment.

You can't use this parameter if the experiment is currently running.



95
96
97
# File 'evidently/cfn_experiment_props.rb', line 95

def remove_segment
  @remove_segment
end

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

A structure that you can use to start and stop the experiment.



100
101
102
# File 'evidently/cfn_experiment_props.rb', line 100

def running_status
  @running_status
end

#sampling_rateNumeric? (readonly)

The portion of the available audience that you want to allocate to this experiment, in thousandths of a percent.

The available audience is the total audience minus the audience that you have allocated to overrides or current launches of this feature.

This is represented in thousandths of a percent. For example, specify 10,000 to allocate 10% of the available audience.



109
110
111
# File 'evidently/cfn_experiment_props.rb', line 109

def sampling_rate
  @sampling_rate
end

#segmentString? (readonly)

Specifies an audience segment to use in the experiment.

When a segment is used in an experiment, only user sessions that match the segment pattern are used in the experiment.

For more information, see Segment rule pattern syntax .



118
119
120
# File 'evidently/cfn_experiment_props.rb', line 118

def segment
  @segment
end

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

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

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 an experiment.

For more information, see Tagging AWS resources .



131
132
133
# File 'evidently/cfn_experiment_props.rb', line 131

def tags
  @tags
end

#treatmentsAWSCDK::IResolvable, Array<AWSCDK::IResolvable, AWSCDK::Evidently::CfnExperiment::TreatmentObjectProperty> (readonly)

An array of structures that describe the configuration of each feature variation used in the experiment.



76
77
78
# File 'evidently/cfn_experiment_props.rb', line 76

def treatments
  @treatments
end

Class Method Details

.jsii_propertiesObject



133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
# File 'evidently/cfn_experiment_props.rb', line 133

def self.jsii_properties
  {
    :metric_goals => "metricGoals",
    :name => "name",
    :online_ab_config => "onlineAbConfig",
    :project => "project",
    :treatments => "treatments",
    :description => "description",
    :randomization_salt => "randomizationSalt",
    :remove_segment => "removeSegment",
    :running_status => "runningStatus",
    :sampling_rate => "samplingRate",
    :segment => "segment",
    :tags => "tags",
  }
end

Instance Method Details

#to_jsiiObject



150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
# File 'evidently/cfn_experiment_props.rb', line 150

def to_jsii
  result = {}
  result.merge!({
    "metricGoals" => @metric_goals,
    "name" => @name,
    "onlineAbConfig" => @online_ab_config,
    "project" => @project,
    "treatments" => @treatments,
    "description" => @description,
    "randomizationSalt" => @randomization_salt,
    "removeSegment" => @remove_segment,
    "runningStatus" => @running_status,
    "samplingRate" => @sampling_rate,
    "segment" => @segment,
    "tags" => @tags,
  })
  result.compact
end