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

commonMain.aws.sdk.kotlin.services.iot.model.AuthInfo.kt Maven / Gradle / Ivy

There is a newer version: 1.3.34
Show newest version
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!

package aws.sdk.kotlin.services.iot.model

import aws.smithy.kotlin.runtime.SdkDsl

/**
 * A collection of authorization information.
 */
public class AuthInfo private constructor(builder: Builder) {
    /**
     * The type of action for which the principal is being authorized.
     */
    public val actionType: aws.sdk.kotlin.services.iot.model.ActionType? = builder.actionType
    /**
     * The resources for which the principal is being authorized to perform the specified action.
     */
    public val resources: List = requireNotNull(builder.resources) { "A non-null value must be provided for resources" }

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

    override fun toString(): kotlin.String = buildString {
        append("AuthInfo(")
        append("actionType=$actionType,")
        append("resources=$resources")
        append(")")
    }

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

        if (actionType != other.actionType) return false
        if (resources != other.resources) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * The type of action for which the principal is being authorized.
         */
        public var actionType: aws.sdk.kotlin.services.iot.model.ActionType? = null
        /**
         * The resources for which the principal is being authorized to perform the specified action.
         */
        public var resources: List? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.iot.model.AuthInfo) : this() {
            this.actionType = x.actionType
            this.resources = x.resources
        }

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

        internal fun correctErrors(): Builder {
            if (resources == null) resources = emptyList()
            return this
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy