commonMain.aws.sdk.kotlin.services.codeartifact.model.PackageVersionSummary.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of codeartifact-jvm Show documentation
Show all versions of codeartifact-jvm Show documentation
The AWS SDK for Kotlin client for codeartifact
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.codeartifact.model
import aws.smithy.kotlin.runtime.SdkDsl
/**
* Details about a package version, including its status, version, and revision. The [ListPackageVersions](https://docs.aws.amazon.com/codeartifact/latest/APIReference/API_ListPackageVersions.html) operation returns a list of `PackageVersionSummary` objects.
*/
public class PackageVersionSummary private constructor(builder: Builder) {
/**
* A [PackageVersionOrigin](https://docs.aws.amazon.com/codeartifact/latest/APIReference/API_PackageVersionOrigin.html) object that contains information about how the package version was added to the repository.
*/
public val origin: aws.sdk.kotlin.services.codeartifact.model.PackageVersionOrigin? = builder.origin
/**
* The revision associated with a package version.
*/
public val revision: kotlin.String? = builder.revision
/**
* A string that contains the status of the package version. It can be one of the following:
*/
public val status: aws.sdk.kotlin.services.codeartifact.model.PackageVersionStatus = requireNotNull(builder.status) { "A non-null value must be provided for status" }
/**
* Information about a package version.
*/
public val version: kotlin.String = requireNotNull(builder.version) { "A non-null value must be provided for version" }
public companion object {
public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.codeartifact.model.PackageVersionSummary = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("PackageVersionSummary(")
append("origin=$origin,")
append("revision=$revision,")
append("status=$status,")
append("version=$version")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = origin?.hashCode() ?: 0
result = 31 * result + (revision?.hashCode() ?: 0)
result = 31 * result + (status.hashCode())
result = 31 * result + (version.hashCode())
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 PackageVersionSummary
if (origin != other.origin) return false
if (revision != other.revision) return false
if (status != other.status) return false
if (version != other.version) return false
return true
}
public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.codeartifact.model.PackageVersionSummary = Builder(this).apply(block).build()
@SdkDsl
public class Builder {
/**
* A [PackageVersionOrigin](https://docs.aws.amazon.com/codeartifact/latest/APIReference/API_PackageVersionOrigin.html) object that contains information about how the package version was added to the repository.
*/
public var origin: aws.sdk.kotlin.services.codeartifact.model.PackageVersionOrigin? = null
/**
* The revision associated with a package version.
*/
public var revision: kotlin.String? = null
/**
* A string that contains the status of the package version. It can be one of the following:
*/
public var status: aws.sdk.kotlin.services.codeartifact.model.PackageVersionStatus? = null
/**
* Information about a package version.
*/
public var version: kotlin.String? = null
@PublishedApi
internal constructor()
@PublishedApi
internal constructor(x: aws.sdk.kotlin.services.codeartifact.model.PackageVersionSummary) : this() {
this.origin = x.origin
this.revision = x.revision
this.status = x.status
this.version = x.version
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.codeartifact.model.PackageVersionSummary = PackageVersionSummary(this)
/**
* construct an [aws.sdk.kotlin.services.codeartifact.model.PackageVersionOrigin] inside the given [block]
*/
public fun origin(block: aws.sdk.kotlin.services.codeartifact.model.PackageVersionOrigin.Builder.() -> kotlin.Unit) {
this.origin = aws.sdk.kotlin.services.codeartifact.model.PackageVersionOrigin.invoke(block)
}
internal fun correctErrors(): Builder {
if (status == null) status = PackageVersionStatus.SdkUnknown("no value provided")
if (version == null) version = ""
return this
}
}
}