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

commonMain.aws.sdk.kotlin.services.codecommit.model.Target.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.codecommit.model

import aws.smithy.kotlin.runtime.SdkDsl

/**
 * Returns information about a target for a pull request.
 */
public class Target private constructor(builder: Builder) {
    /**
     * The branch of the repository where the pull request changes are merged. Also known as the destination branch.
     */
    public val destinationReference: kotlin.String? = builder.destinationReference
    /**
     * The name of the repository that contains the pull request.
     */
    public val repositoryName: kotlin.String = requireNotNull(builder.repositoryName) { "A non-null value must be provided for repositoryName" }
    /**
     * The branch of the repository that contains the changes for the pull request. Also known as the source branch.
     */
    public val sourceReference: kotlin.String = requireNotNull(builder.sourceReference) { "A non-null value must be provided for sourceReference" }

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

    override fun toString(): kotlin.String = buildString {
        append("Target(")
        append("destinationReference=$destinationReference,")
        append("repositoryName=$repositoryName,")
        append("sourceReference=$sourceReference")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = destinationReference?.hashCode() ?: 0
        result = 31 * result + (repositoryName.hashCode())
        result = 31 * result + (sourceReference.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 Target

        if (destinationReference != other.destinationReference) return false
        if (repositoryName != other.repositoryName) return false
        if (sourceReference != other.sourceReference) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * The branch of the repository where the pull request changes are merged. Also known as the destination branch.
         */
        public var destinationReference: kotlin.String? = null
        /**
         * The name of the repository that contains the pull request.
         */
        public var repositoryName: kotlin.String? = null
        /**
         * The branch of the repository that contains the changes for the pull request. Also known as the source branch.
         */
        public var sourceReference: kotlin.String? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.codecommit.model.Target) : this() {
            this.destinationReference = x.destinationReference
            this.repositoryName = x.repositoryName
            this.sourceReference = x.sourceReference
        }

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

        internal fun correctErrors(): Builder {
            if (repositoryName == null) repositoryName = ""
            if (sourceReference == null) sourceReference = ""
            return this
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy