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

commonMain.aws.sdk.kotlin.services.codecommit.model.Difference.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 set of differences for a commit specifier.
 */
public class Difference private constructor(builder: Builder) {
    /**
     * Information about an `afterBlob` data type object, including the ID, the file mode permission code, and the path.
     */
    public val afterBlob: aws.sdk.kotlin.services.codecommit.model.BlobMetadata? = builder.afterBlob
    /**
     * Information about a `beforeBlob` data type object, including the ID, the file mode permission code, and the path.
     */
    public val beforeBlob: aws.sdk.kotlin.services.codecommit.model.BlobMetadata? = builder.beforeBlob
    /**
     * Whether the change type of the difference is an addition (A), deletion (D), or modification (M).
     */
    public val changeType: aws.sdk.kotlin.services.codecommit.model.ChangeTypeEnum? = builder.changeType

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

    override fun toString(): kotlin.String = buildString {
        append("Difference(")
        append("afterBlob=$afterBlob,")
        append("beforeBlob=$beforeBlob,")
        append("changeType=$changeType")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = afterBlob?.hashCode() ?: 0
        result = 31 * result + (beforeBlob?.hashCode() ?: 0)
        result = 31 * result + (changeType?.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 Difference

        if (afterBlob != other.afterBlob) return false
        if (beforeBlob != other.beforeBlob) return false
        if (changeType != other.changeType) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * Information about an `afterBlob` data type object, including the ID, the file mode permission code, and the path.
         */
        public var afterBlob: aws.sdk.kotlin.services.codecommit.model.BlobMetadata? = null
        /**
         * Information about a `beforeBlob` data type object, including the ID, the file mode permission code, and the path.
         */
        public var beforeBlob: aws.sdk.kotlin.services.codecommit.model.BlobMetadata? = null
        /**
         * Whether the change type of the difference is an addition (A), deletion (D), or modification (M).
         */
        public var changeType: aws.sdk.kotlin.services.codecommit.model.ChangeTypeEnum? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.codecommit.model.Difference) : this() {
            this.afterBlob = x.afterBlob
            this.beforeBlob = x.beforeBlob
            this.changeType = x.changeType
        }

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

        /**
         * construct an [aws.sdk.kotlin.services.codecommit.model.BlobMetadata] inside the given [block]
         */
        public fun afterBlob(block: aws.sdk.kotlin.services.codecommit.model.BlobMetadata.Builder.() -> kotlin.Unit) {
            this.afterBlob = aws.sdk.kotlin.services.codecommit.model.BlobMetadata.invoke(block)
        }

        /**
         * construct an [aws.sdk.kotlin.services.codecommit.model.BlobMetadata] inside the given [block]
         */
        public fun beforeBlob(block: aws.sdk.kotlin.services.codecommit.model.BlobMetadata.Builder.() -> kotlin.Unit) {
            this.beforeBlob = aws.sdk.kotlin.services.codecommit.model.BlobMetadata.invoke(block)
        }

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy