commonMain.aws.sdk.kotlin.services.wafv2.model.WafInvalidPermissionPolicyException.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of wafv2-jvm Show documentation
Show all versions of wafv2-jvm Show documentation
The AWS Kotlin client for WAFV2
The newest version!
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.wafv2.model
import aws.smithy.kotlin.runtime.SdkDsl
import aws.smithy.kotlin.runtime.ServiceErrorMetadata
/**
* The operation failed because the specified policy isn't in the proper format.
*
* The policy specifications must conform to the following:
* + The policy must be composed using IAM Policy version 2012-10-17.
* + The policy must include specifications for `Effect`, `Action`, and `Principal`.
* + `Effect` must specify `Allow`.
* + `Action` must specify `wafv2:CreateWebACL`, `wafv2:UpdateWebACL`, and `wafv2:PutFirewallManagerRuleGroups` and may optionally specify `wafv2:GetRuleGroup`. WAF rejects any extra actions or wildcard actions in the policy.
* + The policy must not include a `Resource` parameter.
*
* For more information, see [IAM Policies](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html).
*/
public class WafInvalidPermissionPolicyException private constructor(builder: Builder) : Wafv2Exception(builder.message) {
init {
sdkErrorMetadata.attributes[ServiceErrorMetadata.ErrorType] = ErrorType.Client
}
public companion object {
public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.wafv2.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.wafv2.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.wafv2.model.WafInvalidPermissionPolicyException) : this() {
this.message = x.message
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.wafv2.model.WafInvalidPermissionPolicyException = WafInvalidPermissionPolicyException(this)
internal fun correctErrors(): Builder {
return this
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy