
commonMain.aws.sdk.kotlin.services.verifiedpermissions.model.IsAuthorizedRequest.kt Maven / Gradle / Ivy
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.verifiedpermissions.model
public class IsAuthorizedRequest private constructor(builder: Builder) {
/**
* Specifies the requested action to be authorized. For example, is the principal authorized to perform this action on the resource?
*/
public val action: aws.sdk.kotlin.services.verifiedpermissions.model.ActionIdentifier? = builder.action
/**
* Specifies additional context that can be used to make more granular authorization decisions.
*/
public val context: aws.sdk.kotlin.services.verifiedpermissions.model.ContextDefinition? = builder.context
/**
* Specifies the list of resources and principals and their associated attributes that Verified Permissions can examine when evaluating the policies.
*
* You can include only principal and resource entities in this parameter; you can't include actions. You must specify actions in the schema.
*/
public val entities: aws.sdk.kotlin.services.verifiedpermissions.model.EntitiesDefinition? = builder.entities
/**
* Specifies the ID of the policy store. Policies in this policy store will be used to make an authorization decision for the input.
*/
public val policyStoreId: kotlin.String? = builder.policyStoreId
/**
* Specifies the principal for which the authorization decision is to be made.
*/
public val principal: aws.sdk.kotlin.services.verifiedpermissions.model.EntityIdentifier? = builder.principal
/**
* Specifies the resource for which the authorization decision is to be made.
*/
public val resource: aws.sdk.kotlin.services.verifiedpermissions.model.EntityIdentifier? = builder.resource
public companion object {
public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.verifiedpermissions.model.IsAuthorizedRequest = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("IsAuthorizedRequest(")
append("action=$action,")
append("context=$context,")
append("entities=$entities,")
append("policyStoreId=$policyStoreId,")
append("principal=$principal,")
append("resource=$resource")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = action?.hashCode() ?: 0
result = 31 * result + (context?.hashCode() ?: 0)
result = 31 * result + (entities?.hashCode() ?: 0)
result = 31 * result + (policyStoreId?.hashCode() ?: 0)
result = 31 * result + (principal?.hashCode() ?: 0)
result = 31 * result + (resource?.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 IsAuthorizedRequest
if (action != other.action) return false
if (context != other.context) return false
if (entities != other.entities) return false
if (policyStoreId != other.policyStoreId) return false
if (principal != other.principal) return false
if (resource != other.resource) return false
return true
}
public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.verifiedpermissions.model.IsAuthorizedRequest = Builder(this).apply(block).build()
public class Builder {
/**
* Specifies the requested action to be authorized. For example, is the principal authorized to perform this action on the resource?
*/
public var action: aws.sdk.kotlin.services.verifiedpermissions.model.ActionIdentifier? = null
/**
* Specifies additional context that can be used to make more granular authorization decisions.
*/
public var context: aws.sdk.kotlin.services.verifiedpermissions.model.ContextDefinition? = null
/**
* Specifies the list of resources and principals and their associated attributes that Verified Permissions can examine when evaluating the policies.
*
* You can include only principal and resource entities in this parameter; you can't include actions. You must specify actions in the schema.
*/
public var entities: aws.sdk.kotlin.services.verifiedpermissions.model.EntitiesDefinition? = null
/**
* Specifies the ID of the policy store. Policies in this policy store will be used to make an authorization decision for the input.
*/
public var policyStoreId: kotlin.String? = null
/**
* Specifies the principal for which the authorization decision is to be made.
*/
public var principal: aws.sdk.kotlin.services.verifiedpermissions.model.EntityIdentifier? = null
/**
* Specifies the resource for which the authorization decision is to be made.
*/
public var resource: aws.sdk.kotlin.services.verifiedpermissions.model.EntityIdentifier? = null
@PublishedApi
internal constructor()
@PublishedApi
internal constructor(x: aws.sdk.kotlin.services.verifiedpermissions.model.IsAuthorizedRequest) : this() {
this.action = x.action
this.context = x.context
this.entities = x.entities
this.policyStoreId = x.policyStoreId
this.principal = x.principal
this.resource = x.resource
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.verifiedpermissions.model.IsAuthorizedRequest = IsAuthorizedRequest(this)
/**
* construct an [aws.sdk.kotlin.services.verifiedpermissions.model.ActionIdentifier] inside the given [block]
*/
public fun action(block: aws.sdk.kotlin.services.verifiedpermissions.model.ActionIdentifier.Builder.() -> kotlin.Unit) {
this.action = aws.sdk.kotlin.services.verifiedpermissions.model.ActionIdentifier.invoke(block)
}
/**
* construct an [aws.sdk.kotlin.services.verifiedpermissions.model.EntityIdentifier] inside the given [block]
*/
public fun principal(block: aws.sdk.kotlin.services.verifiedpermissions.model.EntityIdentifier.Builder.() -> kotlin.Unit) {
this.principal = aws.sdk.kotlin.services.verifiedpermissions.model.EntityIdentifier.invoke(block)
}
/**
* construct an [aws.sdk.kotlin.services.verifiedpermissions.model.EntityIdentifier] inside the given [block]
*/
public fun resource(block: aws.sdk.kotlin.services.verifiedpermissions.model.EntityIdentifier.Builder.() -> kotlin.Unit) {
this.resource = aws.sdk.kotlin.services.verifiedpermissions.model.EntityIdentifier.invoke(block)
}
internal fun correctErrors(): Builder {
return this
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy