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

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

public class CreateUsageLimitRequest private constructor(builder: Builder) {
    /**
     * The limit amount. If time-based, this amount is in Redshift Processing Units (RPU) consumed per hour. If data-based, this amount is in terabytes (TB) of data transferred between Regions in cross-account sharing. 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. The default is log.
     */
    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) of the Amazon Redshift Serverless resource to create the usage limit for.
     */
    public val resourceArn: kotlin.String? = builder.resourceArn
    /**
     * The type of Amazon Redshift Serverless usage to create a usage limit for.
     */
    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.CreateUsageLimitRequest = Builder().apply(block).build()
    }

    override fun toString(): kotlin.String = buildString {
        append("CreateUsageLimitRequest(")
        append("amount=$amount,")
        append("breachAction=$breachAction,")
        append("period=$period,")
        append("resourceArn=$resourceArn,")
        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 + (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 CreateUsageLimitRequest

        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 (usageType != other.usageType) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * The limit amount. If time-based, this amount is in Redshift Processing Units (RPU) consumed per hour. If data-based, this amount is in terabytes (TB) of data transferred between Regions in cross-account sharing. 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. The default is log.
         */
        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) of the Amazon Redshift Serverless resource to create the usage limit for.
         */
        public var resourceArn: kotlin.String? = null
        /**
         * The type of Amazon Redshift Serverless usage to create a usage limit for.
         */
        public var usageType: aws.sdk.kotlin.services.redshiftserverless.model.UsageLimitUsageType? = null

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

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy