Chilkat Online Tools

CheckCapacity SQL Server Example

AWS WAFV2

CREATE PROCEDURE ChilkatSample
AS
BEGIN
    DECLARE @hr int
    DECLARE @iTmp0 int
    DECLARE @sTmp0 nvarchar(max)
    -- This example requires the Chilkat API to have been previously unlocked.
    -- See Global Unlock Sample for sample code.

    DECLARE @rest int
    EXEC @hr = sp_OACreate 'Chilkat_9_5_0.Rest', @rest OUT
    IF @hr <> 0
    BEGIN
        PRINT 'Failed to create ActiveX component'
        RETURN
    END

    DECLARE @success int

    DECLARE @authAws int
    EXEC @hr = sp_OACreate 'Chilkat_9_5_0.AuthAws', @authAws OUT

    EXEC sp_OASetProperty @authAws, 'AccessKey', 'AWS_ACCESS_KEY'
    EXEC sp_OASetProperty @authAws, 'SecretKey', 'AWS_SECRET_KEY'

    -- Don't forget to change the region to your particular region. (Also make the same change in the call to Connect below.)
    EXEC sp_OASetProperty @authAws, 'Region', 'us-west-2'
    EXEC sp_OASetProperty @authAws, 'ServiceName', 'wafv2'
    -- SetAuthAws causes Chilkat to automatically add the following headers: Authorization, X-Amz-Date
    EXEC sp_OAMethod @rest, 'SetAuthAws', @success OUT, @authAws

    -- URL: https://wafv2.us-west-2.amazonaws.com/
    -- Use the same region as specified above.
    EXEC sp_OAMethod @rest, 'Connect', @success OUT, 'wafv2.us-west-2.amazonaws.com', 443, 1, 1
    IF @success <> 1
      BEGIN

        EXEC sp_OAGetProperty @rest, 'ConnectFailReason', @iTmp0 OUT
        PRINT 'ConnectFailReason: ' + @iTmp0
        EXEC sp_OAGetProperty @rest, 'LastErrorText', @sTmp0 OUT
        PRINT @sTmp0
        EXEC @hr = sp_OADestroy @rest
        EXEC @hr = sp_OADestroy @authAws
        RETURN
      END

    -- The following code creates the JSON request body.
    -- The JSON created by this code is shown below.

    -- Use this online tool to generate code from sample JSON:
    -- Generate Code to Create JSON

    DECLARE @json int
    EXEC @hr = sp_OACreate 'Chilkat_9_5_0.JsonObject', @json OUT

    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Rules[0].Action.Allow.CustomRequestHandling.InsertHeaders[0].Name', 'string'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Rules[0].Action.Allow.CustomRequestHandling.InsertHeaders[0].Value', 'string'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Rules[0].Action.Block.CustomResponse.CustomResponseBodyKey', 'string'
    EXEC sp_OAMethod @json, 'UpdateInt', @success OUT, 'Rules[0].Action.Block.CustomResponse.ResponseCode', 123
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Rules[0].Action.Block.CustomResponse.ResponseHeaders[0].Name', 'string'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Rules[0].Action.Block.CustomResponse.ResponseHeaders[0].Value', 'string'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Rules[0].Action.Captcha.CustomRequestHandling.InsertHeaders[0].Name', 'string'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Rules[0].Action.Captcha.CustomRequestHandling.InsertHeaders[0].Value', 'string'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Rules[0].Action.Count.CustomRequestHandling.InsertHeaders[0].Name', 'string'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Rules[0].Action.Count.CustomRequestHandling.InsertHeaders[0].Value', 'string'
    EXEC sp_OAMethod @json, 'UpdateInt', @success OUT, 'Rules[0].CaptchaConfig.ImmunityTimeProperty.ImmunityTime', 123
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Rules[0].Name', 'string'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Rules[0].OverrideAction.Count.CustomRequestHandling.InsertHeaders[0].Name', 'string'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Rules[0].OverrideAction.Count.CustomRequestHandling.InsertHeaders[0].Value', 'string'
    EXEC sp_OAMethod @json, 'UpdateNewObject', @success OUT, 'Rules[0].OverrideAction.None'
    EXEC sp_OAMethod @json, 'UpdateInt', @success OUT, 'Rules[0].Priority', 123
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Rules[0].RuleLabels[0].Name', 'string'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Rules[0].Statement.AndStatement.Statements[0]', 'Statement'
    EXEC sp_OAMethod @json, 'UpdateNewObject', @success OUT, 'Rules[0].Statement.ByteMatchStatement.FieldToMatch.AllQueryArguments'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Rules[0].Statement.ByteMatchStatement.FieldToMatch.Body.OversizeHandling', 'string'
    EXEC sp_OAMethod @json, 'UpdateNewObject', @success OUT, 'Rules[0].Statement.ByteMatchStatement.FieldToMatch.Cookies.MatchPattern.All'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Rules[0].Statement.ByteMatchStatement.FieldToMatch.Cookies.MatchPattern.ExcludedCookies[0]', 'string'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Rules[0].Statement.ByteMatchStatement.FieldToMatch.Cookies.MatchPattern.IncludedCookies[0]', 'string'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Rules[0].Statement.ByteMatchStatement.FieldToMatch.Cookies.MatchScope', 'string'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Rules[0].Statement.ByteMatchStatement.FieldToMatch.Cookies.OversizeHandling', 'string'
    EXEC sp_OAMethod @json, 'UpdateNewObject', @success OUT, 'Rules[0].Statement.ByteMatchStatement.FieldToMatch.Headers.MatchPattern.All'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Rules[0].Statement.ByteMatchStatement.FieldToMatch.Headers.MatchPattern.ExcludedHeaders[0]', 'string'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Rules[0].Statement.ByteMatchStatement.FieldToMatch.Headers.MatchPattern.IncludedHeaders[0]', 'string'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Rules[0].Statement.ByteMatchStatement.FieldToMatch.Headers.MatchScope', 'string'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Rules[0].Statement.ByteMatchStatement.FieldToMatch.Headers.OversizeHandling', 'string'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Rules[0].Statement.ByteMatchStatement.FieldToMatch.JsonBody.InvalidFallbackBehavior', 'string'
    EXEC sp_OAMethod @json, 'UpdateNewObject', @success OUT, 'Rules[0].Statement.ByteMatchStatement.FieldToMatch.JsonBody.MatchPattern.All'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Rules[0].Statement.ByteMatchStatement.FieldToMatch.JsonBody.MatchPattern.IncludedPaths[0]', 'string'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Rules[0].Statement.ByteMatchStatement.FieldToMatch.JsonBody.MatchScope', 'string'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Rules[0].Statement.ByteMatchStatement.FieldToMatch.JsonBody.OversizeHandling', 'string'
    EXEC sp_OAMethod @json, 'UpdateNewObject', @success OUT, 'Rules[0].Statement.ByteMatchStatement.FieldToMatch.Method'
    EXEC sp_OAMethod @json, 'UpdateNewObject', @success OUT, 'Rules[0].Statement.ByteMatchStatement.FieldToMatch.QueryString'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Rules[0].Statement.ByteMatchStatement.FieldToMatch.SingleHeader.Name', 'string'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Rules[0].Statement.ByteMatchStatement.FieldToMatch.SingleQueryArgument.Name', 'string'
    EXEC sp_OAMethod @json, 'UpdateNewObject', @success OUT, 'Rules[0].Statement.ByteMatchStatement.FieldToMatch.UriPath'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Rules[0].Statement.ByteMatchStatement.PositionalConstraint', 'string'
    EXEC sp_OAMethod @json, 'UpdateInt', @success OUT, 'Rules[0].Statement.ByteMatchStatement.SearchString', 123
    EXEC sp_OAMethod @json, 'UpdateInt', @success OUT, 'Rules[0].Statement.ByteMatchStatement.TextTransformations[0].Priority', 123
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Rules[0].Statement.ByteMatchStatement.TextTransformations[0].Type', 'string'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Rules[0].Statement.GeoMatchStatement.CountryCodes[0]', 'string'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Rules[0].Statement.GeoMatchStatement.ForwardedIPConfig.FallbackBehavior', 'string'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Rules[0].Statement.GeoMatchStatement.ForwardedIPConfig.HeaderName', 'string'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Rules[0].Statement.IPSetReferenceStatement.ARN', 'string'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Rules[0].Statement.IPSetReferenceStatement.IPSetForwardedIPConfig.FallbackBehavior', 'string'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Rules[0].Statement.IPSetReferenceStatement.IPSetForwardedIPConfig.HeaderName', 'string'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Rules[0].Statement.IPSetReferenceStatement.IPSetForwardedIPConfig.Position', 'string'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Rules[0].Statement.LabelMatchStatement.Key', 'string'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Rules[0].Statement.LabelMatchStatement.Scope', 'string'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Rules[0].Statement.ManagedRuleGroupStatement.ExcludedRules[0].Name', 'string'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Rules[0].Statement.ManagedRuleGroupStatement.ManagedRuleGroupConfigs[0].LoginPath', 'string'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Rules[0].Statement.ManagedRuleGroupStatement.ManagedRuleGroupConfigs[0].PasswordField.Identifier', 'string'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Rules[0].Statement.ManagedRuleGroupStatement.ManagedRuleGroupConfigs[0].PayloadType', 'string'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Rules[0].Statement.ManagedRuleGroupStatement.ManagedRuleGroupConfigs[0].UsernameField.Identifier', 'string'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Rules[0].Statement.ManagedRuleGroupStatement.Name', 'string'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Rules[0].Statement.ManagedRuleGroupStatement.ScopeDownStatement', 'Statement'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Rules[0].Statement.ManagedRuleGroupStatement.VendorName', 'string'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Rules[0].Statement.ManagedRuleGroupStatement.Version', 'string'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Rules[0].Statement.NotStatement.Statement', 'Statement'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Rules[0].Statement.OrStatement.Statements[0]', 'Statement'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Rules[0].Statement.RateBasedStatement.AggregateKeyType', 'string'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Rules[0].Statement.RateBasedStatement.ForwardedIPConfig.FallbackBehavior', 'string'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Rules[0].Statement.RateBasedStatement.ForwardedIPConfig.HeaderName', 'string'
    EXEC sp_OAMethod @json, 'UpdateInt', @success OUT, 'Rules[0].Statement.RateBasedStatement.Limit', 123
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Rules[0].Statement.RateBasedStatement.ScopeDownStatement', 'Statement'
    EXEC sp_OAMethod @json, 'UpdateNewObject', @success OUT, 'Rules[0].Statement.RegexMatchStatement.FieldToMatch.AllQueryArguments'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Rules[0].Statement.RegexMatchStatement.FieldToMatch.Body.OversizeHandling', 'string'
    EXEC sp_OAMethod @json, 'UpdateNewObject', @success OUT, 'Rules[0].Statement.RegexMatchStatement.FieldToMatch.Cookies.MatchPattern.All'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Rules[0].Statement.RegexMatchStatement.FieldToMatch.Cookies.MatchPattern.ExcludedCookies[0]', 'string'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Rules[0].Statement.RegexMatchStatement.FieldToMatch.Cookies.MatchPattern.IncludedCookies[0]', 'string'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Rules[0].Statement.RegexMatchStatement.FieldToMatch.Cookies.MatchScope', 'string'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Rules[0].Statement.RegexMatchStatement.FieldToMatch.Cookies.OversizeHandling', 'string'
    EXEC sp_OAMethod @json, 'UpdateNewObject', @success OUT, 'Rules[0].Statement.RegexMatchStatement.FieldToMatch.Headers.MatchPattern.All'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Rules[0].Statement.RegexMatchStatement.FieldToMatch.Headers.MatchPattern.ExcludedHeaders[0]', 'string'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Rules[0].Statement.RegexMatchStatement.FieldToMatch.Headers.MatchPattern.IncludedHeaders[0]', 'string'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Rules[0].Statement.RegexMatchStatement.FieldToMatch.Headers.MatchScope', 'string'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Rules[0].Statement.RegexMatchStatement.FieldToMatch.Headers.OversizeHandling', 'string'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Rules[0].Statement.RegexMatchStatement.FieldToMatch.JsonBody.InvalidFallbackBehavior', 'string'
    EXEC sp_OAMethod @json, 'UpdateNewObject', @success OUT, 'Rules[0].Statement.RegexMatchStatement.FieldToMatch.JsonBody.MatchPattern.All'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Rules[0].Statement.RegexMatchStatement.FieldToMatch.JsonBody.MatchPattern.IncludedPaths[0]', 'string'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Rules[0].Statement.RegexMatchStatement.FieldToMatch.JsonBody.MatchScope', 'string'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Rules[0].Statement.RegexMatchStatement.FieldToMatch.JsonBody.OversizeHandling', 'string'
    EXEC sp_OAMethod @json, 'UpdateNewObject', @success OUT, 'Rules[0].Statement.RegexMatchStatement.FieldToMatch.Method'
    EXEC sp_OAMethod @json, 'UpdateNewObject', @success OUT, 'Rules[0].Statement.RegexMatchStatement.FieldToMatch.QueryString'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Rules[0].Statement.RegexMatchStatement.FieldToMatch.SingleHeader.Name', 'string'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Rules[0].Statement.RegexMatchStatement.FieldToMatch.SingleQueryArgument.Name', 'string'
    EXEC sp_OAMethod @json, 'UpdateNewObject', @success OUT, 'Rules[0].Statement.RegexMatchStatement.FieldToMatch.UriPath'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Rules[0].Statement.RegexMatchStatement.RegexString', 'string'
    EXEC sp_OAMethod @json, 'UpdateInt', @success OUT, 'Rules[0].Statement.RegexMatchStatement.TextTransformations[0].Priority', 123
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Rules[0].Statement.RegexMatchStatement.TextTransformations[0].Type', 'string'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Rules[0].Statement.RegexPatternSetReferenceStatement.ARN', 'string'
    EXEC sp_OAMethod @json, 'UpdateNewObject', @success OUT, 'Rules[0].Statement.RegexPatternSetReferenceStatement.FieldToMatch.AllQueryArguments'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Rules[0].Statement.RegexPatternSetReferenceStatement.FieldToMatch.Body.OversizeHandling', 'string'
    EXEC sp_OAMethod @json, 'UpdateNewObject', @success OUT, 'Rules[0].Statement.RegexPatternSetReferenceStatement.FieldToMatch.Cookies.MatchPattern.All'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Rules[0].Statement.RegexPatternSetReferenceStatement.FieldToMatch.Cookies.MatchPattern.ExcludedCookies[0]', 'string'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Rules[0].Statement.RegexPatternSetReferenceStatement.FieldToMatch.Cookies.MatchPattern.IncludedCookies[0]', 'string'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Rules[0].Statement.RegexPatternSetReferenceStatement.FieldToMatch.Cookies.MatchScope', 'string'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Rules[0].Statement.RegexPatternSetReferenceStatement.FieldToMatch.Cookies.OversizeHandling', 'string'
    EXEC sp_OAMethod @json, 'UpdateNewObject', @success OUT, 'Rules[0].Statement.RegexPatternSetReferenceStatement.FieldToMatch.Headers.MatchPattern.All'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Rules[0].Statement.RegexPatternSetReferenceStatement.FieldToMatch.Headers.MatchPattern.ExcludedHeaders[0]', 'string'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Rules[0].Statement.RegexPatternSetReferenceStatement.FieldToMatch.Headers.MatchPattern.IncludedHeaders[0]', 'string'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Rules[0].Statement.RegexPatternSetReferenceStatement.FieldToMatch.Headers.MatchScope', 'string'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Rules[0].Statement.RegexPatternSetReferenceStatement.FieldToMatch.Headers.OversizeHandling', 'string'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Rules[0].Statement.RegexPatternSetReferenceStatement.FieldToMatch.JsonBody.InvalidFallbackBehavior', 'string'
    EXEC sp_OAMethod @json, 'UpdateNewObject', @success OUT, 'Rules[0].Statement.RegexPatternSetReferenceStatement.FieldToMatch.JsonBody.MatchPattern.All'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Rules[0].Statement.RegexPatternSetReferenceStatement.FieldToMatch.JsonBody.MatchPattern.IncludedPaths[0]', 'string'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Rules[0].Statement.RegexPatternSetReferenceStatement.FieldToMatch.JsonBody.MatchScope', 'string'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Rules[0].Statement.RegexPatternSetReferenceStatement.FieldToMatch.JsonBody.OversizeHandling', 'string'
    EXEC sp_OAMethod @json, 'UpdateNewObject', @success OUT, 'Rules[0].Statement.RegexPatternSetReferenceStatement.FieldToMatch.Method'
    EXEC sp_OAMethod @json, 'UpdateNewObject', @success OUT, 'Rules[0].Statement.RegexPatternSetReferenceStatement.FieldToMatch.QueryString'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Rules[0].Statement.RegexPatternSetReferenceStatement.FieldToMatch.SingleHeader.Name', 'string'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Rules[0].Statement.RegexPatternSetReferenceStatement.FieldToMatch.SingleQueryArgument.Name', 'string'
    EXEC sp_OAMethod @json, 'UpdateNewObject', @success OUT, 'Rules[0].Statement.RegexPatternSetReferenceStatement.FieldToMatch.UriPath'
    EXEC sp_OAMethod @json, 'UpdateInt', @success OUT, 'Rules[0].Statement.RegexPatternSetReferenceStatement.TextTransformations[0].Priority', 123
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Rules[0].Statement.RegexPatternSetReferenceStatement.TextTransformations[0].Type', 'string'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Rules[0].Statement.RuleGroupReferenceStatement.ARN', 'string'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Rules[0].Statement.RuleGroupReferenceStatement.ExcludedRules[0].Name', 'string'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Rules[0].Statement.SizeConstraintStatement.ComparisonOperator', 'string'
    EXEC sp_OAMethod @json, 'UpdateNewObject', @success OUT, 'Rules[0].Statement.SizeConstraintStatement.FieldToMatch.AllQueryArguments'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Rules[0].Statement.SizeConstraintStatement.FieldToMatch.Body.OversizeHandling', 'string'
    EXEC sp_OAMethod @json, 'UpdateNewObject', @success OUT, 'Rules[0].Statement.SizeConstraintStatement.FieldToMatch.Cookies.MatchPattern.All'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Rules[0].Statement.SizeConstraintStatement.FieldToMatch.Cookies.MatchPattern.ExcludedCookies[0]', 'string'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Rules[0].Statement.SizeConstraintStatement.FieldToMatch.Cookies.MatchPattern.IncludedCookies[0]', 'string'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Rules[0].Statement.SizeConstraintStatement.FieldToMatch.Cookies.MatchScope', 'string'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Rules[0].Statement.SizeConstraintStatement.FieldToMatch.Cookies.OversizeHandling', 'string'
    EXEC sp_OAMethod @json, 'UpdateNewObject', @success OUT, 'Rules[0].Statement.SizeConstraintStatement.FieldToMatch.Headers.MatchPattern.All'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Rules[0].Statement.SizeConstraintStatement.FieldToMatch.Headers.MatchPattern.ExcludedHeaders[0]', 'string'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Rules[0].Statement.SizeConstraintStatement.FieldToMatch.Headers.MatchPattern.IncludedHeaders[0]', 'string'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Rules[0].Statement.SizeConstraintStatement.FieldToMatch.Headers.MatchScope', 'string'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Rules[0].Statement.SizeConstraintStatement.FieldToMatch.Headers.OversizeHandling', 'string'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Rules[0].Statement.SizeConstraintStatement.FieldToMatch.JsonBody.InvalidFallbackBehavior', 'string'
    EXEC sp_OAMethod @json, 'UpdateNewObject', @success OUT, 'Rules[0].Statement.SizeConstraintStatement.FieldToMatch.JsonBody.MatchPattern.All'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Rules[0].Statement.SizeConstraintStatement.FieldToMatch.JsonBody.MatchPattern.IncludedPaths[0]', 'string'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Rules[0].Statement.SizeConstraintStatement.FieldToMatch.JsonBody.MatchScope', 'string'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Rules[0].Statement.SizeConstraintStatement.FieldToMatch.JsonBody.OversizeHandling', 'string'
    EXEC sp_OAMethod @json, 'UpdateNewObject', @success OUT, 'Rules[0].Statement.SizeConstraintStatement.FieldToMatch.Method'
    EXEC sp_OAMethod @json, 'UpdateNewObject', @success OUT, 'Rules[0].Statement.SizeConstraintStatement.FieldToMatch.QueryString'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Rules[0].Statement.SizeConstraintStatement.FieldToMatch.SingleHeader.Name', 'string'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Rules[0].Statement.SizeConstraintStatement.FieldToMatch.SingleQueryArgument.Name', 'string'
    EXEC sp_OAMethod @json, 'UpdateNewObject', @success OUT, 'Rules[0].Statement.SizeConstraintStatement.FieldToMatch.UriPath'
    EXEC sp_OAMethod @json, 'UpdateInt', @success OUT, 'Rules[0].Statement.SizeConstraintStatement.Size', 123
    EXEC sp_OAMethod @json, 'UpdateInt', @success OUT, 'Rules[0].Statement.SizeConstraintStatement.TextTransformations[0].Priority', 123
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Rules[0].Statement.SizeConstraintStatement.TextTransformations[0].Type', 'string'
    EXEC sp_OAMethod @json, 'UpdateNewObject', @success OUT, 'Rules[0].Statement.SqliMatchStatement.FieldToMatch.AllQueryArguments'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Rules[0].Statement.SqliMatchStatement.FieldToMatch.Body.OversizeHandling', 'string'
    EXEC sp_OAMethod @json, 'UpdateNewObject', @success OUT, 'Rules[0].Statement.SqliMatchStatement.FieldToMatch.Cookies.MatchPattern.All'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Rules[0].Statement.SqliMatchStatement.FieldToMatch.Cookies.MatchPattern.ExcludedCookies[0]', 'string'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Rules[0].Statement.SqliMatchStatement.FieldToMatch.Cookies.MatchPattern.IncludedCookies[0]', 'string'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Rules[0].Statement.SqliMatchStatement.FieldToMatch.Cookies.MatchScope', 'string'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Rules[0].Statement.SqliMatchStatement.FieldToMatch.Cookies.OversizeHandling', 'string'
    EXEC sp_OAMethod @json, 'UpdateNewObject', @success OUT, 'Rules[0].Statement.SqliMatchStatement.FieldToMatch.Headers.MatchPattern.All'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Rules[0].Statement.SqliMatchStatement.FieldToMatch.Headers.MatchPattern.ExcludedHeaders[0]', 'string'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Rules[0].Statement.SqliMatchStatement.FieldToMatch.Headers.MatchPattern.IncludedHeaders[0]', 'string'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Rules[0].Statement.SqliMatchStatement.FieldToMatch.Headers.MatchScope', 'string'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Rules[0].Statement.SqliMatchStatement.FieldToMatch.Headers.OversizeHandling', 'string'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Rules[0].Statement.SqliMatchStatement.FieldToMatch.JsonBody.InvalidFallbackBehavior', 'string'
    EXEC sp_OAMethod @json, 'UpdateNewObject', @success OUT, 'Rules[0].Statement.SqliMatchStatement.FieldToMatch.JsonBody.MatchPattern.All'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Rules[0].Statement.SqliMatchStatement.FieldToMatch.JsonBody.MatchPattern.IncludedPaths[0]', 'string'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Rules[0].Statement.SqliMatchStatement.FieldToMatch.JsonBody.MatchScope', 'string'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Rules[0].Statement.SqliMatchStatement.FieldToMatch.JsonBody.OversizeHandling', 'string'
    EXEC sp_OAMethod @json, 'UpdateNewObject', @success OUT, 'Rules[0].Statement.SqliMatchStatement.FieldToMatch.Method'
    EXEC sp_OAMethod @json, 'UpdateNewObject', @success OUT, 'Rules[0].Statement.SqliMatchStatement.FieldToMatch.QueryString'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Rules[0].Statement.SqliMatchStatement.FieldToMatch.SingleHeader.Name', 'string'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Rules[0].Statement.SqliMatchStatement.FieldToMatch.SingleQueryArgument.Name', 'string'
    EXEC sp_OAMethod @json, 'UpdateNewObject', @success OUT, 'Rules[0].Statement.SqliMatchStatement.FieldToMatch.UriPath'
    EXEC sp_OAMethod @json, 'UpdateInt', @success OUT, 'Rules[0].Statement.SqliMatchStatement.TextTransformations[0].Priority', 123
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Rules[0].Statement.SqliMatchStatement.TextTransformations[0].Type', 'string'
    EXEC sp_OAMethod @json, 'UpdateNewObject', @success OUT, 'Rules[0].Statement.XssMatchStatement.FieldToMatch.AllQueryArguments'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Rules[0].Statement.XssMatchStatement.FieldToMatch.Body.OversizeHandling', 'string'
    EXEC sp_OAMethod @json, 'UpdateNewObject', @success OUT, 'Rules[0].Statement.XssMatchStatement.FieldToMatch.Cookies.MatchPattern.All'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Rules[0].Statement.XssMatchStatement.FieldToMatch.Cookies.MatchPattern.ExcludedCookies[0]', 'string'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Rules[0].Statement.XssMatchStatement.FieldToMatch.Cookies.MatchPattern.IncludedCookies[0]', 'string'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Rules[0].Statement.XssMatchStatement.FieldToMatch.Cookies.MatchScope', 'string'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Rules[0].Statement.XssMatchStatement.FieldToMatch.Cookies.OversizeHandling', 'string'
    EXEC sp_OAMethod @json, 'UpdateNewObject', @success OUT, 'Rules[0].Statement.XssMatchStatement.FieldToMatch.Headers.MatchPattern.All'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Rules[0].Statement.XssMatchStatement.FieldToMatch.Headers.MatchPattern.ExcludedHeaders[0]', 'string'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Rules[0].Statement.XssMatchStatement.FieldToMatch.Headers.MatchPattern.IncludedHeaders[0]', 'string'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Rules[0].Statement.XssMatchStatement.FieldToMatch.Headers.MatchScope', 'string'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Rules[0].Statement.XssMatchStatement.FieldToMatch.Headers.OversizeHandling', 'string'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Rules[0].Statement.XssMatchStatement.FieldToMatch.JsonBody.InvalidFallbackBehavior', 'string'
    EXEC sp_OAMethod @json, 'UpdateNewObject', @success OUT, 'Rules[0].Statement.XssMatchStatement.FieldToMatch.JsonBody.MatchPattern.All'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Rules[0].Statement.XssMatchStatement.FieldToMatch.JsonBody.MatchPattern.IncludedPaths[0]', 'string'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Rules[0].Statement.XssMatchStatement.FieldToMatch.JsonBody.MatchScope', 'string'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Rules[0].Statement.XssMatchStatement.FieldToMatch.JsonBody.OversizeHandling', 'string'
    EXEC sp_OAMethod @json, 'UpdateNewObject', @success OUT, 'Rules[0].Statement.XssMatchStatement.FieldToMatch.Method'
    EXEC sp_OAMethod @json, 'UpdateNewObject', @success OUT, 'Rules[0].Statement.XssMatchStatement.FieldToMatch.QueryString'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Rules[0].Statement.XssMatchStatement.FieldToMatch.SingleHeader.Name', 'string'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Rules[0].Statement.XssMatchStatement.FieldToMatch.SingleQueryArgument.Name', 'string'
    EXEC sp_OAMethod @json, 'UpdateNewObject', @success OUT, 'Rules[0].Statement.XssMatchStatement.FieldToMatch.UriPath'
    EXEC sp_OAMethod @json, 'UpdateInt', @success OUT, 'Rules[0].Statement.XssMatchStatement.TextTransformations[0].Priority', 123
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Rules[0].Statement.XssMatchStatement.TextTransformations[0].Type', 'string'
    EXEC sp_OAMethod @json, 'UpdateInt', @success OUT, 'Rules[0].VisibilityConfig.CloudWatchMetricsEnabled', 123
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Rules[0].VisibilityConfig.MetricName', 'string'
    EXEC sp_OAMethod @json, 'UpdateInt', @success OUT, 'Rules[0].VisibilityConfig.SampledRequestsEnabled', 123
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Scope', 'string'

    -- The JSON request body created by the above code:

    -- {
    --   "Rules": [
    --     {
    --       "Action": {
    --         "Allow": {
    --           "CustomRequestHandling": {
    --             "InsertHeaders": [
    --               {
    --                 "Name": "string",
    --                 "Value": "string"
    --               }
    --             ]
    --           }
    --         },
    --         "Block": {
    --           "CustomResponse": {
    --             "CustomResponseBodyKey": "string",
    --             "ResponseCode": number,
    --             "ResponseHeaders": [
    --               {
    --                 "Name": "string",
    --                 "Value": "string"
    --               }
    --             ]
    --           }
    --         },
    --         "Captcha": {
    --           "CustomRequestHandling": {
    --             "InsertHeaders": [
    --               {
    --                 "Name": "string",
    --                 "Value": "string"
    --               }
    --             ]
    --           }
    --         },
    --         "Count": {
    --           "CustomRequestHandling": {
    --             "InsertHeaders": [
    --               {
    --                 "Name": "string",
    --                 "Value": "string"
    --               }
    --             ]
    --           }
    --         }
    --       },
    --       "CaptchaConfig": {
    --         "ImmunityTimeProperty": {
    --           "ImmunityTime": number
    --         }
    --       },
    --       "Name": "string",
    --       "OverrideAction": {
    --         "Count": {
    --           "CustomRequestHandling": {
    --             "InsertHeaders": [
    --               {
    --                 "Name": "string",
    --                 "Value": "string"
    --               }
    --             ]
    --           }
    --         },
    --         "None": {}
    --       },
    --       "Priority": number,
    --       "RuleLabels": [
    --         {
    --           "Name": "string"
    --         }
    --       ],
    --       "Statement": {
    --         "AndStatement": {
    --           "Statements": [
    --             "Statement"
    --           ]
    --         },
    --         "ByteMatchStatement": {
    --           "FieldToMatch": {
    --             "AllQueryArguments": {},
    --             "Body": {
    --               "OversizeHandling": "string"
    --             },
    --             "Cookies": {
    --               "MatchPattern": {
    --                 "All": {},
    --                 "ExcludedCookies": [
    --                   "string"
    --                 ],
    --                 "IncludedCookies": [
    --                   "string"
    --                 ]
    --               },
    --               "MatchScope": "string",
    --               "OversizeHandling": "string"
    --             },
    --             "Headers": {
    --               "MatchPattern": {
    --                 "All": {},
    --                 "ExcludedHeaders": [
    --                   "string"
    --                 ],
    --                 "IncludedHeaders": [
    --                   "string"
    --                 ]
    --               },
    --               "MatchScope": "string",
    --               "OversizeHandling": "string"
    --             },
    --             "JsonBody": {
    --               "InvalidFallbackBehavior": "string",
    --               "MatchPattern": {
    --                 "All": {},
    --                 "IncludedPaths": [
    --                   "string"
    --                 ]
    --               },
    --               "MatchScope": "string",
    --               "OversizeHandling": "string"
    --             },
    --             "Method": {},
    --             "QueryString": {},
    --             "SingleHeader": {
    --               "Name": "string"
    --             },
    --             "SingleQueryArgument": {
    --               "Name": "string"
    --             },
    --             "UriPath": {}
    --           },
    --           "PositionalConstraint": "string",
    --           "SearchString": blob,
    --           "TextTransformations": [
    --             {
    --               "Priority": number,
    --               "Type": "string"
    --             }
    --           ]
    --         },
    --         "GeoMatchStatement": {
    --           "CountryCodes": [
    --             "string"
    --           ],
    --           "ForwardedIPConfig": {
    --             "FallbackBehavior": "string",
    --             "HeaderName": "string"
    --           }
    --         },
    --         "IPSetReferenceStatement": {
    --           "ARN": "string",
    --           "IPSetForwardedIPConfig": {
    --             "FallbackBehavior": "string",
    --             "HeaderName": "string",
    --             "Position": "string"
    --           }
    --         },
    --         "LabelMatchStatement": {
    --           "Key": "string",
    --           "Scope": "string"
    --         },
    --         "ManagedRuleGroupStatement": {
    --           "ExcludedRules": [
    --             {
    --               "Name": "string"
    --             }
    --           ],
    --           "ManagedRuleGroupConfigs": [
    --             {
    --               "LoginPath": "string",
    --               "PasswordField": {
    --                 "Identifier": "string"
    --               },
    --               "PayloadType": "string",
    --               "UsernameField": {
    --                 "Identifier": "string"
    --               }
    --             }
    --           ],
    --           "Name": "string",
    --           "ScopeDownStatement": "Statement",
    --           "VendorName": "string",
    --           "Version": "string"
    --         },
    --         "NotStatement": {
    --           "Statement": "Statement"
    --         },
    --         "OrStatement": {
    --           "Statements": [
    --             "Statement"
    --           ]
    --         },
    --         "RateBasedStatement": {
    --           "AggregateKeyType": "string",
    --           "ForwardedIPConfig": {
    --             "FallbackBehavior": "string",
    --             "HeaderName": "string"
    --           },
    --           "Limit": number,
    --           "ScopeDownStatement": "Statement"
    --         },
    --         "RegexMatchStatement": {
    --           "FieldToMatch": {
    --             "AllQueryArguments": {},
    --             "Body": {
    --               "OversizeHandling": "string"
    --             },
    --             "Cookies": {
    --               "MatchPattern": {
    --                 "All": {},
    --                 "ExcludedCookies": [
    --                   "string"
    --                 ],
    --                 "IncludedCookies": [
    --                   "string"
    --                 ]
    --               },
    --               "MatchScope": "string",
    --               "OversizeHandling": "string"
    --             },
    --             "Headers": {
    --               "MatchPattern": {
    --                 "All": {},
    --                 "ExcludedHeaders": [
    --                   "string"
    --                 ],
    --                 "IncludedHeaders": [
    --                   "string"
    --                 ]
    --               },
    --               "MatchScope": "string",
    --               "OversizeHandling": "string"
    --             },
    --             "JsonBody": {
    --               "InvalidFallbackBehavior": "string",
    --               "MatchPattern": {
    --                 "All": {},
    --                 "IncludedPaths": [
    --                   "string"
    --                 ]
    --               },
    --               "MatchScope": "string",
    --               "OversizeHandling": "string"
    --             },
    --             "Method": {},
    --             "QueryString": {},
    --             "SingleHeader": {
    --               "Name": "string"
    --             },
    --             "SingleQueryArgument": {
    --               "Name": "string"
    --             },
    --             "UriPath": {}
    --           },
    --           "RegexString": "string",
    --           "TextTransformations": [
    --             {
    --               "Priority": number,
    --               "Type": "string"
    --             }
    --           ]
    --         },
    --         "RegexPatternSetReferenceStatement": {
    --           "ARN": "string",
    --           "FieldToMatch": {
    --             "AllQueryArguments": {},
    --             "Body": {
    --               "OversizeHandling": "string"
    --             },
    --             "Cookies": {
    --               "MatchPattern": {
    --                 "All": {},
    --                 "ExcludedCookies": [
    --                   "string"
    --                 ],
    --                 "IncludedCookies": [
    --                   "string"
    --                 ]
    --               },
    --               "MatchScope": "string",
    --               "OversizeHandling": "string"
    --             },
    --             "Headers": {
    --               "MatchPattern": {
    --                 "All": {},
    --                 "ExcludedHeaders": [
    --                   "string"
    --                 ],
    --                 "IncludedHeaders": [
    --                   "string"
    --                 ]
    --               },
    --               "MatchScope": "string",
    --               "OversizeHandling": "string"
    --             },
    --             "JsonBody": {
    --               "InvalidFallbackBehavior": "string",
    --               "MatchPattern": {
    --                 "All": {},
    --                 "IncludedPaths": [
    --                   "string"
    --                 ]
    --               },
    --               "MatchScope": "string",
    --               "OversizeHandling": "string"
    --             },
    --             "Method": {},
    --             "QueryString": {},
    --             "SingleHeader": {
    --               "Name": "string"
    --             },
    --             "SingleQueryArgument": {
    --               "Name": "string"
    --             },
    --             "UriPath": {}
    --           },
    --           "TextTransformations": [
    --             {
    --               "Priority": number,
    --               "Type": "string"
    --             }
    --           ]
    --         },
    --         "RuleGroupReferenceStatement": {
    --           "ARN": "string",
    --           "ExcludedRules": [
    --             {
    --               "Name": "string"
    --             }
    --           ]
    --         },
    --         "SizeConstraintStatement": {
    --           "ComparisonOperator": "string",
    --           "FieldToMatch": {
    --             "AllQueryArguments": {},
    --             "Body": {
    --               "OversizeHandling": "string"
    --             },
    --             "Cookies": {
    --               "MatchPattern": {
    --                 "All": {},
    --                 "ExcludedCookies": [
    --                   "string"
    --                 ],
    --                 "IncludedCookies": [
    --                   "string"
    --                 ]
    --               },
    --               "MatchScope": "string",
    --               "OversizeHandling": "string"
    --             },
    --             "Headers": {
    --               "MatchPattern": {
    --                 "All": {},
    --                 "ExcludedHeaders": [
    --                   "string"
    --                 ],
    --                 "IncludedHeaders": [
    --                   "string"
    --                 ]
    --               },
    --               "MatchScope": "string",
    --               "OversizeHandling": "string"
    --             },
    --             "JsonBody": {
    --               "InvalidFallbackBehavior": "string",
    --               "MatchPattern": {
    --                 "All": {},
    --                 "IncludedPaths": [
    --                   "string"
    --                 ]
    --               },
    --               "MatchScope": "string",
    --               "OversizeHandling": "string"
    --             },
    --             "Method": {},
    --             "QueryString": {},
    --             "SingleHeader": {
    --               "Name": "string"
    --             },
    --             "SingleQueryArgument": {
    --               "Name": "string"
    --             },
    --             "UriPath": {}
    --           },
    --           "Size": number,
    --           "TextTransformations": [
    --             {
    --               "Priority": number,
    --               "Type": "string"
    --             }
    --           ]
    --         },
    --         "SqliMatchStatement": {
    --           "FieldToMatch": {
    --             "AllQueryArguments": {},
    --             "Body": {
    --               "OversizeHandling": "string"
    --             },
    --             "Cookies": {
    --               "MatchPattern": {
    --                 "All": {},
    --                 "ExcludedCookies": [
    --                   "string"
    --                 ],
    --                 "IncludedCookies": [
    --                   "string"
    --                 ]
    --               },
    --               "MatchScope": "string",
    --               "OversizeHandling": "string"
    --             },
    --             "Headers": {
    --               "MatchPattern": {
    --                 "All": {},
    --                 "ExcludedHeaders": [
    --                   "string"
    --                 ],
    --                 "IncludedHeaders": [
    --                   "string"
    --                 ]
    --               },
    --               "MatchScope": "string",
    --               "OversizeHandling": "string"
    --             },
    --             "JsonBody": {
    --               "InvalidFallbackBehavior": "string",
    --               "MatchPattern": {
    --                 "All": {},
    --                 "IncludedPaths": [
    --                   "string"
    --                 ]
    --               },
    --               "MatchScope": "string",
    --               "OversizeHandling": "string"
    --             },
    --             "Method": {},
    --             "QueryString": {},
    --             "SingleHeader": {
    --               "Name": "string"
    --             },
    --             "SingleQueryArgument": {
    --               "Name": "string"
    --             },
    --             "UriPath": {}
    --           },
    --           "TextTransformations": [
    --             {
    --               "Priority": number,
    --               "Type": "string"
    --             }
    --           ]
    --         },
    --         "XssMatchStatement": {
    --           "FieldToMatch": {
    --             "AllQueryArguments": {},
    --             "Body": {
    --               "OversizeHandling": "string"
    --             },
    --             "Cookies": {
    --               "MatchPattern": {
    --                 "All": {},
    --                 "ExcludedCookies": [
    --                   "string"
    --                 ],
    --                 "IncludedCookies": [
    --                   "string"
    --                 ]
    --               },
    --               "MatchScope": "string",
    --               "OversizeHandling": "string"
    --             },
    --             "Headers": {
    --               "MatchPattern": {
    --                 "All": {},
    --                 "ExcludedHeaders": [
    --                   "string"
    --                 ],
    --                 "IncludedHeaders": [
    --                   "string"
    --                 ]
    --               },
    --               "MatchScope": "string",
    --               "OversizeHandling": "string"
    --             },
    --             "JsonBody": {
    --               "InvalidFallbackBehavior": "string",
    --               "MatchPattern": {
    --                 "All": {},
    --                 "IncludedPaths": [
    --                   "string"
    --                 ]
    --               },
    --               "MatchScope": "string",
    --               "OversizeHandling": "string"
    --             },
    --             "Method": {},
    --             "QueryString": {},
    --             "SingleHeader": {
    --               "Name": "string"
    --             },
    --             "SingleQueryArgument": {
    --               "Name": "string"
    --             },
    --             "UriPath": {}
    --           },
    --           "TextTransformations": [
    --             {
    --               "Priority": number,
    --               "Type": "string"
    --             }
    --           ]
    --         }
    --       },
    --       "VisibilityConfig": {
    --         "CloudWatchMetricsEnabled": boolean,
    --         "MetricName": "string",
    --         "SampledRequestsEnabled": boolean
    --       }
    --     }
    --   ],
    --   "Scope": "string"
    -- }

    EXEC sp_OAMethod @rest, 'AddHeader', @success OUT, 'Content-Type', 'application/x-amz-json-1.1'
    EXEC sp_OAMethod @rest, 'AddHeader', @success OUT, 'X-Amz-Target', 'AWSWAF_20190729.CheckCapacity'

    DECLARE @sbRequestBody int
    EXEC @hr = sp_OACreate 'Chilkat_9_5_0.StringBuilder', @sbRequestBody OUT

    EXEC sp_OAMethod @json, 'EmitSb', @success OUT, @sbRequestBody
    DECLARE @sbResponseBody int
    EXEC @hr = sp_OACreate 'Chilkat_9_5_0.StringBuilder', @sbResponseBody OUT

    EXEC sp_OAMethod @rest, 'FullRequestSb', @success OUT, 'POST', '/', @sbRequestBody, @sbResponseBody
    IF @success <> 1
      BEGIN
        EXEC sp_OAGetProperty @rest, 'LastErrorText', @sTmp0 OUT
        PRINT @sTmp0
        EXEC @hr = sp_OADestroy @rest
        EXEC @hr = sp_OADestroy @authAws
        EXEC @hr = sp_OADestroy @json
        EXEC @hr = sp_OADestroy @sbRequestBody
        EXEC @hr = sp_OADestroy @sbResponseBody
        RETURN
      END
    DECLARE @respStatusCode int
    EXEC sp_OAGetProperty @rest, 'ResponseStatusCode', @respStatusCode OUT

    PRINT 'response status code = ' + @respStatusCode
    IF @respStatusCode <> 200
      BEGIN

        PRINT 'Response Header:'
        EXEC sp_OAGetProperty @rest, 'ResponseHeader', @sTmp0 OUT
        PRINT @sTmp0

        PRINT 'Response Body:'
        EXEC sp_OAMethod @sbResponseBody, 'GetAsString', @sTmp0 OUT
        PRINT @sTmp0
        EXEC @hr = sp_OADestroy @rest
        EXEC @hr = sp_OADestroy @authAws
        EXEC @hr = sp_OADestroy @json
        EXEC @hr = sp_OADestroy @sbRequestBody
        EXEC @hr = sp_OADestroy @sbResponseBody
        RETURN
      END

    DECLARE @jResp int
    EXEC @hr = sp_OACreate 'Chilkat_9_5_0.JsonObject', @jResp OUT

    EXEC sp_OAMethod @jResp, 'LoadSb', @success OUT, @sbResponseBody

    -- The following code parses the JSON response.
    -- A sample JSON response is shown below the sample code.

    -- Use this online tool to generate parsing code from sample JSON:
    -- Generate Parsing Code from JSON

    DECLARE @Capacity int
    EXEC sp_OAMethod @jResp, 'IntOf', @Capacity OUT, 'Capacity'

    -- A sample JSON response body parsed by the above code:

    -- {
    --   "Capacity": number
    -- }

    EXEC @hr = sp_OADestroy @rest
    EXEC @hr = sp_OADestroy @authAws
    EXEC @hr = sp_OADestroy @json
    EXEC @hr = sp_OADestroy @sbRequestBody
    EXEC @hr = sp_OADestroy @sbResponseBody
    EXEC @hr = sp_OADestroy @jResp


END
GO