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

commonMain.aws.sdk.kotlin.services.iam.model.ResourceSpecificResult.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.iam.model



/**
 * Contains the result of the simulation of a single API operation call on a single resource.
 *
 * This data type is used by a member of the EvaluationResult data type.
 */
public class ResourceSpecificResult private constructor(builder: Builder) {
    /**
     * Additional details about the results of the evaluation decision on a single resource. This parameter is returned only for cross-account simulations. This parameter explains how each policy type contributes to the resource-specific evaluation decision.
     */
    public val evalDecisionDetails: Map? = builder.evalDecisionDetails
    /**
     * The result of the simulation of the simulated API operation on the resource specified in `EvalResourceName`.
     */
    public val evalResourceDecision: aws.sdk.kotlin.services.iam.model.PolicyEvaluationDecisionType = requireNotNull(builder.evalResourceDecision) { "A non-null value must be provided for evalResourceDecision" }
    /**
     * The name of the simulated resource, in Amazon Resource Name (ARN) format.
     */
    public val evalResourceName: kotlin.String = requireNotNull(builder.evalResourceName) { "A non-null value must be provided for evalResourceName" }
    /**
     * A list of the statements in the input policies that determine the result for this part of the simulation. Remember that even if multiple statements allow the operation on the resource, if *any* statement denies that operation, then the explicit deny overrides any allow. In addition, the deny statement is the only entry included in the result.
     */
    public val matchedStatements: List? = builder.matchedStatements
    /**
     * A list of context keys that are required by the included input policies but that were not provided by one of the input parameters. This list is used when a list of ARNs is included in the `ResourceArns` parameter instead of "*". If you do not specify individual resources, by setting `ResourceArns` to "*" or by not including the `ResourceArns` parameter, then any missing context values are instead included under the `EvaluationResults` section. To discover the context keys used by a set of policies, you can call GetContextKeysForCustomPolicy or GetContextKeysForPrincipalPolicy.
     */
    public val missingContextValues: List? = builder.missingContextValues
    /**
     * Contains information about the effect that a permissions boundary has on a policy simulation when that boundary is applied to an IAM entity.
     */
    public val permissionsBoundaryDecisionDetail: aws.sdk.kotlin.services.iam.model.PermissionsBoundaryDecisionDetail? = builder.permissionsBoundaryDecisionDetail

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

    override fun toString(): kotlin.String = buildString {
        append("ResourceSpecificResult(")
        append("evalDecisionDetails=$evalDecisionDetails,")
        append("evalResourceDecision=$evalResourceDecision,")
        append("evalResourceName=$evalResourceName,")
        append("matchedStatements=$matchedStatements,")
        append("missingContextValues=$missingContextValues,")
        append("permissionsBoundaryDecisionDetail=$permissionsBoundaryDecisionDetail")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = evalDecisionDetails?.hashCode() ?: 0
        result = 31 * result + (evalResourceDecision.hashCode())
        result = 31 * result + (evalResourceName.hashCode())
        result = 31 * result + (matchedStatements?.hashCode() ?: 0)
        result = 31 * result + (missingContextValues?.hashCode() ?: 0)
        result = 31 * result + (permissionsBoundaryDecisionDetail?.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 ResourceSpecificResult

        if (evalDecisionDetails != other.evalDecisionDetails) return false
        if (evalResourceDecision != other.evalResourceDecision) return false
        if (evalResourceName != other.evalResourceName) return false
        if (matchedStatements != other.matchedStatements) return false
        if (missingContextValues != other.missingContextValues) return false
        if (permissionsBoundaryDecisionDetail != other.permissionsBoundaryDecisionDetail) return false

        return true
    }

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

    public class Builder {
        /**
         * Additional details about the results of the evaluation decision on a single resource. This parameter is returned only for cross-account simulations. This parameter explains how each policy type contributes to the resource-specific evaluation decision.
         */
        public var evalDecisionDetails: Map? = null
        /**
         * The result of the simulation of the simulated API operation on the resource specified in `EvalResourceName`.
         */
        public var evalResourceDecision: aws.sdk.kotlin.services.iam.model.PolicyEvaluationDecisionType? = null
        /**
         * The name of the simulated resource, in Amazon Resource Name (ARN) format.
         */
        public var evalResourceName: kotlin.String? = null
        /**
         * A list of the statements in the input policies that determine the result for this part of the simulation. Remember that even if multiple statements allow the operation on the resource, if *any* statement denies that operation, then the explicit deny overrides any allow. In addition, the deny statement is the only entry included in the result.
         */
        public var matchedStatements: List? = null
        /**
         * A list of context keys that are required by the included input policies but that were not provided by one of the input parameters. This list is used when a list of ARNs is included in the `ResourceArns` parameter instead of "*". If you do not specify individual resources, by setting `ResourceArns` to "*" or by not including the `ResourceArns` parameter, then any missing context values are instead included under the `EvaluationResults` section. To discover the context keys used by a set of policies, you can call GetContextKeysForCustomPolicy or GetContextKeysForPrincipalPolicy.
         */
        public var missingContextValues: List? = null
        /**
         * Contains information about the effect that a permissions boundary has on a policy simulation when that boundary is applied to an IAM entity.
         */
        public var permissionsBoundaryDecisionDetail: aws.sdk.kotlin.services.iam.model.PermissionsBoundaryDecisionDetail? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.iam.model.ResourceSpecificResult) : this() {
            this.evalDecisionDetails = x.evalDecisionDetails
            this.evalResourceDecision = x.evalResourceDecision
            this.evalResourceName = x.evalResourceName
            this.matchedStatements = x.matchedStatements
            this.missingContextValues = x.missingContextValues
            this.permissionsBoundaryDecisionDetail = x.permissionsBoundaryDecisionDetail
        }

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

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

        internal fun correctErrors(): Builder {
            if (evalResourceDecision == null) evalResourceDecision = PolicyEvaluationDecisionType.SdkUnknown("no value provided")
            if (evalResourceName == null) evalResourceName = ""
            return this
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy