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

commonMain.aws.sdk.kotlin.services.lightsail.model.CreateDiskRequest.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 CreateDiskRequest private constructor(builder: Builder) {
    /**
     * An array of objects that represent the add-ons to enable for the new disk.
     */
    public val addOns: List? = builder.addOns
    /**
     * The Availability Zone where you want to create the disk (`us-east-2a`). Use the same Availability Zone as the Lightsail instance to which you want to attach the disk.
     *
     * Use the `get regions` operation to list the Availability Zones where Lightsail is currently available.
     */
    public val availabilityZone: kotlin.String? = builder.availabilityZone
    /**
     * The unique Lightsail disk name (`my-disk`).
     */
    public val diskName: kotlin.String? = builder.diskName
    /**
     * The size of the disk in GB (`32`).
     */
    public val sizeInGb: kotlin.Int? = builder.sizeInGb
    /**
     * The tag keys and optional values to add to the resource during create.
     *
     * Use the `TagResource` action to tag a resource after it's created.
     */
    public val tags: List? = builder.tags

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

    override fun toString(): kotlin.String = buildString {
        append("CreateDiskRequest(")
        append("addOns=$addOns,")
        append("availabilityZone=$availabilityZone,")
        append("diskName=$diskName,")
        append("sizeInGb=$sizeInGb,")
        append("tags=$tags")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = addOns?.hashCode() ?: 0
        result = 31 * result + (availabilityZone?.hashCode() ?: 0)
        result = 31 * result + (diskName?.hashCode() ?: 0)
        result = 31 * result + (sizeInGb ?: 0)
        result = 31 * result + (tags?.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 CreateDiskRequest

        if (addOns != other.addOns) return false
        if (availabilityZone != other.availabilityZone) return false
        if (diskName != other.diskName) return false
        if (sizeInGb != other.sizeInGb) return false
        if (tags != other.tags) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * An array of objects that represent the add-ons to enable for the new disk.
         */
        public var addOns: List? = null
        /**
         * The Availability Zone where you want to create the disk (`us-east-2a`). Use the same Availability Zone as the Lightsail instance to which you want to attach the disk.
         *
         * Use the `get regions` operation to list the Availability Zones where Lightsail is currently available.
         */
        public var availabilityZone: kotlin.String? = null
        /**
         * The unique Lightsail disk name (`my-disk`).
         */
        public var diskName: kotlin.String? = null
        /**
         * The size of the disk in GB (`32`).
         */
        public var sizeInGb: kotlin.Int? = null
        /**
         * The tag keys and optional values to add to the resource during create.
         *
         * Use the `TagResource` action to tag a resource after it's created.
         */
        public var tags: List? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.lightsail.model.CreateDiskRequest) : this() {
            this.addOns = x.addOns
            this.availabilityZone = x.availabilityZone
            this.diskName = x.diskName
            this.sizeInGb = x.sizeInGb
            this.tags = x.tags
        }

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy