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

commonMain.aws.sdk.kotlin.services.codecommit.model.Location.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 the location of a change or comment in the comparison between two commits or a pull request.
 */
public class Location private constructor(builder: Builder) {
    /**
     * The name of the file being compared, including its extension and subdirectory, if any.
     */
    public val filePath: kotlin.String? = builder.filePath
    /**
     * The position of a change in a compared file, in line number format.
     */
    public val filePosition: kotlin.Long? = builder.filePosition
    /**
     * In a comparison of commits or a pull request, whether the change is in the before or after of that comparison.
     */
    public val relativeFileVersion: aws.sdk.kotlin.services.codecommit.model.RelativeFileVersionEnum? = builder.relativeFileVersion

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

    override fun toString(): kotlin.String = buildString {
        append("Location(")
        append("filePath=$filePath,")
        append("filePosition=$filePosition,")
        append("relativeFileVersion=$relativeFileVersion")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = filePath?.hashCode() ?: 0
        result = 31 * result + (filePosition?.hashCode() ?: 0)
        result = 31 * result + (relativeFileVersion?.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 Location

        if (filePath != other.filePath) return false
        if (filePosition != other.filePosition) return false
        if (relativeFileVersion != other.relativeFileVersion) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * The name of the file being compared, including its extension and subdirectory, if any.
         */
        public var filePath: kotlin.String? = null
        /**
         * The position of a change in a compared file, in line number format.
         */
        public var filePosition: kotlin.Long? = null
        /**
         * In a comparison of commits or a pull request, whether the change is in the before or after of that comparison.
         */
        public var relativeFileVersion: aws.sdk.kotlin.services.codecommit.model.RelativeFileVersionEnum? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.codecommit.model.Location) : this() {
            this.filePath = x.filePath
            this.filePosition = x.filePosition
            this.relativeFileVersion = x.relativeFileVersion
        }

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy