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

commonMain.aws.sdk.kotlin.services.route53.model.TrafficPolicySummary.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.route53.model

import aws.smithy.kotlin.runtime.SdkDsl

/**
 * A complex type that contains information about the latest version of one traffic policy that is associated with the current Amazon Web Services account.
 */
public class TrafficPolicySummary private constructor(builder: Builder) {
    /**
     * The ID that Amazon Route 53 assigned to the traffic policy when you created it.
     */
    public val id: kotlin.String = requireNotNull(builder.id) { "A non-null value must be provided for id" }
    /**
     * The version number of the latest version of the traffic policy.
     */
    public val latestVersion: kotlin.Int = requireNotNull(builder.latestVersion) { "A non-null value must be provided for latestVersion" }
    /**
     * The name that you specified for the traffic policy when you created it.
     */
    public val name: kotlin.String = requireNotNull(builder.name) { "A non-null value must be provided for name" }
    /**
     * The number of traffic policies that are associated with the current Amazon Web Services account.
     */
    public val trafficPolicyCount: kotlin.Int = requireNotNull(builder.trafficPolicyCount) { "A non-null value must be provided for trafficPolicyCount" }
    /**
     * The DNS type of the resource record sets that Amazon Route 53 creates when you use a traffic policy to create a traffic policy instance.
     */
    public val type: aws.sdk.kotlin.services.route53.model.RrType = requireNotNull(builder.type) { "A non-null value must be provided for type" }

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

    override fun toString(): kotlin.String = buildString {
        append("TrafficPolicySummary(")
        append("id=$id,")
        append("latestVersion=$latestVersion,")
        append("name=$name,")
        append("trafficPolicyCount=$trafficPolicyCount,")
        append("type=$type")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = id.hashCode()
        result = 31 * result + (latestVersion)
        result = 31 * result + (name.hashCode())
        result = 31 * result + (trafficPolicyCount)
        result = 31 * result + (type.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 TrafficPolicySummary

        if (id != other.id) return false
        if (latestVersion != other.latestVersion) return false
        if (name != other.name) return false
        if (trafficPolicyCount != other.trafficPolicyCount) return false
        if (type != other.type) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * The ID that Amazon Route 53 assigned to the traffic policy when you created it.
         */
        public var id: kotlin.String? = null
        /**
         * The version number of the latest version of the traffic policy.
         */
        public var latestVersion: kotlin.Int? = null
        /**
         * The name that you specified for the traffic policy when you created it.
         */
        public var name: kotlin.String? = null
        /**
         * The number of traffic policies that are associated with the current Amazon Web Services account.
         */
        public var trafficPolicyCount: kotlin.Int? = null
        /**
         * The DNS type of the resource record sets that Amazon Route 53 creates when you use a traffic policy to create a traffic policy instance.
         */
        public var type: aws.sdk.kotlin.services.route53.model.RrType? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.route53.model.TrafficPolicySummary) : this() {
            this.id = x.id
            this.latestVersion = x.latestVersion
            this.name = x.name
            this.trafficPolicyCount = x.trafficPolicyCount
            this.type = x.type
        }

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

        internal fun correctErrors(): Builder {
            if (id == null) id = ""
            if (latestVersion == null) latestVersion = 0
            if (name == null) name = ""
            if (trafficPolicyCount == null) trafficPolicyCount = 0
            if (type == null) type = RrType.SdkUnknown("no value provided")
            return this
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy