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

commonMain.aws.sdk.kotlin.services.redshiftserverless.model.UsageLimit.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.redshiftserverless.model

import aws.smithy.kotlin.runtime.SdkDsl

/**
 * The usage limit object.
 */
public class UsageLimit private constructor(builder: Builder) {
    /**
     * The limit amount. If time-based, this amount is in RPUs consumed per hour. If data-based, this amount is in terabytes (TB). The value must be a positive number.
     */
    public val amount: kotlin.Long? = builder.amount
    /**
     * The action that Amazon Redshift Serverless takes when the limit is reached.
     */
    public val breachAction: aws.sdk.kotlin.services.redshiftserverless.model.UsageLimitBreachAction? = builder.breachAction
    /**
     * The time period that the amount applies to. A weekly period begins on Sunday. The default is monthly.
     */
    public val period: aws.sdk.kotlin.services.redshiftserverless.model.UsageLimitPeriod? = builder.period
    /**
     * The Amazon Resource Name (ARN) that identifies the Amazon Redshift Serverless resource.
     */
    public val resourceArn: kotlin.String? = builder.resourceArn
    /**
     * The Amazon Resource Name (ARN) of the resource associated with the usage limit.
     */
    public val usageLimitArn: kotlin.String? = builder.usageLimitArn
    /**
     * The identifier of the usage limit.
     */
    public val usageLimitId: kotlin.String? = builder.usageLimitId
    /**
     * The Amazon Redshift Serverless feature to limit.
     */
    public val usageType: aws.sdk.kotlin.services.redshiftserverless.model.UsageLimitUsageType? = builder.usageType

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

    override fun toString(): kotlin.String = buildString {
        append("UsageLimit(")
        append("amount=$amount,")
        append("breachAction=$breachAction,")
        append("period=$period,")
        append("resourceArn=$resourceArn,")
        append("usageLimitArn=$usageLimitArn,")
        append("usageLimitId=$usageLimitId,")
        append("usageType=$usageType")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = amount?.hashCode() ?: 0
        result = 31 * result + (breachAction?.hashCode() ?: 0)
        result = 31 * result + (period?.hashCode() ?: 0)
        result = 31 * result + (resourceArn?.hashCode() ?: 0)
        result = 31 * result + (usageLimitArn?.hashCode() ?: 0)
        result = 31 * result + (usageLimitId?.hashCode() ?: 0)
        result = 31 * result + (usageType?.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 UsageLimit

        if (amount != other.amount) return false
        if (breachAction != other.breachAction) return false
        if (period != other.period) return false
        if (resourceArn != other.resourceArn) return false
        if (usageLimitArn != other.usageLimitArn) return false
        if (usageLimitId != other.usageLimitId) return false
        if (usageType != other.usageType) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * The limit amount. If time-based, this amount is in RPUs consumed per hour. If data-based, this amount is in terabytes (TB). The value must be a positive number.
         */
        public var amount: kotlin.Long? = null
        /**
         * The action that Amazon Redshift Serverless takes when the limit is reached.
         */
        public var breachAction: aws.sdk.kotlin.services.redshiftserverless.model.UsageLimitBreachAction? = null
        /**
         * The time period that the amount applies to. A weekly period begins on Sunday. The default is monthly.
         */
        public var period: aws.sdk.kotlin.services.redshiftserverless.model.UsageLimitPeriod? = null
        /**
         * The Amazon Resource Name (ARN) that identifies the Amazon Redshift Serverless resource.
         */
        public var resourceArn: kotlin.String? = null
        /**
         * The Amazon Resource Name (ARN) of the resource associated with the usage limit.
         */
        public var usageLimitArn: kotlin.String? = null
        /**
         * The identifier of the usage limit.
         */
        public var usageLimitId: kotlin.String? = null
        /**
         * The Amazon Redshift Serverless feature to limit.
         */
        public var usageType: aws.sdk.kotlin.services.redshiftserverless.model.UsageLimitUsageType? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.redshiftserverless.model.UsageLimit) : this() {
            this.amount = x.amount
            this.breachAction = x.breachAction
            this.period = x.period
            this.resourceArn = x.resourceArn
            this.usageLimitArn = x.usageLimitArn
            this.usageLimitId = x.usageLimitId
            this.usageType = x.usageType
        }

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy