
commonMain.aws.sdk.kotlin.services.s3.model.ObjectVersion.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.time.Instant
/**
* The version of an object.
*/
public class ObjectVersion private constructor(builder: Builder) {
/**
* The algorithm that was used to create a checksum of the object.
*/
public val checksumAlgorithm: List? = builder.checksumAlgorithm
/**
* The entity tag is an MD5 hash of that version of the object.
*/
public val eTag: kotlin.String? = builder.eTag
/**
* Specifies whether the object is (true) or is not (false) the latest version of an object.
*/
public val isLatest: kotlin.Boolean? = builder.isLatest
/**
* The object key.
*/
public val key: kotlin.String? = builder.key
/**
* Date and time when the object was last modified.
*/
public val lastModified: aws.smithy.kotlin.runtime.time.Instant? = builder.lastModified
/**
* Specifies the owner of the object.
*/
public val owner: aws.sdk.kotlin.services.s3.model.Owner? = builder.owner
/**
* Specifies the restoration status of an object. Objects in certain storage classes must be restored before they can be retrieved. For more information about these storage classes and how to work with archived objects, see [ Working with archived objects](https://docs.aws.amazon.com/AmazonS3/latest/userguide/archived-objects.html) in the *Amazon S3 User Guide*.
*/
public val restoreStatus: aws.sdk.kotlin.services.s3.model.RestoreStatus? = builder.restoreStatus
/**
* Size in bytes of the object.
*/
public val size: kotlin.Long? = builder.size
/**
* The class of storage used to store the object.
*/
public val storageClass: aws.sdk.kotlin.services.s3.model.ObjectVersionStorageClass? = builder.storageClass
/**
* Version ID of an object.
*/
public val versionId: kotlin.String? = builder.versionId
public companion object {
public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.s3.model.ObjectVersion = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("ObjectVersion(")
append("checksumAlgorithm=$checksumAlgorithm,")
append("eTag=$eTag,")
append("isLatest=$isLatest,")
append("key=$key,")
append("lastModified=$lastModified,")
append("owner=$owner,")
append("restoreStatus=$restoreStatus,")
append("size=$size,")
append("storageClass=$storageClass,")
append("versionId=$versionId")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = checksumAlgorithm?.hashCode() ?: 0
result = 31 * result + (eTag?.hashCode() ?: 0)
result = 31 * result + (isLatest?.hashCode() ?: 0)
result = 31 * result + (key?.hashCode() ?: 0)
result = 31 * result + (lastModified?.hashCode() ?: 0)
result = 31 * result + (owner?.hashCode() ?: 0)
result = 31 * result + (restoreStatus?.hashCode() ?: 0)
result = 31 * result + (size?.hashCode() ?: 0)
result = 31 * result + (storageClass?.hashCode() ?: 0)
result = 31 * result + (versionId?.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 ObjectVersion
if (checksumAlgorithm != other.checksumAlgorithm) return false
if (eTag != other.eTag) return false
if (isLatest != other.isLatest) return false
if (key != other.key) return false
if (lastModified != other.lastModified) return false
if (owner != other.owner) return false
if (restoreStatus != other.restoreStatus) return false
if (size != other.size) return false
if (storageClass != other.storageClass) return false
if (versionId != other.versionId) return false
return true
}
public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.s3.model.ObjectVersion = Builder(this).apply(block).build()
public class Builder {
/**
* The algorithm that was used to create a checksum of the object.
*/
public var checksumAlgorithm: List? = null
/**
* The entity tag is an MD5 hash of that version of the object.
*/
public var eTag: kotlin.String? = null
/**
* Specifies whether the object is (true) or is not (false) the latest version of an object.
*/
public var isLatest: kotlin.Boolean? = null
/**
* The object key.
*/
public var key: kotlin.String? = null
/**
* Date and time when the object was last modified.
*/
public var lastModified: aws.smithy.kotlin.runtime.time.Instant? = null
/**
* Specifies the owner of the object.
*/
public var owner: aws.sdk.kotlin.services.s3.model.Owner? = null
/**
* Specifies the restoration status of an object. Objects in certain storage classes must be restored before they can be retrieved. For more information about these storage classes and how to work with archived objects, see [ Working with archived objects](https://docs.aws.amazon.com/AmazonS3/latest/userguide/archived-objects.html) in the *Amazon S3 User Guide*.
*/
public var restoreStatus: aws.sdk.kotlin.services.s3.model.RestoreStatus? = null
/**
* Size in bytes of the object.
*/
public var size: kotlin.Long? = null
/**
* The class of storage used to store the object.
*/
public var storageClass: aws.sdk.kotlin.services.s3.model.ObjectVersionStorageClass? = null
/**
* Version ID of an object.
*/
public var versionId: kotlin.String? = null
@PublishedApi
internal constructor()
@PublishedApi
internal constructor(x: aws.sdk.kotlin.services.s3.model.ObjectVersion) : this() {
this.checksumAlgorithm = x.checksumAlgorithm
this.eTag = x.eTag
this.isLatest = x.isLatest
this.key = x.key
this.lastModified = x.lastModified
this.owner = x.owner
this.restoreStatus = x.restoreStatus
this.size = x.size
this.storageClass = x.storageClass
this.versionId = x.versionId
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.s3.model.ObjectVersion = ObjectVersion(this)
/**
* construct an [aws.sdk.kotlin.services.s3.model.Owner] inside the given [block]
*/
public fun owner(block: aws.sdk.kotlin.services.s3.model.Owner.Builder.() -> kotlin.Unit) {
this.owner = aws.sdk.kotlin.services.s3.model.Owner.invoke(block)
}
/**
* construct an [aws.sdk.kotlin.services.s3.model.RestoreStatus] inside the given [block]
*/
public fun restoreStatus(block: aws.sdk.kotlin.services.s3.model.RestoreStatus.Builder.() -> kotlin.Unit) {
this.restoreStatus = aws.sdk.kotlin.services.s3.model.RestoreStatus.invoke(block)
}
internal fun correctErrors(): Builder {
return this
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy