How to use match method of Token class

Best Cucumber Common Library code snippet using Token.match

api-2.json.php

Source:api-2.json.php Github

copy

Full Screen

1<?php2// This file was auto-generated from sdk-root/src/data/waf/2015-08-24/api-2.json3return [ 'version' => '2.0', 'metadata' => [ 'apiVersion' => '2015-08-24', 'endpointPrefix' => 'waf', 'jsonVersion' => '1.1', 'protocol' => 'json', 'serviceAbbreviation' => 'WAF', 'serviceFullName' => 'AWS WAF', 'serviceId' => 'WAF', 'signatureVersion' => 'v4', 'targetPrefix' => 'AWSWAF_20150824', 'uid' => 'waf-2015-08-24', ], 'operations' => [ 'CreateByteMatchSet' => [ 'name' => 'CreateByteMatchSet', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'CreateByteMatchSetRequest', ], 'output' => [ 'shape' => 'CreateByteMatchSetResponse', ], 'errors' => [ [ 'shape' => 'WAFDisallowedNameException', ], [ 'shape' => 'WAFInternalErrorException', ], [ 'shape' => 'WAFInvalidAccountException', ], [ 'shape' => 'WAFInvalidParameterException', ], [ 'shape' => 'WAFStaleDataException', ], [ 'shape' => 'WAFLimitsExceededException', ], ], ], 'CreateGeoMatchSet' => [ 'name' => 'CreateGeoMatchSet', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'CreateGeoMatchSetRequest', ], 'output' => [ 'shape' => 'CreateGeoMatchSetResponse', ], 'errors' => [ [ 'shape' => 'WAFStaleDataException', ], [ 'shape' => 'WAFInternalErrorException', ], [ 'shape' => 'WAFInvalidAccountException', ], [ 'shape' => 'WAFDisallowedNameException', ], [ 'shape' => 'WAFInvalidParameterException', ], [ 'shape' => 'WAFLimitsExceededException', ], ], ], 'CreateIPSet' => [ 'name' => 'CreateIPSet', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'CreateIPSetRequest', ], 'output' => [ 'shape' => 'CreateIPSetResponse', ], 'errors' => [ [ 'shape' => 'WAFStaleDataException', ], [ 'shape' => 'WAFInternalErrorException', ], [ 'shape' => 'WAFInvalidAccountException', ], [ 'shape' => 'WAFDisallowedNameException', ], [ 'shape' => 'WAFInvalidParameterException', ], [ 'shape' => 'WAFLimitsExceededException', ], ], ], 'CreateRateBasedRule' => [ 'name' => 'CreateRateBasedRule', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'CreateRateBasedRuleRequest', ], 'output' => [ 'shape' => 'CreateRateBasedRuleResponse', ], 'errors' => [ [ 'shape' => 'WAFStaleDataException', ], [ 'shape' => 'WAFInternalErrorException', ], [ 'shape' => 'WAFDisallowedNameException', ], [ 'shape' => 'WAFInvalidParameterException', ], [ 'shape' => 'WAFLimitsExceededException', ], ], ], 'CreateRegexMatchSet' => [ 'name' => 'CreateRegexMatchSet', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'CreateRegexMatchSetRequest', ], 'output' => [ 'shape' => 'CreateRegexMatchSetResponse', ], 'errors' => [ [ 'shape' => 'WAFStaleDataException', ], [ 'shape' => 'WAFInternalErrorException', ], [ 'shape' => 'WAFDisallowedNameException', ], [ 'shape' => 'WAFLimitsExceededException', ], ], ], 'CreateRegexPatternSet' => [ 'name' => 'CreateRegexPatternSet', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'CreateRegexPatternSetRequest', ], 'output' => [ 'shape' => 'CreateRegexPatternSetResponse', ], 'errors' => [ [ 'shape' => 'WAFStaleDataException', ], [ 'shape' => 'WAFInternalErrorException', ], [ 'shape' => 'WAFDisallowedNameException', ], [ 'shape' => 'WAFLimitsExceededException', ], ], ], 'CreateRule' => [ 'name' => 'CreateRule', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'CreateRuleRequest', ], 'output' => [ 'shape' => 'CreateRuleResponse', ], 'errors' => [ [ 'shape' => 'WAFStaleDataException', ], [ 'shape' => 'WAFInternalErrorException', ], [ 'shape' => 'WAFDisallowedNameException', ], [ 'shape' => 'WAFInvalidParameterException', ], [ 'shape' => 'WAFLimitsExceededException', ], ], ], 'CreateRuleGroup' => [ 'name' => 'CreateRuleGroup', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'CreateRuleGroupRequest', ], 'output' => [ 'shape' => 'CreateRuleGroupResponse', ], 'errors' => [ [ 'shape' => 'WAFStaleDataException', ], [ 'shape' => 'WAFInternalErrorException', ], [ 'shape' => 'WAFDisallowedNameException', ], [ 'shape' => 'WAFLimitsExceededException', ], ], ], 'CreateSizeConstraintSet' => [ 'name' => 'CreateSizeConstraintSet', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'CreateSizeConstraintSetRequest', ], 'output' => [ 'shape' => 'CreateSizeConstraintSetResponse', ], 'errors' => [ [ 'shape' => 'WAFStaleDataException', ], [ 'shape' => 'WAFInternalErrorException', ], [ 'shape' => 'WAFInvalidAccountException', ], [ 'shape' => 'WAFDisallowedNameException', ], [ 'shape' => 'WAFInvalidParameterException', ], [ 'shape' => 'WAFLimitsExceededException', ], ], ], 'CreateSqlInjectionMatchSet' => [ 'name' => 'CreateSqlInjectionMatchSet', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'CreateSqlInjectionMatchSetRequest', ], 'output' => [ 'shape' => 'CreateSqlInjectionMatchSetResponse', ], 'errors' => [ [ 'shape' => 'WAFDisallowedNameException', ], [ 'shape' => 'WAFInternalErrorException', ], [ 'shape' => 'WAFInvalidAccountException', ], [ 'shape' => 'WAFInvalidParameterException', ], [ 'shape' => 'WAFStaleDataException', ], [ 'shape' => 'WAFLimitsExceededException', ], ], ], 'CreateWebACL' => [ 'name' => 'CreateWebACL', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'CreateWebACLRequest', ], 'output' => [ 'shape' => 'CreateWebACLResponse', ], 'errors' => [ [ 'shape' => 'WAFStaleDataException', ], [ 'shape' => 'WAFInternalErrorException', ], [ 'shape' => 'WAFInvalidAccountException', ], [ 'shape' => 'WAFDisallowedNameException', ], [ 'shape' => 'WAFInvalidParameterException', ], [ 'shape' => 'WAFLimitsExceededException', ], ], ], 'CreateXssMatchSet' => [ 'name' => 'CreateXssMatchSet', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'CreateXssMatchSetRequest', ], 'output' => [ 'shape' => 'CreateXssMatchSetResponse', ], 'errors' => [ [ 'shape' => 'WAFDisallowedNameException', ], [ 'shape' => 'WAFInternalErrorException', ], [ 'shape' => 'WAFInvalidAccountException', ], [ 'shape' => 'WAFInvalidParameterException', ], [ 'shape' => 'WAFStaleDataException', ], [ 'shape' => 'WAFLimitsExceededException', ], ], ], 'DeleteByteMatchSet' => [ 'name' => 'DeleteByteMatchSet', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DeleteByteMatchSetRequest', ], 'output' => [ 'shape' => 'DeleteByteMatchSetResponse', ], 'errors' => [ [ 'shape' => 'WAFInternalErrorException', ], [ 'shape' => 'WAFInvalidAccountException', ], [ 'shape' => 'WAFNonexistentItemException', ], [ 'shape' => 'WAFReferencedItemException', ], [ 'shape' => 'WAFStaleDataException', ], [ 'shape' => 'WAFNonEmptyEntityException', ], ], ], 'DeleteGeoMatchSet' => [ 'name' => 'DeleteGeoMatchSet', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DeleteGeoMatchSetRequest', ], 'output' => [ 'shape' => 'DeleteGeoMatchSetResponse', ], 'errors' => [ [ 'shape' => 'WAFStaleDataException', ], [ 'shape' => 'WAFInternalErrorException', ], [ 'shape' => 'WAFInvalidAccountException', ], [ 'shape' => 'WAFNonexistentItemException', ], [ 'shape' => 'WAFReferencedItemException', ], [ 'shape' => 'WAFNonEmptyEntityException', ], ], ], 'DeleteIPSet' => [ 'name' => 'DeleteIPSet', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DeleteIPSetRequest', ], 'output' => [ 'shape' => 'DeleteIPSetResponse', ], 'errors' => [ [ 'shape' => 'WAFStaleDataException', ], [ 'shape' => 'WAFInternalErrorException', ], [ 'shape' => 'WAFInvalidAccountException', ], [ 'shape' => 'WAFNonexistentItemException', ], [ 'shape' => 'WAFReferencedItemException', ], [ 'shape' => 'WAFNonEmptyEntityException', ], ], ], 'DeleteRateBasedRule' => [ 'name' => 'DeleteRateBasedRule', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DeleteRateBasedRuleRequest', ], 'output' => [ 'shape' => 'DeleteRateBasedRuleResponse', ], 'errors' => [ [ 'shape' => 'WAFStaleDataException', ], [ 'shape' => 'WAFInternalErrorException', ], [ 'shape' => 'WAFInvalidAccountException', ], [ 'shape' => 'WAFNonexistentItemException', ], [ 'shape' => 'WAFReferencedItemException', ], [ 'shape' => 'WAFNonEmptyEntityException', ], ], ], 'DeleteRegexMatchSet' => [ 'name' => 'DeleteRegexMatchSet', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DeleteRegexMatchSetRequest', ], 'output' => [ 'shape' => 'DeleteRegexMatchSetResponse', ], 'errors' => [ [ 'shape' => 'WAFInternalErrorException', ], [ 'shape' => 'WAFInvalidAccountException', ], [ 'shape' => 'WAFNonexistentItemException', ], [ 'shape' => 'WAFReferencedItemException', ], [ 'shape' => 'WAFStaleDataException', ], [ 'shape' => 'WAFNonEmptyEntityException', ], ], ], 'DeleteRegexPatternSet' => [ 'name' => 'DeleteRegexPatternSet', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DeleteRegexPatternSetRequest', ], 'output' => [ 'shape' => 'DeleteRegexPatternSetResponse', ], 'errors' => [ [ 'shape' => 'WAFInternalErrorException', ], [ 'shape' => 'WAFInvalidAccountException', ], [ 'shape' => 'WAFNonexistentItemException', ], [ 'shape' => 'WAFReferencedItemException', ], [ 'shape' => 'WAFStaleDataException', ], [ 'shape' => 'WAFNonEmptyEntityException', ], ], ], 'DeleteRule' => [ 'name' => 'DeleteRule', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DeleteRuleRequest', ], 'output' => [ 'shape' => 'DeleteRuleResponse', ], 'errors' => [ [ 'shape' => 'WAFStaleDataException', ], [ 'shape' => 'WAFInternalErrorException', ], [ 'shape' => 'WAFInvalidAccountException', ], [ 'shape' => 'WAFNonexistentItemException', ], [ 'shape' => 'WAFReferencedItemException', ], [ 'shape' => 'WAFNonEmptyEntityException', ], ], ], 'DeleteRuleGroup' => [ 'name' => 'DeleteRuleGroup', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DeleteRuleGroupRequest', ], 'output' => [ 'shape' => 'DeleteRuleGroupResponse', ], 'errors' => [ [ 'shape' => 'WAFStaleDataException', ], [ 'shape' => 'WAFInternalErrorException', ], [ 'shape' => 'WAFNonexistentItemException', ], [ 'shape' => 'WAFReferencedItemException', ], [ 'shape' => 'WAFNonEmptyEntityException', ], ], ], 'DeleteSizeConstraintSet' => [ 'name' => 'DeleteSizeConstraintSet', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DeleteSizeConstraintSetRequest', ], 'output' => [ 'shape' => 'DeleteSizeConstraintSetResponse', ], 'errors' => [ [ 'shape' => 'WAFStaleDataException', ], [ 'shape' => 'WAFInternalErrorException', ], [ 'shape' => 'WAFInvalidAccountException', ], [ 'shape' => 'WAFNonexistentItemException', ], [ 'shape' => 'WAFReferencedItemException', ], [ 'shape' => 'WAFNonEmptyEntityException', ], ], ], 'DeleteSqlInjectionMatchSet' => [ 'name' => 'DeleteSqlInjectionMatchSet', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DeleteSqlInjectionMatchSetRequest', ], 'output' => [ 'shape' => 'DeleteSqlInjectionMatchSetResponse', ], 'errors' => [ [ 'shape' => 'WAFInternalErrorException', ], [ 'shape' => 'WAFInvalidAccountException', ], [ 'shape' => 'WAFNonexistentItemException', ], [ 'shape' => 'WAFReferencedItemException', ], [ 'shape' => 'WAFStaleDataException', ], [ 'shape' => 'WAFNonEmptyEntityException', ], ], ], 'DeleteWebACL' => [ 'name' => 'DeleteWebACL', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DeleteWebACLRequest', ], 'output' => [ 'shape' => 'DeleteWebACLResponse', ], 'errors' => [ [ 'shape' => 'WAFStaleDataException', ], [ 'shape' => 'WAFInternalErrorException', ], [ 'shape' => 'WAFInvalidAccountException', ], [ 'shape' => 'WAFNonexistentItemException', ], [ 'shape' => 'WAFReferencedItemException', ], [ 'shape' => 'WAFNonEmptyEntityException', ], ], ], 'DeleteXssMatchSet' => [ 'name' => 'DeleteXssMatchSet', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'DeleteXssMatchSetRequest', ], 'output' => [ 'shape' => 'DeleteXssMatchSetResponse', ], 'errors' => [ [ 'shape' => 'WAFInternalErrorException', ], [ 'shape' => 'WAFInvalidAccountException', ], [ 'shape' => 'WAFNonexistentItemException', ], [ 'shape' => 'WAFReferencedItemException', ], [ 'shape' => 'WAFStaleDataException', ], [ 'shape' => 'WAFNonEmptyEntityException', ], ], ], 'GetByteMatchSet' => [ 'name' => 'GetByteMatchSet', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'GetByteMatchSetRequest', ], 'output' => [ 'shape' => 'GetByteMatchSetResponse', ], 'errors' => [ [ 'shape' => 'WAFInternalErrorException', ], [ 'shape' => 'WAFInvalidAccountException', ], [ 'shape' => 'WAFNonexistentItemException', ], ], ], 'GetChangeToken' => [ 'name' => 'GetChangeToken', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'GetChangeTokenRequest', ], 'output' => [ 'shape' => 'GetChangeTokenResponse', ], 'errors' => [ [ 'shape' => 'WAFInternalErrorException', ], ], ], 'GetChangeTokenStatus' => [ 'name' => 'GetChangeTokenStatus', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'GetChangeTokenStatusRequest', ], 'output' => [ 'shape' => 'GetChangeTokenStatusResponse', ], 'errors' => [ [ 'shape' => 'WAFNonexistentItemException', ], [ 'shape' => 'WAFInternalErrorException', ], ], ], 'GetGeoMatchSet' => [ 'name' => 'GetGeoMatchSet', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'GetGeoMatchSetRequest', ], 'output' => [ 'shape' => 'GetGeoMatchSetResponse', ], 'errors' => [ [ 'shape' => 'WAFInternalErrorException', ], [ 'shape' => 'WAFInvalidAccountException', ], [ 'shape' => 'WAFNonexistentItemException', ], ], ], 'GetIPSet' => [ 'name' => 'GetIPSet', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'GetIPSetRequest', ], 'output' => [ 'shape' => 'GetIPSetResponse', ], 'errors' => [ [ 'shape' => 'WAFInternalErrorException', ], [ 'shape' => 'WAFInvalidAccountException', ], [ 'shape' => 'WAFNonexistentItemException', ], ], ], 'GetRateBasedRule' => [ 'name' => 'GetRateBasedRule', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'GetRateBasedRuleRequest', ], 'output' => [ 'shape' => 'GetRateBasedRuleResponse', ], 'errors' => [ [ 'shape' => 'WAFInternalErrorException', ], [ 'shape' => 'WAFInvalidAccountException', ], [ 'shape' => 'WAFNonexistentItemException', ], ], ], 'GetRateBasedRuleManagedKeys' => [ 'name' => 'GetRateBasedRuleManagedKeys', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'GetRateBasedRuleManagedKeysRequest', ], 'output' => [ 'shape' => 'GetRateBasedRuleManagedKeysResponse', ], 'errors' => [ [ 'shape' => 'WAFInternalErrorException', ], [ 'shape' => 'WAFInvalidAccountException', ], [ 'shape' => 'WAFNonexistentItemException', ], [ 'shape' => 'WAFInvalidParameterException', ], ], ], 'GetRegexMatchSet' => [ 'name' => 'GetRegexMatchSet', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'GetRegexMatchSetRequest', ], 'output' => [ 'shape' => 'GetRegexMatchSetResponse', ], 'errors' => [ [ 'shape' => 'WAFInternalErrorException', ], [ 'shape' => 'WAFInvalidAccountException', ], [ 'shape' => 'WAFNonexistentItemException', ], ], ], 'GetRegexPatternSet' => [ 'name' => 'GetRegexPatternSet', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'GetRegexPatternSetRequest', ], 'output' => [ 'shape' => 'GetRegexPatternSetResponse', ], 'errors' => [ [ 'shape' => 'WAFInternalErrorException', ], [ 'shape' => 'WAFInvalidAccountException', ], [ 'shape' => 'WAFNonexistentItemException', ], ], ], 'GetRule' => [ 'name' => 'GetRule', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'GetRuleRequest', ], 'output' => [ 'shape' => 'GetRuleResponse', ], 'errors' => [ [ 'shape' => 'WAFInternalErrorException', ], [ 'shape' => 'WAFInvalidAccountException', ], [ 'shape' => 'WAFNonexistentItemException', ], ], ], 'GetRuleGroup' => [ 'name' => 'GetRuleGroup', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'GetRuleGroupRequest', ], 'output' => [ 'shape' => 'GetRuleGroupResponse', ], 'errors' => [ [ 'shape' => 'WAFInternalErrorException', ], [ 'shape' => 'WAFNonexistentItemException', ], ], ], 'GetSampledRequests' => [ 'name' => 'GetSampledRequests', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'GetSampledRequestsRequest', ], 'output' => [ 'shape' => 'GetSampledRequestsResponse', ], 'errors' => [ [ 'shape' => 'WAFNonexistentItemException', ], [ 'shape' => 'WAFInternalErrorException', ], ], ], 'GetSizeConstraintSet' => [ 'name' => 'GetSizeConstraintSet', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'GetSizeConstraintSetRequest', ], 'output' => [ 'shape' => 'GetSizeConstraintSetResponse', ], 'errors' => [ [ 'shape' => 'WAFInternalErrorException', ], [ 'shape' => 'WAFInvalidAccountException', ], [ 'shape' => 'WAFNonexistentItemException', ], ], ], 'GetSqlInjectionMatchSet' => [ 'name' => 'GetSqlInjectionMatchSet', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'GetSqlInjectionMatchSetRequest', ], 'output' => [ 'shape' => 'GetSqlInjectionMatchSetResponse', ], 'errors' => [ [ 'shape' => 'WAFInternalErrorException', ], [ 'shape' => 'WAFInvalidAccountException', ], [ 'shape' => 'WAFNonexistentItemException', ], ], ], 'GetWebACL' => [ 'name' => 'GetWebACL', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'GetWebACLRequest', ], 'output' => [ 'shape' => 'GetWebACLResponse', ], 'errors' => [ [ 'shape' => 'WAFInternalErrorException', ], [ 'shape' => 'WAFInvalidAccountException', ], [ 'shape' => 'WAFNonexistentItemException', ], ], ], 'GetXssMatchSet' => [ 'name' => 'GetXssMatchSet', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'GetXssMatchSetRequest', ], 'output' => [ 'shape' => 'GetXssMatchSetResponse', ], 'errors' => [ [ 'shape' => 'WAFInternalErrorException', ], [ 'shape' => 'WAFInvalidAccountException', ], [ 'shape' => 'WAFNonexistentItemException', ], ], ], 'ListActivatedRulesInRuleGroup' => [ 'name' => 'ListActivatedRulesInRuleGroup', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'ListActivatedRulesInRuleGroupRequest', ], 'output' => [ 'shape' => 'ListActivatedRulesInRuleGroupResponse', ], 'errors' => [ [ 'shape' => 'WAFInternalErrorException', ], [ 'shape' => 'WAFNonexistentItemException', ], [ 'shape' => 'WAFInvalidParameterException', ], ], ], 'ListByteMatchSets' => [ 'name' => 'ListByteMatchSets', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'ListByteMatchSetsRequest', ], 'output' => [ 'shape' => 'ListByteMatchSetsResponse', ], 'errors' => [ [ 'shape' => 'WAFInternalErrorException', ], [ 'shape' => 'WAFInvalidAccountException', ], ], ], 'ListGeoMatchSets' => [ 'name' => 'ListGeoMatchSets', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'ListGeoMatchSetsRequest', ], 'output' => [ 'shape' => 'ListGeoMatchSetsResponse', ], 'errors' => [ [ 'shape' => 'WAFInternalErrorException', ], [ 'shape' => 'WAFInvalidAccountException', ], ], ], 'ListIPSets' => [ 'name' => 'ListIPSets', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'ListIPSetsRequest', ], 'output' => [ 'shape' => 'ListIPSetsResponse', ], 'errors' => [ [ 'shape' => 'WAFInternalErrorException', ], [ 'shape' => 'WAFInvalidAccountException', ], ], ], 'ListRateBasedRules' => [ 'name' => 'ListRateBasedRules', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'ListRateBasedRulesRequest', ], 'output' => [ 'shape' => 'ListRateBasedRulesResponse', ], 'errors' => [ [ 'shape' => 'WAFInternalErrorException', ], [ 'shape' => 'WAFInvalidAccountException', ], ], ], 'ListRegexMatchSets' => [ 'name' => 'ListRegexMatchSets', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'ListRegexMatchSetsRequest', ], 'output' => [ 'shape' => 'ListRegexMatchSetsResponse', ], 'errors' => [ [ 'shape' => 'WAFInternalErrorException', ], [ 'shape' => 'WAFInvalidAccountException', ], ], ], 'ListRegexPatternSets' => [ 'name' => 'ListRegexPatternSets', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'ListRegexPatternSetsRequest', ], 'output' => [ 'shape' => 'ListRegexPatternSetsResponse', ], 'errors' => [ [ 'shape' => 'WAFInternalErrorException', ], [ 'shape' => 'WAFInvalidAccountException', ], ], ], 'ListRuleGroups' => [ 'name' => 'ListRuleGroups', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'ListRuleGroupsRequest', ], 'output' => [ 'shape' => 'ListRuleGroupsResponse', ], 'errors' => [ [ 'shape' => 'WAFInternalErrorException', ], ], ], 'ListRules' => [ 'name' => 'ListRules', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'ListRulesRequest', ], 'output' => [ 'shape' => 'ListRulesResponse', ], 'errors' => [ [ 'shape' => 'WAFInternalErrorException', ], [ 'shape' => 'WAFInvalidAccountException', ], ], ], 'ListSizeConstraintSets' => [ 'name' => 'ListSizeConstraintSets', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'ListSizeConstraintSetsRequest', ], 'output' => [ 'shape' => 'ListSizeConstraintSetsResponse', ], 'errors' => [ [ 'shape' => 'WAFInternalErrorException', ], [ 'shape' => 'WAFInvalidAccountException', ], ], ], 'ListSqlInjectionMatchSets' => [ 'name' => 'ListSqlInjectionMatchSets', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'ListSqlInjectionMatchSetsRequest', ], 'output' => [ 'shape' => 'ListSqlInjectionMatchSetsResponse', ], 'errors' => [ [ 'shape' => 'WAFInternalErrorException', ], [ 'shape' => 'WAFInvalidAccountException', ], ], ], 'ListSubscribedRuleGroups' => [ 'name' => 'ListSubscribedRuleGroups', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'ListSubscribedRuleGroupsRequest', ], 'output' => [ 'shape' => 'ListSubscribedRuleGroupsResponse', ], 'errors' => [ [ 'shape' => 'WAFNonexistentItemException', ], [ 'shape' => 'WAFInternalErrorException', ], ], ], 'ListWebACLs' => [ 'name' => 'ListWebACLs', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'ListWebACLsRequest', ], 'output' => [ 'shape' => 'ListWebACLsResponse', ], 'errors' => [ [ 'shape' => 'WAFInternalErrorException', ], [ 'shape' => 'WAFInvalidAccountException', ], ], ], 'ListXssMatchSets' => [ 'name' => 'ListXssMatchSets', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'ListXssMatchSetsRequest', ], 'output' => [ 'shape' => 'ListXssMatchSetsResponse', ], 'errors' => [ [ 'shape' => 'WAFInternalErrorException', ], [ 'shape' => 'WAFInvalidAccountException', ], ], ], 'UpdateByteMatchSet' => [ 'name' => 'UpdateByteMatchSet', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'UpdateByteMatchSetRequest', ], 'output' => [ 'shape' => 'UpdateByteMatchSetResponse', ], 'errors' => [ [ 'shape' => 'WAFInternalErrorException', ], [ 'shape' => 'WAFInvalidAccountException', ], [ 'shape' => 'WAFInvalidOperationException', ], [ 'shape' => 'WAFInvalidParameterException', ], [ 'shape' => 'WAFNonexistentContainerException', ], [ 'shape' => 'WAFNonexistentItemException', ], [ 'shape' => 'WAFStaleDataException', ], [ 'shape' => 'WAFLimitsExceededException', ], ], ], 'UpdateGeoMatchSet' => [ 'name' => 'UpdateGeoMatchSet', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'UpdateGeoMatchSetRequest', ], 'output' => [ 'shape' => 'UpdateGeoMatchSetResponse', ], 'errors' => [ [ 'shape' => 'WAFStaleDataException', ], [ 'shape' => 'WAFInternalErrorException', ], [ 'shape' => 'WAFInvalidAccountException', ], [ 'shape' => 'WAFInvalidOperationException', ], [ 'shape' => 'WAFInvalidParameterException', ], [ 'shape' => 'WAFNonexistentContainerException', ], [ 'shape' => 'WAFNonexistentItemException', ], [ 'shape' => 'WAFReferencedItemException', ], [ 'shape' => 'WAFLimitsExceededException', ], ], ], 'UpdateIPSet' => [ 'name' => 'UpdateIPSet', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'UpdateIPSetRequest', ], 'output' => [ 'shape' => 'UpdateIPSetResponse', ], 'errors' => [ [ 'shape' => 'WAFStaleDataException', ], [ 'shape' => 'WAFInternalErrorException', ], [ 'shape' => 'WAFInvalidAccountException', ], [ 'shape' => 'WAFInvalidOperationException', ], [ 'shape' => 'WAFInvalidParameterException', ], [ 'shape' => 'WAFNonexistentContainerException', ], [ 'shape' => 'WAFNonexistentItemException', ], [ 'shape' => 'WAFReferencedItemException', ], [ 'shape' => 'WAFLimitsExceededException', ], ], ], 'UpdateRateBasedRule' => [ 'name' => 'UpdateRateBasedRule', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'UpdateRateBasedRuleRequest', ], 'output' => [ 'shape' => 'UpdateRateBasedRuleResponse', ], 'errors' => [ [ 'shape' => 'WAFStaleDataException', ], [ 'shape' => 'WAFInternalErrorException', ], [ 'shape' => 'WAFInvalidAccountException', ], [ 'shape' => 'WAFInvalidOperationException', ], [ 'shape' => 'WAFInvalidParameterException', ], [ 'shape' => 'WAFNonexistentContainerException', ], [ 'shape' => 'WAFNonexistentItemException', ], [ 'shape' => 'WAFReferencedItemException', ], [ 'shape' => 'WAFLimitsExceededException', ], ], ], 'UpdateRegexMatchSet' => [ 'name' => 'UpdateRegexMatchSet', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'UpdateRegexMatchSetRequest', ], 'output' => [ 'shape' => 'UpdateRegexMatchSetResponse', ], 'errors' => [ [ 'shape' => 'WAFStaleDataException', ], [ 'shape' => 'WAFInternalErrorException', ], [ 'shape' => 'WAFDisallowedNameException', ], [ 'shape' => 'WAFLimitsExceededException', ], [ 'shape' => 'WAFNonexistentItemException', ], [ 'shape' => 'WAFNonexistentContainerException', ], [ 'shape' => 'WAFInvalidOperationException', ], [ 'shape' => 'WAFInvalidAccountException', ], ], ], 'UpdateRegexPatternSet' => [ 'name' => 'UpdateRegexPatternSet', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'UpdateRegexPatternSetRequest', ], 'output' => [ 'shape' => 'UpdateRegexPatternSetResponse', ], 'errors' => [ [ 'shape' => 'WAFStaleDataException', ], [ 'shape' => 'WAFInternalErrorException', ], [ 'shape' => 'WAFLimitsExceededException', ], [ 'shape' => 'WAFNonexistentItemException', ], [ 'shape' => 'WAFNonexistentContainerException', ], [ 'shape' => 'WAFInvalidOperationException', ], [ 'shape' => 'WAFInvalidAccountException', ], [ 'shape' => 'WAFInvalidRegexPatternException', ], ], ], 'UpdateRule' => [ 'name' => 'UpdateRule', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'UpdateRuleRequest', ], 'output' => [ 'shape' => 'UpdateRuleResponse', ], 'errors' => [ [ 'shape' => 'WAFStaleDataException', ], [ 'shape' => 'WAFInternalErrorException', ], [ 'shape' => 'WAFInvalidAccountException', ], [ 'shape' => 'WAFInvalidOperationException', ], [ 'shape' => 'WAFInvalidParameterException', ], [ 'shape' => 'WAFNonexistentContainerException', ], [ 'shape' => 'WAFNonexistentItemException', ], [ 'shape' => 'WAFReferencedItemException', ], [ 'shape' => 'WAFLimitsExceededException', ], ], ], 'UpdateRuleGroup' => [ 'name' => 'UpdateRuleGroup', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'UpdateRuleGroupRequest', ], 'output' => [ 'shape' => 'UpdateRuleGroupResponse', ], 'errors' => [ [ 'shape' => 'WAFStaleDataException', ], [ 'shape' => 'WAFInternalErrorException', ], [ 'shape' => 'WAFNonexistentContainerException', ], [ 'shape' => 'WAFNonexistentItemException', ], [ 'shape' => 'WAFInvalidOperationException', ], [ 'shape' => 'WAFLimitsExceededException', ], [ 'shape' => 'WAFInvalidParameterException', ], ], ], 'UpdateSizeConstraintSet' => [ 'name' => 'UpdateSizeConstraintSet', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'UpdateSizeConstraintSetRequest', ], 'output' => [ 'shape' => 'UpdateSizeConstraintSetResponse', ], 'errors' => [ [ 'shape' => 'WAFStaleDataException', ], [ 'shape' => 'WAFInternalErrorException', ], [ 'shape' => 'WAFInvalidAccountException', ], [ 'shape' => 'WAFInvalidOperationException', ], [ 'shape' => 'WAFInvalidParameterException', ], [ 'shape' => 'WAFNonexistentContainerException', ], [ 'shape' => 'WAFNonexistentItemException', ], [ 'shape' => 'WAFReferencedItemException', ], [ 'shape' => 'WAFLimitsExceededException', ], ], ], 'UpdateSqlInjectionMatchSet' => [ 'name' => 'UpdateSqlInjectionMatchSet', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'UpdateSqlInjectionMatchSetRequest', ], 'output' => [ 'shape' => 'UpdateSqlInjectionMatchSetResponse', ], 'errors' => [ [ 'shape' => 'WAFInternalErrorException', ], [ 'shape' => 'WAFInvalidAccountException', ], [ 'shape' => 'WAFInvalidOperationException', ], [ 'shape' => 'WAFInvalidParameterException', ], [ 'shape' => 'WAFNonexistentContainerException', ], [ 'shape' => 'WAFNonexistentItemException', ], [ 'shape' => 'WAFStaleDataException', ], [ 'shape' => 'WAFLimitsExceededException', ], ], ], 'UpdateWebACL' => [ 'name' => 'UpdateWebACL', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'UpdateWebACLRequest', ], 'output' => [ 'shape' => 'UpdateWebACLResponse', ], 'errors' => [ [ 'shape' => 'WAFStaleDataException', ], [ 'shape' => 'WAFInternalErrorException', ], [ 'shape' => 'WAFInvalidAccountException', ], [ 'shape' => 'WAFInvalidOperationException', ], [ 'shape' => 'WAFInvalidParameterException', ], [ 'shape' => 'WAFNonexistentContainerException', ], [ 'shape' => 'WAFNonexistentItemException', ], [ 'shape' => 'WAFReferencedItemException', ], [ 'shape' => 'WAFLimitsExceededException', ], [ 'shape' => 'WAFSubscriptionNotFoundException', ], ], ], 'UpdateXssMatchSet' => [ 'name' => 'UpdateXssMatchSet', 'http' => [ 'method' => 'POST', 'requestUri' => '/', ], 'input' => [ 'shape' => 'UpdateXssMatchSetRequest', ], 'output' => [ 'shape' => 'UpdateXssMatchSetResponse', ], 'errors' => [ [ 'shape' => 'WAFInternalErrorException', ], [ 'shape' => 'WAFInvalidAccountException', ], [ 'shape' => 'WAFInvalidOperationException', ], [ 'shape' => 'WAFInvalidParameterException', ], [ 'shape' => 'WAFNonexistentContainerException', ], [ 'shape' => 'WAFNonexistentItemException', ], [ 'shape' => 'WAFStaleDataException', ], [ 'shape' => 'WAFLimitsExceededException', ], ], ], ], 'shapes' => [ 'Action' => [ 'type' => 'string', ], 'ActivatedRule' => [ 'type' => 'structure', 'required' => [ 'Priority', 'RuleId', ], 'members' => [ 'Priority' => [ 'shape' => 'RulePriority', ], 'RuleId' => [ 'shape' => 'ResourceId', ], 'Action' => [ 'shape' => 'WafAction', ], 'OverrideAction' => [ 'shape' => 'WafOverrideAction', ], 'Type' => [ 'shape' => 'WafRuleType', ], ], ], 'ActivatedRules' => [ 'type' => 'list', 'member' => [ 'shape' => 'ActivatedRule', ], ], 'ByteMatchSet' => [ 'type' => 'structure', 'required' => [ 'ByteMatchSetId', 'ByteMatchTuples', ], 'members' => [ 'ByteMatchSetId' => [ 'shape' => 'ResourceId', ], 'Name' => [ 'shape' => 'ResourceName', ], 'ByteMatchTuples' => [ 'shape' => 'ByteMatchTuples', ], ], ], 'ByteMatchSetSummaries' => [ 'type' => 'list', 'member' => [ 'shape' => 'ByteMatchSetSummary', ], ], 'ByteMatchSetSummary' => [ 'type' => 'structure', 'required' => [ 'ByteMatchSetId', 'Name', ], 'members' => [ 'ByteMatchSetId' => [ 'shape' => 'ResourceId', ], 'Name' => [ 'shape' => 'ResourceName', ], ], ], 'ByteMatchSetUpdate' => [ 'type' => 'structure', 'required' => [ 'Action', 'ByteMatchTuple', ], 'members' => [ 'Action' => [ 'shape' => 'ChangeAction', ], 'ByteMatchTuple' => [ 'shape' => 'ByteMatchTuple', ], ], ], 'ByteMatchSetUpdates' => [ 'type' => 'list', 'member' => [ 'shape' => 'ByteMatchSetUpdate', ], 'min' => 1, ], 'ByteMatchTargetString' => [ 'type' => 'blob', ], 'ByteMatchTuple' => [ 'type' => 'structure', 'required' => [ 'FieldToMatch', 'TargetString', 'TextTransformation', 'PositionalConstraint', ], 'members' => [ 'FieldToMatch' => [ 'shape' => 'FieldToMatch', ], 'TargetString' => [ 'shape' => 'ByteMatchTargetString', ], 'TextTransformation' => [ 'shape' => 'TextTransformation', ], 'PositionalConstraint' => [ 'shape' => 'PositionalConstraint', ], ], ], 'ByteMatchTuples' => [ 'type' => 'list', 'member' => [ 'shape' => 'ByteMatchTuple', ], ], 'ChangeAction' => [ 'type' => 'string', 'enum' => [ 'INSERT', 'DELETE', ], ], 'ChangeToken' => [ 'type' => 'string', 'min' => 1, ], 'ChangeTokenStatus' => [ 'type' => 'string', 'enum' => [ 'PROVISIONED', 'PENDING', 'INSYNC', ], ], 'ComparisonOperator' => [ 'type' => 'string', 'enum' => [ 'EQ', 'NE', 'LE', 'LT', 'GE', 'GT', ], ], 'Country' => [ 'type' => 'string', ], 'CreateByteMatchSetRequest' => [ 'type' => 'structure', 'required' => [ 'Name', 'ChangeToken', ], 'members' => [ 'Name' => [ 'shape' => 'ResourceName', ], 'ChangeToken' => [ 'shape' => 'ChangeToken', ], ], ], 'CreateByteMatchSetResponse' => [ 'type' => 'structure', 'members' => [ 'ByteMatchSet' => [ 'shape' => 'ByteMatchSet', ], 'ChangeToken' => [ 'shape' => 'ChangeToken', ], ], ], 'CreateGeoMatchSetRequest' => [ 'type' => 'structure', 'required' => [ 'Name', 'ChangeToken', ], 'members' => [ 'Name' => [ 'shape' => 'ResourceName', ], 'ChangeToken' => [ 'shape' => 'ChangeToken', ], ], ], 'CreateGeoMatchSetResponse' => [ 'type' => 'structure', 'members' => [ 'GeoMatchSet' => [ 'shape' => 'GeoMatchSet', ], 'ChangeToken' => [ 'shape' => 'ChangeToken', ], ], ], 'CreateIPSetRequest' => [ 'type' => 'structure', 'required' => [ 'Name', 'ChangeToken', ], 'members' => [ 'Name' => [ 'shape' => 'ResourceName', ], 'ChangeToken' => [ 'shape' => 'ChangeToken', ], ], ], 'CreateIPSetResponse' => [ 'type' => 'structure', 'members' => [ 'IPSet' => [ 'shape' => 'IPSet', ], 'ChangeToken' => [ 'shape' => 'ChangeToken', ], ], ], 'CreateRateBasedRuleRequest' => [ 'type' => 'structure', 'required' => [ 'Name', 'MetricName', 'RateKey', 'RateLimit', 'ChangeToken', ], 'members' => [ 'Name' => [ 'shape' => 'ResourceName', ], 'MetricName' => [ 'shape' => 'MetricName', ], 'RateKey' => [ 'shape' => 'RateKey', ], 'RateLimit' => [ 'shape' => 'RateLimit', ], 'ChangeToken' => [ 'shape' => 'ChangeToken', ], ], ], 'CreateRateBasedRuleResponse' => [ 'type' => 'structure', 'members' => [ 'Rule' => [ 'shape' => 'RateBasedRule', ], 'ChangeToken' => [ 'shape' => 'ChangeToken', ], ], ], 'CreateRegexMatchSetRequest' => [ 'type' => 'structure', 'required' => [ 'Name', 'ChangeToken', ], 'members' => [ 'Name' => [ 'shape' => 'ResourceName', ], 'ChangeToken' => [ 'shape' => 'ChangeToken', ], ], ], 'CreateRegexMatchSetResponse' => [ 'type' => 'structure', 'members' => [ 'RegexMatchSet' => [ 'shape' => 'RegexMatchSet', ], 'ChangeToken' => [ 'shape' => 'ChangeToken', ], ], ], 'CreateRegexPatternSetRequest' => [ 'type' => 'structure', 'required' => [ 'Name', 'ChangeToken', ], 'members' => [ 'Name' => [ 'shape' => 'ResourceName', ], 'ChangeToken' => [ 'shape' => 'ChangeToken', ], ], ], 'CreateRegexPatternSetResponse' => [ 'type' => 'structure', 'members' => [ 'RegexPatternSet' => [ 'shape' => 'RegexPatternSet', ], 'ChangeToken' => [ 'shape' => 'ChangeToken', ], ], ], 'CreateRuleGroupRequest' => [ 'type' => 'structure', 'required' => [ 'Name', 'MetricName', 'ChangeToken', ], 'members' => [ 'Name' => [ 'shape' => 'ResourceName', ], 'MetricName' => [ 'shape' => 'MetricName', ], 'ChangeToken' => [ 'shape' => 'ChangeToken', ], ], ], 'CreateRuleGroupResponse' => [ 'type' => 'structure', 'members' => [ 'RuleGroup' => [ 'shape' => 'RuleGroup', ], 'ChangeToken' => [ 'shape' => 'ChangeToken', ], ], ], 'CreateRuleRequest' => [ 'type' => 'structure', 'required' => [ 'Name', 'MetricName', 'ChangeToken', ], 'members' => [ 'Name' => [ 'shape' => 'ResourceName', ], 'MetricName' => [ 'shape' => 'MetricName', ], 'ChangeToken' => [ 'shape' => 'ChangeToken', ], ], ], 'CreateRuleResponse' => [ 'type' => 'structure', 'members' => [ 'Rule' => [ 'shape' => 'Rule', ], 'ChangeToken' => [ 'shape' => 'ChangeToken', ], ], ], 'CreateSizeConstraintSetRequest' => [ 'type' => 'structure', 'required' => [ 'Name', 'ChangeToken', ], 'members' => [ 'Name' => [ 'shape' => 'ResourceName', ], 'ChangeToken' => [ 'shape' => 'ChangeToken', ], ], ], 'CreateSizeConstraintSetResponse' => [ 'type' => 'structure', 'members' => [ 'SizeConstraintSet' => [ 'shape' => 'SizeConstraintSet', ], 'ChangeToken' => [ 'shape' => 'ChangeToken', ], ], ], 'CreateSqlInjectionMatchSetRequest' => [ 'type' => 'structure', 'required' => [ 'Name', 'ChangeToken', ], 'members' => [ 'Name' => [ 'shape' => 'ResourceName', ], 'ChangeToken' => [ 'shape' => 'ChangeToken', ], ], ], 'CreateSqlInjectionMatchSetResponse' => [ 'type' => 'structure', 'members' => [ 'SqlInjectionMatchSet' => [ 'shape' => 'SqlInjectionMatchSet', ], 'ChangeToken' => [ 'shape' => 'ChangeToken', ], ], ], 'CreateWebACLRequest' => [ 'type' => 'structure', 'required' => [ 'Name', 'MetricName', 'DefaultAction', 'ChangeToken', ], 'members' => [ 'Name' => [ 'shape' => 'ResourceName', ], 'MetricName' => [ 'shape' => 'MetricName', ], 'DefaultAction' => [ 'shape' => 'WafAction', ], 'ChangeToken' => [ 'shape' => 'ChangeToken', ], ], ], 'CreateWebACLResponse' => [ 'type' => 'structure', 'members' => [ 'WebACL' => [ 'shape' => 'WebACL', ], 'ChangeToken' => [ 'shape' => 'ChangeToken', ], ], ], 'CreateXssMatchSetRequest' => [ 'type' => 'structure', 'required' => [ 'Name', 'ChangeToken', ], 'members' => [ 'Name' => [ 'shape' => 'ResourceName', ], 'ChangeToken' => [ 'shape' => 'ChangeToken', ], ], ], 'CreateXssMatchSetResponse' => [ 'type' => 'structure', 'members' => [ 'XssMatchSet' => [ 'shape' => 'XssMatchSet', ], 'ChangeToken' => [ 'shape' => 'ChangeToken', ], ], ], 'DeleteByteMatchSetRequest' => [ 'type' => 'structure', 'required' => [ 'ByteMatchSetId', 'ChangeToken', ], 'members' => [ 'ByteMatchSetId' => [ 'shape' => 'ResourceId', ], 'ChangeToken' => [ 'shape' => 'ChangeToken', ], ], ], 'DeleteByteMatchSetResponse' => [ 'type' => 'structure', 'members' => [ 'ChangeToken' => [ 'shape' => 'ChangeToken', ], ], ], 'DeleteGeoMatchSetRequest' => [ 'type' => 'structure', 'required' => [ 'GeoMatchSetId', 'ChangeToken', ], 'members' => [ 'GeoMatchSetId' => [ 'shape' => 'ResourceId', ], 'ChangeToken' => [ 'shape' => 'ChangeToken', ], ], ], 'DeleteGeoMatchSetResponse' => [ 'type' => 'structure', 'members' => [ 'ChangeToken' => [ 'shape' => 'ChangeToken', ], ], ], 'DeleteIPSetRequest' => [ 'type' => 'structure', 'required' => [ 'IPSetId', 'ChangeToken', ], 'members' => [ 'IPSetId' => [ 'shape' => 'ResourceId', ], 'ChangeToken' => [ 'shape' => 'ChangeToken', ], ], ], 'DeleteIPSetResponse' => [ 'type' => 'structure', 'members' => [ 'ChangeToken' => [ 'shape' => 'ChangeToken', ], ], ], 'DeleteRateBasedRuleRequest' => [ 'type' => 'structure', 'required' => [ 'RuleId', 'ChangeToken', ], 'members' => [ 'RuleId' => [ 'shape' => 'ResourceId', ], 'ChangeToken' => [ 'shape' => 'ChangeToken', ], ], ], 'DeleteRateBasedRuleResponse' => [ 'type' => 'structure', 'members' => [ 'ChangeToken' => [ 'shape' => 'ChangeToken', ], ], ], 'DeleteRegexMatchSetRequest' => [ 'type' => 'structure', 'required' => [ 'RegexMatchSetId', 'ChangeToken', ], 'members' => [ 'RegexMatchSetId' => [ 'shape' => 'ResourceId', ], 'ChangeToken' => [ 'shape' => 'ChangeToken', ], ], ], 'DeleteRegexMatchSetResponse' => [ 'type' => 'structure', 'members' => [ 'ChangeToken' => [ 'shape' => 'ChangeToken', ], ], ], 'DeleteRegexPatternSetRequest' => [ 'type' => 'structure', 'required' => [ 'RegexPatternSetId', 'ChangeToken', ], 'members' => [ 'RegexPatternSetId' => [ 'shape' => 'ResourceId', ], 'ChangeToken' => [ 'shape' => 'ChangeToken', ], ], ], 'DeleteRegexPatternSetResponse' => [ 'type' => 'structure', 'members' => [ 'ChangeToken' => [ 'shape' => 'ChangeToken', ], ], ], 'DeleteRuleGroupRequest' => [ 'type' => 'structure', 'required' => [ 'RuleGroupId', 'ChangeToken', ], 'members' => [ 'RuleGroupId' => [ 'shape' => 'ResourceId', ], 'ChangeToken' => [ 'shape' => 'ChangeToken', ], ], ], 'DeleteRuleGroupResponse' => [ 'type' => 'structure', 'members' => [ 'ChangeToken' => [ 'shape' => 'ChangeToken', ], ], ], 'DeleteRuleRequest' => [ 'type' => 'structure', 'required' => [ 'RuleId', 'ChangeToken', ], 'members' => [ 'RuleId' => [ 'shape' => 'ResourceId', ], 'ChangeToken' => [ 'shape' => 'ChangeToken', ], ], ], 'DeleteRuleResponse' => [ 'type' => 'structure', 'members' => [ 'ChangeToken' => [ 'shape' => 'ChangeToken', ], ], ], 'DeleteSizeConstraintSetRequest' => [ 'type' => 'structure', 'required' => [ 'SizeConstraintSetId', 'ChangeToken', ], 'members' => [ 'SizeConstraintSetId' => [ 'shape' => 'ResourceId', ], 'ChangeToken' => [ 'shape' => 'ChangeToken', ], ], ], 'DeleteSizeConstraintSetResponse' => [ 'type' => 'structure', 'members' => [ 'ChangeToken' => [ 'shape' => 'ChangeToken', ], ], ], 'DeleteSqlInjectionMatchSetRequest' => [ 'type' => 'structure', 'required' => [ 'SqlInjectionMatchSetId', 'ChangeToken', ], 'members' => [ 'SqlInjectionMatchSetId' => [ 'shape' => 'ResourceId', ], 'ChangeToken' => [ 'shape' => 'ChangeToken', ], ], ], 'DeleteSqlInjectionMatchSetResponse' => [ 'type' => 'structure', 'members' => [ 'ChangeToken' => [ 'shape' => 'ChangeToken', ], ], ], 'DeleteWebACLRequest' => [ 'type' => 'structure', 'required' => [ 'WebACLId', 'ChangeToken', ], 'members' => [ 'WebACLId' => [ 'shape' => 'ResourceId', ], 'ChangeToken' => [ 'shape' => 'ChangeToken', ], ], ], 'DeleteWebACLResponse' => [ 'type' => 'structure', 'members' => [ 'ChangeToken' => [ 'shape' => 'ChangeToken', ], ], ], 'DeleteXssMatchSetRequest' => [ 'type' => 'structure', 'required' => [ 'XssMatchSetId', 'ChangeToken', ], 'members' => [ 'XssMatchSetId' => [ 'shape' => 'ResourceId', ], 'ChangeToken' => [ 'shape' => 'ChangeToken', ], ], ], 'DeleteXssMatchSetResponse' => [ 'type' => 'structure', 'members' => [ 'ChangeToken' => [ 'shape' => 'ChangeToken', ], ], ], 'FieldToMatch' => [ 'type' => 'structure', 'required' => [ 'Type', ], 'members' => [ 'Type' => [ 'shape' => 'MatchFieldType', ], 'Data' => [ 'shape' => 'MatchFieldData', ], ], ], 'GeoMatchConstraint' => [ 'type' => 'structure', 'required' => [ 'Type', 'Value', ], 'members' => [ 'Type' => [ 'shape' => 'GeoMatchConstraintType', ], 'Value' => [ 'shape' => 'GeoMatchConstraintValue', ], ], ], 'GeoMatchConstraintType' => [ 'type' => 'string', 'enum' => [ 'Country', ], ], 'GeoMatchConstraintValue' => [ 'type' => 'string', 'enum' => [ 'AF', 'AX', 'AL', 'DZ', 'AS', 'AD', 'AO', 'AI', 'AQ', 'AG', 'AR', 'AM', 'AW', 'AU', 'AT', 'AZ', 'BS', 'BH', 'BD', 'BB', 'BY', 'BE', 'BZ', 'BJ', 'BM', 'BT', 'BO', 'BQ', 'BA', 'BW', 'BV', 'BR', 'IO', 'BN', 'BG', 'BF', 'BI', 'KH', 'CM', 'CA', 'CV', 'KY', 'CF', 'TD', 'CL', 'CN', 'CX', 'CC', 'CO', 'KM', 'CG', 'CD', 'CK', 'CR', 'CI', 'HR', 'CU', 'CW', 'CY', 'CZ', 'DK', 'DJ', 'DM', 'DO', 'EC', 'EG', 'SV', 'GQ', 'ER', 'EE', 'ET', 'FK', 'FO', 'FJ', 'FI', 'FR', 'GF', 'PF', 'TF', 'GA', 'GM', 'GE', 'DE', 'GH', 'GI', 'GR', 'GL', 'GD', 'GP', 'GU', 'GT', 'GG', 'GN', 'GW', 'GY', 'HT', 'HM', 'VA', 'HN', 'HK', 'HU', 'IS', 'IN', 'ID', 'IR', 'IQ', 'IE', 'IM', 'IL', 'IT', 'JM', 'JP', 'JE', 'JO', 'KZ', 'KE', 'KI', 'KP', 'KR', 'KW', 'KG', 'LA', 'LV', 'LB', 'LS', 'LR', 'LY', 'LI', 'LT', 'LU', 'MO', 'MK', 'MG', 'MW', 'MY', 'MV', 'ML', 'MT', 'MH', 'MQ', 'MR', 'MU', 'YT', 'MX', 'FM', 'MD', 'MC', 'MN', 'ME', 'MS', 'MA', 'MZ', 'MM', 'NA', 'NR', 'NP', 'NL', 'NC', 'NZ', 'NI', 'NE', 'NG', 'NU', 'NF', 'MP', 'NO', 'OM', 'PK', 'PW', 'PS', 'PA', 'PG', 'PY', 'PE', 'PH', 'PN', 'PL', 'PT', 'PR', 'QA', 'RE', 'RO', 'RU', 'RW', 'BL', 'SH', 'KN', 'LC', 'MF', 'PM', 'VC', 'WS', 'SM', 'ST', 'SA', 'SN', 'RS', 'SC', 'SL', 'SG', 'SX', 'SK', 'SI', 'SB', 'SO', 'ZA', 'GS', 'SS', 'ES', 'LK', 'SD', 'SR', 'SJ', 'SZ', 'SE', 'CH', 'SY', 'TW', 'TJ', 'TZ', 'TH', 'TL', 'TG', 'TK', 'TO', 'TT', 'TN', 'TR', 'TM', 'TC', 'TV', 'UG', 'UA', 'AE', 'GB', 'US', 'UM', 'UY', 'UZ', 'VU', 'VE', 'VN', 'VG', 'VI', 'WF', 'EH', 'YE', 'ZM', 'ZW', ], ], 'GeoMatchConstraints' => [ 'type' => 'list', 'member' => [ 'shape' => 'GeoMatchConstraint', ], ], 'GeoMatchSet' => [ 'type' => 'structure', 'required' => [ 'GeoMatchSetId', 'GeoMatchConstraints', ], 'members' => [ 'GeoMatchSetId' => [ 'shape' => 'ResourceId', ], 'Name' => [ 'shape' => 'ResourceName', ], 'GeoMatchConstraints' => [ 'shape' => 'GeoMatchConstraints', ], ], ], 'GeoMatchSetSummaries' => [ 'type' => 'list', 'member' => [ 'shape' => 'GeoMatchSetSummary', ], ], 'GeoMatchSetSummary' => [ 'type' => 'structure', 'required' => [ 'GeoMatchSetId', 'Name', ], 'members' => [ 'GeoMatchSetId' => [ 'shape' => 'ResourceId', ], 'Name' => [ 'shape' => 'ResourceName', ], ], ], 'GeoMatchSetUpdate' => [ 'type' => 'structure', 'required' => [ 'Action', 'GeoMatchConstraint', ], 'members' => [ 'Action' => [ 'shape' => 'ChangeAction', ], 'GeoMatchConstraint' => [ 'shape' => 'GeoMatchConstraint', ], ], ], 'GeoMatchSetUpdates' => [ 'type' => 'list', 'member' => [ 'shape' => 'GeoMatchSetUpdate', ], 'min' => 1, ], 'GetByteMatchSetRequest' => [ 'type' => 'structure', 'required' => [ 'ByteMatchSetId', ], 'members' => [ 'ByteMatchSetId' => [ 'shape' => 'ResourceId', ], ], ], 'GetByteMatchSetResponse' => [ 'type' => 'structure', 'members' => [ 'ByteMatchSet' => [ 'shape' => 'ByteMatchSet', ], ], ], 'GetChangeTokenRequest' => [ 'type' => 'structure', 'members' => [], ], 'GetChangeTokenResponse' => [ 'type' => 'structure', 'members' => [ 'ChangeToken' => [ 'shape' => 'ChangeToken', ], ], ], 'GetChangeTokenStatusRequest' => [ 'type' => 'structure', 'required' => [ 'ChangeToken', ], 'members' => [ 'ChangeToken' => [ 'shape' => 'ChangeToken', ], ], ], 'GetChangeTokenStatusResponse' => [ 'type' => 'structure', 'members' => [ 'ChangeTokenStatus' => [ 'shape' => 'ChangeTokenStatus', ], ], ], 'GetGeoMatchSetRequest' => [ 'type' => 'structure', 'required' => [ 'GeoMatchSetId', ], 'members' => [ 'GeoMatchSetId' => [ 'shape' => 'ResourceId', ], ], ], 'GetGeoMatchSetResponse' => [ 'type' => 'structure', 'members' => [ 'GeoMatchSet' => [ 'shape' => 'GeoMatchSet', ], ], ], 'GetIPSetRequest' => [ 'type' => 'structure', 'required' => [ 'IPSetId', ], 'members' => [ 'IPSetId' => [ 'shape' => 'ResourceId', ], ], ], 'GetIPSetResponse' => [ 'type' => 'structure', 'members' => [ 'IPSet' => [ 'shape' => 'IPSet', ], ], ], 'GetRateBasedRuleManagedKeysRequest' => [ 'type' => 'structure', 'required' => [ 'RuleId', ], 'members' => [ 'RuleId' => [ 'shape' => 'ResourceId', ], 'NextMarker' => [ 'shape' => 'NextMarker', ], ], ], 'GetRateBasedRuleManagedKeysResponse' => [ 'type' => 'structure', 'members' => [ 'ManagedKeys' => [ 'shape' => 'ManagedKeys', ], 'NextMarker' => [ 'shape' => 'NextMarker', ], ], ], 'GetRateBasedRuleRequest' => [ 'type' => 'structure', 'required' => [ 'RuleId', ], 'members' => [ 'RuleId' => [ 'shape' => 'ResourceId', ], ], ], 'GetRateBasedRuleResponse' => [ 'type' => 'structure', 'members' => [ 'Rule' => [ 'shape' => 'RateBasedRule', ], ], ], 'GetRegexMatchSetRequest' => [ 'type' => 'structure', 'required' => [ 'RegexMatchSetId', ], 'members' => [ 'RegexMatchSetId' => [ 'shape' => 'ResourceId', ], ], ], 'GetRegexMatchSetResponse' => [ 'type' => 'structure', 'members' => [ 'RegexMatchSet' => [ 'shape' => 'RegexMatchSet', ], ], ], 'GetRegexPatternSetRequest' => [ 'type' => 'structure', 'required' => [ 'RegexPatternSetId', ], 'members' => [ 'RegexPatternSetId' => [ 'shape' => 'ResourceId', ], ], ], 'GetRegexPatternSetResponse' => [ 'type' => 'structure', 'members' => [ 'RegexPatternSet' => [ 'shape' => 'RegexPatternSet', ], ], ], 'GetRuleGroupRequest' => [ 'type' => 'structure', 'required' => [ 'RuleGroupId', ], 'members' => [ 'RuleGroupId' => [ 'shape' => 'ResourceId', ], ], ], 'GetRuleGroupResponse' => [ 'type' => 'structure', 'members' => [ 'RuleGroup' => [ 'shape' => 'RuleGroup', ], ], ], 'GetRuleRequest' => [ 'type' => 'structure', 'required' => [ 'RuleId', ], 'members' => [ 'RuleId' => [ 'shape' => 'ResourceId', ], ], ], 'GetRuleResponse' => [ 'type' => 'structure', 'members' => [ 'Rule' => [ 'shape' => 'Rule', ], ], ], 'GetSampledRequestsMaxItems' => [ 'type' => 'long', 'max' => 500, 'min' => 1, ], 'GetSampledRequestsRequest' => [ 'type' => 'structure', 'required' => [ 'WebAclId', 'RuleId', 'TimeWindow', 'MaxItems', ], 'members' => [ 'WebAclId' => [ 'shape' => 'ResourceId', ], 'RuleId' => [ 'shape' => 'ResourceId', ], 'TimeWindow' => [ 'shape' => 'TimeWindow', ], 'MaxItems' => [ 'shape' => 'GetSampledRequestsMaxItems', ], ], ], 'GetSampledRequestsResponse' => [ 'type' => 'structure', 'members' => [ 'SampledRequests' => [ 'shape' => 'SampledHTTPRequests', ], 'PopulationSize' => [ 'shape' => 'PopulationSize', ], 'TimeWindow' => [ 'shape' => 'TimeWindow', ], ], ], 'GetSizeConstraintSetRequest' => [ 'type' => 'structure', 'required' => [ 'SizeConstraintSetId', ], 'members' => [ 'SizeConstraintSetId' => [ 'shape' => 'ResourceId', ], ], ], 'GetSizeConstraintSetResponse' => [ 'type' => 'structure', 'members' => [ 'SizeConstraintSet' => [ 'shape' => 'SizeConstraintSet', ], ], ], 'GetSqlInjectionMatchSetRequest' => [ 'type' => 'structure', 'required' => [ 'SqlInjectionMatchSetId', ], 'members' => [ 'SqlInjectionMatchSetId' => [ 'shape' => 'ResourceId', ], ], ], 'GetSqlInjectionMatchSetResponse' => [ 'type' => 'structure', 'members' => [ 'SqlInjectionMatchSet' => [ 'shape' => 'SqlInjectionMatchSet', ], ], ], 'GetWebACLRequest' => [ 'type' => 'structure', 'required' => [ 'WebACLId', ], 'members' => [ 'WebACLId' => [ 'shape' => 'ResourceId', ], ], ], 'GetWebACLResponse' => [ 'type' => 'structure', 'members' => [ 'WebACL' => [ 'shape' => 'WebACL', ], ], ], 'GetXssMatchSetRequest' => [ 'type' => 'structure', 'required' => [ 'XssMatchSetId', ], 'members' => [ 'XssMatchSetId' => [ 'shape' => 'ResourceId', ], ], ], 'GetXssMatchSetResponse' => [ 'type' => 'structure', 'members' => [ 'XssMatchSet' => [ 'shape' => 'XssMatchSet', ], ], ], 'HTTPHeader' => [ 'type' => 'structure', 'members' => [ 'Name' => [ 'shape' => 'HeaderName', ], 'Value' => [ 'shape' => 'HeaderValue', ], ], ], 'HTTPHeaders' => [ 'type' => 'list', 'member' => [ 'shape' => 'HTTPHeader', ], ], 'HTTPMethod' => [ 'type' => 'string', ], 'HTTPRequest' => [ 'type' => 'structure', 'members' => [ 'ClientIP' => [ 'shape' => 'IPString', ], 'Country' => [ 'shape' => 'Country', ], 'URI' => [ 'shape' => 'URIString', ], 'Method' => [ 'shape' => 'HTTPMethod', ], 'HTTPVersion' => [ 'shape' => 'HTTPVersion', ], 'Headers' => [ 'shape' => 'HTTPHeaders', ], ], ], 'HTTPVersion' => [ 'type' => 'string', ], 'HeaderName' => [ 'type' => 'string', ], 'HeaderValue' => [ 'type' => 'string', ], 'IPSet' => [ 'type' => 'structure', 'required' => [ 'IPSetId', 'IPSetDescriptors', ], 'members' => [ 'IPSetId' => [ 'shape' => 'ResourceId', ], 'Name' => [ 'shape' => 'ResourceName', ], 'IPSetDescriptors' => [ 'shape' => 'IPSetDescriptors', ], ], ], 'IPSetDescriptor' => [ 'type' => 'structure', 'required' => [ 'Type', 'Value', ], 'members' => [ 'Type' => [ 'shape' => 'IPSetDescriptorType', ], 'Value' => [ 'shape' => 'IPSetDescriptorValue', ], ], ], 'IPSetDescriptorType' => [ 'type' => 'string', 'enum' => [ 'IPV4', 'IPV6', ], ], 'IPSetDescriptorValue' => [ 'type' => 'string', ], 'IPSetDescriptors' => [ 'type' => 'list', 'member' => [ 'shape' => 'IPSetDescriptor', ], ], 'IPSetSummaries' => [ 'type' => 'list', 'member' => [ 'shape' => 'IPSetSummary', ], ], 'IPSetSummary' => [ 'type' => 'structure', 'required' => [ 'IPSetId', 'Name', ], 'members' => [ 'IPSetId' => [ 'shape' => 'ResourceId', ], 'Name' => [ 'shape' => 'ResourceName', ], ], ], 'IPSetUpdate' => [ 'type' => 'structure', 'required' => [ 'Action', 'IPSetDescriptor', ], 'members' => [ 'Action' => [ 'shape' => 'ChangeAction', ], 'IPSetDescriptor' => [ 'shape' => 'IPSetDescriptor', ], ], ], 'IPSetUpdates' => [ 'type' => 'list', 'member' => [ 'shape' => 'IPSetUpdate', ], 'min' => 1, ], 'IPString' => [ 'type' => 'string', ], 'ListActivatedRulesInRuleGroupRequest' => [ 'type' => 'structure', 'members' => [ 'RuleGroupId' => [ 'shape' => 'ResourceId', ], 'NextMarker' => [ 'shape' => 'NextMarker', ], 'Limit' => [ 'shape' => 'PaginationLimit', ], ], ], 'ListActivatedRulesInRuleGroupResponse' => [ 'type' => 'structure', 'members' => [ 'NextMarker' => [ 'shape' => 'NextMarker', ], 'ActivatedRules' => [ 'shape' => 'ActivatedRules', ], ], ], 'ListByteMatchSetsRequest' => [ 'type' => 'structure', 'members' => [ 'NextMarker' => [ 'shape' => 'NextMarker', ], 'Limit' => [ 'shape' => 'PaginationLimit', ], ], ], 'ListByteMatchSetsResponse' => [ 'type' => 'structure', 'members' => [ 'NextMarker' => [ 'shape' => 'NextMarker', ], 'ByteMatchSets' => [ 'shape' => 'ByteMatchSetSummaries', ], ], ], 'ListGeoMatchSetsRequest' => [ 'type' => 'structure', 'members' => [ 'NextMarker' => [ 'shape' => 'NextMarker', ], 'Limit' => [ 'shape' => 'PaginationLimit', ], ], ], 'ListGeoMatchSetsResponse' => [ 'type' => 'structure', 'members' => [ 'NextMarker' => [ 'shape' => 'NextMarker', ], 'GeoMatchSets' => [ 'shape' => 'GeoMatchSetSummaries', ], ], ], 'ListIPSetsRequest' => [ 'type' => 'structure', 'members' => [ 'NextMarker' => [ 'shape' => 'NextMarker', ], 'Limit' => [ 'shape' => 'PaginationLimit', ], ], ], 'ListIPSetsResponse' => [ 'type' => 'structure', 'members' => [ 'NextMarker' => [ 'shape' => 'NextMarker', ], 'IPSets' => [ 'shape' => 'IPSetSummaries', ], ], ], 'ListRateBasedRulesRequest' => [ 'type' => 'structure', 'members' => [ 'NextMarker' => [ 'shape' => 'NextMarker', ], 'Limit' => [ 'shape' => 'PaginationLimit', ], ], ], 'ListRateBasedRulesResponse' => [ 'type' => 'structure', 'members' => [ 'NextMarker' => [ 'shape' => 'NextMarker', ], 'Rules' => [ 'shape' => 'RuleSummaries', ], ], ], 'ListRegexMatchSetsRequest' => [ 'type' => 'structure', 'members' => [ 'NextMarker' => [ 'shape' => 'NextMarker', ], 'Limit' => [ 'shape' => 'PaginationLimit', ], ], ], 'ListRegexMatchSetsResponse' => [ 'type' => 'structure', 'members' => [ 'NextMarker' => [ 'shape' => 'NextMarker', ], 'RegexMatchSets' => [ 'shape' => 'RegexMatchSetSummaries', ], ], ], 'ListRegexPatternSetsRequest' => [ 'type' => 'structure', 'members' => [ 'NextMarker' => [ 'shape' => 'NextMarker', ], 'Limit' => [ 'shape' => 'PaginationLimit', ], ], ], 'ListRegexPatternSetsResponse' => [ 'type' => 'structure', 'members' => [ 'NextMarker' => [ 'shape' => 'NextMarker', ], 'RegexPatternSets' => [ 'shape' => 'RegexPatternSetSummaries', ], ], ], 'ListRuleGroupsRequest' => [ 'type' => 'structure', 'members' => [ 'NextMarker' => [ 'shape' => 'NextMarker', ], 'Limit' => [ 'shape' => 'PaginationLimit', ], ], ], 'ListRuleGroupsResponse' => [ 'type' => 'structure', 'members' => [ 'NextMarker' => [ 'shape' => 'NextMarker', ], 'RuleGroups' => [ 'shape' => 'RuleGroupSummaries', ], ], ], 'ListRulesRequest' => [ 'type' => 'structure', 'members' => [ 'NextMarker' => [ 'shape' => 'NextMarker', ], 'Limit' => [ 'shape' => 'PaginationLimit', ], ], ], 'ListRulesResponse' => [ 'type' => 'structure', 'members' => [ 'NextMarker' => [ 'shape' => 'NextMarker', ], 'Rules' => [ 'shape' => 'RuleSummaries', ], ], ], 'ListSizeConstraintSetsRequest' => [ 'type' => 'structure', 'members' => [ 'NextMarker' => [ 'shape' => 'NextMarker', ], 'Limit' => [ 'shape' => 'PaginationLimit', ], ], ], 'ListSizeConstraintSetsResponse' => [ 'type' => 'structure', 'members' => [ 'NextMarker' => [ 'shape' => 'NextMarker', ], 'SizeConstraintSets' => [ 'shape' => 'SizeConstraintSetSummaries', ], ], ], 'ListSqlInjectionMatchSetsRequest' => [ 'type' => 'structure', 'members' => [ 'NextMarker' => [ 'shape' => 'NextMarker', ], 'Limit' => [ 'shape' => 'PaginationLimit', ], ], ], 'ListSqlInjectionMatchSetsResponse' => [ 'type' => 'structure', 'members' => [ 'NextMarker' => [ 'shape' => 'NextMarker', ], 'SqlInjectionMatchSets' => [ 'shape' => 'SqlInjectionMatchSetSummaries', ], ], ], 'ListSubscribedRuleGroupsRequest' => [ 'type' => 'structure', 'members' => [ 'NextMarker' => [ 'shape' => 'NextMarker', ], 'Limit' => [ 'shape' => 'PaginationLimit', ], ], ], 'ListSubscribedRuleGroupsResponse' => [ 'type' => 'structure', 'members' => [ 'NextMarker' => [ 'shape' => 'NextMarker', ], 'RuleGroups' => [ 'shape' => 'SubscribedRuleGroupSummaries', ], ], ], 'ListWebACLsRequest' => [ 'type' => 'structure', 'members' => [ 'NextMarker' => [ 'shape' => 'NextMarker', ], 'Limit' => [ 'shape' => 'PaginationLimit', ], ], ], 'ListWebACLsResponse' => [ 'type' => 'structure', 'members' => [ 'NextMarker' => [ 'shape' => 'NextMarker', ], 'WebACLs' => [ 'shape' => 'WebACLSummaries', ], ], ], 'ListXssMatchSetsRequest' => [ 'type' => 'structure', 'members' => [ 'NextMarker' => [ 'shape' => 'NextMarker', ], 'Limit' => [ 'shape' => 'PaginationLimit', ], ], ], 'ListXssMatchSetsResponse' => [ 'type' => 'structure', 'members' => [ 'NextMarker' => [ 'shape' => 'NextMarker', ], 'XssMatchSets' => [ 'shape' => 'XssMatchSetSummaries', ], ], ], 'ManagedKey' => [ 'type' => 'string', ], 'ManagedKeys' => [ 'type' => 'list', 'member' => [ 'shape' => 'ManagedKey', ], ], 'MatchFieldData' => [ 'type' => 'string', ], 'MatchFieldType' => [ 'type' => 'string', 'enum' => [ 'URI', 'QUERY_STRING', 'HEADER', 'METHOD', 'BODY', ], ], 'MetricName' => [ 'type' => 'string', ], 'Negated' => [ 'type' => 'boolean', ], 'NextMarker' => [ 'type' => 'string', 'min' => 1, ], 'PaginationLimit' => [ 'type' => 'integer', 'max' => 100, 'min' => 0, ], 'ParameterExceptionField' => [ 'type' => 'string', 'enum' => [ 'CHANGE_ACTION', 'WAF_ACTION', 'WAF_OVERRIDE_ACTION', 'PREDICATE_TYPE', 'IPSET_TYPE', 'BYTE_MATCH_FIELD_TYPE', 'SQL_INJECTION_MATCH_FIELD_TYPE', 'BYTE_MATCH_TEXT_TRANSFORMATION', 'BYTE_MATCH_POSITIONAL_CONSTRAINT', 'SIZE_CONSTRAINT_COMPARISON_OPERATOR', 'GEO_MATCH_LOCATION_TYPE', 'GEO_MATCH_LOCATION_VALUE', 'RATE_KEY', 'RULE_TYPE', 'NEXT_MARKER', ], ], 'ParameterExceptionParameter' => [ 'type' => 'string', 'min' => 1, ], 'ParameterExceptionReason' => [ 'type' => 'string', 'enum' => [ 'INVALID_OPTION', 'ILLEGAL_COMBINATION', ], ], 'PopulationSize' => [ 'type' => 'long', ], 'PositionalConstraint' => [ 'type' => 'string', 'enum' => [ 'EXACTLY', 'STARTS_WITH', 'ENDS_WITH', 'CONTAINS', 'CONTAINS_WORD', ], ], 'Predicate' => [ 'type' => 'structure', 'required' => [ 'Negated', 'Type', 'DataId', ], 'members' => [ 'Negated' => [ 'shape' => 'Negated', ], 'Type' => [ 'shape' => 'PredicateType', ], 'DataId' => [ 'shape' => 'ResourceId', ], ], ], 'PredicateType' => [ 'type' => 'string', 'enum' => [ 'IPMatch', 'ByteMatch', 'SqlInjectionMatch', 'GeoMatch', 'SizeConstraint', 'XssMatch', 'RegexMatch', ], ], 'Predicates' => [ 'type' => 'list', 'member' => [ 'shape' => 'Predicate', ], ], 'RateBasedRule' => [ 'type' => 'structure', 'required' => [ 'RuleId', 'MatchPredicates', 'RateKey', 'RateLimit', ], 'members' => [ 'RuleId' => [ 'shape' => 'ResourceId', ], 'Name' => [ 'shape' => 'ResourceName', ], 'MetricName' => [ 'shape' => 'MetricName', ], 'MatchPredicates' => [ 'shape' => 'Predicates', ], 'RateKey' => [ 'shape' => 'RateKey', ], 'RateLimit' => [ 'shape' => 'RateLimit', ], ], ], 'RateKey' => [ 'type' => 'string', 'enum' => [ 'IP', ], ], 'RateLimit' => [ 'type' => 'long', 'min' => 2000, ], 'RegexMatchSet' => [ 'type' => 'structure', 'members' => [ 'RegexMatchSetId' => [ 'shape' => 'ResourceId', ], 'Name' => [ 'shape' => 'ResourceName', ], 'RegexMatchTuples' => [ 'shape' => 'RegexMatchTuples', ], ], ], 'RegexMatchSetSummaries' => [ 'type' => 'list', 'member' => [ 'shape' => 'RegexMatchSetSummary', ], ], 'RegexMatchSetSummary' => [ 'type' => 'structure', 'required' => [ 'RegexMatchSetId', 'Name', ], 'members' => [ 'RegexMatchSetId' => [ 'shape' => 'ResourceId', ], 'Name' => [ 'shape' => 'ResourceName', ], ], ], 'RegexMatchSetUpdate' => [ 'type' => 'structure', 'required' => [ 'Action', 'RegexMatchTuple', ], 'members' => [ 'Action' => [ 'shape' => 'ChangeAction', ], 'RegexMatchTuple' => [ 'shape' => 'RegexMatchTuple', ], ], ], 'RegexMatchSetUpdates' => [ 'type' => 'list', 'member' => [ 'shape' => 'RegexMatchSetUpdate', ], 'min' => 1, ], 'RegexMatchTuple' => [ 'type' => 'structure', 'required' => [ 'FieldToMatch', 'TextTransformation', 'RegexPatternSetId', ], 'members' => [ 'FieldToMatch' => [ 'shape' => 'FieldToMatch', ], 'TextTransformation' => [ 'shape' => 'TextTransformation', ], 'RegexPatternSetId' => [ 'shape' => 'ResourceId', ], ], ], 'RegexMatchTuples' => [ 'type' => 'list', 'member' => [ 'shape' => 'RegexMatchTuple', ], ], 'RegexPatternSet' => [ 'type' => 'structure', 'required' => [ 'RegexPatternSetId', 'RegexPatternStrings', ], 'members' => [ 'RegexPatternSetId' => [ 'shape' => 'ResourceId', ], 'Name' => [ 'shape' => 'ResourceName', ], 'RegexPatternStrings' => [ 'shape' => 'RegexPatternStrings', ], ], ], 'RegexPatternSetSummaries' => [ 'type' => 'list', 'member' => [ 'shape' => 'RegexPatternSetSummary', ], ], 'RegexPatternSetSummary' => [ 'type' => 'structure', 'required' => [ 'RegexPatternSetId', 'Name', ], 'members' => [ 'RegexPatternSetId' => [ 'shape' => 'ResourceId', ], 'Name' => [ 'shape' => 'ResourceName', ], ], ], 'RegexPatternSetUpdate' => [ 'type' => 'structure', 'required' => [ 'Action', 'RegexPatternString', ], 'members' => [ 'Action' => [ 'shape' => 'ChangeAction', ], 'RegexPatternString' => [ 'shape' => 'RegexPatternString', ], ], ], 'RegexPatternSetUpdates' => [ 'type' => 'list', 'member' => [ 'shape' => 'RegexPatternSetUpdate', ], 'min' => 1, ], 'RegexPatternString' => [ 'type' => 'string', 'min' => 1, ], 'RegexPatternStrings' => [ 'type' => 'list', 'member' => [ 'shape' => 'RegexPatternString', ], 'max' => 10, ], 'ResourceId' => [ 'type' => 'string', 'max' => 128, 'min' => 1, ], 'ResourceName' => [ 'type' => 'string', 'max' => 128, 'min' => 1, ], 'Rule' => [ 'type' => 'structure', 'required' => [ 'RuleId', 'Predicates', ], 'members' => [ 'RuleId' => [ 'shape' => 'ResourceId', ], 'Name' => [ 'shape' => 'ResourceName', ], 'MetricName' => [ 'shape' => 'MetricName', ], 'Predicates' => [ 'shape' => 'Predicates', ], ], ], 'RuleGroup' => [ 'type' => 'structure', 'required' => [ 'RuleGroupId', ], 'members' => [ 'RuleGroupId' => [ 'shape' => 'ResourceId', ], 'Name' => [ 'shape' => 'ResourceName', ], 'MetricName' => [ 'shape' => 'MetricName', ], ], ], 'RuleGroupSummaries' => [ 'type' => 'list', 'member' => [ 'shape' => 'RuleGroupSummary', ], ], 'RuleGroupSummary' => [ 'type' => 'structure', 'required' => [ 'RuleGroupId', 'Name', ], 'members' => [ 'RuleGroupId' => [ 'shape' => 'ResourceId', ], 'Name' => [ 'shape' => 'ResourceName', ], ], ], 'RuleGroupUpdate' => [ 'type' => 'structure', 'required' => [ 'Action', 'ActivatedRule', ], 'members' => [ 'Action' => [ 'shape' => 'ChangeAction', ], 'ActivatedRule' => [ 'shape' => 'ActivatedRule', ], ], ], 'RuleGroupUpdates' => [ 'type' => 'list', 'member' => [ 'shape' => 'RuleGroupUpdate', ], 'min' => 1, ], 'RulePriority' => [ 'type' => 'integer', ], 'RuleSummaries' => [ 'type' => 'list', 'member' => [ 'shape' => 'RuleSummary', ], ], 'RuleSummary' => [ 'type' => 'structure', 'required' => [ 'RuleId', 'Name', ], 'members' => [ 'RuleId' => [ 'shape' => 'ResourceId', ], 'Name' => [ 'shape' => 'ResourceName', ], ], ], 'RuleUpdate' => [ 'type' => 'structure', 'required' => [ 'Action', 'Predicate', ], 'members' => [ 'Action' => [ 'shape' => 'ChangeAction', ], 'Predicate' => [ 'shape' => 'Predicate', ], ], ], 'RuleUpdates' => [ 'type' => 'list', 'member' => [ 'shape' => 'RuleUpdate', ], ], 'SampleWeight' => [ 'type' => 'long', 'min' => 0, ], 'SampledHTTPRequest' => [ 'type' => 'structure', 'required' => [ 'Request', 'Weight', ], 'members' => [ 'Request' => [ 'shape' => 'HTTPRequest', ], 'Weight' => [ 'shape' => 'SampleWeight', ], 'Timestamp' => [ 'shape' => 'Timestamp', ], 'Action' => [ 'shape' => 'Action', ], 'RuleWithinRuleGroup' => [ 'shape' => 'ResourceId', ], ], ], 'SampledHTTPRequests' => [ 'type' => 'list', 'member' => [ 'shape' => 'SampledHTTPRequest', ], ], 'Size' => [ 'type' => 'long', 'max' => 21474836480, 'min' => 0, ], 'SizeConstraint' => [ 'type' => 'structure', 'required' => [ 'FieldToMatch', 'TextTransformation', 'ComparisonOperator', 'Size', ], 'members' => [ 'FieldToMatch' => [ 'shape' => 'FieldToMatch', ], 'TextTransformation' => [ 'shape' => 'TextTransformation', ], 'ComparisonOperator' => [ 'shape' => 'ComparisonOperator', ], 'Size' => [ 'shape' => 'Size', ], ], ], 'SizeConstraintSet' => [ 'type' => 'structure', 'required' => [ 'SizeConstraintSetId', 'SizeConstraints', ], 'members' => [ 'SizeConstraintSetId' => [ 'shape' => 'ResourceId', ], 'Name' => [ 'shape' => 'ResourceName', ], 'SizeConstraints' => [ 'shape' => 'SizeConstraints', ], ], ], 'SizeConstraintSetSummaries' => [ 'type' => 'list', 'member' => [ 'shape' => 'SizeConstraintSetSummary', ], ], 'SizeConstraintSetSummary' => [ 'type' => 'structure', 'required' => [ 'SizeConstraintSetId', 'Name', ], 'members' => [ 'SizeConstraintSetId' => [ 'shape' => 'ResourceId', ], 'Name' => [ 'shape' => 'ResourceName', ], ], ], 'SizeConstraintSetUpdate' => [ 'type' => 'structure', 'required' => [ 'Action', 'SizeConstraint', ], 'members' => [ 'Action' => [ 'shape' => 'ChangeAction', ], 'SizeConstraint' => [ 'shape' => 'SizeConstraint', ], ], ], 'SizeConstraintSetUpdates' => [ 'type' => 'list', 'member' => [ 'shape' => 'SizeConstraintSetUpdate', ], 'min' => 1, ], 'SizeConstraints' => [ 'type' => 'list', 'member' => [ 'shape' => 'SizeConstraint', ], ], 'SqlInjectionMatchSet' => [ 'type' => 'structure', 'required' => [ 'SqlInjectionMatchSetId', 'SqlInjectionMatchTuples', ], 'members' => [ 'SqlInjectionMatchSetId' => [ 'shape' => 'ResourceId', ], 'Name' => [ 'shape' => 'ResourceName', ], 'SqlInjectionMatchTuples' => [ 'shape' => 'SqlInjectionMatchTuples', ], ], ], 'SqlInjectionMatchSetSummaries' => [ 'type' => 'list', 'member' => [ 'shape' => 'SqlInjectionMatchSetSummary', ], ], 'SqlInjectionMatchSetSummary' => [ 'type' => 'structure', 'required' => [ 'SqlInjectionMatchSetId', 'Name', ], 'members' => [ 'SqlInjectionMatchSetId' => [ 'shape' => 'ResourceId', ], 'Name' => [ 'shape' => 'ResourceName', ], ], ], 'SqlInjectionMatchSetUpdate' => [ 'type' => 'structure', 'required' => [ 'Action', 'SqlInjectionMatchTuple', ], 'members' => [ 'Action' => [ 'shape' => 'ChangeAction', ], 'SqlInjectionMatchTuple' => [ 'shape' => 'SqlInjectionMatchTuple', ], ], ], 'SqlInjectionMatchSetUpdates' => [ 'type' => 'list', 'member' => [ 'shape' => 'SqlInjectionMatchSetUpdate', ], 'min' => 1, ], 'SqlInjectionMatchTuple' => [ 'type' => 'structure', 'required' => [ 'FieldToMatch', 'TextTransformation', ], 'members' => [ 'FieldToMatch' => [ 'shape' => 'FieldToMatch', ], 'TextTransformation' => [ 'shape' => 'TextTransformation', ], ], ], 'SqlInjectionMatchTuples' => [ 'type' => 'list', 'member' => [ 'shape' => 'SqlInjectionMatchTuple', ], ], 'SubscribedRuleGroupSummaries' => [ 'type' => 'list', 'member' => [ 'shape' => 'SubscribedRuleGroupSummary', ], ], 'SubscribedRuleGroupSummary' => [ 'type' => 'structure', 'required' => [ 'RuleGroupId', 'Name', 'MetricName', ], 'members' => [ 'RuleGroupId' => [ 'shape' => 'ResourceId', ], 'Name' => [ 'shape' => 'ResourceName', ], 'MetricName' => [ 'shape' => 'MetricName', ], ], ], 'TextTransformation' => [ 'type' => 'string', 'enum' => [ 'NONE', 'COMPRESS_WHITE_SPACE', 'HTML_ENTITY_DECODE', 'LOWERCASE', 'CMD_LINE', 'URL_DECODE', ], ], 'TimeWindow' => [ 'type' => 'structure', 'required' => [ 'StartTime', 'EndTime', ], 'members' => [ 'StartTime' => [ 'shape' => 'Timestamp', ], 'EndTime' => [ 'shape' => 'Timestamp', ], ], ], 'Timestamp' => [ 'type' => 'timestamp', ], 'URIString' => [ 'type' => 'string', ], 'UpdateByteMatchSetRequest' => [ 'type' => 'structure', 'required' => [ 'ByteMatchSetId', 'ChangeToken', 'Updates', ], 'members' => [ 'ByteMatchSetId' => [ 'shape' => 'ResourceId', ], 'ChangeToken' => [ 'shape' => 'ChangeToken', ], 'Updates' => [ 'shape' => 'ByteMatchSetUpdates', ], ], ], 'UpdateByteMatchSetResponse' => [ 'type' => 'structure', 'members' => [ 'ChangeToken' => [ 'shape' => 'ChangeToken', ], ], ], 'UpdateGeoMatchSetRequest' => [ 'type' => 'structure', 'required' => [ 'GeoMatchSetId', 'ChangeToken', 'Updates', ], 'members' => [ 'GeoMatchSetId' => [ 'shape' => 'ResourceId', ], 'ChangeToken' => [ 'shape' => 'ChangeToken', ], 'Updates' => [ 'shape' => 'GeoMatchSetUpdates', ], ], ], 'UpdateGeoMatchSetResponse' => [ 'type' => 'structure', 'members' => [ 'ChangeToken' => [ 'shape' => 'ChangeToken', ], ], ], 'UpdateIPSetRequest' => [ 'type' => 'structure', 'required' => [ 'IPSetId', 'ChangeToken', 'Updates', ], 'members' => [ 'IPSetId' => [ 'shape' => 'ResourceId', ], 'ChangeToken' => [ 'shape' => 'ChangeToken', ], 'Updates' => [ 'shape' => 'IPSetUpdates', ], ], ], 'UpdateIPSetResponse' => [ 'type' => 'structure', 'members' => [ 'ChangeToken' => [ 'shape' => 'ChangeToken', ], ], ], 'UpdateRateBasedRuleRequest' => [ 'type' => 'structure', 'required' => [ 'RuleId', 'ChangeToken', 'Updates', 'RateLimit', ], 'members' => [ 'RuleId' => [ 'shape' => 'ResourceId', ], 'ChangeToken' => [ 'shape' => 'ChangeToken', ], 'Updates' => [ 'shape' => 'RuleUpdates', ], 'RateLimit' => [ 'shape' => 'RateLimit', ], ], ], 'UpdateRateBasedRuleResponse' => [ 'type' => 'structure', 'members' => [ 'ChangeToken' => [ 'shape' => 'ChangeToken', ], ], ], 'UpdateRegexMatchSetRequest' => [ 'type' => 'structure', 'required' => [ 'RegexMatchSetId', 'Updates', 'ChangeToken', ], 'members' => [ 'RegexMatchSetId' => [ 'shape' => 'ResourceId', ], 'Updates' => [ 'shape' => 'RegexMatchSetUpdates', ], 'ChangeToken' => [ 'shape' => 'ChangeToken', ], ], ], 'UpdateRegexMatchSetResponse' => [ 'type' => 'structure', 'members' => [ 'ChangeToken' => [ 'shape' => 'ChangeToken', ], ], ], 'UpdateRegexPatternSetRequest' => [ 'type' => 'structure', 'required' => [ 'RegexPatternSetId', 'Updates', 'ChangeToken', ], 'members' => [ 'RegexPatternSetId' => [ 'shape' => 'ResourceId', ], 'Updates' => [ 'shape' => 'RegexPatternSetUpdates', ], 'ChangeToken' => [ 'shape' => 'ChangeToken', ], ], ], 'UpdateRegexPatternSetResponse' => [ 'type' => 'structure', 'members' => [ 'ChangeToken' => [ 'shape' => 'ChangeToken', ], ], ], 'UpdateRuleGroupRequest' => [ 'type' => 'structure', 'required' => [ 'RuleGroupId', 'Updates', 'ChangeToken', ], 'members' => [ 'RuleGroupId' => [ 'shape' => 'ResourceId', ], 'Updates' => [ 'shape' => 'RuleGroupUpdates', ], 'ChangeToken' => [ 'shape' => 'ChangeToken', ], ], ], 'UpdateRuleGroupResponse' => [ 'type' => 'structure', 'members' => [ 'ChangeToken' => [ 'shape' => 'ChangeToken', ], ], ], 'UpdateRuleRequest' => [ 'type' => 'structure', 'required' => [ 'RuleId', 'ChangeToken', 'Updates', ], 'members' => [ 'RuleId' => [ 'shape' => 'ResourceId', ], 'ChangeToken' => [ 'shape' => 'ChangeToken', ], 'Updates' => [ 'shape' => 'RuleUpdates', ], ], ], 'UpdateRuleResponse' => [ 'type' => 'structure', 'members' => [ 'ChangeToken' => [ 'shape' => 'ChangeToken', ], ], ], 'UpdateSizeConstraintSetRequest' => [ 'type' => 'structure', 'required' => [ 'SizeConstraintSetId', 'ChangeToken', 'Updates', ], 'members' => [ 'SizeConstraintSetId' => [ 'shape' => 'ResourceId', ], 'ChangeToken' => [ 'shape' => 'ChangeToken', ], 'Updates' => [ 'shape' => 'SizeConstraintSetUpdates', ], ], ], 'UpdateSizeConstraintSetResponse' => [ 'type' => 'structure', 'members' => [ 'ChangeToken' => [ 'shape' => 'ChangeToken', ], ], ], 'UpdateSqlInjectionMatchSetRequest' => [ 'type' => 'structure', 'required' => [ 'SqlInjectionMatchSetId', 'ChangeToken', 'Updates', ], 'members' => [ 'SqlInjectionMatchSetId' => [ 'shape' => 'ResourceId', ], 'ChangeToken' => [ 'shape' => 'ChangeToken', ], 'Updates' => [ 'shape' => 'SqlInjectionMatchSetUpdates', ], ], ], 'UpdateSqlInjectionMatchSetResponse' => [ 'type' => 'structure', 'members' => [ 'ChangeToken' => [ 'shape' => 'ChangeToken', ], ], ], 'UpdateWebACLRequest' => [ 'type' => 'structure', 'required' => [ 'WebACLId', 'ChangeToken', ], 'members' => [ 'WebACLId' => [ 'shape' => 'ResourceId', ], 'ChangeToken' => [ 'shape' => 'ChangeToken', ], 'Updates' => [ 'shape' => 'WebACLUpdates', ], 'DefaultAction' => [ 'shape' => 'WafAction', ], ], ], 'UpdateWebACLResponse' => [ 'type' => 'structure', 'members' => [ 'ChangeToken' => [ 'shape' => 'ChangeToken', ], ], ], 'UpdateXssMatchSetRequest' => [ 'type' => 'structure', 'required' => [ 'XssMatchSetId', 'ChangeToken', 'Updates', ], 'members' => [ 'XssMatchSetId' => [ 'shape' => 'ResourceId', ], 'ChangeToken' => [ 'shape' => 'ChangeToken', ], 'Updates' => [ 'shape' => 'XssMatchSetUpdates', ], ], ], 'UpdateXssMatchSetResponse' => [ 'type' => 'structure', 'members' => [ 'ChangeToken' => [ 'shape' => 'ChangeToken', ], ], ], 'WAFDisallowedNameException' => [ 'type' => 'structure', 'members' => [ 'message' => [ 'shape' => 'errorMessage', ], ], 'exception' => true, ], 'WAFInternalErrorException' => [ 'type' => 'structure', 'members' => [ 'message' => [ 'shape' => 'errorMessage', ], ], 'exception' => true, 'fault' => true, ], 'WAFInvalidAccountException' => [ 'type' => 'structure', 'members' => [], 'exception' => true, ], 'WAFInvalidOperationException' => [ 'type' => 'structure', 'members' => [ 'message' => [ 'shape' => 'errorMessage', ], ], 'exception' => true, ], 'WAFInvalidParameterException' => [ 'type' => 'structure', 'members' => [ 'field' => [ 'shape' => 'ParameterExceptionField', ], 'parameter' => [ 'shape' => 'ParameterExceptionParameter', ], 'reason' => [ 'shape' => 'ParameterExceptionReason', ], ], 'exception' => true, ], 'WAFInvalidRegexPatternException' => [ 'type' => 'structure', 'members' => [ 'message' => [ 'shape' => 'errorMessage', ], ], 'exception' => true, ], 'WAFLimitsExceededException' => [ 'type' => 'structure', 'members' => [ 'message' => [ 'shape' => 'errorMessage', ], ], 'exception' => true, ], 'WAFNonEmptyEntityException' => [ 'type' => 'structure', 'members' => [ 'message' => [ 'shape' => 'errorMessage', ], ], 'exception' => true, ], 'WAFNonexistentContainerException' => [ 'type' => 'structure', 'members' => [ 'message' => [ 'shape' => 'errorMessage', ], ], 'exception' => true, ], 'WAFNonexistentItemException' => [ 'type' => 'structure', 'members' => [ 'message' => [ 'shape' => 'errorMessage', ], ], 'exception' => true, ], 'WAFReferencedItemException' => [ 'type' => 'structure', 'members' => [ 'message' => [ 'shape' => 'errorMessage', ], ], 'exception' => true, ], 'WAFStaleDataException' => [ 'type' => 'structure', 'members' => [ 'message' => [ 'shape' => 'errorMessage', ], ], 'exception' => true, ], 'WAFSubscriptionNotFoundException' => [ 'type' => 'structure', 'members' => [ 'message' => [ 'shape' => 'errorMessage', ], ], 'exception' => true, ], 'WafAction' => [ 'type' => 'structure', 'required' => [ 'Type', ], 'members' => [ 'Type' => [ 'shape' => 'WafActionType', ], ], ], 'WafActionType' => [ 'type' => 'string', 'enum' => [ 'BLOCK', 'ALLOW', 'COUNT', ], ], 'WafOverrideAction' => [ 'type' => 'structure', 'required' => [ 'Type', ], 'members' => [ 'Type' => [ 'shape' => 'WafOverrideActionType', ], ], ], 'WafOverrideActionType' => [ 'type' => 'string', 'enum' => [ 'NONE', 'COUNT', ], ], 'WafRuleType' => [ 'type' => 'string', 'enum' => [ 'REGULAR', 'RATE_BASED', 'GROUP', ], ], 'WebACL' => [ 'type' => 'structure', 'required' => [ 'WebACLId', 'DefaultAction', 'Rules', ], 'members' => [ 'WebACLId' => [ 'shape' => 'ResourceId', ], 'Name' => [ 'shape' => 'ResourceName', ], 'MetricName' => [ 'shape' => 'MetricName', ], 'DefaultAction' => [ 'shape' => 'WafAction', ], 'Rules' => [ 'shape' => 'ActivatedRules', ], ], ], 'WebACLSummaries' => [ 'type' => 'list', 'member' => [ 'shape' => 'WebACLSummary', ], ], 'WebACLSummary' => [ 'type' => 'structure', 'required' => [ 'WebACLId', 'Name', ], 'members' => [ 'WebACLId' => [ 'shape' => 'ResourceId', ], 'Name' => [ 'shape' => 'ResourceName', ], ], ], 'WebACLUpdate' => [ 'type' => 'structure', 'required' => [ 'Action', 'ActivatedRule', ], 'members' => [ 'Action' => [ 'shape' => 'ChangeAction', ], 'ActivatedRule' => [ 'shape' => 'ActivatedRule', ], ], ], 'WebACLUpdates' => [ 'type' => 'list', 'member' => [ 'shape' => 'WebACLUpdate', ], ], 'XssMatchSet' => [ 'type' => 'structure', 'required' => [ 'XssMatchSetId', 'XssMatchTuples', ], 'members' => [ 'XssMatchSetId' => [ 'shape' => 'ResourceId', ], 'Name' => [ 'shape' => 'ResourceName', ], 'XssMatchTuples' => [ 'shape' => 'XssMatchTuples', ], ], ], 'XssMatchSetSummaries' => [ 'type' => 'list', 'member' => [ 'shape' => 'XssMatchSetSummary', ], ], 'XssMatchSetSummary' => [ 'type' => 'structure', 'required' => [ 'XssMatchSetId', 'Name', ], 'members' => [ 'XssMatchSetId' => [ 'shape' => 'ResourceId', ], 'Name' => [ 'shape' => 'ResourceName', ], ], ], 'XssMatchSetUpdate' => [ 'type' => 'structure', 'required' => [ 'Action', 'XssMatchTuple', ], 'members' => [ 'Action' => [ 'shape' => 'ChangeAction', ], 'XssMatchTuple' => [ 'shape' => 'XssMatchTuple', ], ], ], 'XssMatchSetUpdates' => [ 'type' => 'list', 'member' => [ 'shape' => 'XssMatchSetUpdate', ], 'min' => 1, ], 'XssMatchTuple' => [ 'type' => 'structure', 'required' => [ 'FieldToMatch', 'TextTransformation', ], 'members' => [ 'FieldToMatch' => [ 'shape' => 'FieldToMatch', ], 'TextTransformation' => [ 'shape' => 'TextTransformation', ], ], ], 'XssMatchTuples' => [ 'type' => 'list', 'member' => [ 'shape' => 'XssMatchTuple', ], ], 'errorMessage' => [ 'type' => 'string', ], ],];...

Full Screen

Full Screen

BackfillMatchTokenTest.php

Source:BackfillMatchTokenTest.php Github

copy

Full Screen

1<?php2/**3 * Tests the backfilling of the T_MATCH token to PHP < 8.0, as well as the4 * setting of parenthesis/scopes for match control structures across PHP versions.5 *6 * @author Juliette Reinders Folmer <phpcs_nospam@adviesenzo.nl>7 * @copyright 2020-2021 Squiz Pty Ltd (ABN 77 084 670 600)8 * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence9 */10namespace PHP_CodeSniffer\Tests\Core\Tokenizer;11use PHP_CodeSniffer\Tests\Core\AbstractMethodUnitTest;12use PHP_CodeSniffer\Util\Tokens;13class BackfillMatchTokenTest extends AbstractMethodUnitTest14{15 /**16 * Test tokenization of match expressions.17 *18 * @param string $testMarker The comment prefacing the target token.19 * @param int $openerOffset The expected offset of the scope opener in relation to the testMarker.20 * @param int $closerOffset The expected offset of the scope closer in relation to the testMarker.21 * @param string $testContent The token content to look for.22 *23 * @dataProvider dataMatchExpression24 * @covers PHP_CodeSniffer\Tokenizers\PHP::tokenize25 *26 * @return void27 */28 public function testMatchExpression($testMarker, $openerOffset, $closerOffset, $testContent='match')29 {30 $tokens = self::$phpcsFile->getTokens();31 $token = $this->getTargetToken($testMarker, [T_STRING, T_MATCH], $testContent);32 $tokenArray = $tokens[$token];33 $this->assertSame(T_MATCH, $tokenArray['code'], 'Token tokenized as '.$tokenArray['type'].', not T_MATCH (code)');34 $this->assertSame('T_MATCH', $tokenArray['type'], 'Token tokenized as '.$tokenArray['type'].', not T_MATCH (type)');35 $this->scopeTestHelper($token, $openerOffset, $closerOffset);36 $this->parenthesisTestHelper($token);37 }//end testMatchExpression()38 /**39 * Data provider.40 *41 * @see testMatchExpression()42 *43 * @return array44 */45 public function dataMatchExpression()46 {47 return [48 'simple_match' => [49 '/* testMatchSimple */',50 6,51 33,52 ],53 'no_trailing_comma' => [54 '/* testMatchNoTrailingComma */',55 6,56 24,57 ],58 'with_default_case' => [59 '/* testMatchWithDefault */',60 6,61 33,62 ],63 'expression_in_condition' => [64 '/* testMatchExpressionInCondition */',65 6,66 77,67 ],68 'multicase' => [69 '/* testMatchMultiCase */',70 6,71 40,72 ],73 'multicase_trailing_comma_in_case' => [74 '/* testMatchMultiCaseTrailingCommaInCase */',75 6,76 47,77 ],78 'in_closure_not_lowercase' => [79 '/* testMatchInClosureNotLowercase */',80 6,81 36,82 'Match',83 ],84 'in_arrow_function' => [85 '/* testMatchInArrowFunction */',86 5,87 36,88 ],89 'arrow_function_in_match_no_trailing_comma' => [90 '/* testArrowFunctionInMatchNoTrailingComma */',91 6,92 44,93 ],94 'in_function_call_param_not_lowercase' => [95 '/* testMatchInFunctionCallParamNotLowercase */',96 8,97 32,98 'MATCH',99 ],100 'in_method_call_param' => [101 '/* testMatchInMethodCallParam */',102 5,103 13,104 ],105 'discard_result' => [106 '/* testMatchDiscardResult */',107 6,108 18,109 ],110 'duplicate_conditions_and_comments' => [111 '/* testMatchWithDuplicateConditionsWithComments */',112 12,113 59,114 ],115 'nested_match_outer' => [116 '/* testNestedMatchOuter */',117 6,118 33,119 ],120 'nested_match_inner' => [121 '/* testNestedMatchInner */',122 6,123 14,124 ],125 'ternary_condition' => [126 '/* testMatchInTernaryCondition */',127 6,128 21,129 ],130 'ternary_then' => [131 '/* testMatchInTernaryThen */',132 6,133 21,134 ],135 'ternary_else' => [136 '/* testMatchInTernaryElse */',137 6,138 21,139 ],140 'array_value' => [141 '/* testMatchInArrayValue */',142 6,143 21,144 ],145 'array_key' => [146 '/* testMatchInArrayKey */',147 6,148 21,149 ],150 'returning_array' => [151 '/* testMatchreturningArray */',152 6,153 125,154 ],155 'nested_in_switch_case_1' => [156 '/* testMatchWithDefaultNestedInSwitchCase1 */',157 6,158 25,159 ],160 'nested_in_switch_case_2' => [161 '/* testMatchWithDefaultNestedInSwitchCase2 */',162 6,163 25,164 ],165 'nested_in_switch_default' => [166 '/* testMatchWithDefaultNestedInSwitchDefault */',167 6,168 25,169 ],170 'match_with_nested_switch' => [171 '/* testMatchContainingSwitch */',172 6,173 180,174 ],175 'no_cases' => [176 '/* testMatchNoCases */',177 6,178 7,179 ],180 'multi_default' => [181 '/* testMatchMultiDefault */',182 6,183 40,184 ],185 ];186 }//end dataMatchExpression()187 /**188 * Verify that "match" keywords which are not match control structures get tokenized as T_STRING189 * and don't have the extra token array indexes.190 *191 * @param string $testMarker The comment prefacing the target token.192 * @param string $testContent The token content to look for.193 *194 * @dataProvider dataNotAMatchStructure195 * @covers PHP_CodeSniffer\Tokenizers\PHP::tokenize196 * @covers PHP_CodeSniffer\Tokenizers\PHP::processAdditional197 *198 * @return void199 */200 public function testNotAMatchStructure($testMarker, $testContent='match')201 {202 $tokens = self::$phpcsFile->getTokens();203 $token = $this->getTargetToken($testMarker, [T_STRING, T_MATCH], $testContent);204 $tokenArray = $tokens[$token];205 $this->assertSame(T_STRING, $tokenArray['code'], 'Token tokenized as '.$tokenArray['type'].', not T_STRING (code)');206 $this->assertSame('T_STRING', $tokenArray['type'], 'Token tokenized as '.$tokenArray['type'].', not T_STRING (type)');207 $this->assertArrayNotHasKey('scope_condition', $tokenArray, 'Scope condition is set');208 $this->assertArrayNotHasKey('scope_opener', $tokenArray, 'Scope opener is set');209 $this->assertArrayNotHasKey('scope_closer', $tokenArray, 'Scope closer is set');210 $this->assertArrayNotHasKey('parenthesis_owner', $tokenArray, 'Parenthesis owner is set');211 $this->assertArrayNotHasKey('parenthesis_opener', $tokenArray, 'Parenthesis opener is set');212 $this->assertArrayNotHasKey('parenthesis_closer', $tokenArray, 'Parenthesis closer is set');213 $next = self::$phpcsFile->findNext(Tokens::$emptyTokens, ($token + 1), null, true);214 if ($next !== false && $tokens[$next]['code'] === T_OPEN_PARENTHESIS) {215 $this->assertArrayNotHasKey('parenthesis_owner', $tokenArray, 'Parenthesis owner is set for opener after');216 }217 }//end testNotAMatchStructure()218 /**219 * Data provider.220 *221 * @see testNotAMatchStructure()222 *223 * @return array224 */225 public function dataNotAMatchStructure()226 {227 return [228 'static_method_call' => ['/* testNoMatchStaticMethodCall */'],229 'class_constant_access' => [230 '/* testNoMatchClassConstantAccess */',231 'MATCH',232 ],233 'class_constant_array_access' => [234 '/* testNoMatchClassConstantArrayAccessMixedCase */',235 'Match',236 ],237 'method_call' => ['/* testNoMatchMethodCall */'],238 'method_call_uppercase' => [239 '/* testNoMatchMethodCallUpper */',240 'MATCH',241 ],242 'property_access' => ['/* testNoMatchPropertyAccess */'],243 'namespaced_function_call' => ['/* testNoMatchNamespacedFunctionCall */'],244 'namespace_operator_function_call' => ['/* testNoMatchNamespaceOperatorFunctionCall */'],245 'interface_method_declaration' => ['/* testNoMatchInterfaceMethodDeclaration */'],246 'class_constant_declaration' => ['/* testNoMatchClassConstantDeclarationLower */'],247 'class_method_declaration' => ['/* testNoMatchClassMethodDeclaration */'],248 'property_assigment' => ['/* testNoMatchPropertyAssignment */'],249 'class_instantiation' => [250 '/* testNoMatchClassInstantiation */',251 'Match',252 ],253 'anon_class_method_declaration' => [254 '/* testNoMatchAnonClassMethodDeclaration */',255 'maTCH',256 ],257 'class_declaration' => [258 '/* testNoMatchClassDeclaration */',259 'Match',260 ],261 'interface_declaration' => [262 '/* testNoMatchInterfaceDeclaration */',263 'Match',264 ],265 'trait_declaration' => [266 '/* testNoMatchTraitDeclaration */',267 'Match',268 ],269 'constant_declaration' => [270 '/* testNoMatchConstantDeclaration */',271 'MATCH',272 ],273 'function_declaration' => ['/* testNoMatchFunctionDeclaration */'],274 'namespace_declaration' => [275 '/* testNoMatchNamespaceDeclaration */',276 'Match',277 ],278 'class_extends_declaration' => [279 '/* testNoMatchExtendedClassDeclaration */',280 'Match',281 ],282 'class_implements_declaration' => [283 '/* testNoMatchImplementedClassDeclaration */',284 'Match',285 ],286 'use_statement' => [287 '/* testNoMatchInUseStatement */',288 'Match',289 ],290 'unsupported_inline_control_structure' => ['/* testNoMatchMissingCurlies */'],291 'unsupported_alternative_syntax' => ['/* testNoMatchAlternativeSyntax */'],292 'live_coding' => ['/* testLiveCoding */'],293 ];294 }//end dataNotAMatchStructure()295 /**296 * Verify that the tokenization of switch structures is not affected by the backfill.297 *298 * @param string $testMarker The comment prefacing the target token.299 * @param int $openerOffset The expected offset of the scope opener in relation to the testMarker.300 * @param int $closerOffset The expected offset of the scope closer in relation to the testMarker.301 *302 * @dataProvider dataSwitchExpression303 * @covers PHP_CodeSniffer\Tokenizers\PHP::tokenize304 * @covers PHP_CodeSniffer\Tokenizers\PHP::processAdditional305 *306 * @return void307 */308 public function testSwitchExpression($testMarker, $openerOffset, $closerOffset)309 {310 $token = $this->getTargetToken($testMarker, T_SWITCH);311 $this->scopeTestHelper($token, $openerOffset, $closerOffset);312 $this->parenthesisTestHelper($token);313 }//end testSwitchExpression()314 /**315 * Data provider.316 *317 * @see testSwitchExpression()318 *319 * @return array320 */321 public function dataSwitchExpression()322 {323 return [324 'switch_containing_match' => [325 '/* testSwitchContainingMatch */',326 6,327 174,328 ],329 'match_containing_switch_1' => [330 '/* testSwitchNestedInMatch1 */',331 5,332 63,333 ],334 'match_containing_switch_2' => [335 '/* testSwitchNestedInMatch2 */',336 5,337 63,338 ],339 ];340 }//end dataSwitchExpression()341 /**342 * Verify that the tokenization of a switch case/default structure containing a match structure343 * or contained *in* a match structure is not affected by the backfill.344 *345 * @param string $testMarker The comment prefacing the target token.346 * @param int $openerOffset The expected offset of the scope opener in relation to the testMarker.347 * @param int $closerOffset The expected offset of the scope closer in relation to the testMarker.348 *349 * @dataProvider dataSwitchCaseVersusMatch350 * @covers PHP_CodeSniffer\Tokenizers\PHP::tokenize351 * @covers PHP_CodeSniffer\Tokenizers\PHP::processAdditional352 *353 * @return void354 */355 public function testSwitchCaseVersusMatch($testMarker, $openerOffset, $closerOffset)356 {357 $token = $this->getTargetToken($testMarker, [T_CASE, T_DEFAULT]);358 $this->scopeTestHelper($token, $openerOffset, $closerOffset);359 }//end testSwitchCaseVersusMatch()360 /**361 * Data provider.362 *363 * @see testSwitchCaseVersusMatch()364 *365 * @return array366 */367 public function dataSwitchCaseVersusMatch()368 {369 return [370 'switch_with_nested_match_case_1' => [371 '/* testMatchWithDefaultNestedInSwitchCase1 */',372 3,373 55,374 ],375 'switch_with_nested_match_case_2' => [376 '/* testMatchWithDefaultNestedInSwitchCase2 */',377 4,378 21,379 ],380 'switch_with_nested_match_default_case' => [381 '/* testMatchWithDefaultNestedInSwitchDefault */',382 1,383 38,384 ],385 'match_with_nested_switch_case' => [386 '/* testSwitchDefaultNestedInMatchCase */',387 1,388 18,389 ],390 'match_with_nested_switch_default_case' => [391 '/* testSwitchDefaultNestedInMatchDefault */',392 1,393 20,394 ],395 ];396 }//end dataSwitchCaseVersusMatch()397 /**398 * Helper function to verify that all scope related array indexes for a control structure399 * are set correctly.400 *401 * @param string $token The control structure token to check.402 * @param int $openerOffset The expected offset of the scope opener in relation to403 * the control structure token.404 * @param int $closerOffset The expected offset of the scope closer in relation to...

Full Screen

Full Screen

lexer.php

Source:lexer.php Github

copy

Full Screen

...71 $this->scanner->skip('/\s+/s');72 if ($this->scanner->eos()) {73 return false;74 }75 if (($match = $this->scanner->scan(self::MATCH_IDENTIFIER)) !== null)76 switch (wfWAFUtils::strtolower($match)) {77 case 'if':78 return $this->createToken(self::T_RULE_START, $match);79 case 'and':80 case 'or':81 case 'xor':82 return $this->createToken(self::T_COMPARISON_OPERATOR, $match);83 default:84 return $this->createToken(self::T_IDENTIFIER, $match);85 }86 else if (($match = $this->scanner->scan(self::MATCH_SINGLE_STRING_LITERAL)) !== null) return $this->createToken(self::T_SINGLE_STRING_LITERAL, $match);87 else if (($match = $this->scanner->scan(self::MATCH_DOUBLE_STRING_LITERAL)) !== null) return $this->createToken(self::T_DOUBLE_STRING_LITERAL, $match);88 else if (($match = $this->scanner->scan(self::MATCH_NUMBER_LITERAL)) !== null) return $this->createToken(self::T_NUMBER_LITERAL, $match);89 else if (($match = $this->scanner->scan(self::MATCH_DOT)) !== null) return $this->createToken(self::T_DOT, $match);90 else if (($match = $this->scanner->scan(self::MATCH_COMPARISON_OPERATOR)) !== null) return $this->createToken(self::T_COMPARISON_OPERATOR, $match);91 else if (($match = $this->scanner->scan(self::MATCH_OPEN_PARENTHESIS)) !== null) return $this->createToken(self::T_OPEN_PARENTHESIS, $match);92 else if (($match = $this->scanner->scan(self::MATCH_CLOSE_PARENTHESIS)) !== null) return $this->createToken(self::T_CLOSE_PARENTHESIS, $match);93 else if (($match = $this->scanner->scan(self::MATCH_COMMA)) !== null) return $this->createToken(self::T_COMMA, $match);94 else if (($match = $this->scanner->scan(self::MATCH_RULE_COMPARISON_END)) !== null) return $this->createToken(self::T_RULE_COMPARISON_END, $match);95 else if (($match = $this->scanner->scan(self::MATCH_ASSIGNMENT)) !== null) return $this->createToken(self::T_ASSIGNMENT, $match);96 else if (($match = $this->scanner->scan(self::MATCH_OPEN_BRACKET)) !== null) return $this->createToken(self::T_OPEN_BRACKET, $match);97 else if (($match = $this->scanner->scan(self::MATCH_CLOSE_BRACKET)) !== null) return $this->createToken(self::T_CLOSE_BRACKET, $match);98 else if (($match = $this->scanner->scan(self::MATCH_SINGLE_LINE_COMMENT)) !== null) return $this->createToken(self::T_SINGLE_LINE_COMMENT, $match);99 else if (($match = $this->scanner->scan(self::MATCH_MULTIPLE_LINE_COMMENT)) !== null) return $this->createToken(self::T_MULTIPLE_LINE_COMMENT, $match);100 else {101 $e = new wfWAFParserSyntaxError(sprintf('Invalid character "%s" found on line %d, column %d',102 $this->scanner->scanChar(), $this->scanner->getLine(), $this->scanner->getColumn()));103 $e->setParseLine($this->scanner->getLine());104 $e->setParseColumn($this->scanner->getColumn());105 throw $e;106 }107 }108 return false;109 }110 /**111 * @param $type112 * @param $value113 * @return wfWAFLexerToken114 */115 protected function createToken($type, $value) {116 return new wfWAFLexerToken($type, $value, $this->scanner->getLine(), $this->scanner->getColumn());117 }118 /**119 * @return string120 */121 public function getRules() {122 return $this->rules;123 }124 /**125 * @param string $rules126 */127 public function setRules($rules) {128 $this->rules = rtrim($rules);129 }130}131/**132 *133 */134class wfWAFLexerToken {135 private $type;136 private $value;137 private $line;138 private $column;139 /**140 * wfWAFRuleToken constructor.141 *142 * @param $type143 * @param $value144 * @param $line145 * @param $column146 */147 public function __construct($type, $value, $line, $column) {148 $this->setType($type);149 $this->setValue($value);150 $this->setLine($line);151 $this->setColumn($column);152 }153 /**154 * @return string155 */156 public function getLowerCaseValue() {157 return wfWAFUtils::strtolower($this->getValue());158 }159 /**160 * @return string161 */162 public function getUpperCaseValue() {163 return wfWAFUtils::strtoupper($this->getValue());164 }165 /**166 * @return mixed167 */168 public function getType() {169 return $this->type;170 }171 /**172 * @param mixed $type173 */174 public function setType($type) {175 $this->type = $type;176 }177 /**178 * @return mixed179 */180 public function getValue() {181 return $this->value;182 }183 /**184 * @param mixed $value185 */186 public function setValue($value) {187 $this->value = $value;188 }189 /**190 * @return mixed191 */192 public function getLine() {193 return $this->line;194 }195 /**196 * @param mixed $line197 */198 public function setLine($line) {199 $this->line = $line;200 }201 /**202 * @return mixed203 */204 public function getColumn() {205 return $this->column;206 }207 /**208 * @param mixed $column209 */210 public function setColumn($column) {211 $this->column = $column;212 }213}214class wfWAFParserSyntaxError extends wfWAFException {215 private $parseLine;216 private $parseColumn;217 private $token;218 /**219 * @return mixed220 */221 public function getToken() {222 return $this->token;223 }224 /**225 * @param mixed $token226 */227 public function setToken($token) {228 $this->token = $token;229 }230 /**231 * @return mixed232 */233 public function getParseLine() {234 return $this->parseLine;235 }236 /**237 * @param mixed $parseLine238 */239 public function setParseLine($parseLine) {240 $this->parseLine = $parseLine;241 }242 /**243 * @return mixed244 */245 public function getParseColumn() {246 return $this->parseColumn;247 }248 /**249 * @param mixed $parseColumn250 */251 public function setParseColumn($parseColumn) {252 $this->parseColumn = $parseColumn;253 }254}255class wfWAFBaseParser {256 protected $tokens;257 protected $index;258 /** @var wfWAFLexerInterface */259 protected $lexer;260 public function __construct($lexer) {261 $this->lexer = $lexer;262 }263 /**264 * @param wfWAFLexerToken $token265 * @param mixed $type266 * @return bool267 */268 protected function isTokenOfType($token, $type) {269 if (is_array($type)) {270 return $token && in_array($token->getType(), $type);271 }272 return $token && $token->getType() === $type;273 }274 /**275 * @param wfWAFLexerToken $token276 * @param int $type277 * @param string $message278 * @throws wfWAFParserSyntaxError279 */280 protected function expectTokenTypeEquals($token, $type, $message = 'Wordfence WAF Syntax Error: Unexpected %s found on line %d, column %d. Expected %s.') {281 if ($token->getType() !== $type) {282 $this->triggerSyntaxError($token, sprintf($message, $token->getType(),283 $token->getLine(), $token->getColumn(), $type));284 }285 }286 /**287 * @param wfWAFLexerToken $token288 * @param array $types289 * @param string $message290 * @throws wfWAFParserSyntaxError291 */292 protected function expectTokenTypeInArray($token, $types, $message = 'Wordfence WAF Syntax Error: Unexpected %s found on line %d, column %d') {293 if (!in_array($token->getType(), $types)) {294 $this->triggerSyntaxError($token, sprintf($message, $token->getType(),295 $token->getLine(), $token->getColumn()));296 }297 }298 /**299 * @param wfWAFLexerToken $token300 * @param string $message301 * @throws wfWAFParserSyntaxError302 */303 protected function triggerSyntaxError($token, $message = 'Wordfence WAF Syntax Error: Unexpected %s %s found on line %d, column %d') {304 $e = new wfWAFParserSyntaxError(sprintf($message, $token->getType(), $token->getValue(),305 $token->getLine(), $token->getColumn()));306 $e->setToken($token);307 $e->setParseLine($token->getLine());308 $e->setParseColumn($token->getColumn());309 throw $e;310 }311 /**312 * @return wfWAFLexerToken313 */314 protected function currentToken() {315 return $this->getToken($this->index);316 }317 /**318 * @return bool|wfWAFLexerToken319 */320 protected function nextToken() {321 $this->index++;322 return $this->getToken($this->index);323 }324 /**325 * @param string $message326 * @return wfWAFLexerToken327 * @throws wfWAFParserSyntaxError328 */329 protected function expectNextToken($message = 'Expected statement') {330 $this->index++;331 if ($token = $this->getToken($this->index)) {332 return $token;333 }334 throw new wfWAFParserSyntaxError($message);335 }336 /**337 * @param int $index338 * @return mixed339 */340 protected function getToken($index) {341 if (is_array($this->tokens) && array_key_exists($index, $this->tokens)) {342 return $this->tokens[$index];343 }344 if ($token = $this->getLexer()->nextToken()) {345 $this->tokens[$index] = $token;346 return $this->tokens[$index];347 }348 return false;349 }350 /**351 * @return wfWAFLexerInterface352 */353 public function getLexer() {354 return $this->lexer;355 }356 /**357 * @param wfWAFLexerInterface $lexer358 */359 public function setLexer($lexer) {360 $this->lexer = $lexer;361 }362 /**363 * @return mixed364 */365 public function getTokens() {366 return $this->tokens;367 }368 /**369 * @param mixed $tokens370 */371 public function setTokens($tokens) {372 $this->tokens = $tokens;373 }374}375/**376 *377 */378class wfWAFStringScanner {379 private $string;380 private $length;381 private $pointer;382 private $prevPointer;383 private $match;384 private $captures;385 /**386 * wfWAFStringScanner constructor.387 * @param $string388 */389 public function __construct($string = null) {390 if (is_string($string)) {391 $this->setString($string);392 }393 }394 /**395 * @param $regex396 * @return mixed397 */398 public function scan($regex) {399 $remaining = $this->getRemainingString();400 if ($this->regexMatch($regex, $remaining, $matches)) {401 $matchLen = wfWAFUtils::strlen($matches[0]);402 if ($matchLen > 0 && wfWAFUtils::strpos($remaining, $matches[0]) === 0) {403 return $this->setState($matches, $this->getPointer() + $matchLen, $this->getPointer());404 }405 }406 return $this->setState();407 }408 /**409 * @param $regex410 * @return int|null411 */412 public function skip($regex) {413 return $this->scan($regex) ? wfWAFUtils::strlen($this->getMatch()) : null;414 }415 /**416 * @return mixed417 */418 public function scanChar() {419 return $this->scan('/./s');420 }421 /**422 * @param string $regex423 * @return mixed424 */425 public function check($regex) {426 $remaining = $this->getRemainingString();427 if ($this->regexMatch($regex, $remaining, $matches)) {428 $matchLen = wfWAFUtils::strlen($matches[0]);429 if ($matchLen > 0 && wfWAFUtils::strpos($remaining, $matches[0]) === 0) {430 return $this->setState($matches);431 }432 }433 return $this->setState();434 }435 /**436 * @param string $regex437 * @param string $remaining438 * @param $matches439 * @return int440 */441 public function regexMatch($regex, $remaining, &$matches) {442// $startTime = microtime(true);443 $result = preg_match($regex, $remaining, $matches);444// printf("%s took %f seconds\n", $regex, microtime(true) - $startTime);445 return $result;446 }447 /**448 * @return bool449 */450 public function eos() {451 return $this->getPointer() === $this->getLength();452 }453 /**454 * @return string455 */456 public function getRemainingString() {457 return wfWAFUtils::substr($this->getString(), $this->getPointer());458 }459 /**460 * @return $this461 */462 public function reset() {463 $this->setState(array(), 0, 0);464 return $this;465 }466 /**467 * The current line of the scanned string.468 *469 * @return int470 */471 public function getLine() {472 if ($this->getPointer() + 1 > $this->getLength()) {473 return wfWAFUtils::substr_count($this->getString(), "\n") + 1;474 }475 return wfWAFUtils::substr_count($this->getString(), "\n", 0, $this->getPointer() + 1) + 1;476 }477 /**478 * The current column of the line of the scanned string.479 *480 * @return int481 */482 public function getColumn() {483 return $this->getPointer() - ((int) wfWAFUtils::strrpos(wfWAFUtils::substr($this->getString(), 0, $this->getPointer() + 1), "\n")) + 1;484 }485 /**486 * @param array $matches487 * @param int|null $pointer488 * @param int|null $prevPointer489 * @return mixed490 */491 protected function setState($matches = array(), $pointer = null, $prevPointer = null) {492 if ($pointer !== null) {493 $this->setPointer($pointer);494 }495 if ($prevPointer !== null) {496 $this->setPrevPointer($prevPointer);497 }498 if (is_array($matches)) {499 $this->setCaptures(array_slice($matches, 1));500 if (count($matches) > 0) {501 $this->setMatch($matches[0]);502 } else {503 $this->setMatch(null);504 }505 } else {506 $this->setMatch(null);507 }508 return $this->getMatch();509 }510 /**511 * @return string512 */513 public function getString() {514 return $this->string;515 }516 /**517 * @param string $string518 * @throws InvalidArgumentException519 */520 public function setString($string) {521 if (!is_string($string)) {522 throw new InvalidArgumentException(sprintf('String expected, got [%s]', gettype($string)));523 }524 $this->setLength(wfWAFUtils::strlen($string));525 $this->string = $string;526 $this->reset();527 }528 /**529 * @return int530 */531 public function getLength() {532 return $this->length;533 }534 /**535 * @param int $length536 */537 protected function setLength($length) {538 $this->length = $length;539 }540 /**541 * @param int $length542 */543 public function advancePointer($length) {544 $this->setPointer($this->getPointer() + $length);545 }546 /**547 * @return int548 */549 public function getPointer() {550 return $this->pointer;551 }552 /**553 * @param int $pointer554 */555 protected function setPointer($pointer) {556 $this->pointer = $pointer;557 }558 /**559 * @return int560 */561 public function getPrevPointer() {562 return $this->prevPointer;563 }564 /**565 * @param int $prevPointer566 */567 protected function setPrevPointer($prevPointer) {568 $this->prevPointer = $prevPointer;569 }570 /**571 * @return mixed572 */573 public function getMatch() {574 return $this->match;575 }576 /**577 * @param mixed $match578 */579 protected function setMatch($match) {580 $this->match = $match;581 }582 /**583 * @param null $index584 * @return mixed585 */586 public function getCaptures($index = null) {587 if (is_numeric($index)) {588 return isset($this->captures[$index]) ? $this->captures[$index] : null;589 }590 return $this->captures;591 }592 /**593 * @param mixed $captures594 */...

Full Screen

Full Screen

DefaultKeywordTest.php

Source:DefaultKeywordTest.php Github

copy

Full Screen

1<?php2/**3 * Tests the retokenization of the `default` keyword to T_MATCH_DEFAULT for PHP 8.0 match structures4 * and makes sure that the tokenization of switch `T_DEFAULT` structures is not aversely affected.5 *6 * @author Juliette Reinders Folmer <phpcs_nospam@adviesenzo.nl>7 * @copyright 2020-2021 Squiz Pty Ltd (ABN 77 084 670 600)8 * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence9 */10namespace PHP_CodeSniffer\Tests\Core\Tokenizer;11use PHP_CodeSniffer\Tests\Core\AbstractMethodUnitTest;12class DefaultKeywordTest extends AbstractMethodUnitTest13{14 /**15 * Test the retokenization of the `default` keyword for match structure to `T_MATCH_DEFAULT`.16 *17 * Note: Cases and default structures within a match structure do *NOT* get case/default scope18 * conditions, in contrast to case and default structures in switch control structures.19 *20 * @param string $testMarker The comment prefacing the target token.21 * @param string $testContent The token content to look for.22 *23 * @dataProvider dataMatchDefault24 * @covers PHP_CodeSniffer\Tokenizers\PHP::tokenize25 * @covers PHP_CodeSniffer\Tokenizers\Tokenizer::recurseScopeMap26 *27 * @return void28 */29 public function testMatchDefault($testMarker, $testContent='default')30 {31 $tokens = self::$phpcsFile->getTokens();32 $token = $this->getTargetToken($testMarker, [T_MATCH_DEFAULT, T_DEFAULT, T_STRING], $testContent);33 $tokenArray = $tokens[$token];34 $this->assertSame(T_MATCH_DEFAULT, $tokenArray['code'], 'Token tokenized as '.$tokenArray['type'].', not T_MATCH_DEFAULT (code)');35 $this->assertSame('T_MATCH_DEFAULT', $tokenArray['type'], 'Token tokenized as '.$tokenArray['type'].', not T_MATCH_DEFAULT (type)');36 $this->assertArrayNotHasKey('scope_condition', $tokenArray, 'Scope condition is set');37 $this->assertArrayNotHasKey('scope_opener', $tokenArray, 'Scope opener is set');38 $this->assertArrayNotHasKey('scope_closer', $tokenArray, 'Scope closer is set');39 }//end testMatchDefault()40 /**41 * Data provider.42 *43 * @see testMatchDefault()44 *45 * @return array46 */47 public function dataMatchDefault()48 {49 return [50 'simple_match_default' => ['/* testSimpleMatchDefault */'],51 'match_default_in_switch_case_1' => ['/* testMatchDefaultNestedInSwitchCase1 */'],52 'match_default_in_switch_case_2' => ['/* testMatchDefaultNestedInSwitchCase2 */'],53 'match_default_in_switch_default' => ['/* testMatchDefaultNestedInSwitchDefault */'],54 'match_default_containing_switch' => ['/* testMatchDefault */'],55 'match_default_with_nested_long_array_and_default_key' => [56 '/* testMatchDefaultWithNestedLongArrayWithClassConstantKey */',57 'DEFAULT',58 ],59 'match_default_with_nested_long_array_and_default_key_2' => [60 '/* testMatchDefaultWithNestedLongArrayWithClassConstantKeyLevelDown */',61 'DEFAULT',62 ],63 'match_default_with_nested_short_array_and_default_key' => [64 '/* testMatchDefaultWithNestedShortArrayWithClassConstantKey */',65 'DEFAULT',66 ],67 'match_default_with_nested_short_array_and_default_key_2' => [68 '/* testMatchDefaultWithNestedShortArrayWithClassConstantKeyLevelDown */',69 'DEFAULT',70 ],71 'match_default_in_long_array' => [72 '/* testMatchDefaultNestedInLongArray */',73 'DEFAULT',74 ],75 'match_default_in_short_array' => [76 '/* testMatchDefaultNestedInShortArray */',77 'DEFAULT',78 ],79 ];80 }//end dataMatchDefault()81 /**82 * Verify that the retokenization of `T_DEFAULT` tokens in match constructs, doesn't negatively83 * impact the tokenization of `T_DEFAULT` tokens in switch control structures.84 *85 * Note: Cases and default structures within a switch control structure *do* get case/default scope86 * conditions.87 *88 * @param string $testMarker The comment prefacing the target token.89 * @param int $openerOffset The expected offset of the scope opener in relation to the testMarker.90 * @param int $closerOffset The expected offset of the scope closer in relation to the testMarker.91 * @param int|null $conditionStop The expected offset at which tokens stop having T_DEFAULT as a scope condition.92 * @param string $testContent The token content to look for.93 *94 * @dataProvider dataSwitchDefault95 * @covers PHP_CodeSniffer\Tokenizers\Tokenizer::recurseScopeMap96 *97 * @return void98 */99 public function testSwitchDefault($testMarker, $openerOffset, $closerOffset, $conditionStop=null, $testContent='default')100 {101 $tokens = self::$phpcsFile->getTokens();102 $token = $this->getTargetToken($testMarker, [T_MATCH_DEFAULT, T_DEFAULT, T_STRING], $testContent);103 $tokenArray = $tokens[$token];104 $expectedScopeOpener = ($token + $openerOffset);105 $expectedScopeCloser = ($token + $closerOffset);106 $this->assertSame(T_DEFAULT, $tokenArray['code'], 'Token tokenized as '.$tokenArray['type'].', not T_DEFAULT (code)');107 $this->assertSame('T_DEFAULT', $tokenArray['type'], 'Token tokenized as '.$tokenArray['type'].', not T_DEFAULT (type)');108 $this->assertArrayHasKey('scope_condition', $tokenArray, 'Scope condition is not set');109 $this->assertArrayHasKey('scope_opener', $tokenArray, 'Scope opener is not set');110 $this->assertArrayHasKey('scope_closer', $tokenArray, 'Scope closer is not set');111 $this->assertSame($token, $tokenArray['scope_condition'], 'Scope condition is not the T_DEFAULT token');112 $this->assertSame($expectedScopeOpener, $tokenArray['scope_opener'], 'Scope opener of the T_DEFAULT token incorrect');113 $this->assertSame($expectedScopeCloser, $tokenArray['scope_closer'], 'Scope closer of the T_DEFAULT token incorrect');114 $opener = $tokenArray['scope_opener'];115 $this->assertArrayHasKey('scope_condition', $tokens[$opener], 'Opener scope condition is not set');116 $this->assertArrayHasKey('scope_opener', $tokens[$opener], 'Opener scope opener is not set');117 $this->assertArrayHasKey('scope_closer', $tokens[$opener], 'Opener scope closer is not set');118 $this->assertSame($token, $tokens[$opener]['scope_condition'], 'Opener scope condition is not the T_DEFAULT token');119 $this->assertSame($expectedScopeOpener, $tokens[$opener]['scope_opener'], 'T_DEFAULT opener scope opener token incorrect');120 $this->assertSame($expectedScopeCloser, $tokens[$opener]['scope_closer'], 'T_DEFAULT opener scope closer token incorrect');121 $closer = $tokenArray['scope_closer'];122 $this->assertArrayHasKey('scope_condition', $tokens[$closer], 'Closer scope condition is not set');123 $this->assertArrayHasKey('scope_opener', $tokens[$closer], 'Closer scope opener is not set');124 $this->assertArrayHasKey('scope_closer', $tokens[$closer], 'Closer scope closer is not set');125 $this->assertSame($token, $tokens[$closer]['scope_condition'], 'Closer scope condition is not the T_DEFAULT token');126 $this->assertSame($expectedScopeOpener, $tokens[$closer]['scope_opener'], 'T_DEFAULT closer scope opener token incorrect');127 $this->assertSame($expectedScopeCloser, $tokens[$closer]['scope_closer'], 'T_DEFAULT closer scope closer token incorrect');128 if (($opener + 1) !== $closer) {129 $end = $closer;130 if (isset($conditionStop) === true) {131 $end = $conditionStop;132 }133 for ($i = ($opener + 1); $i < $end; $i++) {134 $this->assertArrayHasKey(135 $token,136 $tokens[$i]['conditions'],137 'T_DEFAULT condition not added for token belonging to the T_DEFAULT structure'138 );139 }140 }141 }//end testSwitchDefault()142 /**143 * Data provider.144 *145 * @see testSwitchDefault()146 *147 * @return array148 */149 public function dataSwitchDefault()150 {151 return [152 'simple_switch_default' => [153 '/* testSimpleSwitchDefault */',154 1,155 4,156 ],157 'simple_switch_default_with_curlies' => [158 // For a default structure with curly braces, the scope opener159 // will be the open curly and the closer the close curly.160 // However, scope conditions will not be set for open to close,161 // but only for the open token up to the "break/return/continue" etc.162 '/* testSimpleSwitchDefaultWithCurlies */',163 3,164 12,165 6,166 ],167 'switch_default_toplevel' => [168 '/* testSwitchDefault */',169 1,170 43,171 ],172 'switch_default_nested_in_match_case' => [173 '/* testSwitchDefaultNestedInMatchCase */',174 1,175 20,176 ],177 'switch_default_nested_in_match_default' => [178 '/* testSwitchDefaultNestedInMatchDefault */',179 1,180 18,181 ],182 ];183 }//end dataSwitchDefault()184 /**185 * Verify that the retokenization of `T_DEFAULT` tokens in match constructs, doesn't negatively186 * impact the tokenization of `T_STRING` tokens with the contents 'default' which aren't in187 * actual fact the default keyword.188 *189 * @param string $testMarker The comment prefacing the target token.190 * @param string $testContent The token content to look for.191 *192 * @dataProvider dataNotDefaultKeyword193 * @covers PHP_CodeSniffer\Tokenizers\PHP::processAdditional194 *195 * @return void196 */197 public function testNotDefaultKeyword($testMarker, $testContent='DEFAULT')198 {199 $tokens = self::$phpcsFile->getTokens();200 $token = $this->getTargetToken($testMarker, [T_MATCH_DEFAULT, T_DEFAULT, T_STRING], $testContent);201 $tokenArray = $tokens[$token];202 $this->assertSame(T_STRING, $tokenArray['code'], 'Token tokenized as '.$tokenArray['type'].', not T_STRING (code)');203 $this->assertSame('T_STRING', $tokenArray['type'], 'Token tokenized as '.$tokenArray['type'].', not T_STRING (type)');204 $this->assertArrayNotHasKey('scope_condition', $tokenArray, 'Scope condition is set');205 $this->assertArrayNotHasKey('scope_opener', $tokenArray, 'Scope opener is set');206 $this->assertArrayNotHasKey('scope_closer', $tokenArray, 'Scope closer is set');207 }//end testNotDefaultKeyword()208 /**209 * Data provider.210 *211 * @see testNotDefaultKeyword()212 *213 * @return array214 */215 public function dataNotDefaultKeyword()216 {217 return [218 'class-constant-as-short-array-key' => ['/* testClassConstantAsShortArrayKey */'],219 'class-property-as-short-array-key' => ['/* testClassPropertyAsShortArrayKey */'],220 'namespaced-constant-as-short-array-key' => ['/* testNamespacedConstantAsShortArrayKey */'],221 'fqn-global-constant-as-short-array-key' => ['/* testFQNGlobalConstantAsShortArrayKey */'],222 'class-constant-as-long-array-key' => ['/* testClassConstantAsLongArrayKey */'],223 'class-constant-as-yield-key' => ['/* testClassConstantAsYieldKey */'],224 'class-constant-as-long-array-key-nested-in-match' => ['/* testClassConstantAsLongArrayKeyNestedInMatch */'],225 'class-constant-as-long-array-key-nested-in-match-2' => ['/* testClassConstantAsLongArrayKeyNestedInMatchLevelDown */'],226 'class-constant-as-short-array-key-nested-in-match' => ['/* testClassConstantAsShortArrayKeyNestedInMatch */'],227 'class-constant-as-short-array-key-nested-in-match-2' => ['/* testClassConstantAsShortArrayKeyNestedInMatchLevelDown */'],228 'class-constant-as-long-array-key-with-nested-match' => ['/* testClassConstantAsLongArrayKeyWithNestedMatch */'],229 'class-constant-as-short-array-key-with-nested-match' => ['/* testClassConstantAsShortArrayKeyWithNestedMatch */'],230 'class-constant-in-switch-case' => ['/* testClassConstantInSwitchCase */'],231 'class-property-in-switch-case' => ['/* testClassPropertyInSwitchCase */'],232 'namespaced-constant-in-switch-case' => ['/* testNamespacedConstantInSwitchCase */'],233 'namespace-relative-constant-in-switch-case' => ['/* testNamespaceRelativeConstantInSwitchCase */'],234 ];235 }//end dataNotDefaultKeyword()236}//end class...

Full Screen

Full Screen

SqlToken.php

Source:SqlToken.php Github

copy

Full Screen

...176 }177 return mb_substr($code->content, $this->startOffset, $this->endOffset - $this->startOffset, 'UTF-8');178 }179 /**180 * Returns whether this token (including its children) matches the specified "pattern" SQL code.181 *182 * Usage Example:183 *184 * ```php185 * $patternToken = (new \yii\db\sqlite\SqlTokenizer('SELECT any FROM any'))->tokenize();186 * if ($sqlToken->matches($patternToken, 0, $firstMatchIndex, $lastMatchIndex)) {187 * // ...188 * }189 * ```190 *191 * @param SqlToken $patternToken tokenized SQL code to match against. In addition to normal SQL, the192 * `any` keyword is supported which will match any number of keywords, identifiers, whitespaces.193 * @param int $offset token children offset to start lookup with.194 * @param int|null $firstMatchIndex token children offset where a successful match begins.195 * @param int|null $lastMatchIndex token children offset where a successful match ends.196 * @return bool whether this token matches the pattern SQL code.197 */198 public function matches(SqlToken $patternToken, $offset = 0, &$firstMatchIndex = null, &$lastMatchIndex = null)199 {200 if (!$patternToken->getHasChildren()) {201 return false;202 }203 $patternToken = $patternToken[0];204 return $this->tokensMatch($patternToken, $this, $offset, $firstMatchIndex, $lastMatchIndex);205 }206 /**207 * Tests the given token to match the specified pattern token.208 * @param SqlToken $patternToken209 * @param SqlToken $token210 * @param int $offset211 * @param int|null $firstMatchIndex212 * @param int|null $lastMatchIndex213 * @return bool214 */215 private function tokensMatch(SqlToken $patternToken, SqlToken $token, $offset = 0, &$firstMatchIndex = null, &$lastMatchIndex = null)216 {217 if (218 $patternToken->getIsCollection() !== $token->getIsCollection()219 || (!$patternToken->getIsCollection() && $patternToken->content !== $token->content)220 ) {221 return false;222 }223 if ($patternToken->children === $token->children) {224 $firstMatchIndex = $lastMatchIndex = $offset;225 return true;226 }227 $firstMatchIndex = $lastMatchIndex = null;228 $wildcard = false;229 for ($index = 0, $count = count($patternToken->children); $index < $count; $index++) {230 // Here we iterate token by token with an exception of "any" that toggles231 // an iteration until we matched with a next pattern token or EOF.232 if ($patternToken[$index]->content === 'any') {233 $wildcard = true;234 continue;235 }236 for ($limit = $wildcard ? count($token->children) : $offset + 1; $offset < $limit; $offset++) {237 if (!$wildcard && !isset($token[$offset])) {238 break;239 }240 if (!$this->tokensMatch($patternToken[$index], $token[$offset])) {241 continue;242 }243 if ($firstMatchIndex === null) {244 $firstMatchIndex = $offset;245 $lastMatchIndex = $offset;...

Full Screen

Full Screen

JSONPathLexer.php

Source:JSONPathLexer.php Github

copy

Full Screen

...130 * @throws JSONPathException131 */132 protected function createToken($value)133 {134 if (preg_match('/^(' . static::MATCH_INDEX . ')$/xu', $value, $matches)) {135 if (preg_match('/^-?\d+$/', $value)) {136 $value = (int)$value;137 }138 return new JSONPathToken(JSONPathToken::T_INDEX, $value);139 }140 if (preg_match('/^' . static::MATCH_INDEXES . '$/xu', $value, $matches)) {141 $value = explode(',', trim($value, ','));142 foreach ($value as $i => $v) {143 $value[$i] = (int) trim($v);144 }145 return new JSONPathToken(JSONPathToken::T_INDEXES, $value);146 }147 if (preg_match('/^' . static::MATCH_SLICE . '$/xu', $value, $matches)) {148 $parts = explode(':', $value);149 $value = [150 'start' => isset($parts[0]) && $parts[0] !== "" ? (int) $parts[0] : null,151 'end' => isset($parts[1]) && $parts[1] !== "" ? (int) $parts[1] : null,152 'step' => isset($parts[2]) && $parts[2] !== "" ? (int) $parts[2] : null,153 ];154 return new JSONPathToken(JSONPathToken::T_SLICE, $value);155 }156 if (preg_match('/^' . static::MATCH_QUERY_RESULT . '$/xu', $value)) {157 $value = substr($value, 1, -1);158 return new JSONPathToken(JSONPathToken::T_QUERY_RESULT, $value);159 }160 if (preg_match('/^' . static::MATCH_QUERY_MATCH . '$/xu', $value)) {161 $value = substr($value, 2, -1);162 return new JSONPathToken(JSONPathToken::T_QUERY_MATCH, $value);163 }164 if (preg_match('/^' . static::MATCH_INDEX_IN_SINGLE_QUOTES . '$/xu', $value, $matches)) {165 $value = $matches[1];166 $value = trim($value);167 return new JSONPathToken(JSONPathToken::T_INDEX, $value);168 }169 if (preg_match('/^' . static::MATCH_INDEX_IN_DOUBLE_QUOTES . '$/xu', $value, $matches)) {170 $value = $matches[1];171 $value = trim($value);172 return new JSONPathToken(JSONPathToken::T_INDEX, $value);173 }174 throw new JSONPathException("Unable to parse token {$value} in expression: $this->expression");175 }176}...

Full Screen

Full Screen

creole.php

Source:creole.php Github

copy

Full Screen

...87 // The requested header is likely to have been passed to htmlspecialchars in88 // self::before_parsing(), therefore we should decode it when looking for it.89 return parent::get_section(htmlspecialchars_decode($header), $text, $clean);90 }91 protected function header_block_rule($match) {92 $num = strlen($match[1]);93 $text = trim($match[2]);94 $text = preg_replace("/\s*={1,$num}$/im", "", $text);95 return $this->generate_header($text, $num);96 }97 /**98 * Table generation99 */100 protected function table_block_rule($match) {101 $rows = explode("\n", $match[0]);102 $table = array();103 foreach($rows as $r) {104 if(empty($r)) {105 continue;106 }107 $rawcells = explode("|", $r);108 $cells = array();109 array_shift($rawcells);110 array_pop($rawcells);111 foreach($rawcells as $c) {112 if(!empty($c)) {113 if($c[0] == "=") {114 $type = 'header';115 $c = substr($c, 1);116 }117 else {118 $type = 'normal';119 }120 $this->rules($c);121 $cells[] = array($type, $c);122 }123 }124 $table[] = $cells;125 }126 return $this->generate_table($table);127 }128 protected function paragraph_block_rule($match) {129 $text = $match[1];130 foreach($this->tagrules as $tr) {131 if(isset($tr['token'])) {132 if(is_array($tr['token'])) {133 $this->escape_token_string($text, $tr['token'][0]);134 $this->escape_token_string($text, $tr['token'][1]);135 }136 else {137 $this->escape_token_string($text, $tr['token']);138 }139 }140 }141 $this->escape_token_string($text, "~");142 return $text;143 }144 /**145 * Escape token when it is "negated"146 */147 private function escape_token_string(&$text, $token) {148 $text = str_replace("~".$token, $this->protect($token), $text);149 }150 /**151 * Tag functions152 */153 protected function url_tag_rule($match) {154 if(strpos($match[0], "~") === 0) {155 return substr($match[0], 1);156 }157 else {158 $text = trim($match[0]);159 $options = array('href' => $text);160 return array($text, $options);161 }162 }163 protected function link_tag_rule($match) {164 $text = trim($match[1]);165 if(strpos($match[0], "~") === 0) {166 return substr($match[0], 1);167 }168 else {169 return $this->format_link($text);170 }171 }172 /**173 * Special treatment of // ** // ** //174 */175 protected function bold_tag_rule($match) {176 $text = $match[1];177 $this->rules($text, array('only' => array('italic')));178 if(strpos($text, "//") !== false) {179 $text = str_replace("//", $this->protect("//"), $text);180 }181 return array($text, array());182 }183 protected function image_tag_rule($match) {184 if(strpos($match[0], "~") === 0) {185 return substr($match[0], 1);186 }187 return $this->format_image($match[1], $match[2]);188 }189}...

Full Screen

Full Screen

NumericLiteralSeparatorEmulator.php

Source:NumericLiteralSeparatorEmulator.php Github

copy

Full Screen

...15 // skip version where this is supported16 if (version_compare(\PHP_VERSION, Emulative::PHP_7_4, '>=')) {17 return false;18 }19 return preg_match('~[0-9]_[0-9]~', $code)20 || preg_match('~0x[0-9a-f]+_[0-9a-f]~i', $code);21 }22 public function emulate(string $code, array $tokens): array23 {24 // We need to manually iterate and manage a count because we'll change25 // the tokens array on the way26 $codeOffset = 0;27 for ($i = 0, $c = count($tokens); $i < $c; ++$i) {28 $token = $tokens[$i];29 $tokenLen = \strlen(\is_array($token) ? $token[1] : $token);30 if ($token[0] !== T_LNUMBER && $token[0] !== T_DNUMBER) {31 $codeOffset += $tokenLen;32 continue;33 }34 $res = preg_match(self::NUMBER, $code, $matches, 0, $codeOffset);35 assert($res, "No number at number token position");36 $match = $matches[0];37 $matchLen = \strlen($match);38 if ($matchLen === $tokenLen) {39 // Original token already holds the full number.40 $codeOffset += $tokenLen;41 continue;42 }43 $tokenKind = $this->resolveIntegerOrFloatToken($match);44 $newTokens = [[$tokenKind, $match, $token[2]]];45 $numTokens = 1;46 $len = $tokenLen;47 while ($matchLen > $len) {48 $nextToken = $tokens[$i + $numTokens];49 $nextTokenText = \is_array($nextToken) ? $nextToken[1] : $nextToken;50 $nextTokenLen = \strlen($nextTokenText);51 $numTokens++;52 if ($matchLen < $len + $nextTokenLen) {53 // Split trailing characters into a partial token.54 assert(is_array($nextToken), "Partial token should be an array token");55 $partialText = substr($nextTokenText, $matchLen - $len);56 $newTokens[] = [$nextToken[0], $partialText, $nextToken[2]];57 break;58 }59 $len += $nextTokenLen;60 }61 array_splice($tokens, $i, $numTokens, $newTokens);62 $c -= $numTokens - \count($newTokens);63 $codeOffset += $matchLen;64 }65 return $tokens;66 }67 private function resolveIntegerOrFloatToken(string $str): int68 {69 $str = str_replace('_', '', $str);70 if (stripos($str, '0b') === 0) {71 $num = bindec($str);72 } elseif (stripos($str, '0x') === 0) {73 $num = hexdec($str);74 } elseif (stripos($str, '0') === 0 && ctype_digit($str)) {75 $num = octdec($str);76 } else {77 $num = +$str;...

Full Screen

Full Screen

match

Using AI Code Generation

copy

Full Screen

1$token = new Token();2$token->match();3$token = new Token();4$token->match();5$token = new Token();6$token->match();7$token = new Token();8$token->match();9$token = new Token();10$token->match();11$token = new Token();12$token->match();13$token = new Token();14$token->match();15$token = new Token();16$token->match();17$token = new Token();18$token->match();19$token = new Token();20$token->match();21$token = new Token();22$token->match();23$token = new Token();24$token->match();25$token = new Token();26$token->match();27$token = new Token();28$token->match();29$token = new Token();30$token->match();31$token = new Token();32$token->match();33$token = new Token();34$token->match();35$token = new Token();36$token->match();

Full Screen

Full Screen

match

Using AI Code Generation

copy

Full Screen

1$tokens = token_get_all(file_get_contents('2.php'));2foreach ($tokens as $token) {3 if (is_array($token)) {4 if ($token[0] == T_COMMENT) {5 echo $token[1];6 }7 }8}9$tokens = token_get_all(file_get_contents('3.php'));10foreach ($tokens as $token) {11 if (is_array($token)) {12 if ($token[0] == T_COMMENT) {13 echo $token[1];14 }15 }16}17$tokens = token_get_all(file_get_contents('4.php'));18foreach ($tokens as $token) {19 if (is_array($token)) {20 if ($token[0] == T_COMMENT) {21 echo $token[1];22 }23 }24}25$tokens = token_get_all(file_get_contents('5.php'));26foreach ($tokens as $token) {27 if (is_array($token)) {28 if ($token[0] == T_COMMENT) {29 echo $token[1];30 }31 }32}33$tokens = token_get_all(file_get_contents('6.php'));34foreach ($tokens as $token) {35 if (is_array($token)) {36 if ($token[0] == T_COMMENT) {37 echo $token[1];38 }39 }40}41$tokens = token_get_all(file_get_contents('7.php'));42foreach ($tokens as $token) {43 if (is_array($token)) {44 if ($token[0] == T_COMMENT) {45 echo $token[1];46 }47 }48}49$tokens = token_get_all(file_get_contents('8.php'));50foreach ($tokens as $token) {51 if (is_array($token)) {52 if ($token[0] == T_COMMENT) {53 echo $token[1];54 }55 }56}

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run Cucumber Common Library automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Most used method in Token

Trigger match code on LambdaTest Cloud Grid

Execute automation tests with match on a cloud-based Grid of 3000+ real browsers and operating systems for both web and mobile applications.

Test now for Free

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful