
commonMain.aws.sdk.kotlin.services.waf.model.WafInvalidPermissionPolicyException.kt Maven / Gradle / Ivy
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.waf.model
import aws.smithy.kotlin.runtime.SdkDsl
import aws.smithy.kotlin.runtime.ServiceErrorMetadata
/**
* The operation failed because the specified policy is not in the proper format.
*
* The policy is subject to the following restrictions:
* + You can attach only one policy with each `PutPermissionPolicy` request.
* + The policy must include an `Effect`, `Action` and `Principal`.
* + `Effect` must specify `Allow`.
* + The `Action` in the policy must be `waf:UpdateWebACL`, `waf-regional:UpdateWebACL`, `waf:GetRuleGroup` and `waf-regional:GetRuleGroup` . Any extra or wildcard actions in the policy will be rejected.
* + The policy cannot include a `Resource` parameter.
* + The ARN in the request must be a valid WAF RuleGroup ARN and the RuleGroup must exist in the same region.
* + The user making the request must be the owner of the RuleGroup.
* + Your policy must be composed using IAM Policy version 2012-10-17.
*/
public class WafInvalidPermissionPolicyException private constructor(builder: Builder) : WafException(builder.message) {
init {
sdkErrorMetadata.attributes[ServiceErrorMetadata.ErrorType] = ErrorType.Client
}
public companion object {
public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.waf.model.WafInvalidPermissionPolicyException = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("WafInvalidPermissionPolicyException(")
append("message=$message")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = message?.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 WafInvalidPermissionPolicyException
if (message != other.message) return false
return true
}
public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.waf.model.WafInvalidPermissionPolicyException = Builder(this).apply(block).build()
@SdkDsl
public class Builder {
public var message: kotlin.String? = null
@PublishedApi
internal constructor()
@PublishedApi
internal constructor(x: aws.sdk.kotlin.services.waf.model.WafInvalidPermissionPolicyException) : this() {
this.message = x.message
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.waf.model.WafInvalidPermissionPolicyException = WafInvalidPermissionPolicyException(this)
internal fun correctErrors(): Builder {
return this
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy