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

commonMain.aws.sdk.kotlin.services.codeartifact.model.CopyPackageVersionsRequest.kt Maven / Gradle / Ivy

The newest version!
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!

package aws.sdk.kotlin.services.codeartifact.model

import aws.smithy.kotlin.runtime.SdkDsl

public class CopyPackageVersionsRequest private constructor(builder: Builder) {
    /**
     * Set to true to overwrite a package version that already exists in the destination repository. If set to false and the package version already exists in the destination repository, the package version is returned in the `failedVersions` field of the response with an `ALREADY_EXISTS` error code.
     */
    public val allowOverwrite: kotlin.Boolean? = builder.allowOverwrite
    /**
     * The name of the repository into which package versions are copied.
     */
    public val destinationRepository: kotlin.String? = builder.destinationRepository
    /**
     * The name of the domain that contains the source and destination repositories.
     */
    public val domain: kotlin.String? = builder.domain
    /**
     * The 12-digit account number of the Amazon Web Services account that owns the domain. It does not include dashes or spaces.
     */
    public val domainOwner: kotlin.String? = builder.domainOwner
    /**
     * The format of the package versions to be copied.
     */
    public val format: aws.sdk.kotlin.services.codeartifact.model.PackageFormat? = builder.format
    /**
     * Set to true to copy packages from repositories that are upstream from the source repository to the destination repository. The default setting is false. For more information, see [Working with upstream repositories](https://docs.aws.amazon.com/codeartifact/latest/ug/repos-upstream.html).
     */
    public val includeFromUpstream: kotlin.Boolean? = builder.includeFromUpstream
    /**
     * The namespace of the package versions to be copied. The package component that specifies its namespace depends on its type. For example:
     *
     * The namespace is required when copying package versions of the following formats:
     * + Maven
     * + Swift
     * + generic
     * +  The namespace of a Maven package version is its `groupId`.
     * +  The namespace of an npm or Swift package version is its `scope`.
     * + The namespace of a generic package is its `namespace`.
     * +  Python, NuGet, Ruby, and Cargo package versions do not contain a corresponding component, package versions of those formats do not have a namespace.
     */
    public val namespace: kotlin.String? = builder.namespace
    /**
     * The name of the package that contains the versions to be copied.
     */
    public val `package`: kotlin.String? = builder.`package`
    /**
     * The name of the repository that contains the package versions to be copied.
     */
    public val sourceRepository: kotlin.String? = builder.sourceRepository
    /**
     * A list of key-value pairs. The keys are package versions and the values are package version revisions. A `CopyPackageVersion` operation succeeds if the specified versions in the source repository match the specified package version revision.
     *
     *  You must specify `versions` or `versionRevisions`. You cannot specify both.
     */
    public val versionRevisions: Map? = builder.versionRevisions
    /**
     * The versions of the package to be copied.
     *
     *  You must specify `versions` or `versionRevisions`. You cannot specify both.
     */
    public val versions: List? = builder.versions

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

    override fun toString(): kotlin.String = buildString {
        append("CopyPackageVersionsRequest(")
        append("allowOverwrite=$allowOverwrite,")
        append("destinationRepository=$destinationRepository,")
        append("domain=$domain,")
        append("domainOwner=$domainOwner,")
        append("format=$format,")
        append("includeFromUpstream=$includeFromUpstream,")
        append("namespace=$namespace,")
        append("package=$`package`,")
        append("sourceRepository=$sourceRepository,")
        append("versionRevisions=$versionRevisions,")
        append("versions=$versions")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = allowOverwrite?.hashCode() ?: 0
        result = 31 * result + (destinationRepository?.hashCode() ?: 0)
        result = 31 * result + (domain?.hashCode() ?: 0)
        result = 31 * result + (domainOwner?.hashCode() ?: 0)
        result = 31 * result + (format?.hashCode() ?: 0)
        result = 31 * result + (includeFromUpstream?.hashCode() ?: 0)
        result = 31 * result + (namespace?.hashCode() ?: 0)
        result = 31 * result + (`package`?.hashCode() ?: 0)
        result = 31 * result + (sourceRepository?.hashCode() ?: 0)
        result = 31 * result + (versionRevisions?.hashCode() ?: 0)
        result = 31 * result + (versions?.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 CopyPackageVersionsRequest

        if (allowOverwrite != other.allowOverwrite) return false
        if (destinationRepository != other.destinationRepository) return false
        if (domain != other.domain) return false
        if (domainOwner != other.domainOwner) return false
        if (format != other.format) return false
        if (includeFromUpstream != other.includeFromUpstream) return false
        if (namespace != other.namespace) return false
        if (`package` != other.`package`) return false
        if (sourceRepository != other.sourceRepository) return false
        if (versionRevisions != other.versionRevisions) return false
        if (versions != other.versions) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * Set to true to overwrite a package version that already exists in the destination repository. If set to false and the package version already exists in the destination repository, the package version is returned in the `failedVersions` field of the response with an `ALREADY_EXISTS` error code.
         */
        public var allowOverwrite: kotlin.Boolean? = null
        /**
         * The name of the repository into which package versions are copied.
         */
        public var destinationRepository: kotlin.String? = null
        /**
         * The name of the domain that contains the source and destination repositories.
         */
        public var domain: kotlin.String? = null
        /**
         * The 12-digit account number of the Amazon Web Services account that owns the domain. It does not include dashes or spaces.
         */
        public var domainOwner: kotlin.String? = null
        /**
         * The format of the package versions to be copied.
         */
        public var format: aws.sdk.kotlin.services.codeartifact.model.PackageFormat? = null
        /**
         * Set to true to copy packages from repositories that are upstream from the source repository to the destination repository. The default setting is false. For more information, see [Working with upstream repositories](https://docs.aws.amazon.com/codeartifact/latest/ug/repos-upstream.html).
         */
        public var includeFromUpstream: kotlin.Boolean? = null
        /**
         * The namespace of the package versions to be copied. The package component that specifies its namespace depends on its type. For example:
         *
         * The namespace is required when copying package versions of the following formats:
         * + Maven
         * + Swift
         * + generic
         * +  The namespace of a Maven package version is its `groupId`.
         * +  The namespace of an npm or Swift package version is its `scope`.
         * + The namespace of a generic package is its `namespace`.
         * +  Python, NuGet, Ruby, and Cargo package versions do not contain a corresponding component, package versions of those formats do not have a namespace.
         */
        public var namespace: kotlin.String? = null
        /**
         * The name of the package that contains the versions to be copied.
         */
        public var `package`: kotlin.String? = null
        /**
         * The name of the repository that contains the package versions to be copied.
         */
        public var sourceRepository: kotlin.String? = null
        /**
         * A list of key-value pairs. The keys are package versions and the values are package version revisions. A `CopyPackageVersion` operation succeeds if the specified versions in the source repository match the specified package version revision.
         *
         *  You must specify `versions` or `versionRevisions`. You cannot specify both.
         */
        public var versionRevisions: Map? = null
        /**
         * The versions of the package to be copied.
         *
         *  You must specify `versions` or `versionRevisions`. You cannot specify both.
         */
        public var versions: List? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.codeartifact.model.CopyPackageVersionsRequest) : this() {
            this.allowOverwrite = x.allowOverwrite
            this.destinationRepository = x.destinationRepository
            this.domain = x.domain
            this.domainOwner = x.domainOwner
            this.format = x.format
            this.includeFromUpstream = x.includeFromUpstream
            this.namespace = x.namespace
            this.`package` = x.`package`
            this.sourceRepository = x.sourceRepository
            this.versionRevisions = x.versionRevisions
            this.versions = x.versions
        }

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy