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

commonMain.aws.sdk.kotlin.services.qapps.model.PermissionInput.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.qapps.model

import aws.smithy.kotlin.runtime.SdkDsl

/**
 * The permission to grant or revoke for a Amazon Q App.
 */
public class PermissionInput private constructor(builder: Builder) {
    /**
     * The action associated with the permission.
     */
    public val action: aws.sdk.kotlin.services.qapps.model.Action = requireNotNull(builder.action) { "A non-null value must be provided for action" }
    /**
     * The principal user to which the permission applies.
     */
    public val principal: kotlin.String = requireNotNull(builder.principal) { "A non-null value must be provided for principal" }

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

    override fun toString(): kotlin.String = buildString {
        append("PermissionInput(")
        append("action=$action,")
        append("principal=$principal")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = action.hashCode()
        result = 31 * result + (principal.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 PermissionInput

        if (action != other.action) return false
        if (principal != other.principal) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * The action associated with the permission.
         */
        public var action: aws.sdk.kotlin.services.qapps.model.Action? = null
        /**
         * The principal user to which the permission applies.
         */
        public var principal: kotlin.String? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.qapps.model.PermissionInput) : this() {
            this.action = x.action
            this.principal = x.principal
        }

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

        internal fun correctErrors(): Builder {
            if (action == null) action = Action.SdkUnknown("no value provided")
            if (principal == null) principal = ""
            return this
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy