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

commonMain.aws.sdk.kotlin.services.ec2instanceconnect.model.SendSerialConsoleSshPublicKeyRequest.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.ec2instanceconnect.model

import aws.smithy.kotlin.runtime.SdkDsl

public class SendSerialConsoleSshPublicKeyRequest private constructor(builder: Builder) {
    /**
     * The ID of the EC2 instance.
     */
    public val instanceId: kotlin.String? = builder.instanceId
    /**
     * The serial port of the EC2 instance. Currently only port 0 is supported.
     *
     * Default: 0
     */
    public val serialPort: kotlin.Int? = builder.serialPort
    /**
     * The public key material. To use the public key, you must have the matching private key. For information about the supported key formats and lengths, see [Requirements for key pairs](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html#how-to-generate-your-own-key-and-import-it-to-aws) in the *Amazon EC2 User Guide*.
     */
    public val sshPublicKey: kotlin.String? = builder.sshPublicKey

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

    override fun toString(): kotlin.String = buildString {
        append("SendSerialConsoleSshPublicKeyRequest(")
        append("instanceId=$instanceId,")
        append("serialPort=$serialPort,")
        append("sshPublicKey=$sshPublicKey")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = instanceId?.hashCode() ?: 0
        result = 31 * result + (serialPort ?: 0)
        result = 31 * result + (sshPublicKey?.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 SendSerialConsoleSshPublicKeyRequest

        if (instanceId != other.instanceId) return false
        if (serialPort != other.serialPort) return false
        if (sshPublicKey != other.sshPublicKey) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * The ID of the EC2 instance.
         */
        public var instanceId: kotlin.String? = null
        /**
         * The serial port of the EC2 instance. Currently only port 0 is supported.
         *
         * Default: 0
         */
        public var serialPort: kotlin.Int? = null
        /**
         * The public key material. To use the public key, you must have the matching private key. For information about the supported key formats and lengths, see [Requirements for key pairs](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html#how-to-generate-your-own-key-and-import-it-to-aws) in the *Amazon EC2 User Guide*.
         */
        public var sshPublicKey: kotlin.String? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.ec2instanceconnect.model.SendSerialConsoleSshPublicKeyRequest) : this() {
            this.instanceId = x.instanceId
            this.serialPort = x.serialPort
            this.sshPublicKey = x.sshPublicKey
        }

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy