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

commonMain.aws.sdk.kotlin.services.codecommit.model.Approval.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 specific approval on a pull request.
 */
public class Approval private constructor(builder: Builder) {
    /**
     * The state of the approval, APPROVE or REVOKE. REVOKE states are not stored.
     */
    public val approvalState: aws.sdk.kotlin.services.codecommit.model.ApprovalState? = builder.approvalState
    /**
     * The Amazon Resource Name (ARN) of the user.
     */
    public val userArn: kotlin.String? = builder.userArn

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

    override fun toString(): kotlin.String = buildString {
        append("Approval(")
        append("approvalState=$approvalState,")
        append("userArn=$userArn")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = approvalState?.hashCode() ?: 0
        result = 31 * result + (userArn?.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 Approval

        if (approvalState != other.approvalState) return false
        if (userArn != other.userArn) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * The state of the approval, APPROVE or REVOKE. REVOKE states are not stored.
         */
        public var approvalState: aws.sdk.kotlin.services.codecommit.model.ApprovalState? = null
        /**
         * The Amazon Resource Name (ARN) of the user.
         */
        public var userArn: kotlin.String? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.codecommit.model.Approval) : this() {
            this.approvalState = x.approvalState
            this.userArn = x.userArn
        }

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy