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

commonMain.aws.sdk.kotlin.services.glacier.model.PolicyEnforcedException.kt Maven / Gradle / Ivy

There is a newer version: 1.3.99
Show newest version
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!

package aws.sdk.kotlin.services.glacier.model

import aws.smithy.kotlin.runtime.ServiceErrorMetadata

/**
 * Returned if a retrieval job would exceed the current data policy's retrieval rate limit. For more information about data retrieval policies,
 */
public class PolicyEnforcedException private constructor(builder: Builder) : GlacierException() {

    /**
     * PolicyEnforcedException
     */
    public val code: kotlin.String? = builder.code
    /**
     * InitiateJob request denied by current data retrieval policy.
     */
    override val message: kotlin.String? = builder.message
    /**
     * Client
     */
    public val type: kotlin.String? = builder.type

    init {
        sdkErrorMetadata.attributes[ServiceErrorMetadata.ErrorType] = ErrorType.Client
    }

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

    override fun toString(): kotlin.String = buildString {
        append("PolicyEnforcedException(")
        append("code=$code,")
        append("message=$message,")
        append("type=$type")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = code?.hashCode() ?: 0
        result = 31 * result + (message?.hashCode() ?: 0)
        result = 31 * result + (type?.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 PolicyEnforcedException

        if (code != other.code) return false
        if (message != other.message) return false
        if (type != other.type) return false

        return true
    }

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

    public class Builder {
        /**
         * PolicyEnforcedException
         */
        public var code: kotlin.String? = null
        /**
         * InitiateJob request denied by current data retrieval policy.
         */
        public var message: kotlin.String? = null
        /**
         * Client
         */
        public var type: kotlin.String? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.glacier.model.PolicyEnforcedException) : this() {
            this.code = x.code
            this.message = x.message
            this.type = x.type
        }

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy