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

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

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

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



public class CreateKeyPairResponse private constructor(builder: Builder) {
    /**
     * An array of key-value pairs containing information about the new key pair you just created.
     */
    public val keyPair: aws.sdk.kotlin.services.lightsail.model.KeyPair? = builder.keyPair
    /**
     * An array of objects that describe the result of the action, such as the status of the request, the timestamp of the request, and the resources affected by the request.
     */
    public val operation: aws.sdk.kotlin.services.lightsail.model.Operation? = builder.operation
    /**
     * A base64-encoded RSA private key.
     */
    public val privateKeyBase64: kotlin.String? = builder.privateKeyBase64
    /**
     * A base64-encoded public key of the `ssh-rsa` type.
     */
    public val publicKeyBase64: kotlin.String? = builder.publicKeyBase64

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

    override fun toString(): kotlin.String = buildString {
        append("CreateKeyPairResponse(")
        append("keyPair=$keyPair,")
        append("operation=$operation,")
        append("privateKeyBase64=$privateKeyBase64,")
        append("publicKeyBase64=$publicKeyBase64")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = keyPair?.hashCode() ?: 0
        result = 31 * result + (operation?.hashCode() ?: 0)
        result = 31 * result + (privateKeyBase64?.hashCode() ?: 0)
        result = 31 * result + (publicKeyBase64?.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 CreateKeyPairResponse

        if (keyPair != other.keyPair) return false
        if (operation != other.operation) return false
        if (privateKeyBase64 != other.privateKeyBase64) return false
        if (publicKeyBase64 != other.publicKeyBase64) return false

        return true
    }

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

    public class Builder {
        /**
         * An array of key-value pairs containing information about the new key pair you just created.
         */
        public var keyPair: aws.sdk.kotlin.services.lightsail.model.KeyPair? = null
        /**
         * An array of objects that describe the result of the action, such as the status of the request, the timestamp of the request, and the resources affected by the request.
         */
        public var operation: aws.sdk.kotlin.services.lightsail.model.Operation? = null
        /**
         * A base64-encoded RSA private key.
         */
        public var privateKeyBase64: kotlin.String? = null
        /**
         * A base64-encoded public key of the `ssh-rsa` type.
         */
        public var publicKeyBase64: kotlin.String? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.lightsail.model.CreateKeyPairResponse) : this() {
            this.keyPair = x.keyPair
            this.operation = x.operation
            this.privateKeyBase64 = x.privateKeyBase64
            this.publicKeyBase64 = x.publicKeyBase64
        }

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

        /**
         * construct an [aws.sdk.kotlin.services.lightsail.model.KeyPair] inside the given [block]
         */
        public fun keyPair(block: aws.sdk.kotlin.services.lightsail.model.KeyPair.Builder.() -> kotlin.Unit) {
            this.keyPair = aws.sdk.kotlin.services.lightsail.model.KeyPair.invoke(block)
        }

        /**
         * construct an [aws.sdk.kotlin.services.lightsail.model.Operation] inside the given [block]
         */
        public fun operation(block: aws.sdk.kotlin.services.lightsail.model.Operation.Builder.() -> kotlin.Unit) {
            this.operation = aws.sdk.kotlin.services.lightsail.model.Operation.invoke(block)
        }

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy