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

commonMain.aws.sdk.kotlin.services.codeartifact.model.PackageDependency.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

/**
 * Details about a package dependency.
 */
public class PackageDependency private constructor(builder: Builder) {
    /**
     * The type of a package dependency. The possible values depend on the package type.
     * + npm: `regular`, `dev`, `peer`, `optional`
     * + maven: `optional`, `parent`, `compile`, `runtime`, `test`, `system`, `provided`.Note that `parent` is not a regular Maven dependency type; instead this is extracted from the `` element if one is defined in the package version's POM file.
     * + nuget: The `dependencyType` field is never set for NuGet packages.
     * + pypi: `Requires-Dist`
     */
    public val dependencyType: kotlin.String? = builder.dependencyType
    /**
     * The namespace of the package that this package depends on. The package component that specifies its namespace depends on its type. For example:
     * +  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 this package depends on.
     */
    public val `package`: kotlin.String? = builder.`package`
    /**
     * The required version, or version range, of the package that this package depends on. The version format is specific to the package type. For example, the following are possible valid required versions: `1.2.3`, `^2.3.4`, or `4.x`.
     */
    public val versionRequirement: kotlin.String? = builder.versionRequirement

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

    override fun toString(): kotlin.String = buildString {
        append("PackageDependency(")
        append("dependencyType=$dependencyType,")
        append("namespace=$namespace,")
        append("package=$`package`,")
        append("versionRequirement=$versionRequirement")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = dependencyType?.hashCode() ?: 0
        result = 31 * result + (namespace?.hashCode() ?: 0)
        result = 31 * result + (`package`?.hashCode() ?: 0)
        result = 31 * result + (versionRequirement?.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 PackageDependency

        if (dependencyType != other.dependencyType) return false
        if (namespace != other.namespace) return false
        if (`package` != other.`package`) return false
        if (versionRequirement != other.versionRequirement) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * The type of a package dependency. The possible values depend on the package type.
         * + npm: `regular`, `dev`, `peer`, `optional`
         * + maven: `optional`, `parent`, `compile`, `runtime`, `test`, `system`, `provided`.Note that `parent` is not a regular Maven dependency type; instead this is extracted from the `` element if one is defined in the package version's POM file.
         * + nuget: The `dependencyType` field is never set for NuGet packages.
         * + pypi: `Requires-Dist`
         */
        public var dependencyType: kotlin.String? = null
        /**
         * The namespace of the package that this package depends on. The package component that specifies its namespace depends on its type. For example:
         * +  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 this package depends on.
         */
        public var `package`: kotlin.String? = null
        /**
         * The required version, or version range, of the package that this package depends on. The version format is specific to the package type. For example, the following are possible valid required versions: `1.2.3`, `^2.3.4`, or `4.x`.
         */
        public var versionRequirement: kotlin.String? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.codeartifact.model.PackageDependency) : this() {
            this.dependencyType = x.dependencyType
            this.namespace = x.namespace
            this.`package` = x.`package`
            this.versionRequirement = x.versionRequirement
        }

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy