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

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

There is a newer version: 1.3.76
Show 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 settings for a traffic policy.
 */
public class TrafficPolicy private constructor(builder: Builder) {
    /**
     * The comment that you specify in the `CreateTrafficPolicy` request, if any.
     */
    public val comment: kotlin.String? = builder.comment
    /**
     * The definition of a traffic policy in JSON format. You specify the JSON document to use for a new traffic policy in the `CreateTrafficPolicy` request. For more information about the JSON format, see [Traffic Policy Document Format](https://docs.aws.amazon.com/Route53/latest/APIReference/api-policies-traffic-policy-document-format.html).
     */
    public val document: kotlin.String = requireNotNull(builder.document) { "A non-null value must be provided for document" }
    /**
     * The ID that Amazon Route 53 assigned to a traffic policy when you created it.
     */
    public val id: kotlin.String = requireNotNull(builder.id) { "A non-null value must be provided for id" }
    /**
     * The name that you specified when you created the traffic policy.
     */
    public val name: kotlin.String = requireNotNull(builder.name) { "A non-null value must be provided for name" }
    /**
     * 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" }
    /**
     * The version number that Amazon Route 53 assigns to a traffic policy. For a new traffic policy, the value of `Version` is always 1.
     */
    public val version: kotlin.Int = requireNotNull(builder.version) { "A non-null value must be provided for version" }

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

    override fun toString(): kotlin.String = buildString {
        append("TrafficPolicy(")
        append("comment=$comment,")
        append("document=$document,")
        append("id=$id,")
        append("name=$name,")
        append("type=$type,")
        append("version=$version")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = comment?.hashCode() ?: 0
        result = 31 * result + (document.hashCode())
        result = 31 * result + (id.hashCode())
        result = 31 * result + (name.hashCode())
        result = 31 * result + (type.hashCode())
        result = 31 * result + (version)
        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 TrafficPolicy

        if (comment != other.comment) return false
        if (document != other.document) return false
        if (id != other.id) return false
        if (name != other.name) return false
        if (type != other.type) return false
        if (version != other.version) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * The comment that you specify in the `CreateTrafficPolicy` request, if any.
         */
        public var comment: kotlin.String? = null
        /**
         * The definition of a traffic policy in JSON format. You specify the JSON document to use for a new traffic policy in the `CreateTrafficPolicy` request. For more information about the JSON format, see [Traffic Policy Document Format](https://docs.aws.amazon.com/Route53/latest/APIReference/api-policies-traffic-policy-document-format.html).
         */
        public var document: kotlin.String? = null
        /**
         * The ID that Amazon Route 53 assigned to a traffic policy when you created it.
         */
        public var id: kotlin.String? = null
        /**
         * The name that you specified when you created the traffic policy.
         */
        public var name: kotlin.String? = 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
        /**
         * The version number that Amazon Route 53 assigns to a traffic policy. For a new traffic policy, the value of `Version` is always 1.
         */
        public var version: kotlin.Int? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.route53.model.TrafficPolicy) : this() {
            this.comment = x.comment
            this.document = x.document
            this.id = x.id
            this.name = x.name
            this.type = x.type
            this.version = x.version
        }

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy