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

commonMain.aws.sdk.kotlin.services.verifiedpermissions.model.IsAuthorizedWithTokenResponse.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.verifiedpermissions.model



public class IsAuthorizedWithTokenResponse private constructor(builder: Builder) {
    /**
     * An authorization decision that indicates if the authorization request should be allowed or denied.
     */
    public val decision: aws.sdk.kotlin.services.verifiedpermissions.model.Decision = requireNotNull(builder.decision) { "A non-null value must be provided for decision" }
    /**
     * The list of determining policies used to make the authorization decision. For example, if there are multiple matching policies, where at least one is a forbid policy, then because forbid always overrides permit the forbid policies are the determining policies. If all matching policies are permit policies, then those policies are the determining policies. When no policies match and the response is the default DENY, there are no determining policies.
     */
    public val determiningPolicies: List = requireNotNull(builder.determiningPolicies) { "A non-null value must be provided for determiningPolicies" }
    /**
     * Errors that occurred while making an authorization decision. For example, a policy references an entity or entity attribute that does not exist in the slice.
     */
    public val errors: List = requireNotNull(builder.errors) { "A non-null value must be provided for errors" }

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

    override fun toString(): kotlin.String = buildString {
        append("IsAuthorizedWithTokenResponse(")
        append("decision=$decision,")
        append("determiningPolicies=$determiningPolicies,")
        append("errors=$errors")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = decision.hashCode()
        result = 31 * result + (determiningPolicies.hashCode())
        result = 31 * result + (errors.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 IsAuthorizedWithTokenResponse

        if (decision != other.decision) return false
        if (determiningPolicies != other.determiningPolicies) return false
        if (errors != other.errors) return false

        return true
    }

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

    public class Builder {
        /**
         * An authorization decision that indicates if the authorization request should be allowed or denied.
         */
        public var decision: aws.sdk.kotlin.services.verifiedpermissions.model.Decision? = null
        /**
         * The list of determining policies used to make the authorization decision. For example, if there are multiple matching policies, where at least one is a forbid policy, then because forbid always overrides permit the forbid policies are the determining policies. If all matching policies are permit policies, then those policies are the determining policies. When no policies match and the response is the default DENY, there are no determining policies.
         */
        public var determiningPolicies: List? = null
        /**
         * Errors that occurred while making an authorization decision. For example, a policy references an entity or entity attribute that does not exist in the slice.
         */
        public var errors: List? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.verifiedpermissions.model.IsAuthorizedWithTokenResponse) : this() {
            this.decision = x.decision
            this.determiningPolicies = x.determiningPolicies
            this.errors = x.errors
        }

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

        internal fun correctErrors(): Builder {
            if (decision == null) decision = Decision.SdkUnknown("no value provided")
            if (determiningPolicies == null) determiningPolicies = emptyList()
            if (errors == null) errors = emptyList()
            return this
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy