github.com/aavshr/aws-sdk-go@v1.41.3/service/waf/errors.go (about)

     1  // Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
     2  
     3  package waf
     4  
     5  import (
     6  	"github.com/aavshr/aws-sdk-go/private/protocol"
     7  )
     8  
     9  const (
    10  
    11  	// ErrCodeBadRequestException for service response error code
    12  	// "WAFBadRequestException".
    13  	ErrCodeBadRequestException = "WAFBadRequestException"
    14  
    15  	// ErrCodeDisallowedNameException for service response error code
    16  	// "WAFDisallowedNameException".
    17  	//
    18  	// The name specified is invalid.
    19  	ErrCodeDisallowedNameException = "WAFDisallowedNameException"
    20  
    21  	// ErrCodeInternalErrorException for service response error code
    22  	// "WAFInternalErrorException".
    23  	//
    24  	// The operation failed because of a system problem, even though the request
    25  	// was valid. Retry your request.
    26  	ErrCodeInternalErrorException = "WAFInternalErrorException"
    27  
    28  	// ErrCodeInvalidAccountException for service response error code
    29  	// "WAFInvalidAccountException".
    30  	//
    31  	// The operation failed because you tried to create, update, or delete an object
    32  	// by using an invalid account identifier.
    33  	ErrCodeInvalidAccountException = "WAFInvalidAccountException"
    34  
    35  	// ErrCodeInvalidOperationException for service response error code
    36  	// "WAFInvalidOperationException".
    37  	//
    38  	// The operation failed because there was nothing to do. For example:
    39  	//
    40  	//    * You tried to remove a Rule from a WebACL, but the Rule isn't in the
    41  	//    specified WebACL.
    42  	//
    43  	//    * You tried to remove an IP address from an IPSet, but the IP address
    44  	//    isn't in the specified IPSet.
    45  	//
    46  	//    * You tried to remove a ByteMatchTuple from a ByteMatchSet, but the ByteMatchTuple
    47  	//    isn't in the specified WebACL.
    48  	//
    49  	//    * You tried to add a Rule to a WebACL, but the Rule already exists in
    50  	//    the specified WebACL.
    51  	//
    52  	//    * You tried to add a ByteMatchTuple to a ByteMatchSet, but the ByteMatchTuple
    53  	//    already exists in the specified WebACL.
    54  	ErrCodeInvalidOperationException = "WAFInvalidOperationException"
    55  
    56  	// ErrCodeInvalidParameterException for service response error code
    57  	// "WAFInvalidParameterException".
    58  	//
    59  	// The operation failed because AWS WAF didn't recognize a parameter in the
    60  	// request. For example:
    61  	//
    62  	//    * You specified an invalid parameter name.
    63  	//
    64  	//    * You specified an invalid value.
    65  	//
    66  	//    * You tried to update an object (ByteMatchSet, IPSet, Rule, or WebACL)
    67  	//    using an action other than INSERT or DELETE.
    68  	//
    69  	//    * You tried to create a WebACL with a DefaultAction Type other than ALLOW,
    70  	//    BLOCK, or COUNT.
    71  	//
    72  	//    * You tried to create a RateBasedRule with a RateKey value other than
    73  	//    IP.
    74  	//
    75  	//    * You tried to update a WebACL with a WafAction Type other than ALLOW,
    76  	//    BLOCK, or COUNT.
    77  	//
    78  	//    * You tried to update a ByteMatchSet with a FieldToMatch Type other than
    79  	//    HEADER, METHOD, QUERY_STRING, URI, or BODY.
    80  	//
    81  	//    * You tried to update a ByteMatchSet with a Field of HEADER but no value
    82  	//    for Data.
    83  	//
    84  	//    * Your request references an ARN that is malformed, or corresponds to
    85  	//    a resource with which a web ACL cannot be associated.
    86  	ErrCodeInvalidParameterException = "WAFInvalidParameterException"
    87  
    88  	// ErrCodeInvalidPermissionPolicyException for service response error code
    89  	// "WAFInvalidPermissionPolicyException".
    90  	//
    91  	// The operation failed because the specified policy is not in the proper format.
    92  	//
    93  	// The policy is subject to the following restrictions:
    94  	//
    95  	//    * You can attach only one policy with each PutPermissionPolicy request.
    96  	//
    97  	//    * The policy must include an Effect, Action and Principal.
    98  	//
    99  	//    * Effect must specify Allow.
   100  	//
   101  	//    * The Action in the policy must be waf:UpdateWebACL, waf-regional:UpdateWebACL,
   102  	//    waf:GetRuleGroup and waf-regional:GetRuleGroup . Any extra or wildcard
   103  	//    actions in the policy will be rejected.
   104  	//
   105  	//    * The policy cannot include a Resource parameter.
   106  	//
   107  	//    * The ARN in the request must be a valid WAF RuleGroup ARN and the RuleGroup
   108  	//    must exist in the same region.
   109  	//
   110  	//    * The user making the request must be the owner of the RuleGroup.
   111  	//
   112  	//    * Your policy must be composed using IAM Policy version 2012-10-17.
   113  	ErrCodeInvalidPermissionPolicyException = "WAFInvalidPermissionPolicyException"
   114  
   115  	// ErrCodeInvalidRegexPatternException for service response error code
   116  	// "WAFInvalidRegexPatternException".
   117  	//
   118  	// The regular expression (regex) you specified in RegexPatternString is invalid.
   119  	ErrCodeInvalidRegexPatternException = "WAFInvalidRegexPatternException"
   120  
   121  	// ErrCodeLimitsExceededException for service response error code
   122  	// "WAFLimitsExceededException".
   123  	//
   124  	// The operation exceeds a resource limit, for example, the maximum number of
   125  	// WebACL objects that you can create for an AWS account. For more information,
   126  	// see Limits (https://docs.aws.amazon.com/waf/latest/developerguide/limits.html)
   127  	// in the AWS WAF Developer Guide.
   128  	ErrCodeLimitsExceededException = "WAFLimitsExceededException"
   129  
   130  	// ErrCodeNonEmptyEntityException for service response error code
   131  	// "WAFNonEmptyEntityException".
   132  	//
   133  	// The operation failed because you tried to delete an object that isn't empty.
   134  	// For example:
   135  	//
   136  	//    * You tried to delete a WebACL that still contains one or more Rule objects.
   137  	//
   138  	//    * You tried to delete a Rule that still contains one or more ByteMatchSet
   139  	//    objects or other predicates.
   140  	//
   141  	//    * You tried to delete a ByteMatchSet that contains one or more ByteMatchTuple
   142  	//    objects.
   143  	//
   144  	//    * You tried to delete an IPSet that references one or more IP addresses.
   145  	ErrCodeNonEmptyEntityException = "WAFNonEmptyEntityException"
   146  
   147  	// ErrCodeNonexistentContainerException for service response error code
   148  	// "WAFNonexistentContainerException".
   149  	//
   150  	// The operation failed because you tried to add an object to or delete an object
   151  	// from another object that doesn't exist. For example:
   152  	//
   153  	//    * You tried to add a Rule to or delete a Rule from a WebACL that doesn't
   154  	//    exist.
   155  	//
   156  	//    * You tried to add a ByteMatchSet to or delete a ByteMatchSet from a Rule
   157  	//    that doesn't exist.
   158  	//
   159  	//    * You tried to add an IP address to or delete an IP address from an IPSet
   160  	//    that doesn't exist.
   161  	//
   162  	//    * You tried to add a ByteMatchTuple to or delete a ByteMatchTuple from
   163  	//    a ByteMatchSet that doesn't exist.
   164  	ErrCodeNonexistentContainerException = "WAFNonexistentContainerException"
   165  
   166  	// ErrCodeNonexistentItemException for service response error code
   167  	// "WAFNonexistentItemException".
   168  	//
   169  	// The operation failed because the referenced object doesn't exist.
   170  	ErrCodeNonexistentItemException = "WAFNonexistentItemException"
   171  
   172  	// ErrCodeReferencedItemException for service response error code
   173  	// "WAFReferencedItemException".
   174  	//
   175  	// The operation failed because you tried to delete an object that is still
   176  	// in use. For example:
   177  	//
   178  	//    * You tried to delete a ByteMatchSet that is still referenced by a Rule.
   179  	//
   180  	//    * You tried to delete a Rule that is still referenced by a WebACL.
   181  	ErrCodeReferencedItemException = "WAFReferencedItemException"
   182  
   183  	// ErrCodeServiceLinkedRoleErrorException for service response error code
   184  	// "WAFServiceLinkedRoleErrorException".
   185  	//
   186  	// AWS WAF is not able to access the service linked role. This can be caused
   187  	// by a previous PutLoggingConfiguration request, which can lock the service
   188  	// linked role for about 20 seconds. Please try your request again. The service
   189  	// linked role can also be locked by a previous DeleteServiceLinkedRole request,
   190  	// which can lock the role for 15 minutes or more. If you recently made a DeleteServiceLinkedRole,
   191  	// wait at least 15 minutes and try the request again. If you receive this same
   192  	// exception again, you will have to wait additional time until the role is
   193  	// unlocked.
   194  	ErrCodeServiceLinkedRoleErrorException = "WAFServiceLinkedRoleErrorException"
   195  
   196  	// ErrCodeStaleDataException for service response error code
   197  	// "WAFStaleDataException".
   198  	//
   199  	// The operation failed because you tried to create, update, or delete an object
   200  	// by using a change token that has already been used.
   201  	ErrCodeStaleDataException = "WAFStaleDataException"
   202  
   203  	// ErrCodeSubscriptionNotFoundException for service response error code
   204  	// "WAFSubscriptionNotFoundException".
   205  	//
   206  	// The specified subscription does not exist.
   207  	ErrCodeSubscriptionNotFoundException = "WAFSubscriptionNotFoundException"
   208  
   209  	// ErrCodeTagOperationException for service response error code
   210  	// "WAFTagOperationException".
   211  	ErrCodeTagOperationException = "WAFTagOperationException"
   212  
   213  	// ErrCodeTagOperationInternalErrorException for service response error code
   214  	// "WAFTagOperationInternalErrorException".
   215  	ErrCodeTagOperationInternalErrorException = "WAFTagOperationInternalErrorException"
   216  
   217  	// ErrCodeWAFEntityMigrationException for service response error code
   218  	// "WAFEntityMigrationException".
   219  	//
   220  	// The operation failed due to a problem with the migration. The failure cause
   221  	// is provided in the exception, in the MigrationErrorType:
   222  	//
   223  	//    * ENTITY_NOT_SUPPORTED - The web ACL has an unsupported entity but the
   224  	//    IgnoreUnsupportedType is not set to true.
   225  	//
   226  	//    * ENTITY_NOT_FOUND - The web ACL doesn't exist.
   227  	//
   228  	//    * S3_BUCKET_NO_PERMISSION - You don't have permission to perform the PutObject
   229  	//    action to the specified Amazon S3 bucket.
   230  	//
   231  	//    * S3_BUCKET_NOT_ACCESSIBLE - The bucket policy doesn't allow AWS WAF to
   232  	//    perform the PutObject action in the bucket.
   233  	//
   234  	//    * S3_BUCKET_NOT_FOUND - The S3 bucket doesn't exist.
   235  	//
   236  	//    * S3_BUCKET_INVALID_REGION - The S3 bucket is not in the same Region as
   237  	//    the web ACL.
   238  	//
   239  	//    * S3_INTERNAL_ERROR - AWS WAF failed to create the template in the S3
   240  	//    bucket for another reason.
   241  	ErrCodeWAFEntityMigrationException = "WAFEntityMigrationException"
   242  )
   243  
   244  var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{
   245  	"WAFBadRequestException":                newErrorBadRequestException,
   246  	"WAFDisallowedNameException":            newErrorDisallowedNameException,
   247  	"WAFInternalErrorException":             newErrorInternalErrorException,
   248  	"WAFInvalidAccountException":            newErrorInvalidAccountException,
   249  	"WAFInvalidOperationException":          newErrorInvalidOperationException,
   250  	"WAFInvalidParameterException":          newErrorInvalidParameterException,
   251  	"WAFInvalidPermissionPolicyException":   newErrorInvalidPermissionPolicyException,
   252  	"WAFInvalidRegexPatternException":       newErrorInvalidRegexPatternException,
   253  	"WAFLimitsExceededException":            newErrorLimitsExceededException,
   254  	"WAFNonEmptyEntityException":            newErrorNonEmptyEntityException,
   255  	"WAFNonexistentContainerException":      newErrorNonexistentContainerException,
   256  	"WAFNonexistentItemException":           newErrorNonexistentItemException,
   257  	"WAFReferencedItemException":            newErrorReferencedItemException,
   258  	"WAFServiceLinkedRoleErrorException":    newErrorServiceLinkedRoleErrorException,
   259  	"WAFStaleDataException":                 newErrorStaleDataException,
   260  	"WAFSubscriptionNotFoundException":      newErrorSubscriptionNotFoundException,
   261  	"WAFTagOperationException":              newErrorTagOperationException,
   262  	"WAFTagOperationInternalErrorException": newErrorTagOperationInternalErrorException,
   263  	"WAFEntityMigrationException":           newErrorWAFEntityMigrationException,
   264  }