Chilkat Online Tools

DescribeRuleGroup SQL Server Example

AWS Network Firewall

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', 'network-firewall'
    -- SetAuthAws causes Chilkat to automatically add the following headers: Authorization, X-Amz-Date
    EXEC sp_OAMethod @rest, 'SetAuthAws', @success OUT, @authAws

    -- URL: https://network-firewall.us-west-2.amazonaws.com/
    -- Use the same region as specified above.
    EXEC sp_OAMethod @rest, 'Connect', @success OUT, 'network-firewall.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, 'RuleGroupArn', 'string'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'RuleGroupName', 'string'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'Type', 'string'

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

    -- {
    --   "RuleGroupArn": "string",
    --   "RuleGroupName": "string",
    --   "Type": "string"
    -- }

    EXEC sp_OAMethod @rest, 'AddHeader', @success OUT, 'Content-Type', 'application/x-amz-json-1.0'
    EXEC sp_OAMethod @rest, 'AddHeader', @success OUT, 'X-Amz-Target', 'NetworkFirewall_20201112.DescribeRuleGroup'

    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 @strVal nvarchar(max)

    DECLARE @Action nvarchar(max)

    DECLARE @Destination nvarchar(max)

    DECLARE @DestinationPort nvarchar(max)

    DECLARE @Direction nvarchar(max)

    DECLARE @Protocol nvarchar(max)

    DECLARE @Source nvarchar(max)

    DECLARE @SourcePort nvarchar(max)

    DECLARE @j int

    DECLARE @count_j int

    DECLARE @Keyword nvarchar(max)

    DECLARE @k int

    DECLARE @count_k int

    DECLARE @ActionName nvarchar(max)

    DECLARE @Value nvarchar(max)

    DECLARE @Priority int

    DECLARE @FromPort int

    DECLARE @ToPort int

    DECLARE @AddressDefinition nvarchar(max)

    DECLARE @intVal int

    DECLARE @Key nvarchar(max)

    DECLARE @GeneratedRulesType nvarchar(max)
    EXEC sp_OAMethod @jResp, 'StringOf', @GeneratedRulesType OUT, 'RuleGroup.RulesSource.RulesSourceList.GeneratedRulesType'
    DECLARE @RulesString nvarchar(max)
    EXEC sp_OAMethod @jResp, 'StringOf', @RulesString OUT, 'RuleGroup.RulesSource.RulesString'
    DECLARE @RuleOrder nvarchar(max)
    EXEC sp_OAMethod @jResp, 'StringOf', @RuleOrder OUT, 'RuleGroup.StatefulRuleOptions.RuleOrder'
    DECLARE @Capacity int
    EXEC sp_OAMethod @jResp, 'IntOf', @Capacity OUT, 'RuleGroupResponse.Capacity'
    DECLARE @ConsumedCapacity int
    EXEC sp_OAMethod @jResp, 'IntOf', @ConsumedCapacity OUT, 'RuleGroupResponse.ConsumedCapacity'
    DECLARE @Description nvarchar(max)
    EXEC sp_OAMethod @jResp, 'StringOf', @Description OUT, 'RuleGroupResponse.Description'
    DECLARE @KeyId nvarchar(max)
    EXEC sp_OAMethod @jResp, 'StringOf', @KeyId OUT, 'RuleGroupResponse.EncryptionConfiguration.KeyId'
    DECLARE @v_Type nvarchar(max)
    EXEC sp_OAMethod @jResp, 'StringOf', @v_Type OUT, 'RuleGroupResponse.EncryptionConfiguration.Type'
    DECLARE @LastModifiedTime int
    EXEC sp_OAMethod @jResp, 'IntOf', @LastModifiedTime OUT, 'RuleGroupResponse.LastModifiedTime'
    DECLARE @NumberOfAssociations int
    EXEC sp_OAMethod @jResp, 'IntOf', @NumberOfAssociations OUT, 'RuleGroupResponse.NumberOfAssociations'
    DECLARE @RuleGroupArn nvarchar(max)
    EXEC sp_OAMethod @jResp, 'StringOf', @RuleGroupArn OUT, 'RuleGroupResponse.RuleGroupArn'
    DECLARE @RuleGroupId nvarchar(max)
    EXEC sp_OAMethod @jResp, 'StringOf', @RuleGroupId OUT, 'RuleGroupResponse.RuleGroupId'
    DECLARE @RuleGroupName nvarchar(max)
    EXEC sp_OAMethod @jResp, 'StringOf', @RuleGroupName OUT, 'RuleGroupResponse.RuleGroupName'
    DECLARE @RuleGroupStatus nvarchar(max)
    EXEC sp_OAMethod @jResp, 'StringOf', @RuleGroupStatus OUT, 'RuleGroupResponse.RuleGroupStatus'
    DECLARE @SnsTopic nvarchar(max)
    EXEC sp_OAMethod @jResp, 'StringOf', @SnsTopic OUT, 'RuleGroupResponse.SnsTopic'
    DECLARE @SourceArn nvarchar(max)
    EXEC sp_OAMethod @jResp, 'StringOf', @SourceArn OUT, 'RuleGroupResponse.SourceMetadata.SourceArn'
    DECLARE @SourceUpdateToken nvarchar(max)
    EXEC sp_OAMethod @jResp, 'StringOf', @SourceUpdateToken OUT, 'RuleGroupResponse.SourceMetadata.SourceUpdateToken'
    DECLARE @RuleGroupResponseType nvarchar(max)
    EXEC sp_OAMethod @jResp, 'StringOf', @RuleGroupResponseType OUT, 'RuleGroupResponse.Type'
    DECLARE @UpdateToken nvarchar(max)
    EXEC sp_OAMethod @jResp, 'StringOf', @UpdateToken OUT, 'UpdateToken'
    DECLARE @i int
    SELECT @i = 0
    DECLARE @count_i int
    EXEC sp_OAMethod @jResp, 'SizeOfArray', @count_i OUT, 'RuleGroup.RulesSource.RulesSourceList.Targets'
    WHILE @i < @count_i
      BEGIN
        EXEC sp_OASetProperty @jResp, 'I', @i
        EXEC sp_OAMethod @jResp, 'StringOf', @strVal OUT, 'RuleGroup.RulesSource.RulesSourceList.Targets[i]'
        SELECT @i = @i + 1
      END
    SELECT @i = 0
    EXEC sp_OAMethod @jResp, 'SizeOfArray', @count_i OUT, 'RuleGroup.RulesSource.RulesSourceList.TargetTypes'
    WHILE @i < @count_i
      BEGIN
        EXEC sp_OASetProperty @jResp, 'I', @i
        EXEC sp_OAMethod @jResp, 'StringOf', @strVal OUT, 'RuleGroup.RulesSource.RulesSourceList.TargetTypes[i]'
        SELECT @i = @i + 1
      END
    SELECT @i = 0
    EXEC sp_OAMethod @jResp, 'SizeOfArray', @count_i OUT, 'RuleGroup.RulesSource.StatefulRules'
    WHILE @i < @count_i
      BEGIN
        EXEC sp_OASetProperty @jResp, 'I', @i
        EXEC sp_OAMethod @jResp, 'StringOf', @Action OUT, 'RuleGroup.RulesSource.StatefulRules[i].Action'
        EXEC sp_OAMethod @jResp, 'StringOf', @Destination OUT, 'RuleGroup.RulesSource.StatefulRules[i].Header.Destination'
        EXEC sp_OAMethod @jResp, 'StringOf', @DestinationPort OUT, 'RuleGroup.RulesSource.StatefulRules[i].Header.DestinationPort'
        EXEC sp_OAMethod @jResp, 'StringOf', @Direction OUT, 'RuleGroup.RulesSource.StatefulRules[i].Header.Direction'
        EXEC sp_OAMethod @jResp, 'StringOf', @Protocol OUT, 'RuleGroup.RulesSource.StatefulRules[i].Header.Protocol'
        EXEC sp_OAMethod @jResp, 'StringOf', @Source OUT, 'RuleGroup.RulesSource.StatefulRules[i].Header.Source'
        EXEC sp_OAMethod @jResp, 'StringOf', @SourcePort OUT, 'RuleGroup.RulesSource.StatefulRules[i].Header.SourcePort'
        SELECT @j = 0
        EXEC sp_OAMethod @jResp, 'SizeOfArray', @count_j OUT, 'RuleGroup.RulesSource.StatefulRules[i].RuleOptions'
        WHILE @j < @count_j
          BEGIN
            EXEC sp_OASetProperty @jResp, 'J', @j
            EXEC sp_OAMethod @jResp, 'StringOf', @Keyword OUT, 'RuleGroup.RulesSource.StatefulRules[i].RuleOptions[j].Keyword'
            SELECT @k = 0
            EXEC sp_OAMethod @jResp, 'SizeOfArray', @count_k OUT, 'RuleGroup.RulesSource.StatefulRules[i].RuleOptions[j].Settings'
            WHILE @k < @count_k
              BEGIN
                EXEC sp_OASetProperty @jResp, 'K', @k
                EXEC sp_OAMethod @jResp, 'StringOf', @strVal OUT, 'RuleGroup.RulesSource.StatefulRules[i].RuleOptions[j].Settings[k]'
                SELECT @k = @k + 1
              END
            SELECT @j = @j + 1
          END
        SELECT @i = @i + 1
      END
    SELECT @i = 0
    EXEC sp_OAMethod @jResp, 'SizeOfArray', @count_i OUT, 'RuleGroup.RulesSource.StatelessRulesAndCustomActions.CustomActions'
    WHILE @i < @count_i
      BEGIN
        EXEC sp_OASetProperty @jResp, 'I', @i
        EXEC sp_OAMethod @jResp, 'StringOf', @ActionName OUT, 'RuleGroup.RulesSource.StatelessRulesAndCustomActions.CustomActions[i].ActionName'
        SELECT @j = 0
        EXEC sp_OAMethod @jResp, 'SizeOfArray', @count_j OUT, 'RuleGroup.RulesSource.StatelessRulesAndCustomActions.CustomActions[i].ActionDefinition.PublishMetricAction.Dimensions'
        WHILE @j < @count_j
          BEGIN
            EXEC sp_OASetProperty @jResp, 'J', @j
            EXEC sp_OAMethod @jResp, 'StringOf', @Value OUT, 'RuleGroup.RulesSource.StatelessRulesAndCustomActions.CustomActions[i].ActionDefinition.PublishMetricAction.Dimensions[j].Value'
            SELECT @j = @j + 1
          END
        SELECT @i = @i + 1
      END
    SELECT @i = 0
    EXEC sp_OAMethod @jResp, 'SizeOfArray', @count_i OUT, 'RuleGroup.RulesSource.StatelessRulesAndCustomActions.StatelessRules'
    WHILE @i < @count_i
      BEGIN
        EXEC sp_OASetProperty @jResp, 'I', @i
        EXEC sp_OAMethod @jResp, 'IntOf', @Priority OUT, 'RuleGroup.RulesSource.StatelessRulesAndCustomActions.StatelessRules[i].Priority'
        SELECT @j = 0
        EXEC sp_OAMethod @jResp, 'SizeOfArray', @count_j OUT, 'RuleGroup.RulesSource.StatelessRulesAndCustomActions.StatelessRules[i].RuleDefinition.Actions'
        WHILE @j < @count_j
          BEGIN
            EXEC sp_OASetProperty @jResp, 'J', @j
            EXEC sp_OAMethod @jResp, 'StringOf', @strVal OUT, 'RuleGroup.RulesSource.StatelessRulesAndCustomActions.StatelessRules[i].RuleDefinition.Actions[j]'
            SELECT @j = @j + 1
          END
        SELECT @j = 0
        EXEC sp_OAMethod @jResp, 'SizeOfArray', @count_j OUT, 'RuleGroup.RulesSource.StatelessRulesAndCustomActions.StatelessRules[i].RuleDefinition.MatchAttributes.DestinationPorts'
        WHILE @j < @count_j
          BEGIN
            EXEC sp_OASetProperty @jResp, 'J', @j
            EXEC sp_OAMethod @jResp, 'IntOf', @FromPort OUT, 'RuleGroup.RulesSource.StatelessRulesAndCustomActions.StatelessRules[i].RuleDefinition.MatchAttributes.DestinationPorts[j].FromPort'
            EXEC sp_OAMethod @jResp, 'IntOf', @ToPort OUT, 'RuleGroup.RulesSource.StatelessRulesAndCustomActions.StatelessRules[i].RuleDefinition.MatchAttributes.DestinationPorts[j].ToPort'
            SELECT @j = @j + 1
          END
        SELECT @j = 0
        EXEC sp_OAMethod @jResp, 'SizeOfArray', @count_j OUT, 'RuleGroup.RulesSource.StatelessRulesAndCustomActions.StatelessRules[i].RuleDefinition.MatchAttributes.Destinations'
        WHILE @j < @count_j
          BEGIN
            EXEC sp_OASetProperty @jResp, 'J', @j
            EXEC sp_OAMethod @jResp, 'StringOf', @AddressDefinition OUT, 'RuleGroup.RulesSource.StatelessRulesAndCustomActions.StatelessRules[i].RuleDefinition.MatchAttributes.Destinations[j].AddressDefinition'
            SELECT @j = @j + 1
          END
        SELECT @j = 0
        EXEC sp_OAMethod @jResp, 'SizeOfArray', @count_j OUT, 'RuleGroup.RulesSource.StatelessRulesAndCustomActions.StatelessRules[i].RuleDefinition.MatchAttributes.Protocols'
        WHILE @j < @count_j
          BEGIN
            EXEC sp_OASetProperty @jResp, 'J', @j
            EXEC sp_OAMethod @jResp, 'IntOf', @intVal OUT, 'RuleGroup.RulesSource.StatelessRulesAndCustomActions.StatelessRules[i].RuleDefinition.MatchAttributes.Protocols[j]'
            SELECT @j = @j + 1
          END
        SELECT @j = 0
        EXEC sp_OAMethod @jResp, 'SizeOfArray', @count_j OUT, 'RuleGroup.RulesSource.StatelessRulesAndCustomActions.StatelessRules[i].RuleDefinition.MatchAttributes.SourcePorts'
        WHILE @j < @count_j
          BEGIN
            EXEC sp_OASetProperty @jResp, 'J', @j
            EXEC sp_OAMethod @jResp, 'IntOf', @FromPort OUT, 'RuleGroup.RulesSource.StatelessRulesAndCustomActions.StatelessRules[i].RuleDefinition.MatchAttributes.SourcePorts[j].FromPort'
            EXEC sp_OAMethod @jResp, 'IntOf', @ToPort OUT, 'RuleGroup.RulesSource.StatelessRulesAndCustomActions.StatelessRules[i].RuleDefinition.MatchAttributes.SourcePorts[j].ToPort'
            SELECT @j = @j + 1
          END
        SELECT @j = 0
        EXEC sp_OAMethod @jResp, 'SizeOfArray', @count_j OUT, 'RuleGroup.RulesSource.StatelessRulesAndCustomActions.StatelessRules[i].RuleDefinition.MatchAttributes.Sources'
        WHILE @j < @count_j
          BEGIN
            EXEC sp_OASetProperty @jResp, 'J', @j
            EXEC sp_OAMethod @jResp, 'StringOf', @AddressDefinition OUT, 'RuleGroup.RulesSource.StatelessRulesAndCustomActions.StatelessRules[i].RuleDefinition.MatchAttributes.Sources[j].AddressDefinition'
            SELECT @j = @j + 1
          END
        SELECT @j = 0
        EXEC sp_OAMethod @jResp, 'SizeOfArray', @count_j OUT, 'RuleGroup.RulesSource.StatelessRulesAndCustomActions.StatelessRules[i].RuleDefinition.MatchAttributes.TCPFlags'
        WHILE @j < @count_j
          BEGIN
            EXEC sp_OASetProperty @jResp, 'J', @j
            SELECT @k = 0
            EXEC sp_OAMethod @jResp, 'SizeOfArray', @count_k OUT, 'RuleGroup.RulesSource.StatelessRulesAndCustomActions.StatelessRules[i].RuleDefinition.MatchAttributes.TCPFlags[j].Flags'
            WHILE @k < @count_k
              BEGIN
                EXEC sp_OASetProperty @jResp, 'K', @k
                EXEC sp_OAMethod @jResp, 'StringOf', @strVal OUT, 'RuleGroup.RulesSource.StatelessRulesAndCustomActions.StatelessRules[i].RuleDefinition.MatchAttributes.TCPFlags[j].Flags[k]'
                SELECT @k = @k + 1
              END
            SELECT @k = 0
            EXEC sp_OAMethod @jResp, 'SizeOfArray', @count_k OUT, 'RuleGroup.RulesSource.StatelessRulesAndCustomActions.StatelessRules[i].RuleDefinition.MatchAttributes.TCPFlags[j].Masks'
            WHILE @k < @count_k
              BEGIN
                EXEC sp_OASetProperty @jResp, 'K', @k
                EXEC sp_OAMethod @jResp, 'StringOf', @strVal OUT, 'RuleGroup.RulesSource.StatelessRulesAndCustomActions.StatelessRules[i].RuleDefinition.MatchAttributes.TCPFlags[j].Masks[k]'
                SELECT @k = @k + 1
              END
            SELECT @j = @j + 1
          END
        SELECT @i = @i + 1
      END
    SELECT @i = 0
    EXEC sp_OAMethod @jResp, 'SizeOfArray', @count_i OUT, 'RuleGroup.RuleVariables.IPSets.string.Definition'
    WHILE @i < @count_i
      BEGIN
        EXEC sp_OASetProperty @jResp, 'I', @i
        EXEC sp_OAMethod @jResp, 'StringOf', @strVal OUT, 'RuleGroup.RuleVariables.IPSets.string.Definition[i]'
        SELECT @i = @i + 1
      END
    SELECT @i = 0
    EXEC sp_OAMethod @jResp, 'SizeOfArray', @count_i OUT, 'RuleGroup.RuleVariables.PortSets.string.Definition'
    WHILE @i < @count_i
      BEGIN
        EXEC sp_OASetProperty @jResp, 'I', @i
        EXEC sp_OAMethod @jResp, 'StringOf', @strVal OUT, 'RuleGroup.RuleVariables.PortSets.string.Definition[i]'
        SELECT @i = @i + 1
      END
    SELECT @i = 0
    EXEC sp_OAMethod @jResp, 'SizeOfArray', @count_i OUT, 'RuleGroupResponse.Tags'
    WHILE @i < @count_i
      BEGIN
        EXEC sp_OASetProperty @jResp, 'I', @i
        EXEC sp_OAMethod @jResp, 'StringOf', @Key OUT, 'RuleGroupResponse.Tags[i].Key'
        EXEC sp_OAMethod @jResp, 'StringOf', @Value OUT, 'RuleGroupResponse.Tags[i].Value'
        SELECT @i = @i + 1
      END

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

    -- {
    --   "RuleGroup": {
    --     "RulesSource": {
    --       "RulesSourceList": {
    --         "GeneratedRulesType": "string",
    --         "Targets": [
    --           "string"
    --         ],
    --         "TargetTypes": [
    --           "string"
    --         ]
    --       },
    --       "RulesString": "string",
    --       "StatefulRules": [
    --         {
    --           "Action": "string",
    --           "Header": {
    --             "Destination": "string",
    --             "DestinationPort": "string",
    --             "Direction": "string",
    --             "Protocol": "string",
    --             "Source": "string",
    --             "SourcePort": "string"
    --           },
    --           "RuleOptions": [
    --             {
    --               "Keyword": "string",
    --               "Settings": [
    --                 "string"
    --               ]
    --             }
    --           ]
    --         }
    --       ],
    --       "StatelessRulesAndCustomActions": {
    --         "CustomActions": [
    --           {
    --             "ActionDefinition": {
    --               "PublishMetricAction": {
    --                 "Dimensions": [
    --                   {
    --                     "Value": "string"
    --                   }
    --                 ]
    --               }
    --             },
    --             "ActionName": "string"
    --           }
    --         ],
    --         "StatelessRules": [
    --           {
    --             "Priority": number,
    --             "RuleDefinition": {
    --               "Actions": [
    --                 "string"
    --               ],
    --               "MatchAttributes": {
    --                 "DestinationPorts": [
    --                   {
    --                     "FromPort": number,
    --                     "ToPort": number
    --                   }
    --                 ],
    --                 "Destinations": [
    --                   {
    --                     "AddressDefinition": "string"
    --                   }
    --                 ],
    --                 "Protocols": [
    --                   number
    --                 ],
    --                 "SourcePorts": [
    --                   {
    --                     "FromPort": number,
    --                     "ToPort": number
    --                   }
    --                 ],
    --                 "Sources": [
    --                   {
    --                     "AddressDefinition": "string"
    --                   }
    --                 ],
    --                 "TCPFlags": [
    --                   {
    --                     "Flags": [
    --                       "string"
    --                     ],
    --                     "Masks": [
    --                       "string"
    --                     ]
    --                   }
    --                 ]
    --               }
    --             }
    --           }
    --         ]
    --       }
    --     },
    --     "RuleVariables": {
    --       "IPSets": {
    --         "string": {
    --           "Definition": [
    --             "string"
    --           ]
    --         }
    --       },
    --       "PortSets": {
    --         "string": {
    --           "Definition": [
    --             "string"
    --           ]
    --         }
    --       }
    --     },
    --     "StatefulRuleOptions": {
    --       "RuleOrder": "string"
    --     }
    --   },
    --   "RuleGroupResponse": {
    --     "Capacity": number,
    --     "ConsumedCapacity": number,
    --     "Description": "string",
    --     "EncryptionConfiguration": {
    --       "KeyId": "string",
    --       "Type": "string"
    --     },
    --     "LastModifiedTime": number,
    --     "NumberOfAssociations": number,
    --     "RuleGroupArn": "string",
    --     "RuleGroupId": "string",
    --     "RuleGroupName": "string",
    --     "RuleGroupStatus": "string",
    --     "SnsTopic": "string",
    --     "SourceMetadata": {
    --       "SourceArn": "string",
    --       "SourceUpdateToken": "string"
    --     },
    --     "Tags": [
    --       {
    --         "Key": "string",
    --         "Value": "string"
    --       }
    --     ],
    --     "Type": "string"
    --   },
    --   "UpdateToken": "string"
    -- }

    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