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

aws.sdk.kotlin.services.connect.model.SecurityKey.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.connect.model

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

/**
 * Configuration information of the security key.
 */
class SecurityKey private constructor(builder: BuilderImpl) {
    /**
     * The existing association identifier that uniquely identifies the resource type and storage config for the given instance ID.
     */
    val associationId: String? = builder.associationId
    /**
     * When the security key was created.
     */
    val creationTime: Instant? = builder.creationTime
    /**
     * The key of the security key.
     */
    val key: String? = builder.key

    companion object {
        @JvmStatic
        fun fluentBuilder(): FluentBuilder = BuilderImpl()

        internal fun builder(): DslBuilder = BuilderImpl()

        operator fun invoke(block: DslBuilder.() -> kotlin.Unit): SecurityKey = BuilderImpl().apply(block).build()

    }

    override fun toString(): kotlin.String = buildString {
        append("SecurityKey(")
        append("associationId=$associationId,")
        append("creationTime=$creationTime,")
        append("key=$key)")
    }

    override fun hashCode(): kotlin.Int {
        var result = associationId?.hashCode() ?: 0
        result = 31 * result + (creationTime?.hashCode() ?: 0)
        result = 31 * result + (key?.hashCode() ?: 0)
        return result
    }

    override fun equals(other: kotlin.Any?): kotlin.Boolean {
        if (this === other) return true
        if (javaClass != other?.javaClass) return false

        other as SecurityKey

        if (associationId != other.associationId) return false
        if (creationTime != other.creationTime) return false
        if (key != other.key) return false

        return true
    }

    fun copy(block: DslBuilder.() -> kotlin.Unit = {}): SecurityKey = BuilderImpl(this).apply(block).build()

    interface FluentBuilder {
        fun build(): SecurityKey
        /**
         * The existing association identifier that uniquely identifies the resource type and storage config for the given instance ID.
         */
        fun associationId(associationId: String): FluentBuilder
        /**
         * When the security key was created.
         */
        fun creationTime(creationTime: Instant): FluentBuilder
        /**
         * The key of the security key.
         */
        fun key(key: String): FluentBuilder
    }

    interface DslBuilder {
        /**
         * The existing association identifier that uniquely identifies the resource type and storage config for the given instance ID.
         */
        var associationId: String?
        /**
         * When the security key was created.
         */
        var creationTime: Instant?
        /**
         * The key of the security key.
         */
        var key: String?

        fun build(): SecurityKey
    }

    private class BuilderImpl() : FluentBuilder, DslBuilder {
        override var associationId: String? = null
        override var creationTime: Instant? = null
        override var key: String? = null

        constructor(x: SecurityKey) : this() {
            this.associationId = x.associationId
            this.creationTime = x.creationTime
            this.key = x.key
        }

        override fun build(): SecurityKey = SecurityKey(this)
        override fun associationId(associationId: String): FluentBuilder = apply { this.associationId = associationId }
        override fun creationTime(creationTime: Instant): FluentBuilder = apply { this.creationTime = creationTime }
        override fun key(key: String): FluentBuilder = apply { this.key = key }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy