commonMain.aws.sdk.kotlin.services.glue.model.PutResourcePolicyRequest.kt Maven / Gradle / Ivy
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.glue.model
import aws.smithy.kotlin.runtime.SdkDsl
public class PutResourcePolicyRequest private constructor(builder: Builder) {
/**
* If `'TRUE'`, indicates that you are using both methods to grant cross-account access to Data Catalog resources:
* + By directly updating the resource policy with `PutResourePolicy`
* + By using the **Grant permissions** command on the Amazon Web Services Management Console.
*
* Must be set to `'TRUE'` if you have already used the Management Console to grant cross-account access, otherwise the call fails. Default is 'FALSE'.
*/
public val enableHybrid: aws.sdk.kotlin.services.glue.model.EnableHybridValues? = builder.enableHybrid
/**
* A value of `MUST_EXIST` is used to update a policy. A value of `NOT_EXIST` is used to create a new policy. If a value of `NONE` or a null value is used, the call does not depend on the existence of a policy.
*/
public val policyExistsCondition: aws.sdk.kotlin.services.glue.model.ExistCondition? = builder.policyExistsCondition
/**
* The hash value returned when the previous policy was set using `PutResourcePolicy`. Its purpose is to prevent concurrent modifications of a policy. Do not use this parameter if no previous policy has been set.
*/
public val policyHashCondition: kotlin.String? = builder.policyHashCondition
/**
* Contains the policy document to set, in JSON format.
*/
public val policyInJson: kotlin.String? = builder.policyInJson
/**
* Do not use. For internal use only.
*/
public val resourceArn: kotlin.String? = builder.resourceArn
public companion object {
public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.glue.model.PutResourcePolicyRequest = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("PutResourcePolicyRequest(")
append("enableHybrid=$enableHybrid,")
append("policyExistsCondition=$policyExistsCondition,")
append("policyHashCondition=$policyHashCondition,")
append("policyInJson=$policyInJson,")
append("resourceArn=$resourceArn")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = enableHybrid?.hashCode() ?: 0
result = 31 * result + (policyExistsCondition?.hashCode() ?: 0)
result = 31 * result + (policyHashCondition?.hashCode() ?: 0)
result = 31 * result + (policyInJson?.hashCode() ?: 0)
result = 31 * result + (resourceArn?.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 PutResourcePolicyRequest
if (enableHybrid != other.enableHybrid) return false
if (policyExistsCondition != other.policyExistsCondition) return false
if (policyHashCondition != other.policyHashCondition) return false
if (policyInJson != other.policyInJson) return false
if (resourceArn != other.resourceArn) return false
return true
}
public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.glue.model.PutResourcePolicyRequest = Builder(this).apply(block).build()
@SdkDsl
public class Builder {
/**
* If `'TRUE'`, indicates that you are using both methods to grant cross-account access to Data Catalog resources:
* + By directly updating the resource policy with `PutResourePolicy`
* + By using the **Grant permissions** command on the Amazon Web Services Management Console.
*
* Must be set to `'TRUE'` if you have already used the Management Console to grant cross-account access, otherwise the call fails. Default is 'FALSE'.
*/
public var enableHybrid: aws.sdk.kotlin.services.glue.model.EnableHybridValues? = null
/**
* A value of `MUST_EXIST` is used to update a policy. A value of `NOT_EXIST` is used to create a new policy. If a value of `NONE` or a null value is used, the call does not depend on the existence of a policy.
*/
public var policyExistsCondition: aws.sdk.kotlin.services.glue.model.ExistCondition? = null
/**
* The hash value returned when the previous policy was set using `PutResourcePolicy`. Its purpose is to prevent concurrent modifications of a policy. Do not use this parameter if no previous policy has been set.
*/
public var policyHashCondition: kotlin.String? = null
/**
* Contains the policy document to set, in JSON format.
*/
public var policyInJson: kotlin.String? = null
/**
* Do not use. For internal use only.
*/
public var resourceArn: kotlin.String? = null
@PublishedApi
internal constructor()
@PublishedApi
internal constructor(x: aws.sdk.kotlin.services.glue.model.PutResourcePolicyRequest) : this() {
this.enableHybrid = x.enableHybrid
this.policyExistsCondition = x.policyExistsCondition
this.policyHashCondition = x.policyHashCondition
this.policyInJson = x.policyInJson
this.resourceArn = x.resourceArn
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.glue.model.PutResourcePolicyRequest = PutResourcePolicyRequest(this)
internal fun correctErrors(): Builder {
return this
}
}
}