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

commonMain.aws.sdk.kotlin.services.proton.model.RepositoryBranch.kt Maven / Gradle / Ivy

There is a newer version: 1.3.99
Show newest version
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!

package aws.sdk.kotlin.services.proton.model

import aws.smithy.kotlin.runtime.SdkDsl

/**
 * Detail data for a linked repository branch.
 */
public class RepositoryBranch private constructor(builder: Builder) {
    /**
     * The Amazon Resource Name (ARN) of the linked repository.
     */
    public val arn: kotlin.String = requireNotNull(builder.arn) { "A non-null value must be provided for arn" }
    /**
     * The repository branch.
     */
    public val branch: kotlin.String = requireNotNull(builder.branch) { "A non-null value must be provided for branch" }
    /**
     * The repository name.
     */
    public val name: kotlin.String = requireNotNull(builder.name) { "A non-null value must be provided for name" }
    /**
     * The repository provider.
     */
    public val provider: aws.sdk.kotlin.services.proton.model.RepositoryProvider = requireNotNull(builder.provider) { "A non-null value must be provided for provider" }

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

    override fun toString(): kotlin.String = buildString {
        append("RepositoryBranch(")
        append("arn=$arn,")
        append("branch=$branch,")
        append("name=$name,")
        append("provider=$provider")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = arn.hashCode()
        result = 31 * result + (branch.hashCode())
        result = 31 * result + (name.hashCode())
        result = 31 * result + (provider.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 RepositoryBranch

        if (arn != other.arn) return false
        if (branch != other.branch) return false
        if (name != other.name) return false
        if (provider != other.provider) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * The Amazon Resource Name (ARN) of the linked repository.
         */
        public var arn: kotlin.String? = null
        /**
         * The repository branch.
         */
        public var branch: kotlin.String? = null
        /**
         * The repository name.
         */
        public var name: kotlin.String? = null
        /**
         * The repository provider.
         */
        public var provider: aws.sdk.kotlin.services.proton.model.RepositoryProvider? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.proton.model.RepositoryBranch) : this() {
            this.arn = x.arn
            this.branch = x.branch
            this.name = x.name
            this.provider = x.provider
        }

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

        internal fun correctErrors(): Builder {
            if (arn == null) arn = ""
            if (branch == null) branch = ""
            if (name == null) name = ""
            if (provider == null) provider = RepositoryProvider.SdkUnknown("no value provided")
            return this
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy