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

commonMain.aws.sdk.kotlin.services.redshift.model.ReservedNodeConfigurationOption.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.redshift.model

import aws.smithy.kotlin.runtime.SdkDsl

/**
 * Details for a reserved-node exchange. Examples include the node type for a reserved node, the price for a node, the node's state, and other details.
 */
public class ReservedNodeConfigurationOption private constructor(builder: Builder) {
    /**
     * Describes a reserved node. You can call the DescribeReservedNodeOfferings API to obtain the available reserved node offerings.
     */
    public val sourceReservedNode: aws.sdk.kotlin.services.redshift.model.ReservedNode? = builder.sourceReservedNode
    /**
     * The target reserved-node count.
     */
    public val targetReservedNodeCount: kotlin.Int? = builder.targetReservedNodeCount
    /**
     * Describes a reserved node offering.
     */
    public val targetReservedNodeOffering: aws.sdk.kotlin.services.redshift.model.ReservedNodeOffering? = builder.targetReservedNodeOffering

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

    override fun toString(): kotlin.String = buildString {
        append("ReservedNodeConfigurationOption(")
        append("sourceReservedNode=$sourceReservedNode,")
        append("targetReservedNodeCount=$targetReservedNodeCount,")
        append("targetReservedNodeOffering=$targetReservedNodeOffering")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = sourceReservedNode?.hashCode() ?: 0
        result = 31 * result + (targetReservedNodeCount ?: 0)
        result = 31 * result + (targetReservedNodeOffering?.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 ReservedNodeConfigurationOption

        if (sourceReservedNode != other.sourceReservedNode) return false
        if (targetReservedNodeCount != other.targetReservedNodeCount) return false
        if (targetReservedNodeOffering != other.targetReservedNodeOffering) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * Describes a reserved node. You can call the DescribeReservedNodeOfferings API to obtain the available reserved node offerings.
         */
        public var sourceReservedNode: aws.sdk.kotlin.services.redshift.model.ReservedNode? = null
        /**
         * The target reserved-node count.
         */
        public var targetReservedNodeCount: kotlin.Int? = null
        /**
         * Describes a reserved node offering.
         */
        public var targetReservedNodeOffering: aws.sdk.kotlin.services.redshift.model.ReservedNodeOffering? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.redshift.model.ReservedNodeConfigurationOption) : this() {
            this.sourceReservedNode = x.sourceReservedNode
            this.targetReservedNodeCount = x.targetReservedNodeCount
            this.targetReservedNodeOffering = x.targetReservedNodeOffering
        }

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

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

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy