
commonMain.aws.sdk.kotlin.services.s3.model.InvalidObjectState.kt Maven / Gradle / Ivy
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.s3.model
import aws.smithy.kotlin.runtime.ServiceErrorMetadata
/**
* Object is archived and inaccessible until restored.
*
* If the object you are retrieving is stored in the S3 Glacier Flexible Retrieval storage class, the S3 Glacier Deep Archive storage class, the S3 Intelligent-Tiering Archive Access tier, or the S3 Intelligent-Tiering Deep Archive Access tier, before you can retrieve the object you must first restore a copy using [RestoreObject](https://docs.aws.amazon.com/AmazonS3/latest/API/API_RestoreObject.html). Otherwise, this operation returns an `InvalidObjectState` error. For information about restoring archived objects, see [Restoring Archived Objects](https://docs.aws.amazon.com/AmazonS3/latest/dev/restoring-objects.html) in the *Amazon S3 User Guide*.
*/
public class InvalidObjectState private constructor(builder: Builder) : S3Exception() {
public val accessTier: aws.sdk.kotlin.services.s3.model.IntelligentTieringAccessTier? = builder.accessTier
public val storageClass: aws.sdk.kotlin.services.s3.model.StorageClass? = builder.storageClass
init {
sdkErrorMetadata.attributes[ServiceErrorMetadata.ErrorType] = ErrorType.Client
}
public companion object {
public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.s3.model.InvalidObjectState = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("InvalidObjectState(")
append("accessTier=$accessTier,")
append("storageClass=$storageClass")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = accessTier?.hashCode() ?: 0
result = 31 * result + (storageClass?.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 InvalidObjectState
if (accessTier != other.accessTier) return false
if (storageClass != other.storageClass) return false
return true
}
public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.s3.model.InvalidObjectState = Builder(this).apply(block).build()
public class Builder {
public var accessTier: aws.sdk.kotlin.services.s3.model.IntelligentTieringAccessTier? = null
public var storageClass: aws.sdk.kotlin.services.s3.model.StorageClass? = null
@PublishedApi
internal constructor()
@PublishedApi
internal constructor(x: aws.sdk.kotlin.services.s3.model.InvalidObjectState) : this() {
this.accessTier = x.accessTier
this.storageClass = x.storageClass
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.s3.model.InvalidObjectState = InvalidObjectState(this)
internal fun correctErrors(): Builder {
return this
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy