commonMain.aws.sdk.kotlin.services.evidently.model.ScheduledSplit.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of evidently-jvm Show documentation
Show all versions of evidently-jvm Show documentation
The AWS SDK for Kotlin client for Evidently
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.evidently.model
import aws.smithy.kotlin.runtime.SdkDsl
import aws.smithy.kotlin.runtime.time.Instant
/**
* This structure defines the traffic allocation percentages among the feature variations during one step of a launch, and the start time of that step.
*/
public class ScheduledSplit private constructor(builder: Builder) {
/**
* The traffic allocation percentages among the feature variations during one step of a launch. This is a set of key-value pairs. The keys are variation names. The values represent the percentage of traffic to allocate to that variation during this step.
*
* The values is expressed in thousandths of a percent, so assigning a weight of 50000 assigns 50% of traffic to that variation.
*
* If the sum of the weights for all the variations in a segment override does not add up to 100,000, then the remaining traffic that matches this segment is not assigned by this segment override, and instead moves on to the next segment override or the default traffic split.
*/
public val groupWeights: Map? = builder.groupWeights
/**
* Use this parameter to specify different traffic splits for one or more audience *segments*. 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.
*
* This parameter is an array of up to six segment override objects. Each of these objects specifies a segment that you have already created, and defines the traffic split for that segment.
*/
public val segmentOverrides: List? = builder.segmentOverrides
/**
* The date and time that this step of the launch starts.
*/
public val startTime: aws.smithy.kotlin.runtime.time.Instant = requireNotNull(builder.startTime) { "A non-null value must be provided for startTime" }
public companion object {
public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.evidently.model.ScheduledSplit = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("ScheduledSplit(")
append("groupWeights=$groupWeights,")
append("segmentOverrides=$segmentOverrides,")
append("startTime=$startTime")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = groupWeights?.hashCode() ?: 0
result = 31 * result + (segmentOverrides?.hashCode() ?: 0)
result = 31 * result + (startTime.hashCode())
return result
}
override fun equals(other: kotlin.Any?): kotlin.Boolean {
if (this === other) return true
if (other == null || this::class != other::class) return false
other as ScheduledSplit
if (groupWeights != other.groupWeights) return false
if (segmentOverrides != other.segmentOverrides) return false
if (startTime != other.startTime) return false
return true
}
public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.evidently.model.ScheduledSplit = Builder(this).apply(block).build()
@SdkDsl
public class Builder {
/**
* The traffic allocation percentages among the feature variations during one step of a launch. This is a set of key-value pairs. The keys are variation names. The values represent the percentage of traffic to allocate to that variation during this step.
*
* The values is expressed in thousandths of a percent, so assigning a weight of 50000 assigns 50% of traffic to that variation.
*
* If the sum of the weights for all the variations in a segment override does not add up to 100,000, then the remaining traffic that matches this segment is not assigned by this segment override, and instead moves on to the next segment override or the default traffic split.
*/
public var groupWeights: Map? = null
/**
* Use this parameter to specify different traffic splits for one or more audience *segments*. 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.
*
* This parameter is an array of up to six segment override objects. Each of these objects specifies a segment that you have already created, and defines the traffic split for that segment.
*/
public var segmentOverrides: List? = null
/**
* The date and time that this step of the launch starts.
*/
public var startTime: aws.smithy.kotlin.runtime.time.Instant? = null
@PublishedApi
internal constructor()
@PublishedApi
internal constructor(x: aws.sdk.kotlin.services.evidently.model.ScheduledSplit) : this() {
this.groupWeights = x.groupWeights
this.segmentOverrides = x.segmentOverrides
this.startTime = x.startTime
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.evidently.model.ScheduledSplit = ScheduledSplit(this)
internal fun correctErrors(): Builder {
if (startTime == null) startTime = Instant.fromEpochSeconds(0)
return this
}
}
}