Class CfnSegment
- All Implemented Interfaces:
IInspectable,ITaggable,ISegmentRef,software.amazon.jsii.JsiiSerializable,software.constructs.IConstruct,software.constructs.IDependable
A segment is a portion of your audience that share one or more characteristics. Examples could be Chrome browser users, users in Europe, or Firefox browser users in Europe who also fit other criteria that your application collects, such as age.
Using a segment in an experiment limits that experiment to evaluate only the users who match the segment criteria. Using one or more segments in a launch allow you to define different traffic splits for the different audience segments.
For more information about segment pattern syntax, see Segment rule pattern syntax .
The pattern that you define for a segment is matched against the value of evaluationContext , which is passed into Evidently in the EvaluateFeature operation, when Evidently assigns a feature variation to a user.
Example:
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.evidently.*;
CfnSegment cfnSegment = CfnSegment.Builder.create(this, "MyCfnSegment")
.name("name")
// the properties below are optional
.description("description")
.pattern("pattern")
.tags(List.of(CfnTag.builder()
.key("key")
.value("value")
.build()))
.build();
- See Also:
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationModeNested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.amazon.awscdk.IInspectable
IInspectable.Jsii$Default, IInspectable.Jsii$ProxyNested classes/interfaces inherited from interface software.amazon.awscdk.services.evidently.ISegmentRef
ISegmentRef.Jsii$Default, ISegmentRef.Jsii$ProxyNested classes/interfaces inherited from interface software.amazon.awscdk.ITaggable
ITaggable.Jsii$Default, ITaggable.Jsii$Proxy -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe CloudFormation resource type name for this resource class. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCfnSegment(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedCfnSegment(software.amazon.jsii.JsiiObjectRef objRef) CfnSegment(software.constructs.Construct scope, String id, CfnSegmentProps props) -
Method Summary
Modifier and TypeMethodDescriptionThe ARN of the segment.An optional description for this segment.getName()A name for the segment.The pattern to use for the segment.A reference to a Segment resource.getTags()Tag Manager which manages the tags for this resource.Assigns one or more tags (key-value pairs) to the feature.voidinspect(TreeInspector inspector) Examines the CloudFormation resource and discloses attributes.renderProperties(Map<String, Object> props) voidsetDescription(String value) An optional description for this segment.voidA name for the segment.voidsetPattern(String value) The pattern to use for the segment.voidsetTagsRaw(List<CfnTag> value) Assigns one or more tags (key-value pairs) to the feature.Methods inherited from class software.amazon.awscdk.CfnResource
addDeletionOverride, addDependency, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getAtt, getCfnOptions, getCfnResourceType, getMetadata, getUpdatedProperites, getUpdatedProperties, isCfnResource, obtainDependencies, obtainResourceDependencies, removeDependency, replaceDependency, shouldSynthesize, toString, validatePropertiesMethods inherited from class software.amazon.awscdk.CfnRefElement
getRefMethods inherited from class software.amazon.awscdk.CfnElement
getCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalIdMethods inherited from class software.constructs.Construct
getNode, isConstructMethods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface software.constructs.IConstruct
getNodeMethods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Field Details
-
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
-
-
Constructor Details
-
CfnSegment
protected CfnSegment(software.amazon.jsii.JsiiObjectRef objRef) -
CfnSegment
protected CfnSegment(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
CfnSegment
@Stability(Stable) public CfnSegment(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull CfnSegmentProps props) - Parameters:
scope- Scope in which this resource is defined. This parameter is required.id- Construct identifier for this resource (unique in its scope). This parameter is required.props- Resource properties. This parameter is required.
-
-
Method Details
-
inspect
Examines the CloudFormation resource and discloses attributes.- Specified by:
inspectin interfaceIInspectable- Parameters:
inspector- tree inspector to collect and process attributes. This parameter is required.
-
renderProperties
@Stability(Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String, Object> props) - Overrides:
renderPropertiesin classCfnResource- Parameters:
props- This parameter is required.
-
getAttrArn
The ARN of the segment.For example,
arn:aws:evidently:us-west-2:123456789012:segment/australiaSegment -
getCfnProperties
- Overrides:
getCfnPropertiesin classCfnResource
-
getSegmentRef
A reference to a Segment resource.- Specified by:
getSegmentRefin interfaceISegmentRef
-
getTags
Tag Manager which manages the tags for this resource. -
getName
A name for the segment. -
setName
A name for the segment. -
getDescription
An optional description for this segment. -
setDescription
An optional description for this segment. -
getPattern
The pattern to use for the segment. -
setPattern
The pattern to use for the segment. -
getTagsRaw
Assigns one or more tags (key-value pairs) to the feature. -
setTagsRaw
Assigns one or more tags (key-value pairs) to the feature.
-