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

commonMain.aws.sdk.kotlin.services.lightsail.model.AttachCertificateToDistributionRequest.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.lightsail.model

import aws.smithy.kotlin.runtime.SdkDsl

public class AttachCertificateToDistributionRequest private constructor(builder: Builder) {
    /**
     * The name of the certificate to attach to a distribution.
     *
     * Only certificates with a status of `ISSUED` can be attached to a distribution.
     *
     * Use the `GetCertificates` action to get a list of certificate names that you can specify.
     *
     * This is the name of the certificate resource type and is used only to reference the certificate in other API actions. It can be different than the domain name of the certificate. For example, your certificate name might be `WordPress-Blog-Certificate` and the domain name of the certificate might be `example.com`.
     */
    public val certificateName: kotlin.String? = builder.certificateName
    /**
     * The name of the distribution that the certificate will be attached to.
     *
     * Use the `GetDistributions` action to get a list of distribution names that you can specify.
     */
    public val distributionName: kotlin.String? = builder.distributionName

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

    override fun toString(): kotlin.String = buildString {
        append("AttachCertificateToDistributionRequest(")
        append("certificateName=$certificateName,")
        append("distributionName=$distributionName")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = certificateName?.hashCode() ?: 0
        result = 31 * result + (distributionName?.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 AttachCertificateToDistributionRequest

        if (certificateName != other.certificateName) return false
        if (distributionName != other.distributionName) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * The name of the certificate to attach to a distribution.
         *
         * Only certificates with a status of `ISSUED` can be attached to a distribution.
         *
         * Use the `GetCertificates` action to get a list of certificate names that you can specify.
         *
         * This is the name of the certificate resource type and is used only to reference the certificate in other API actions. It can be different than the domain name of the certificate. For example, your certificate name might be `WordPress-Blog-Certificate` and the domain name of the certificate might be `example.com`.
         */
        public var certificateName: kotlin.String? = null
        /**
         * The name of the distribution that the certificate will be attached to.
         *
         * Use the `GetDistributions` action to get a list of distribution names that you can specify.
         */
        public var distributionName: kotlin.String? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.lightsail.model.AttachCertificateToDistributionRequest) : this() {
            this.certificateName = x.certificateName
            this.distributionName = x.distributionName
        }

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy