commonMain.aws.sdk.kotlin.services.evidently.model.Segment.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 contains information about one audience *segment*. You can use segments in your experiments and launches to narrow the user sessions used for experiment or launch to only the user sessions that match one or more criteria.
*/
public class Segment private constructor(builder: Builder) {
/**
* The ARN of the segment.
*/
public val arn: kotlin.String = requireNotNull(builder.arn) { "A non-null value must be provided for arn" }
/**
* The date and time that this segment was created.
*/
public val createdTime: aws.smithy.kotlin.runtime.time.Instant = requireNotNull(builder.createdTime) { "A non-null value must be provided for createdTime" }
/**
* The customer-created description for this segment.
*/
public val description: kotlin.String? = builder.description
/**
* The number of experiments that this segment is used in. This count includes all current experiments, not just those that are currently running.
*/
public val experimentCount: kotlin.Long? = builder.experimentCount
/**
* The date and time that this segment was most recently updated.
*/
public val lastUpdatedTime: aws.smithy.kotlin.runtime.time.Instant = requireNotNull(builder.lastUpdatedTime) { "A non-null value must be provided for lastUpdatedTime" }
/**
* The number of launches that this segment is used in. This count includes all current launches, not just those that are currently running.
*/
public val launchCount: kotlin.Long? = builder.launchCount
/**
* The name of the segment.
*/
public val name: kotlin.String = requireNotNull(builder.name) { "A non-null value must be provided for name" }
/**
* The pattern that defines the attributes to use to evalute whether a user session will be in the segment. For more information about the pattern syntax, see [Segment rule pattern syntax](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-Evidently-segments.html).
*/
public val pattern: kotlin.String = requireNotNull(builder.pattern) { "A non-null value must be provided for pattern" }
/**
* The list of tag keys and values associated with this launch.
*/
public val tags: Map? = builder.tags
public companion object {
public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.evidently.model.Segment = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("Segment(")
append("arn=$arn,")
append("createdTime=$createdTime,")
append("description=$description,")
append("experimentCount=$experimentCount,")
append("lastUpdatedTime=$lastUpdatedTime,")
append("launchCount=$launchCount,")
append("name=$name,")
append("pattern=$pattern,")
append("tags=$tags")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = arn.hashCode()
result = 31 * result + (createdTime.hashCode())
result = 31 * result + (description?.hashCode() ?: 0)
result = 31 * result + (experimentCount?.hashCode() ?: 0)
result = 31 * result + (lastUpdatedTime.hashCode())
result = 31 * result + (launchCount?.hashCode() ?: 0)
result = 31 * result + (name.hashCode())
result = 31 * result + (pattern.hashCode())
result = 31 * result + (tags?.hashCode() ?: 0)
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 Segment
if (arn != other.arn) return false
if (createdTime != other.createdTime) return false
if (description != other.description) return false
if (experimentCount != other.experimentCount) return false
if (lastUpdatedTime != other.lastUpdatedTime) return false
if (launchCount != other.launchCount) return false
if (name != other.name) return false
if (pattern != other.pattern) return false
if (tags != other.tags) return false
return true
}
public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.evidently.model.Segment = Builder(this).apply(block).build()
@SdkDsl
public class Builder {
/**
* The ARN of the segment.
*/
public var arn: kotlin.String? = null
/**
* The date and time that this segment was created.
*/
public var createdTime: aws.smithy.kotlin.runtime.time.Instant? = null
/**
* The customer-created description for this segment.
*/
public var description: kotlin.String? = null
/**
* The number of experiments that this segment is used in. This count includes all current experiments, not just those that are currently running.
*/
public var experimentCount: kotlin.Long? = null
/**
* The date and time that this segment was most recently updated.
*/
public var lastUpdatedTime: aws.smithy.kotlin.runtime.time.Instant? = null
/**
* The number of launches that this segment is used in. This count includes all current launches, not just those that are currently running.
*/
public var launchCount: kotlin.Long? = null
/**
* The name of the segment.
*/
public var name: kotlin.String? = null
/**
* The pattern that defines the attributes to use to evalute whether a user session will be in the segment. For more information about the pattern syntax, see [Segment rule pattern syntax](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-Evidently-segments.html).
*/
public var pattern: kotlin.String? = null
/**
* The list of tag keys and values associated with this launch.
*/
public var tags: Map? = null
@PublishedApi
internal constructor()
@PublishedApi
internal constructor(x: aws.sdk.kotlin.services.evidently.model.Segment) : this() {
this.arn = x.arn
this.createdTime = x.createdTime
this.description = x.description
this.experimentCount = x.experimentCount
this.lastUpdatedTime = x.lastUpdatedTime
this.launchCount = x.launchCount
this.name = x.name
this.pattern = x.pattern
this.tags = x.tags
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.evidently.model.Segment = Segment(this)
internal fun correctErrors(): Builder {
if (arn == null) arn = ""
if (createdTime == null) createdTime = Instant.fromEpochSeconds(0)
if (lastUpdatedTime == null) lastUpdatedTime = Instant.fromEpochSeconds(0)
if (name == null) name = ""
if (pattern == null) pattern = ""
return this
}
}
}