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

commonMain.aws.sdk.kotlin.services.route53.model.GeoLocation.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 information about a geographic location.
 */
public class GeoLocation private constructor(builder: Builder) {
    /**
     * The two-letter code for the continent.
     *
     * Amazon Route 53 supports the following continent codes:
     * + **AF**: Africa
     * + **AN**: Antarctica
     * + **AS**: Asia
     * + **EU**: Europe
     * + **OC**: Oceania
     * + **NA**: North America
     * + **SA**: South America
     *
     * Constraint: Specifying `ContinentCode` with either `CountryCode` or `SubdivisionCode` returns an `InvalidInput` error.
     */
    public val continentCode: kotlin.String? = builder.continentCode
    /**
     * For geolocation resource record sets, the two-letter code for a country.
     *
     * Amazon Route 53 uses the two-letter country codes that are specified in [ISO standard 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2).
     *
     * Route 53 also supports the country code **UA** for Ukraine.
     */
    public val countryCode: kotlin.String? = builder.countryCode
    /**
     * For geolocation resource record sets, the two-letter code for a state of the United States. Route 53 doesn't support any other values for `SubdivisionCode`. For a list of state abbreviations, see [Appendix B: Two–Letter State and Possession Abbreviations](https://pe.usps.com/text/pub28/28apb.htm) on the United States Postal Service website.
     *
     * If you specify `subdivisioncode`, you must also specify `US` for `CountryCode`.
     */
    public val subdivisionCode: kotlin.String? = builder.subdivisionCode

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

    override fun toString(): kotlin.String = buildString {
        append("GeoLocation(")
        append("continentCode=$continentCode,")
        append("countryCode=$countryCode,")
        append("subdivisionCode=$subdivisionCode")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = continentCode?.hashCode() ?: 0
        result = 31 * result + (countryCode?.hashCode() ?: 0)
        result = 31 * result + (subdivisionCode?.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 GeoLocation

        if (continentCode != other.continentCode) return false
        if (countryCode != other.countryCode) return false
        if (subdivisionCode != other.subdivisionCode) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * The two-letter code for the continent.
         *
         * Amazon Route 53 supports the following continent codes:
         * + **AF**: Africa
         * + **AN**: Antarctica
         * + **AS**: Asia
         * + **EU**: Europe
         * + **OC**: Oceania
         * + **NA**: North America
         * + **SA**: South America
         *
         * Constraint: Specifying `ContinentCode` with either `CountryCode` or `SubdivisionCode` returns an `InvalidInput` error.
         */
        public var continentCode: kotlin.String? = null
        /**
         * For geolocation resource record sets, the two-letter code for a country.
         *
         * Amazon Route 53 uses the two-letter country codes that are specified in [ISO standard 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2).
         *
         * Route 53 also supports the country code **UA** for Ukraine.
         */
        public var countryCode: kotlin.String? = null
        /**
         * For geolocation resource record sets, the two-letter code for a state of the United States. Route 53 doesn't support any other values for `SubdivisionCode`. For a list of state abbreviations, see [Appendix B: Two–Letter State and Possession Abbreviations](https://pe.usps.com/text/pub28/28apb.htm) on the United States Postal Service website.
         *
         * If you specify `subdivisioncode`, you must also specify `US` for `CountryCode`.
         */
        public var subdivisionCode: kotlin.String? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.route53.model.GeoLocation) : this() {
            this.continentCode = x.continentCode
            this.countryCode = x.countryCode
            this.subdivisionCode = x.subdivisionCode
        }

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

        internal fun correctErrors(): Builder {
            return this
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy