All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.aws.sdk.kotlin.services.ssmcontacts.model.GetRotationResponse.kt Maven / Gradle / Ivy

// Code generated by smithy-kotlin-codegen. DO NOT EDIT!

package aws.sdk.kotlin.services.ssmcontacts.model

import aws.smithy.kotlin.runtime.SdkDsl
import aws.smithy.kotlin.runtime.time.Instant

public class GetRotationResponse private constructor(builder: Builder) {
    /**
     * The Amazon Resource Names (ARNs) of the contacts assigned to the on-call rotation team.
     */
    public val contactIds: List = requireNotNull(builder.contactIds) { "A non-null value must be provided for contactIds" }
    /**
     * The name of the on-call rotation.
     */
    public val name: kotlin.String = requireNotNull(builder.name) { "A non-null value must be provided for name" }
    /**
     * Specifies how long a rotation lasts before restarting at the beginning of the shift order.
     */
    public val recurrence: aws.sdk.kotlin.services.ssmcontacts.model.RecurrenceSettings? = builder.recurrence
    /**
     * The Amazon Resource Name (ARN) of the on-call rotation.
     */
    public val rotationArn: kotlin.String = requireNotNull(builder.rotationArn) { "A non-null value must be provided for rotationArn" }
    /**
     * The specified start time for the on-call rotation.
     */
    public val startTime: aws.smithy.kotlin.runtime.time.Instant = requireNotNull(builder.startTime) { "A non-null value must be provided for startTime" }
    /**
     * The time zone that the rotation’s activity is based on, in Internet Assigned Numbers Authority (IANA) format.
     */
    public val timeZoneId: kotlin.String = requireNotNull(builder.timeZoneId) { "A non-null value must be provided for timeZoneId" }

    public companion object {
        public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.ssmcontacts.model.GetRotationResponse = Builder().apply(block).build()
    }

    override fun toString(): kotlin.String = buildString {
        append("GetRotationResponse(")
        append("contactIds=$contactIds,")
        append("name=$name,")
        append("recurrence=$recurrence,")
        append("rotationArn=$rotationArn,")
        append("startTime=$startTime,")
        append("timeZoneId=$timeZoneId")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = contactIds.hashCode()
        result = 31 * result + (name.hashCode())
        result = 31 * result + (recurrence?.hashCode() ?: 0)
        result = 31 * result + (rotationArn.hashCode())
        result = 31 * result + (startTime.hashCode())
        result = 31 * result + (timeZoneId.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 GetRotationResponse

        if (contactIds != other.contactIds) return false
        if (name != other.name) return false
        if (recurrence != other.recurrence) return false
        if (rotationArn != other.rotationArn) return false
        if (startTime != other.startTime) return false
        if (timeZoneId != other.timeZoneId) return false

        return true
    }

    public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.ssmcontacts.model.GetRotationResponse = Builder(this).apply(block).build()

    @SdkDsl
    public class Builder {
        /**
         * The Amazon Resource Names (ARNs) of the contacts assigned to the on-call rotation team.
         */
        public var contactIds: List? = null
        /**
         * The name of the on-call rotation.
         */
        public var name: kotlin.String? = null
        /**
         * Specifies how long a rotation lasts before restarting at the beginning of the shift order.
         */
        public var recurrence: aws.sdk.kotlin.services.ssmcontacts.model.RecurrenceSettings? = null
        /**
         * The Amazon Resource Name (ARN) of the on-call rotation.
         */
        public var rotationArn: kotlin.String? = null
        /**
         * The specified start time for the on-call rotation.
         */
        public var startTime: aws.smithy.kotlin.runtime.time.Instant? = null
        /**
         * The time zone that the rotation’s activity is based on, in Internet Assigned Numbers Authority (IANA) format.
         */
        public var timeZoneId: kotlin.String? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.ssmcontacts.model.GetRotationResponse) : this() {
            this.contactIds = x.contactIds
            this.name = x.name
            this.recurrence = x.recurrence
            this.rotationArn = x.rotationArn
            this.startTime = x.startTime
            this.timeZoneId = x.timeZoneId
        }

        @PublishedApi
        internal fun build(): aws.sdk.kotlin.services.ssmcontacts.model.GetRotationResponse = GetRotationResponse(this)

        /**
         * construct an [aws.sdk.kotlin.services.ssmcontacts.model.RecurrenceSettings] inside the given [block]
         */
        public fun recurrence(block: aws.sdk.kotlin.services.ssmcontacts.model.RecurrenceSettings.Builder.() -> kotlin.Unit) {
            this.recurrence = aws.sdk.kotlin.services.ssmcontacts.model.RecurrenceSettings.invoke(block)
        }

        internal fun correctErrors(): Builder {
            if (contactIds == null) contactIds = emptyList()
            if (name == null) name = ""
            if (rotationArn == null) rotationArn = ""
            if (startTime == null) startTime = Instant.fromEpochSeconds(0)
            if (timeZoneId == null) timeZoneId = ""
            return this
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy