import { HttpRequest as __HttpRequest , HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http" ; import { expectBoolean as __expectBoolean , expectInt32 as __expectInt32 , expectString as __expectString , } from "@aws-sdk/smithy-client" ; import { Endpoint as __Endpoint , HeaderBag as __HeaderBag , MetadataBearer as __MetadataBearer , ResponseMetadata as __ResponseMetadata , SerdeContext as __SerdeContext , SmithyException as __SmithyException , } from "@aws-sdk/types" ; import { AssociateFirewallPolicyCommandInput , AssociateFirewallPolicyCommandOutput , } from "../commands/AssociateFirewallPolicyCommand" ; import { AssociateSubnetsCommandInput , AssociateSubnetsCommandOutput } from "../commands/AssociateSubnetsCommand" ; import { CreateFirewallCommandInput , CreateFirewallCommandOutput } from "../commands/CreateFirewallCommand" ; import { CreateFirewallPolicyCommandInput , CreateFirewallPolicyCommandOutput , } from "../commands/CreateFirewallPolicyCommand" ; import { CreateRuleGroupCommandInput , CreateRuleGroupCommandOutput } from "../commands/CreateRuleGroupCommand" ; import { DeleteFirewallCommandInput , DeleteFirewallCommandOutput } from "../commands/DeleteFirewallCommand" ; import { DeleteFirewallPolicyCommandInput , DeleteFirewallPolicyCommandOutput , } from "../commands/DeleteFirewallPolicyCommand" ; import { DeleteResourcePolicyCommandInput , DeleteResourcePolicyCommandOutput , } from "../commands/DeleteResourcePolicyCommand" ; import { DeleteRuleGroupCommandInput , DeleteRuleGroupCommandOutput } from "../commands/DeleteRuleGroupCommand" ; import { DescribeFirewallCommandInput , DescribeFirewallCommandOutput } from "../commands/DescribeFirewallCommand" ; import { DescribeFirewallPolicyCommandInput , DescribeFirewallPolicyCommandOutput , } from "../commands/DescribeFirewallPolicyCommand" ; import { DescribeLoggingConfigurationCommandInput , DescribeLoggingConfigurationCommandOutput , } from "../commands/DescribeLoggingConfigurationCommand" ; import { DescribeResourcePolicyCommandInput , DescribeResourcePolicyCommandOutput , } from "../commands/DescribeResourcePolicyCommand" ; import { DescribeRuleGroupCommandInput , DescribeRuleGroupCommandOutput } from "../commands/DescribeRuleGroupCommand" ; import { DescribeRuleGroupMetadataCommandInput , DescribeRuleGroupMetadataCommandOutput , } from "../commands/DescribeRuleGroupMetadataCommand" ; import { DisassociateSubnetsCommandInput , DisassociateSubnetsCommandOutput , } from "../commands/DisassociateSubnetsCommand" ; import { ListFirewallPoliciesCommandInput , ListFirewallPoliciesCommandOutput , } from "../commands/ListFirewallPoliciesCommand" ; import { ListFirewallsCommandInput , ListFirewallsCommandOutput } from "../commands/ListFirewallsCommand" ; import { ListRuleGroupsCommandInput , ListRuleGroupsCommandOutput } from "../commands/ListRuleGroupsCommand" ; import { ListTagsForResourceCommandInput , ListTagsForResourceCommandOutput , } from "../commands/ListTagsForResourceCommand" ; import { PutResourcePolicyCommandInput , PutResourcePolicyCommandOutput } from "../commands/PutResourcePolicyCommand" ; import { TagResourceCommandInput , TagResourceCommandOutput } from "../commands/TagResourceCommand" ; import { UntagResourceCommandInput , UntagResourceCommandOutput } from "../commands/UntagResourceCommand" ; import { UpdateFirewallDeleteProtectionCommandInput , UpdateFirewallDeleteProtectionCommandOutput , } from "../commands/UpdateFirewallDeleteProtectionCommand" ; import { UpdateFirewallDescriptionCommandInput , UpdateFirewallDescriptionCommandOutput , } from "../commands/UpdateFirewallDescriptionCommand" ; import { UpdateFirewallPolicyChangeProtectionCommandInput , UpdateFirewallPolicyChangeProtectionCommandOutput , } from "../commands/UpdateFirewallPolicyChangeProtectionCommand" ; import { UpdateFirewallPolicyCommandInput , UpdateFirewallPolicyCommandOutput , } from "../commands/UpdateFirewallPolicyCommand" ; import { UpdateLoggingConfigurationCommandInput , UpdateLoggingConfigurationCommandOutput , } from "../commands/UpdateLoggingConfigurationCommand" ; import { UpdateRuleGroupCommandInput , UpdateRuleGroupCommandOutput } from "../commands/UpdateRuleGroupCommand" ; import { UpdateSubnetChangeProtectionCommandInput , UpdateSubnetChangeProtectionCommandOutput , } from "../commands/UpdateSubnetChangeProtectionCommand" ; import { ActionDefinition , Address , AssociateFirewallPolicyRequest , AssociateFirewallPolicyResponse , AssociateSubnetsRequest , AssociateSubnetsResponse , Attachment , CreateFirewallPolicyRequest , CreateFirewallPolicyResponse , CreateFirewallRequest , CreateFirewallResponse , CreateRuleGroupRequest , CreateRuleGroupResponse , CustomAction , DeleteFirewallPolicyRequest , DeleteFirewallPolicyResponse , DeleteFirewallRequest , DeleteFirewallResponse , DeleteResourcePolicyRequest , DeleteResourcePolicyResponse , DeleteRuleGroupRequest , DeleteRuleGroupResponse , DescribeFirewallPolicyRequest , DescribeFirewallPolicyResponse , DescribeFirewallRequest , DescribeFirewallResponse , DescribeLoggingConfigurationRequest , DescribeLoggingConfigurationResponse , DescribeResourcePolicyRequest , DescribeResourcePolicyResponse , DescribeRuleGroupMetadataRequest , DescribeRuleGroupMetadataResponse , DescribeRuleGroupRequest , DescribeRuleGroupResponse , Dimension , DisassociateSubnetsRequest , DisassociateSubnetsResponse , Firewall , FirewallMetadata , FirewallPolicy , FirewallPolicyMetadata , FirewallPolicyResponse , FirewallStatus , Header , InsufficientCapacityException , InternalServerError , InvalidOperationException , InvalidRequestException , InvalidResourcePolicyException , InvalidTokenException , IPSet , LimitExceededException , ListFirewallPoliciesRequest , ListFirewallPoliciesResponse , ListFirewallsRequest , ListFirewallsResponse , ListRuleGroupsRequest , ListRuleGroupsResponse , ListTagsForResourceRequest , ListTagsForResourceResponse , LogDestinationConfig , LogDestinationPermissionException , LoggingConfiguration , MatchAttributes , PerObjectStatus , PortRange , PortSet , PublishMetricAction , PutResourcePolicyRequest , PutResourcePolicyResponse , ResourceNotFoundException , ResourceOwnerCheckException , RuleDefinition , RuleGroup , RuleGroupMetadata , RuleGroupResponse , RuleOption , RulesSource , RulesSourceList , RuleVariables , StatefulEngineOptions , StatefulRule , StatefulRuleGroupOverride , StatefulRuleGroupReference , StatefulRuleOptions , StatelessRule , StatelessRuleGroupReference , StatelessRulesAndCustomActions , SubnetMapping , SyncState , Tag , TagResourceRequest , TagResourceResponse , TargetType , TCPFlag , TCPFlagField , ThrottlingException , UnsupportedOperationException , UntagResourceRequest , UntagResourceResponse , UpdateFirewallDeleteProtectionRequest , UpdateFirewallDeleteProtectionResponse , UpdateFirewallDescriptionRequest , UpdateFirewallDescriptionResponse , UpdateFirewallPolicyChangeProtectionRequest , UpdateFirewallPolicyChangeProtectionResponse , UpdateFirewallPolicyRequest , UpdateFirewallPolicyResponse , UpdateLoggingConfigurationRequest , UpdateLoggingConfigurationResponse , UpdateRuleGroupRequest , UpdateRuleGroupResponse , UpdateSubnetChangeProtectionRequest , UpdateSubnetChangeProtectionResponse , } from "../models/models_0" ; export const serializeAws_json1_0AssociateFirewallPolicyCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.0" , "x-amz-target" : "NetworkFirewall_20201112.AssociateFirewallPolicy" , } ; let body ; body = JSON . stringify ( serializeAws_json1_0AssociateFirewallPolicyRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_0AssociateSubnetsCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.0" , "x-amz-target" : "NetworkFirewall_20201112.AssociateSubnets" , } ; let body ; body = JSON . stringify ( serializeAws_json1_0AssociateSubnetsRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_0CreateFirewallCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.0" , "x-amz-target" : "NetworkFirewall_20201112.CreateFirewall" , } ; let body ; body = JSON . stringify ( serializeAws_json1_0CreateFirewallRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_0CreateFirewallPolicyCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.0" , "x-amz-target" : "NetworkFirewall_20201112.CreateFirewallPolicy" , } ; let body ; body = JSON . stringify ( serializeAws_json1_0CreateFirewallPolicyRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_0CreateRuleGroupCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.0" , "x-amz-target" : "NetworkFirewall_20201112.CreateRuleGroup" , } ; let body ; body = JSON . stringify ( serializeAws_json1_0CreateRuleGroupRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_0DeleteFirewallCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.0" , "x-amz-target" : "NetworkFirewall_20201112.DeleteFirewall" , } ; let body ; body = JSON . stringify ( serializeAws_json1_0DeleteFirewallRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_0DeleteFirewallPolicyCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.0" , "x-amz-target" : "NetworkFirewall_20201112.DeleteFirewallPolicy" , } ; let body ; body = JSON . stringify ( serializeAws_json1_0DeleteFirewallPolicyRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_0DeleteResourcePolicyCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.0" , "x-amz-target" : "NetworkFirewall_20201112.DeleteResourcePolicy" , } ; let body ; body = JSON . stringify ( serializeAws_json1_0DeleteResourcePolicyRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_0DeleteRuleGroupCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.0" , "x-amz-target" : "NetworkFirewall_20201112.DeleteRuleGroup" , } ; let body ; body = JSON . stringify ( serializeAws_json1_0DeleteRuleGroupRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_0DescribeFirewallCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.0" , "x-amz-target" : "NetworkFirewall_20201112.DescribeFirewall" , } ; let body ; body = JSON . stringify ( serializeAws_json1_0DescribeFirewallRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_0DescribeFirewallPolicyCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.0" , "x-amz-target" : "NetworkFirewall_20201112.DescribeFirewallPolicy" , } ; let body ; body = JSON . stringify ( serializeAws_json1_0DescribeFirewallPolicyRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_0DescribeLoggingConfigurationCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.0" , "x-amz-target" : "NetworkFirewall_20201112.DescribeLoggingConfiguration" , } ; let body ; body = JSON . stringify ( serializeAws_json1_0DescribeLoggingConfigurationRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_0DescribeResourcePolicyCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.0" , "x-amz-target" : "NetworkFirewall_20201112.DescribeResourcePolicy" , } ; let body ; body = JSON . stringify ( serializeAws_json1_0DescribeResourcePolicyRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_0DescribeRuleGroupCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.0" , "x-amz-target" : "NetworkFirewall_20201112.DescribeRuleGroup" , } ; let body ; body = JSON . stringify ( serializeAws_json1_0DescribeRuleGroupRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_0DescribeRuleGroupMetadataCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.0" , "x-amz-target" : "NetworkFirewall_20201112.DescribeRuleGroupMetadata" , } ; let body ; body = JSON . stringify ( serializeAws_json1_0DescribeRuleGroupMetadataRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_0DisassociateSubnetsCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.0" , "x-amz-target" : "NetworkFirewall_20201112.DisassociateSubnets" , } ; let body ; body = JSON . stringify ( serializeAws_json1_0DisassociateSubnetsRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_0ListFirewallPoliciesCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.0" , "x-amz-target" : "NetworkFirewall_20201112.ListFirewallPolicies" , } ; let body ; body = JSON . stringify ( serializeAws_json1_0ListFirewallPoliciesRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_0ListFirewallsCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.0" , "x-amz-target" : "NetworkFirewall_20201112.ListFirewalls" , } ; let body ; body = JSON . stringify ( serializeAws_json1_0ListFirewallsRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_0ListRuleGroupsCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.0" , "x-amz-target" : "NetworkFirewall_20201112.ListRuleGroups" , } ; let body ; body = JSON . stringify ( serializeAws_json1_0ListRuleGroupsRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_0ListTagsForResourceCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.0" , "x-amz-target" : "NetworkFirewall_20201112.ListTagsForResource" , } ; let body ; body = JSON . stringify ( serializeAws_json1_0ListTagsForResourceRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_0PutResourcePolicyCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.0" , "x-amz-target" : "NetworkFirewall_20201112.PutResourcePolicy" , } ; let body ; body = JSON . stringify ( serializeAws_json1_0PutResourcePolicyRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_0TagResourceCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.0" , "x-amz-target" : "NetworkFirewall_20201112.TagResource" , } ; let body ; body = JSON . stringify ( serializeAws_json1_0TagResourceRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_0UntagResourceCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.0" , "x-amz-target" : "NetworkFirewall_20201112.UntagResource" , } ; let body ; body = JSON . stringify ( serializeAws_json1_0UntagResourceRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_0UpdateFirewallDeleteProtectionCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.0" , "x-amz-target" : "NetworkFirewall_20201112.UpdateFirewallDeleteProtection" , } ; let body ; body = JSON . stringify ( serializeAws_json1_0UpdateFirewallDeleteProtectionRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_0UpdateFirewallDescriptionCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.0" , "x-amz-target" : "NetworkFirewall_20201112.UpdateFirewallDescription" , } ; let body ; body = JSON . stringify ( serializeAws_json1_0UpdateFirewallDescriptionRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_0UpdateFirewallPolicyCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.0" , "x-amz-target" : "NetworkFirewall_20201112.UpdateFirewallPolicy" , } ; let body ; body = JSON . stringify ( serializeAws_json1_0UpdateFirewallPolicyRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_0UpdateFirewallPolicyChangeProtectionCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.0" , "x-amz-target" : "NetworkFirewall_20201112.UpdateFirewallPolicyChangeProtection" , } ; let body ; body = JSON . stringify ( serializeAws_json1_0UpdateFirewallPolicyChangeProtectionRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_0UpdateLoggingConfigurationCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.0" , "x-amz-target" : "NetworkFirewall_20201112.UpdateLoggingConfiguration" , } ; let body ; body = JSON . stringify ( serializeAws_json1_0UpdateLoggingConfigurationRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_0UpdateRuleGroupCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.0" , "x-amz-target" : "NetworkFirewall_20201112.UpdateRuleGroup" , } ; let body ; body = JSON . stringify ( serializeAws_json1_0UpdateRuleGroupRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_0UpdateSubnetChangeProtectionCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.0" , "x-amz-target" : "NetworkFirewall_20201112.UpdateSubnetChangeProtection" , } ; let body ; body = JSON . stringify ( serializeAws_json1_0UpdateSubnetChangeProtectionRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const deserializeAws_json1_0AssociateFirewallPolicyCommand = async ( output , context ) : Promise < AssociateFirewallPolicyCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_0AssociateFirewallPolicyCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_0AssociateFirewallPolicyResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_0AssociateFirewallPolicyCommandError = async ( output , context ) : Promise < AssociateFirewallPolicyCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalServerError" : case "com.amazonaws.networkfirewall#InternalServerError" : response = { ... ( await deserializeAws_json1_0InternalServerErrorResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidOperationException" : case "com.amazonaws.networkfirewall#InvalidOperationException" : response = { ... ( await deserializeAws_json1_0InvalidOperationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidRequestException" : case "com.amazonaws.networkfirewall#InvalidRequestException" : response = { ... ( await deserializeAws_json1_0InvalidRequestExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidTokenException" : case "com.amazonaws.networkfirewall#InvalidTokenException" : response = { ... ( await deserializeAws_json1_0InvalidTokenExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.networkfirewall#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_0ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.networkfirewall#ThrottlingException" : response = { ... ( await deserializeAws_json1_0ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_0AssociateSubnetsCommand = async ( output , context ) : Promise < AssociateSubnetsCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_0AssociateSubnetsCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_0AssociateSubnetsResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_0AssociateSubnetsCommandError = async ( output , context ) : Promise < AssociateSubnetsCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InsufficientCapacityException" : case "com.amazonaws.networkfirewall#InsufficientCapacityException" : response = { ... ( await deserializeAws_json1_0InsufficientCapacityExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerError" : case "com.amazonaws.networkfirewall#InternalServerError" : response = { ... ( await deserializeAws_json1_0InternalServerErrorResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidOperationException" : case "com.amazonaws.networkfirewall#InvalidOperationException" : response = { ... ( await deserializeAws_json1_0InvalidOperationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidRequestException" : case "com.amazonaws.networkfirewall#InvalidRequestException" : response = { ... ( await deserializeAws_json1_0InvalidRequestExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidTokenException" : case "com.amazonaws.networkfirewall#InvalidTokenException" : response = { ... ( await deserializeAws_json1_0InvalidTokenExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.networkfirewall#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_0ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.networkfirewall#ThrottlingException" : response = { ... ( await deserializeAws_json1_0ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_0CreateFirewallCommand = async ( output , context ) : Promise < CreateFirewallCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_0CreateFirewallCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_0CreateFirewallResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_0CreateFirewallCommandError = async ( output , context ) : Promise < CreateFirewallCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InsufficientCapacityException" : case "com.amazonaws.networkfirewall#InsufficientCapacityException" : response = { ... ( await deserializeAws_json1_0InsufficientCapacityExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerError" : case "com.amazonaws.networkfirewall#InternalServerError" : response = { ... ( await deserializeAws_json1_0InternalServerErrorResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidOperationException" : case "com.amazonaws.networkfirewall#InvalidOperationException" : response = { ... ( await deserializeAws_json1_0InvalidOperationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidRequestException" : case "com.amazonaws.networkfirewall#InvalidRequestException" : response = { ... ( await deserializeAws_json1_0InvalidRequestExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "LimitExceededException" : case "com.amazonaws.networkfirewall#LimitExceededException" : response = { ... ( await deserializeAws_json1_0LimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.networkfirewall#ThrottlingException" : response = { ... ( await deserializeAws_json1_0ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_0CreateFirewallPolicyCommand = async ( output , context ) : Promise < CreateFirewallPolicyCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_0CreateFirewallPolicyCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_0CreateFirewallPolicyResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_0CreateFirewallPolicyCommandError = async ( output , context ) : Promise < CreateFirewallPolicyCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InsufficientCapacityException" : case "com.amazonaws.networkfirewall#InsufficientCapacityException" : response = { ... ( await deserializeAws_json1_0InsufficientCapacityExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerError" : case "com.amazonaws.networkfirewall#InternalServerError" : response = { ... ( await deserializeAws_json1_0InternalServerErrorResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidRequestException" : case "com.amazonaws.networkfirewall#InvalidRequestException" : response = { ... ( await deserializeAws_json1_0InvalidRequestExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "LimitExceededException" : case "com.amazonaws.networkfirewall#LimitExceededException" : response = { ... ( await deserializeAws_json1_0LimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.networkfirewall#ThrottlingException" : response = { ... ( await deserializeAws_json1_0ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_0CreateRuleGroupCommand = async ( output , context ) : Promise < CreateRuleGroupCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_0CreateRuleGroupCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_0CreateRuleGroupResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_0CreateRuleGroupCommandError = async ( output , context ) : Promise < CreateRuleGroupCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InsufficientCapacityException" : case "com.amazonaws.networkfirewall#InsufficientCapacityException" : response = { ... ( await deserializeAws_json1_0InsufficientCapacityExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerError" : case "com.amazonaws.networkfirewall#InternalServerError" : response = { ... ( await deserializeAws_json1_0InternalServerErrorResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidRequestException" : case "com.amazonaws.networkfirewall#InvalidRequestException" : response = { ... ( await deserializeAws_json1_0InvalidRequestExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "LimitExceededException" : case "com.amazonaws.networkfirewall#LimitExceededException" : response = { ... ( await deserializeAws_json1_0LimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.networkfirewall#ThrottlingException" : response = { ... ( await deserializeAws_json1_0ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_0DeleteFirewallCommand = async ( output , context ) : Promise < DeleteFirewallCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_0DeleteFirewallCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_0DeleteFirewallResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_0DeleteFirewallCommandError = async ( output , context ) : Promise < DeleteFirewallCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalServerError" : case "com.amazonaws.networkfirewall#InternalServerError" : response = { ... ( await deserializeAws_json1_0InternalServerErrorResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidOperationException" : case "com.amazonaws.networkfirewall#InvalidOperationException" : response = { ... ( await deserializeAws_json1_0InvalidOperationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidRequestException" : case "com.amazonaws.networkfirewall#InvalidRequestException" : response = { ... ( await deserializeAws_json1_0InvalidRequestExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.networkfirewall#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_0ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.networkfirewall#ThrottlingException" : response = { ... ( await deserializeAws_json1_0ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnsupportedOperationException" : case "com.amazonaws.networkfirewall#UnsupportedOperationException" : response = { ... ( await deserializeAws_json1_0UnsupportedOperationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_0DeleteFirewallPolicyCommand = async ( output , context ) : Promise < DeleteFirewallPolicyCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_0DeleteFirewallPolicyCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_0DeleteFirewallPolicyResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_0DeleteFirewallPolicyCommandError = async ( output , context ) : Promise < DeleteFirewallPolicyCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalServerError" : case "com.amazonaws.networkfirewall#InternalServerError" : response = { ... ( await deserializeAws_json1_0InternalServerErrorResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidOperationException" : case "com.amazonaws.networkfirewall#InvalidOperationException" : response = { ... ( await deserializeAws_json1_0InvalidOperationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidRequestException" : case "com.amazonaws.networkfirewall#InvalidRequestException" : response = { ... ( await deserializeAws_json1_0InvalidRequestExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.networkfirewall#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_0ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.networkfirewall#ThrottlingException" : response = { ... ( await deserializeAws_json1_0ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnsupportedOperationException" : case "com.amazonaws.networkfirewall#UnsupportedOperationException" : response = { ... ( await deserializeAws_json1_0UnsupportedOperationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_0DeleteResourcePolicyCommand = async ( output , context ) : Promise < DeleteResourcePolicyCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_0DeleteResourcePolicyCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_0DeleteResourcePolicyResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_0DeleteResourcePolicyCommandError = async ( output , context ) : Promise < DeleteResourcePolicyCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalServerError" : case "com.amazonaws.networkfirewall#InternalServerError" : response = { ... ( await deserializeAws_json1_0InternalServerErrorResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidRequestException" : case "com.amazonaws.networkfirewall#InvalidRequestException" : response = { ... ( await deserializeAws_json1_0InvalidRequestExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidResourcePolicyException" : case "com.amazonaws.networkfirewall#InvalidResourcePolicyException" : response = { ... ( await deserializeAws_json1_0InvalidResourcePolicyExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.networkfirewall#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_0ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.networkfirewall#ThrottlingException" : response = { ... ( await deserializeAws_json1_0ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_0DeleteRuleGroupCommand = async ( output , context ) : Promise < DeleteRuleGroupCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_0DeleteRuleGroupCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_0DeleteRuleGroupResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_0DeleteRuleGroupCommandError = async ( output , context ) : Promise < DeleteRuleGroupCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalServerError" : case "com.amazonaws.networkfirewall#InternalServerError" : response = { ... ( await deserializeAws_json1_0InternalServerErrorResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidOperationException" : case "com.amazonaws.networkfirewall#InvalidOperationException" : response = { ... ( await deserializeAws_json1_0InvalidOperationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidRequestException" : case "com.amazonaws.networkfirewall#InvalidRequestException" : response = { ... ( await deserializeAws_json1_0InvalidRequestExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.networkfirewall#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_0ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.networkfirewall#ThrottlingException" : response = { ... ( await deserializeAws_json1_0ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnsupportedOperationException" : case "com.amazonaws.networkfirewall#UnsupportedOperationException" : response = { ... ( await deserializeAws_json1_0UnsupportedOperationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_0DescribeFirewallCommand = async ( output , context ) : Promise < DescribeFirewallCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_0DescribeFirewallCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_0DescribeFirewallResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_0DescribeFirewallCommandError = async ( output , context ) : Promise < DescribeFirewallCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalServerError" : case "com.amazonaws.networkfirewall#InternalServerError" : response = { ... ( await deserializeAws_json1_0InternalServerErrorResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidRequestException" : case "com.amazonaws.networkfirewall#InvalidRequestException" : response = { ... ( await deserializeAws_json1_0InvalidRequestExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.networkfirewall#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_0ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.networkfirewall#ThrottlingException" : response = { ... ( await deserializeAws_json1_0ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_0DescribeFirewallPolicyCommand = async ( output , context ) : Promise < DescribeFirewallPolicyCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_0DescribeFirewallPolicyCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_0DescribeFirewallPolicyResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_0DescribeFirewallPolicyCommandError = async ( output , context ) : Promise < DescribeFirewallPolicyCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalServerError" : case "com.amazonaws.networkfirewall#InternalServerError" : response = { ... ( await deserializeAws_json1_0InternalServerErrorResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidRequestException" : case "com.amazonaws.networkfirewall#InvalidRequestException" : response = { ... ( await deserializeAws_json1_0InvalidRequestExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.networkfirewall#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_0ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.networkfirewall#ThrottlingException" : response = { ... ( await deserializeAws_json1_0ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_0DescribeLoggingConfigurationCommand = async ( output , context ) : Promise < DescribeLoggingConfigurationCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_0DescribeLoggingConfigurationCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_0DescribeLoggingConfigurationResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_0DescribeLoggingConfigurationCommandError = async ( output , context ) : Promise < DescribeLoggingConfigurationCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalServerError" : case "com.amazonaws.networkfirewall#InternalServerError" : response = { ... ( await deserializeAws_json1_0InternalServerErrorResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidRequestException" : case "com.amazonaws.networkfirewall#InvalidRequestException" : response = { ... ( await deserializeAws_json1_0InvalidRequestExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.networkfirewall#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_0ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.networkfirewall#ThrottlingException" : response = { ... ( await deserializeAws_json1_0ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_0DescribeResourcePolicyCommand = async ( output , context ) : Promise < DescribeResourcePolicyCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_0DescribeResourcePolicyCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_0DescribeResourcePolicyResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_0DescribeResourcePolicyCommandError = async ( output , context ) : Promise < DescribeResourcePolicyCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalServerError" : case "com.amazonaws.networkfirewall#InternalServerError" : response = { ... ( await deserializeAws_json1_0InternalServerErrorResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidRequestException" : case "com.amazonaws.networkfirewall#InvalidRequestException" : response = { ... ( await deserializeAws_json1_0InvalidRequestExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.networkfirewall#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_0ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.networkfirewall#ThrottlingException" : response = { ... ( await deserializeAws_json1_0ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_0DescribeRuleGroupCommand = async ( output , context ) : Promise < DescribeRuleGroupCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_0DescribeRuleGroupCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_0DescribeRuleGroupResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_0DescribeRuleGroupCommandError = async ( output , context ) : Promise < DescribeRuleGroupCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalServerError" : case "com.amazonaws.networkfirewall#InternalServerError" : response = { ... ( await deserializeAws_json1_0InternalServerErrorResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidRequestException" : case "com.amazonaws.networkfirewall#InvalidRequestException" : response = { ... ( await deserializeAws_json1_0InvalidRequestExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.networkfirewall#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_0ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.networkfirewall#ThrottlingException" : response = { ... ( await deserializeAws_json1_0ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_0DescribeRuleGroupMetadataCommand = async ( output , context ) : Promise < DescribeRuleGroupMetadataCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_0DescribeRuleGroupMetadataCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_0DescribeRuleGroupMetadataResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_0DescribeRuleGroupMetadataCommandError = async ( output , context ) : Promise < DescribeRuleGroupMetadataCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalServerError" : case "com.amazonaws.networkfirewall#InternalServerError" : response = { ... ( await deserializeAws_json1_0InternalServerErrorResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidRequestException" : case "com.amazonaws.networkfirewall#InvalidRequestException" : response = { ... ( await deserializeAws_json1_0InvalidRequestExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.networkfirewall#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_0ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.networkfirewall#ThrottlingException" : response = { ... ( await deserializeAws_json1_0ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_0DisassociateSubnetsCommand = async ( output , context ) : Promise < DisassociateSubnetsCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_0DisassociateSubnetsCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_0DisassociateSubnetsResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_0DisassociateSubnetsCommandError = async ( output , context ) : Promise < DisassociateSubnetsCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalServerError" : case "com.amazonaws.networkfirewall#InternalServerError" : response = { ... ( await deserializeAws_json1_0InternalServerErrorResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidOperationException" : case "com.amazonaws.networkfirewall#InvalidOperationException" : response = { ... ( await deserializeAws_json1_0InvalidOperationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidRequestException" : case "com.amazonaws.networkfirewall#InvalidRequestException" : response = { ... ( await deserializeAws_json1_0InvalidRequestExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidTokenException" : case "com.amazonaws.networkfirewall#InvalidTokenException" : response = { ... ( await deserializeAws_json1_0InvalidTokenExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.networkfirewall#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_0ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.networkfirewall#ThrottlingException" : response = { ... ( await deserializeAws_json1_0ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_0ListFirewallPoliciesCommand = async ( output , context ) : Promise < ListFirewallPoliciesCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_0ListFirewallPoliciesCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_0ListFirewallPoliciesResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_0ListFirewallPoliciesCommandError = async ( output , context ) : Promise < ListFirewallPoliciesCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalServerError" : case "com.amazonaws.networkfirewall#InternalServerError" : response = { ... ( await deserializeAws_json1_0InternalServerErrorResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidRequestException" : case "com.amazonaws.networkfirewall#InvalidRequestException" : response = { ... ( await deserializeAws_json1_0InvalidRequestExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.networkfirewall#ThrottlingException" : response = { ... ( await deserializeAws_json1_0ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_0ListFirewallsCommand = async ( output , context ) : Promise < ListFirewallsCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_0ListFirewallsCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_0ListFirewallsResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_0ListFirewallsCommandError = async ( output , context ) : Promise < ListFirewallsCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalServerError" : case "com.amazonaws.networkfirewall#InternalServerError" : response = { ... ( await deserializeAws_json1_0InternalServerErrorResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidRequestException" : case "com.amazonaws.networkfirewall#InvalidRequestException" : response = { ... ( await deserializeAws_json1_0InvalidRequestExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.networkfirewall#ThrottlingException" : response = { ... ( await deserializeAws_json1_0ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_0ListRuleGroupsCommand = async ( output , context ) : Promise < ListRuleGroupsCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_0ListRuleGroupsCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_0ListRuleGroupsResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_0ListRuleGroupsCommandError = async ( output , context ) : Promise < ListRuleGroupsCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalServerError" : case "com.amazonaws.networkfirewall#InternalServerError" : response = { ... ( await deserializeAws_json1_0InternalServerErrorResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidRequestException" : case "com.amazonaws.networkfirewall#InvalidRequestException" : response = { ... ( await deserializeAws_json1_0InvalidRequestExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.networkfirewall#ThrottlingException" : response = { ... ( await deserializeAws_json1_0ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_0ListTagsForResourceCommand = async ( output , context ) : Promise < ListTagsForResourceCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_0ListTagsForResourceCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_0ListTagsForResourceResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_0ListTagsForResourceCommandError = async ( output , context ) : Promise < ListTagsForResourceCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalServerError" : case "com.amazonaws.networkfirewall#InternalServerError" : response = { ... ( await deserializeAws_json1_0InternalServerErrorResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidRequestException" : case "com.amazonaws.networkfirewall#InvalidRequestException" : response = { ... ( await deserializeAws_json1_0InvalidRequestExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.networkfirewall#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_0ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.networkfirewall#ThrottlingException" : response = { ... ( await deserializeAws_json1_0ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_0PutResourcePolicyCommand = async ( output , context ) : Promise < PutResourcePolicyCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_0PutResourcePolicyCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_0PutResourcePolicyResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_0PutResourcePolicyCommandError = async ( output , context ) : Promise < PutResourcePolicyCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalServerError" : case "com.amazonaws.networkfirewall#InternalServerError" : response = { ... ( await deserializeAws_json1_0InternalServerErrorResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidRequestException" : case "com.amazonaws.networkfirewall#InvalidRequestException" : response = { ... ( await deserializeAws_json1_0InvalidRequestExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidResourcePolicyException" : case "com.amazonaws.networkfirewall#InvalidResourcePolicyException" : response = { ... ( await deserializeAws_json1_0InvalidResourcePolicyExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.networkfirewall#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_0ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.networkfirewall#ThrottlingException" : response = { ... ( await deserializeAws_json1_0ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_0TagResourceCommand = async ( output , context ) : Promise < TagResourceCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_0TagResourceCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_0TagResourceResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_0TagResourceCommandError = async ( output , context ) : Promise < TagResourceCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalServerError" : case "com.amazonaws.networkfirewall#InternalServerError" : response = { ... ( await deserializeAws_json1_0InternalServerErrorResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidRequestException" : case "com.amazonaws.networkfirewall#InvalidRequestException" : response = { ... ( await deserializeAws_json1_0InvalidRequestExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.networkfirewall#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_0ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.networkfirewall#ThrottlingException" : response = { ... ( await deserializeAws_json1_0ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_0UntagResourceCommand = async ( output , context ) : Promise < UntagResourceCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_0UntagResourceCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_0UntagResourceResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_0UntagResourceCommandError = async ( output , context ) : Promise < UntagResourceCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalServerError" : case "com.amazonaws.networkfirewall#InternalServerError" : response = { ... ( await deserializeAws_json1_0InternalServerErrorResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidRequestException" : case "com.amazonaws.networkfirewall#InvalidRequestException" : response = { ... ( await deserializeAws_json1_0InvalidRequestExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.networkfirewall#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_0ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.networkfirewall#ThrottlingException" : response = { ... ( await deserializeAws_json1_0ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_0UpdateFirewallDeleteProtectionCommand = async ( output , context ) : Promise < UpdateFirewallDeleteProtectionCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_0UpdateFirewallDeleteProtectionCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_0UpdateFirewallDeleteProtectionResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_0UpdateFirewallDeleteProtectionCommandError = async ( output , context ) : Promise < UpdateFirewallDeleteProtectionCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalServerError" : case "com.amazonaws.networkfirewall#InternalServerError" : response = { ... ( await deserializeAws_json1_0InternalServerErrorResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidRequestException" : case "com.amazonaws.networkfirewall#InvalidRequestException" : response = { ... ( await deserializeAws_json1_0InvalidRequestExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidTokenException" : case "com.amazonaws.networkfirewall#InvalidTokenException" : response = { ... ( await deserializeAws_json1_0InvalidTokenExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.networkfirewall#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_0ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceOwnerCheckException" : case "com.amazonaws.networkfirewall#ResourceOwnerCheckException" : response = { ... ( await deserializeAws_json1_0ResourceOwnerCheckExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.networkfirewall#ThrottlingException" : response = { ... ( await deserializeAws_json1_0ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_0UpdateFirewallDescriptionCommand = async ( output , context ) : Promise < UpdateFirewallDescriptionCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_0UpdateFirewallDescriptionCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_0UpdateFirewallDescriptionResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_0UpdateFirewallDescriptionCommandError = async ( output , context ) : Promise < UpdateFirewallDescriptionCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalServerError" : case "com.amazonaws.networkfirewall#InternalServerError" : response = { ... ( await deserializeAws_json1_0InternalServerErrorResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidRequestException" : case "com.amazonaws.networkfirewall#InvalidRequestException" : response = { ... ( await deserializeAws_json1_0InvalidRequestExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidTokenException" : case "com.amazonaws.networkfirewall#InvalidTokenException" : response = { ... ( await deserializeAws_json1_0InvalidTokenExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.networkfirewall#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_0ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.networkfirewall#ThrottlingException" : response = { ... ( await deserializeAws_json1_0ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_0UpdateFirewallPolicyCommand = async ( output , context ) : Promise < UpdateFirewallPolicyCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_0UpdateFirewallPolicyCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_0UpdateFirewallPolicyResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_0UpdateFirewallPolicyCommandError = async ( output , context ) : Promise < UpdateFirewallPolicyCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalServerError" : case "com.amazonaws.networkfirewall#InternalServerError" : response = { ... ( await deserializeAws_json1_0InternalServerErrorResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidRequestException" : case "com.amazonaws.networkfirewall#InvalidRequestException" : response = { ... ( await deserializeAws_json1_0InvalidRequestExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidTokenException" : case "com.amazonaws.networkfirewall#InvalidTokenException" : response = { ... ( await deserializeAws_json1_0InvalidTokenExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.networkfirewall#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_0ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.networkfirewall#ThrottlingException" : response = { ... ( await deserializeAws_json1_0ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_0UpdateFirewallPolicyChangeProtectionCommand = async ( output , context ) : Promise < UpdateFirewallPolicyChangeProtectionCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_0UpdateFirewallPolicyChangeProtectionCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_0UpdateFirewallPolicyChangeProtectionResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_0UpdateFirewallPolicyChangeProtectionCommandError = async ( output , context ) : Promise < UpdateFirewallPolicyChangeProtectionCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalServerError" : case "com.amazonaws.networkfirewall#InternalServerError" : response = { ... ( await deserializeAws_json1_0InternalServerErrorResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidRequestException" : case "com.amazonaws.networkfirewall#InvalidRequestException" : response = { ... ( await deserializeAws_json1_0InvalidRequestExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidTokenException" : case "com.amazonaws.networkfirewall#InvalidTokenException" : response = { ... ( await deserializeAws_json1_0InvalidTokenExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.networkfirewall#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_0ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceOwnerCheckException" : case "com.amazonaws.networkfirewall#ResourceOwnerCheckException" : response = { ... ( await deserializeAws_json1_0ResourceOwnerCheckExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.networkfirewall#ThrottlingException" : response = { ... ( await deserializeAws_json1_0ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_0UpdateLoggingConfigurationCommand = async ( output , context ) : Promise < UpdateLoggingConfigurationCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_0UpdateLoggingConfigurationCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_0UpdateLoggingConfigurationResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_0UpdateLoggingConfigurationCommandError = async ( output , context ) : Promise < UpdateLoggingConfigurationCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalServerError" : case "com.amazonaws.networkfirewall#InternalServerError" : response = { ... ( await deserializeAws_json1_0InternalServerErrorResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidRequestException" : case "com.amazonaws.networkfirewall#InvalidRequestException" : response = { ... ( await deserializeAws_json1_0InvalidRequestExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidTokenException" : case "com.amazonaws.networkfirewall#InvalidTokenException" : response = { ... ( await deserializeAws_json1_0InvalidTokenExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "LogDestinationPermissionException" : case "com.amazonaws.networkfirewall#LogDestinationPermissionException" : response = { ... ( await deserializeAws_json1_0LogDestinationPermissionExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.networkfirewall#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_0ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.networkfirewall#ThrottlingException" : response = { ... ( await deserializeAws_json1_0ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_0UpdateRuleGroupCommand = async ( output , context ) : Promise < UpdateRuleGroupCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_0UpdateRuleGroupCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_0UpdateRuleGroupResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_0UpdateRuleGroupCommandError = async ( output , context ) : Promise < UpdateRuleGroupCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalServerError" : case "com.amazonaws.networkfirewall#InternalServerError" : response = { ... ( await deserializeAws_json1_0InternalServerErrorResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidRequestException" : case "com.amazonaws.networkfirewall#InvalidRequestException" : response = { ... ( await deserializeAws_json1_0InvalidRequestExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidTokenException" : case "com.amazonaws.networkfirewall#InvalidTokenException" : response = { ... ( await deserializeAws_json1_0InvalidTokenExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.networkfirewall#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_0ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.networkfirewall#ThrottlingException" : response = { ... ( await deserializeAws_json1_0ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_0UpdateSubnetChangeProtectionCommand = async ( output , context ) : Promise < UpdateSubnetChangeProtectionCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_0UpdateSubnetChangeProtectionCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_0UpdateSubnetChangeProtectionResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_0UpdateSubnetChangeProtectionCommandError = async ( output , context ) : Promise < UpdateSubnetChangeProtectionCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalServerError" : case "com.amazonaws.networkfirewall#InternalServerError" : response = { ... ( await deserializeAws_json1_0InternalServerErrorResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidRequestException" : case "com.amazonaws.networkfirewall#InvalidRequestException" : response = { ... ( await deserializeAws_json1_0InvalidRequestExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidTokenException" : case "com.amazonaws.networkfirewall#InvalidTokenException" : response = { ... ( await deserializeAws_json1_0InvalidTokenExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.networkfirewall#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_0ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceOwnerCheckException" : case "com.amazonaws.networkfirewall#ResourceOwnerCheckException" : response = { ... ( await deserializeAws_json1_0ResourceOwnerCheckExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.networkfirewall#ThrottlingException" : response = { ... ( await deserializeAws_json1_0ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; const deserializeAws_json1_0InsufficientCapacityExceptionResponse = async ( parsedOutput , context ) : Promise < InsufficientCapacityException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_0InsufficientCapacityException ( body , context ) ; const contents = { name : "InsufficientCapacityException" , $fault : "server" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_0InternalServerErrorResponse = async ( parsedOutput , context ) : Promise < InternalServerError > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_0InternalServerError ( body , context ) ; const contents = { name : "InternalServerError" , $fault : "server" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_0InvalidOperationExceptionResponse = async ( parsedOutput , context ) : Promise < InvalidOperationException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_0InvalidOperationException ( body , context ) ; const contents = { name : "InvalidOperationException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_0InvalidRequestExceptionResponse = async ( parsedOutput , context ) : Promise < InvalidRequestException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_0InvalidRequestException ( body , context ) ; const contents = { name : "InvalidRequestException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_0InvalidResourcePolicyExceptionResponse = async ( parsedOutput , context ) : Promise < InvalidResourcePolicyException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_0InvalidResourcePolicyException ( body , context ) ; const contents = { name : "InvalidResourcePolicyException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_0InvalidTokenExceptionResponse = async ( parsedOutput , context ) : Promise < InvalidTokenException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_0InvalidTokenException ( body , context ) ; const contents = { name : "InvalidTokenException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_0LimitExceededExceptionResponse = async ( parsedOutput , context ) : Promise < LimitExceededException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_0LimitExceededException ( body , context ) ; const contents = { name : "LimitExceededException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_0LogDestinationPermissionExceptionResponse = async ( parsedOutput , context ) : Promise < LogDestinationPermissionException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_0LogDestinationPermissionException ( body , context ) ; const contents = { name : "LogDestinationPermissionException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_0ResourceNotFoundExceptionResponse = async ( parsedOutput , context ) : Promise < ResourceNotFoundException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_0ResourceNotFoundException ( body , context ) ; const contents = { name : "ResourceNotFoundException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_0ResourceOwnerCheckExceptionResponse = async ( parsedOutput , context ) : Promise < ResourceOwnerCheckException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_0ResourceOwnerCheckException ( body , context ) ; const contents = { name : "ResourceOwnerCheckException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_0ThrottlingExceptionResponse = async ( parsedOutput , context ) : Promise < ThrottlingException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_0ThrottlingException ( body , context ) ; const contents = { name : "ThrottlingException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_0UnsupportedOperationExceptionResponse = async ( parsedOutput , context ) : Promise < UnsupportedOperationException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_0UnsupportedOperationException ( body , context ) ; const contents = { name : "UnsupportedOperationException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const serializeAws_json1_0ActionDefinition = ( input , context ) : any => { return { ... ( input . PublishMetricAction !== undefined && input . PublishMetricAction !== null && { PublishMetricAction : serializeAws_json1_0PublishMetricAction ( input . PublishMetricAction , context ) , } ) , } ; } ; const serializeAws_json1_0Address = ( input , context ) : any => { return { ... ( input . AddressDefinition !== undefined && input . AddressDefinition !== null && { AddressDefinition : input . AddressDefinition } ) , } ; } ; const serializeAws_json1_0Addresses = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return serializeAws_json1_0Address ( entry , context ) ; } ) ; } ; const serializeAws_json1_0AssociateFirewallPolicyRequest = ( input , context ) : any => { return { ... ( input . FirewallArn !== undefined && input . FirewallArn !== null && { FirewallArn : input . FirewallArn } ) , ... ( input . FirewallName !== undefined && input . FirewallName !== null && { FirewallName : input . FirewallName } ) , ... ( input . FirewallPolicyArn !== undefined && input . FirewallPolicyArn !== null && { FirewallPolicyArn : input . FirewallPolicyArn } ) , ... ( input . UpdateToken !== undefined && input . UpdateToken !== null && { UpdateToken : input . UpdateToken } ) , } ; } ; const serializeAws_json1_0AssociateSubnetsRequest = ( input , context ) : any => { return { ... ( input . FirewallArn !== undefined && input . FirewallArn !== null && { FirewallArn : input . FirewallArn } ) , ... ( input . FirewallName !== undefined && input . FirewallName !== null && { FirewallName : input . FirewallName } ) , ... ( input . SubnetMappings !== undefined && input . SubnetMappings !== null && { SubnetMappings : serializeAws_json1_0SubnetMappings ( input . SubnetMappings , context ) , } ) , ... ( input . UpdateToken !== undefined && input . UpdateToken !== null && { UpdateToken : input . UpdateToken } ) , } ; } ; const serializeAws_json1_0AzSubnets = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return entry ; } ) ; } ; const serializeAws_json1_0CreateFirewallPolicyRequest = ( input , context ) : any => { return { ... ( input . Description !== undefined && input . Description !== null && { Description : input . Description } ) , ... ( input . DryRun !== undefined && input . DryRun !== null && { DryRun : input . DryRun } ) , ... ( input . FirewallPolicy !== undefined && input . FirewallPolicy !== null && { FirewallPolicy : serializeAws_json1_0FirewallPolicy ( input . FirewallPolicy , context ) , } ) , ... ( input . FirewallPolicyName !== undefined && input . FirewallPolicyName !== null && { FirewallPolicyName : input . FirewallPolicyName } ) , ... ( input . Tags !== undefined && input . Tags !== null && { Tags : serializeAws_json1_0TagList ( input . Tags , context ) } ) , } ; } ; const serializeAws_json1_0CreateFirewallRequest = ( input , context ) : any => { return { ... ( input . DeleteProtection !== undefined && input . DeleteProtection !== null && { DeleteProtection : input . DeleteProtection } ) , ... ( input . Description !== undefined && input . Description !== null && { Description : input . Description } ) , ... ( input . FirewallName !== undefined && input . FirewallName !== null && { FirewallName : input . FirewallName } ) , ... ( input . FirewallPolicyArn !== undefined && input . FirewallPolicyArn !== null && { FirewallPolicyArn : input . FirewallPolicyArn } ) , ... ( input . FirewallPolicyChangeProtection !== undefined && input . FirewallPolicyChangeProtection !== null && { FirewallPolicyChangeProtection : input . FirewallPolicyChangeProtection , } ) , ... ( input . SubnetChangeProtection !== undefined && input . SubnetChangeProtection !== null && { SubnetChangeProtection : input . SubnetChangeProtection } ) , ... ( input . SubnetMappings !== undefined && input . SubnetMappings !== null && { SubnetMappings : serializeAws_json1_0SubnetMappings ( input . SubnetMappings , context ) , } ) , ... ( input . Tags !== undefined && input . Tags !== null && { Tags : serializeAws_json1_0TagList ( input . Tags , context ) } ) , ... ( input . VpcId !== undefined && input . VpcId !== null && { VpcId : input . VpcId } ) , } ; } ; const serializeAws_json1_0CreateRuleGroupRequest = ( input , context ) : any => { return { ... ( input . Capacity !== undefined && input . Capacity !== null && { Capacity : input . Capacity } ) , ... ( input . Description !== undefined && input . Description !== null && { Description : input . Description } ) , ... ( input . DryRun !== undefined && input . DryRun !== null && { DryRun : input . DryRun } ) , ... ( input . RuleGroup !== undefined && input . RuleGroup !== null && { RuleGroup : serializeAws_json1_0RuleGroup ( input . RuleGroup , context ) } ) , ... ( input . RuleGroupName !== undefined && input . RuleGroupName !== null && { RuleGroupName : input . RuleGroupName } ) , ... ( input . Rules !== undefined && input . Rules !== null && { Rules : input . Rules } ) , ... ( input . Tags !== undefined && input . Tags !== null && { Tags : serializeAws_json1_0TagList ( input . Tags , context ) } ) , ... ( input . Type !== undefined && input . Type !== null && { Type : input . Type } ) , } ; } ; const serializeAws_json1_0CustomAction = ( input , context ) : any => { return { ... ( input . ActionDefinition !== undefined && input . ActionDefinition !== null && { ActionDefinition : serializeAws_json1_0ActionDefinition ( input . ActionDefinition , context ) , } ) , ... ( input . ActionName !== undefined && input . ActionName !== null && { ActionName : input . ActionName } ) , } ; } ; const serializeAws_json1_0CustomActions = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return serializeAws_json1_0CustomAction ( entry , context ) ; } ) ; } ; const serializeAws_json1_0DeleteFirewallPolicyRequest = ( input , context ) : any => { return { ... ( input . FirewallPolicyArn !== undefined && input . FirewallPolicyArn !== null && { FirewallPolicyArn : input . FirewallPolicyArn } ) , ... ( input . FirewallPolicyName !== undefined && input . FirewallPolicyName !== null && { FirewallPolicyName : input . FirewallPolicyName } ) , } ; } ; const serializeAws_json1_0DeleteFirewallRequest = ( input , context ) : any => { return { ... ( input . FirewallArn !== undefined && input . FirewallArn !== null && { FirewallArn : input . FirewallArn } ) , ... ( input . FirewallName !== undefined && input . FirewallName !== null && { FirewallName : input . FirewallName } ) , } ; } ; const serializeAws_json1_0DeleteResourcePolicyRequest = ( input , context ) : any => { return { ... ( input . ResourceArn !== undefined && input . ResourceArn !== null && { ResourceArn : input . ResourceArn } ) , } ; } ; const serializeAws_json1_0DeleteRuleGroupRequest = ( input , context ) : any => { return { ... ( input . RuleGroupArn !== undefined && input . RuleGroupArn !== null && { RuleGroupArn : input . RuleGroupArn } ) , ... ( input . RuleGroupName !== undefined && input . RuleGroupName !== null && { RuleGroupName : input . RuleGroupName } ) , ... ( input . Type !== undefined && input . Type !== null && { Type : input . Type } ) , } ; } ; const serializeAws_json1_0DescribeFirewallPolicyRequest = ( input , context ) : any => { return { ... ( input . FirewallPolicyArn !== undefined && input . FirewallPolicyArn !== null && { FirewallPolicyArn : input . FirewallPolicyArn } ) , ... ( input . FirewallPolicyName !== undefined && input . FirewallPolicyName !== null && { FirewallPolicyName : input . FirewallPolicyName } ) , } ; } ; const serializeAws_json1_0DescribeFirewallRequest = ( input , context ) : any => { return { ... ( input . FirewallArn !== undefined && input . FirewallArn !== null && { FirewallArn : input . FirewallArn } ) , ... ( input . FirewallName !== undefined && input . FirewallName !== null && { FirewallName : input . FirewallName } ) , } ; } ; const serializeAws_json1_0DescribeLoggingConfigurationRequest = ( input , context ) : any => { return { ... ( input . FirewallArn !== undefined && input . FirewallArn !== null && { FirewallArn : input . FirewallArn } ) , ... ( input . FirewallName !== undefined && input . FirewallName !== null && { FirewallName : input . FirewallName } ) , } ; } ; const serializeAws_json1_0DescribeResourcePolicyRequest = ( input , context ) : any => { return { ... ( input . ResourceArn !== undefined && input . ResourceArn !== null && { ResourceArn : input . ResourceArn } ) , } ; } ; const serializeAws_json1_0DescribeRuleGroupMetadataRequest = ( input , context ) : any => { return { ... ( input . RuleGroupArn !== undefined && input . RuleGroupArn !== null && { RuleGroupArn : input . RuleGroupArn } ) , ... ( input . RuleGroupName !== undefined && input . RuleGroupName !== null && { RuleGroupName : input . RuleGroupName } ) , ... ( input . Type !== undefined && input . Type !== null && { Type : input . Type } ) , } ; } ; const serializeAws_json1_0DescribeRuleGroupRequest = ( input , context ) : any => { return { ... ( input . RuleGroupArn !== undefined && input . RuleGroupArn !== null && { RuleGroupArn : input . RuleGroupArn } ) , ... ( input . RuleGroupName !== undefined && input . RuleGroupName !== null && { RuleGroupName : input . RuleGroupName } ) , ... ( input . Type !== undefined && input . Type !== null && { Type : input . Type } ) , } ; } ; const serializeAws_json1_0Dimension = ( input , context ) : any => { return { ... ( input . Value !== undefined && input . Value !== null && { Value : input . Value } ) , } ; } ; const serializeAws_json1_0Dimensions = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return serializeAws_json1_0Dimension ( entry , context ) ; } ) ; } ; const serializeAws_json1_0DisassociateSubnetsRequest = ( input , context ) : any => { return { ... ( input . FirewallArn !== undefined && input . FirewallArn !== null && { FirewallArn : input . FirewallArn } ) , ... ( input . FirewallName !== undefined && input . FirewallName !== null && { FirewallName : input . FirewallName } ) , ... ( input . SubnetIds !== undefined && input . SubnetIds !== null && { SubnetIds : serializeAws_json1_0AzSubnets ( input . SubnetIds , context ) } ) , ... ( input . UpdateToken !== undefined && input . UpdateToken !== null && { UpdateToken : input . UpdateToken } ) , } ; } ; const serializeAws_json1_0FirewallPolicy = ( input , context ) : any => { return { ... ( input . StatefulDefaultActions !== undefined && input . StatefulDefaultActions !== null && { StatefulDefaultActions : serializeAws_json1_0StatefulActions ( input . StatefulDefaultActions , context ) , } ) , ... ( input . StatefulEngineOptions !== undefined && input . StatefulEngineOptions !== null && { StatefulEngineOptions : serializeAws_json1_0StatefulEngineOptions ( input . StatefulEngineOptions , context ) , } ) , ... ( input . StatefulRuleGroupReferences !== undefined && input . StatefulRuleGroupReferences !== null && { StatefulRuleGroupReferences : serializeAws_json1_0StatefulRuleGroupReferences ( input . StatefulRuleGroupReferences , context ) , } ) , ... ( input . StatelessCustomActions !== undefined && input . StatelessCustomActions !== null && { StatelessCustomActions : serializeAws_json1_0CustomActions ( input . StatelessCustomActions , context ) , } ) , ... ( input . StatelessDefaultActions !== undefined && input . StatelessDefaultActions !== null && { StatelessDefaultActions : serializeAws_json1_0StatelessActions ( input . StatelessDefaultActions , context ) , } ) , ... ( input . StatelessFragmentDefaultActions !== undefined && input . StatelessFragmentDefaultActions !== null && { StatelessFragmentDefaultActions : serializeAws_json1_0StatelessActions ( input . StatelessFragmentDefaultActions , context ) , } ) , ... ( input . StatelessRuleGroupReferences !== undefined && input . StatelessRuleGroupReferences !== null && { StatelessRuleGroupReferences : serializeAws_json1_0StatelessRuleGroupReferences ( input . StatelessRuleGroupReferences , context ) , } ) , } ; } ; const serializeAws_json1_0Flags = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return entry ; } ) ; } ; const serializeAws_json1_0Header = ( input , context ) : any => { return { ... ( input . Destination !== undefined && input . Destination !== null && { Destination : input . Destination } ) , ... ( input . DestinationPort !== undefined && input . DestinationPort !== null && { DestinationPort : input . DestinationPort } ) , ... ( input . Direction !== undefined && input . Direction !== null && { Direction : input . Direction } ) , ... ( input . Protocol !== undefined && input . Protocol !== null && { Protocol : input . Protocol } ) , ... ( input . Source !== undefined && input . Source !== null && { Source : input . Source } ) , ... ( input . SourcePort !== undefined && input . SourcePort !== null && { SourcePort : input . SourcePort } ) , } ; } ; const serializeAws_json1_0IPSet = ( input , context ) : any => { return { ... ( input . Definition !== undefined && input . Definition !== null && { Definition : serializeAws_json1_0VariableDefinitionList ( input . Definition , context ) , } ) , } ; } ; const serializeAws_json1_0IPSets = ( input , context ) : any => { return Object . entries ( input ) . reduce ( ( acc , [ key , value ] ) => { if ( value === null ) { return acc ; } return { ... acc , [ key ] : serializeAws_json1_0IPSet ( value , context ) , } ; } , { } ) ; } ; const serializeAws_json1_0ListFirewallPoliciesRequest = ( input , context ) : any => { return { ... ( input . MaxResults !== undefined && input . MaxResults !== null && { MaxResults : input . MaxResults } ) , ... ( input . NextToken !== undefined && input . NextToken !== null && { NextToken : input . NextToken } ) , } ; } ; const serializeAws_json1_0ListFirewallsRequest = ( input , context ) : any => { return { ... ( input . MaxResults !== undefined && input . MaxResults !== null && { MaxResults : input . MaxResults } ) , ... ( input . NextToken !== undefined && input . NextToken !== null && { NextToken : input . NextToken } ) , ... ( input . VpcIds !== undefined && input . VpcIds !== null && { VpcIds : serializeAws_json1_0VpcIds ( input . VpcIds , context ) } ) , } ; } ; const serializeAws_json1_0ListRuleGroupsRequest = ( input , context ) : any => { return { ... ( input . MaxResults !== undefined && input . MaxResults !== null && { MaxResults : input . MaxResults } ) , ... ( input . NextToken !== undefined && input . NextToken !== null && { NextToken : input . NextToken } ) , ... ( input . Scope !== undefined && input . Scope !== null && { Scope : input . Scope } ) , } ; } ; const serializeAws_json1_0ListTagsForResourceRequest = ( input , context ) : any => { return { ... ( input . MaxResults !== undefined && input . MaxResults !== null && { MaxResults : input . MaxResults } ) , ... ( input . NextToken !== undefined && input . NextToken !== null && { NextToken : input . NextToken } ) , ... ( input . ResourceArn !== undefined && input . ResourceArn !== null && { ResourceArn : input . ResourceArn } ) , } ; } ; const serializeAws_json1_0LogDestinationConfig = ( input , context ) : any => { return { ... ( input . LogDestination !== undefined && input . LogDestination !== null && { LogDestination : serializeAws_json1_0LogDestinationMap ( input . LogDestination , context ) , } ) , ... ( input . LogDestinationType !== undefined && input . LogDestinationType !== null && { LogDestinationType : input . LogDestinationType } ) , ... ( input . LogType !== undefined && input . LogType !== null && { LogType : input . LogType } ) , } ; } ; const serializeAws_json1_0LogDestinationConfigs = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return serializeAws_json1_0LogDestinationConfig ( entry , context ) ; } ) ; } ; const serializeAws_json1_0LogDestinationMap = ( input , context ) : any => { return Object . entries ( input ) . reduce ( ( acc , [ key , value ] ) => { if ( value === null ) { return acc ; } return { ... acc , [ key ] : value , } ; } , { } ) ; } ; const serializeAws_json1_0LoggingConfiguration = ( input , context ) : any => { return { ... ( input . LogDestinationConfigs !== undefined && input . LogDestinationConfigs !== null && { LogDestinationConfigs : serializeAws_json1_0LogDestinationConfigs ( input . LogDestinationConfigs , context ) , } ) , } ; } ; const serializeAws_json1_0MatchAttributes = ( input , context ) : any => { return { ... ( input . DestinationPorts !== undefined && input . DestinationPorts !== null && { DestinationPorts : serializeAws_json1_0PortRanges ( input . DestinationPorts , context ) , } ) , ... ( input . Destinations !== undefined && input . Destinations !== null && { Destinations : serializeAws_json1_0Addresses ( input . Destinations , context ) } ) , ... ( input . Protocols !== undefined && input . Protocols !== null && { Protocols : serializeAws_json1_0ProtocolNumbers ( input . Protocols , context ) } ) , ... ( input . SourcePorts !== undefined && input . SourcePorts !== null && { SourcePorts : serializeAws_json1_0PortRanges ( input . SourcePorts , context ) } ) , ... ( input . Sources !== undefined && input . Sources !== null && { Sources : serializeAws_json1_0Addresses ( input . Sources , context ) } ) , ... ( input . TCPFlags !== undefined && input . TCPFlags !== null && { TCPFlags : serializeAws_json1_0TCPFlags ( input . TCPFlags , context ) } ) , } ; } ; const serializeAws_json1_0PortRange = ( input , context ) : any => { return { ... ( input . FromPort !== undefined && input . FromPort !== null && { FromPort : input . FromPort } ) , ... ( input . ToPort !== undefined && input . ToPort !== null && { ToPort : input . ToPort } ) , } ; } ; const serializeAws_json1_0PortRanges = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return serializeAws_json1_0PortRange ( entry , context ) ; } ) ; } ; const serializeAws_json1_0PortSet = ( input , context ) : any => { return { ... ( input . Definition !== undefined && input . Definition !== null && { Definition : serializeAws_json1_0VariableDefinitionList ( input . Definition , context ) , } ) , } ; } ; const serializeAws_json1_0PortSets = ( input , context ) : any => { return Object . entries ( input ) . reduce ( ( acc , [ key , value ] ) => { if ( value === null ) { return acc ; } return { ... acc , [ key ] : serializeAws_json1_0PortSet ( value , context ) , } ; } , { } ) ; } ; const serializeAws_json1_0ProtocolNumbers = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return entry ; } ) ; } ; const serializeAws_json1_0PublishMetricAction = ( input , context ) : any => { return { ... ( input . Dimensions !== undefined && input . Dimensions !== null && { Dimensions : serializeAws_json1_0Dimensions ( input . Dimensions , context ) } ) , } ; } ; const serializeAws_json1_0PutResourcePolicyRequest = ( input , context ) : any => { return { ... ( input . Policy !== undefined && input . Policy !== null && { Policy : input . Policy } ) , ... ( input . ResourceArn !== undefined && input . ResourceArn !== null && { ResourceArn : input . ResourceArn } ) , } ; } ; const serializeAws_json1_0RuleDefinition = ( input , context ) : any => { return { ... ( input . Actions !== undefined && input . Actions !== null && { Actions : serializeAws_json1_0StatelessActions ( input . Actions , context ) } ) , ... ( input . MatchAttributes !== undefined && input . MatchAttributes !== null && { MatchAttributes : serializeAws_json1_0MatchAttributes ( input . MatchAttributes , context ) , } ) , } ; } ; const serializeAws_json1_0RuleGroup = ( input , context ) : any => { return { ... ( input . RuleVariables !== undefined && input . RuleVariables !== null && { RuleVariables : serializeAws_json1_0RuleVariables ( input . RuleVariables , context ) , } ) , ... ( input . RulesSource !== undefined && input . RulesSource !== null && { RulesSource : serializeAws_json1_0RulesSource ( input . RulesSource , context ) } ) , ... ( input . StatefulRuleOptions !== undefined && input . StatefulRuleOptions !== null && { StatefulRuleOptions : serializeAws_json1_0StatefulRuleOptions ( input . StatefulRuleOptions , context ) , } ) , } ; } ; const serializeAws_json1_0RuleOption = ( input , context ) : any => { return { ... ( input . Keyword !== undefined && input . Keyword !== null && { Keyword : input . Keyword } ) , ... ( input . Settings !== undefined && input . Settings !== null && { Settings : serializeAws_json1_0Settings ( input . Settings , context ) } ) , } ; } ; const serializeAws_json1_0RuleOptions = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return serializeAws_json1_0RuleOption ( entry , context ) ; } ) ; } ; const serializeAws_json1_0RulesSource = ( input , context ) : any => { return { ... ( input . RulesSourceList !== undefined && input . RulesSourceList !== null && { RulesSourceList : serializeAws_json1_0RulesSourceList ( input . RulesSourceList , context ) , } ) , ... ( input . RulesString !== undefined && input . RulesString !== null && { RulesString : input . RulesString } ) , ... ( input . StatefulRules !== undefined && input . StatefulRules !== null && { StatefulRules : serializeAws_json1_0StatefulRules ( input . StatefulRules , context ) , } ) , ... ( input . StatelessRulesAndCustomActions !== undefined && input . StatelessRulesAndCustomActions !== null && { StatelessRulesAndCustomActions : serializeAws_json1_0StatelessRulesAndCustomActions ( input . StatelessRulesAndCustomActions , context ) , } ) , } ; } ; const serializeAws_json1_0RulesSourceList = ( input , context ) : any => { return { ... ( input . GeneratedRulesType !== undefined && input . GeneratedRulesType !== null && { GeneratedRulesType : input . GeneratedRulesType } ) , ... ( input . TargetTypes !== undefined && input . TargetTypes !== null && { TargetTypes : serializeAws_json1_0TargetTypes ( input . TargetTypes , context ) } ) , ... ( input . Targets !== undefined && input . Targets !== null && { Targets : serializeAws_json1_0RuleTargets ( input . Targets , context ) } ) , } ; } ; const serializeAws_json1_0RuleTargets = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return entry ; } ) ; } ; const serializeAws_json1_0RuleVariables = ( input , context ) : any => { return { ... ( input . IPSets !== undefined && input . IPSets !== null && { IPSets : serializeAws_json1_0IPSets ( input . IPSets , context ) } ) , ... ( input . PortSets !== undefined && input . PortSets !== null && { PortSets : serializeAws_json1_0PortSets ( input . PortSets , context ) } ) , } ; } ; const serializeAws_json1_0Settings = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return entry ; } ) ; } ; const serializeAws_json1_0StatefulActions = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return entry ; } ) ; } ; const serializeAws_json1_0StatefulEngineOptions = ( input , context ) : any => { return { ... ( input . RuleOrder !== undefined && input . RuleOrder !== null && { RuleOrder : input . RuleOrder } ) , } ; } ; const serializeAws_json1_0StatefulRule = ( input , context ) : any => { return { ... ( input . Action !== undefined && input . Action !== null && { Action : input . Action } ) , ... ( input . Header !== undefined && input . Header !== null && { Header : serializeAws_json1_0Header ( input . Header , context ) } ) , ... ( input . RuleOptions !== undefined && input . RuleOptions !== null && { RuleOptions : serializeAws_json1_0RuleOptions ( input . RuleOptions , context ) } ) , } ; } ; const serializeAws_json1_0StatefulRuleGroupOverride = ( input , context ) : any => { return { ... ( input . Action !== undefined && input . Action !== null && { Action : input . Action } ) , } ; } ; const serializeAws_json1_0StatefulRuleGroupReference = ( input , context ) : any => { return { ... ( input . Override !== undefined && input . Override !== null && { Override : serializeAws_json1_0StatefulRuleGroupOverride ( input . Override , context ) } ) , ... ( input . Priority !== undefined && input . Priority !== null && { Priority : input . Priority } ) , ... ( input . ResourceArn !== undefined && input . ResourceArn !== null && { ResourceArn : input . ResourceArn } ) , } ; } ; const serializeAws_json1_0StatefulRuleGroupReferences = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return serializeAws_json1_0StatefulRuleGroupReference ( entry , context ) ; } ) ; } ; const serializeAws_json1_0StatefulRuleOptions = ( input , context ) : any => { return { ... ( input . RuleOrder !== undefined && input . RuleOrder !== null && { RuleOrder : input . RuleOrder } ) , } ; } ; const serializeAws_json1_0StatefulRules = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return serializeAws_json1_0StatefulRule ( entry , context ) ; } ) ; } ; const serializeAws_json1_0StatelessActions = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return entry ; } ) ; } ; const serializeAws_json1_0StatelessRule = ( input , context ) : any => { return { ... ( input . Priority !== undefined && input . Priority !== null && { Priority : input . Priority } ) , ... ( input . RuleDefinition !== undefined && input . RuleDefinition !== null && { RuleDefinition : serializeAws_json1_0RuleDefinition ( input . RuleDefinition , context ) , } ) , } ; } ; const serializeAws_json1_0StatelessRuleGroupReference = ( input , context ) : any => { return { ... ( input . Priority !== undefined && input . Priority !== null && { Priority : input . Priority } ) , ... ( input . ResourceArn !== undefined && input . ResourceArn !== null && { ResourceArn : input . ResourceArn } ) , } ; } ; const serializeAws_json1_0StatelessRuleGroupReferences = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return serializeAws_json1_0StatelessRuleGroupReference ( entry , context ) ; } ) ; } ; const serializeAws_json1_0StatelessRules = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return serializeAws_json1_0StatelessRule ( entry , context ) ; } ) ; } ; const serializeAws_json1_0StatelessRulesAndCustomActions = ( input , context ) : any => { return { ... ( input . CustomActions !== undefined && input . CustomActions !== null && { CustomActions : serializeAws_json1_0CustomActions ( input . CustomActions , context ) , } ) , ... ( input . StatelessRules !== undefined && input . StatelessRules !== null && { StatelessRules : serializeAws_json1_0StatelessRules ( input . StatelessRules , context ) , } ) , } ; } ; const serializeAws_json1_0SubnetMapping = ( input , context ) : any => { return { ... ( input . SubnetId !== undefined && input . SubnetId !== null && { SubnetId : input . SubnetId } ) , } ; } ; const serializeAws_json1_0SubnetMappings = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return serializeAws_json1_0SubnetMapping ( entry , context ) ; } ) ; } ; const serializeAws_json1_0Tag = ( input , context ) : any => { return { ... ( input . Key !== undefined && input . Key !== null && { Key : input . Key } ) , ... ( input . Value !== undefined && input . Value !== null && { Value : input . Value } ) , } ; } ; const serializeAws_json1_0TagKeyList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return entry ; } ) ; } ; const serializeAws_json1_0TagList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return serializeAws_json1_0Tag ( entry , context ) ; } ) ; } ; const serializeAws_json1_0TagResourceRequest = ( input , context ) : any => { return { ... ( input . ResourceArn !== undefined && input . ResourceArn !== null && { ResourceArn : input . ResourceArn } ) , ... ( input . Tags !== undefined && input . Tags !== null && { Tags : serializeAws_json1_0TagList ( input . Tags , context ) } ) , } ; } ; const serializeAws_json1_0TargetTypes = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return entry ; } ) ; } ; const serializeAws_json1_0TCPFlagField = ( input , context ) : any => { return { ... ( input . Flags !== undefined && input . Flags !== null && { Flags : serializeAws_json1_0Flags ( input . Flags , context ) } ) , ... ( input . Masks !== undefined && input . Masks !== null && { Masks : serializeAws_json1_0Flags ( input . Masks , context ) } ) , } ; } ; const serializeAws_json1_0TCPFlags = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return serializeAws_json1_0TCPFlagField ( entry , context ) ; } ) ; } ; const serializeAws_json1_0UntagResourceRequest = ( input , context ) : any => { return { ... ( input . ResourceArn !== undefined && input . ResourceArn !== null && { ResourceArn : input . ResourceArn } ) , ... ( input . TagKeys !== undefined && input . TagKeys !== null && { TagKeys : serializeAws_json1_0TagKeyList ( input . TagKeys , context ) } ) , } ; } ; const serializeAws_json1_0UpdateFirewallDeleteProtectionRequest = ( input , context ) : any => { return { ... ( input . DeleteProtection !== undefined && input . DeleteProtection !== null && { DeleteProtection : input . DeleteProtection } ) , ... ( input . FirewallArn !== undefined && input . FirewallArn !== null && { FirewallArn : input . FirewallArn } ) , ... ( input . FirewallName !== undefined && input . FirewallName !== null && { FirewallName : input . FirewallName } ) , ... ( input . UpdateToken !== undefined && input . UpdateToken !== null && { UpdateToken : input . UpdateToken } ) , } ; } ; const serializeAws_json1_0UpdateFirewallDescriptionRequest = ( input , context ) : any => { return { ... ( input . Description !== undefined && input . Description !== null && { Description : input . Description } ) , ... ( input . FirewallArn !== undefined && input . FirewallArn !== null && { FirewallArn : input . FirewallArn } ) , ... ( input . FirewallName !== undefined && input . FirewallName !== null && { FirewallName : input . FirewallName } ) , ... ( input . UpdateToken !== undefined && input . UpdateToken !== null && { UpdateToken : input . UpdateToken } ) , } ; } ; const serializeAws_json1_0UpdateFirewallPolicyChangeProtectionRequest = ( input , context ) : any => { return { ... ( input . FirewallArn !== undefined && input . FirewallArn !== null && { FirewallArn : input . FirewallArn } ) , ... ( input . FirewallName !== undefined && input . FirewallName !== null && { FirewallName : input . FirewallName } ) , ... ( input . FirewallPolicyChangeProtection !== undefined && input . FirewallPolicyChangeProtection !== null && { FirewallPolicyChangeProtection : input . FirewallPolicyChangeProtection , } ) , ... ( input . UpdateToken !== undefined && input . UpdateToken !== null && { UpdateToken : input . UpdateToken } ) , } ; } ; const serializeAws_json1_0UpdateFirewallPolicyRequest = ( input , context ) : any => { return { ... ( input . Description !== undefined && input . Description !== null && { Description : input . Description } ) , ... ( input . DryRun !== undefined && input . DryRun !== null && { DryRun : input . DryRun } ) , ... ( input . FirewallPolicy !== undefined && input . FirewallPolicy !== null && { FirewallPolicy : serializeAws_json1_0FirewallPolicy ( input . FirewallPolicy , context ) , } ) , ... ( input . FirewallPolicyArn !== undefined && input . FirewallPolicyArn !== null && { FirewallPolicyArn : input . FirewallPolicyArn } ) , ... ( input . FirewallPolicyName !== undefined && input . FirewallPolicyName !== null && { FirewallPolicyName : input . FirewallPolicyName } ) , ... ( input . UpdateToken !== undefined && input . UpdateToken !== null && { UpdateToken : input . UpdateToken } ) , } ; } ; const serializeAws_json1_0UpdateLoggingConfigurationRequest = ( input , context ) : any => { return { ... ( input . FirewallArn !== undefined && input . FirewallArn !== null && { FirewallArn : input . FirewallArn } ) , ... ( input . FirewallName !== undefined && input . FirewallName !== null && { FirewallName : input . FirewallName } ) , ... ( input . LoggingConfiguration !== undefined && input . LoggingConfiguration !== null && { LoggingConfiguration : serializeAws_json1_0LoggingConfiguration ( input . LoggingConfiguration , context ) , } ) , } ; } ; const serializeAws_json1_0UpdateRuleGroupRequest = ( input , context ) : any => { return { ... ( input . Description !== undefined && input . Description !== null && { Description : input . Description } ) , ... ( input . DryRun !== undefined && input . DryRun !== null && { DryRun : input . DryRun } ) , ... ( input . RuleGroup !== undefined && input . RuleGroup !== null && { RuleGroup : serializeAws_json1_0RuleGroup ( input . RuleGroup , context ) } ) , ... ( input . RuleGroupArn !== undefined && input . RuleGroupArn !== null && { RuleGroupArn : input . RuleGroupArn } ) , ... ( input . RuleGroupName !== undefined && input . RuleGroupName !== null && { RuleGroupName : input . RuleGroupName } ) , ... ( input . Rules !== undefined && input . Rules !== null && { Rules : input . Rules } ) , ... ( input . Type !== undefined && input . Type !== null && { Type : input . Type } ) , ... ( input . UpdateToken !== undefined && input . UpdateToken !== null && { UpdateToken : input . UpdateToken } ) , } ; } ; const serializeAws_json1_0UpdateSubnetChangeProtectionRequest = ( input , context ) : any => { return { ... ( input . FirewallArn !== undefined && input . FirewallArn !== null && { FirewallArn : input . FirewallArn } ) , ... ( input . FirewallName !== undefined && input . FirewallName !== null && { FirewallName : input . FirewallName } ) , ... ( input . SubnetChangeProtection !== undefined && input . SubnetChangeProtection !== null && { SubnetChangeProtection : input . SubnetChangeProtection } ) , ... ( input . UpdateToken !== undefined && input . UpdateToken !== null && { UpdateToken : input . UpdateToken } ) , } ; } ; const serializeAws_json1_0VariableDefinitionList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return entry ; } ) ; } ; const serializeAws_json1_0VpcIds = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return entry ; } ) ; } ; const deserializeAws_json1_0ActionDefinition = ( output , context ) : ActionDefinition => { return { PublishMetricAction : output . PublishMetricAction !== undefined && output . PublishMetricAction !== null ? deserializeAws_json1_0PublishMetricAction ( output . PublishMetricAction , context ) : undefined , } as any ; } ; const deserializeAws_json1_0Address = ( output , context ) : Address => { return { AddressDefinition : __expectString ( output . AddressDefinition ) , } as any ; } ; const deserializeAws_json1_0Addresses = ( output , context ) : Address [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_0Address ( entry , context ) ; } ) ; } ; const deserializeAws_json1_0AssociateFirewallPolicyResponse = ( output , context ) : AssociateFirewallPolicyResponse => { return { FirewallArn : __expectString ( output . FirewallArn ) , FirewallName : __expectString ( output . FirewallName ) , FirewallPolicyArn : __expectString ( output . FirewallPolicyArn ) , UpdateToken : __expectString ( output . UpdateToken ) , } as any ; } ; const deserializeAws_json1_0AssociateSubnetsResponse = ( output , context ) : AssociateSubnetsResponse => { return { FirewallArn : __expectString ( output . FirewallArn ) , FirewallName : __expectString ( output . FirewallName ) , SubnetMappings : output . SubnetMappings !== undefined && output . SubnetMappings !== null ? deserializeAws_json1_0SubnetMappings ( output . SubnetMappings , context ) : undefined , UpdateToken : __expectString ( output . UpdateToken ) , } as any ; } ; const deserializeAws_json1_0Attachment = ( output , context ) : Attachment => { return { EndpointId : __expectString ( output . EndpointId ) , Status : __expectString ( output . Status ) , SubnetId : __expectString ( output . SubnetId ) , } as any ; } ; const deserializeAws_json1_0CreateFirewallPolicyResponse = ( output , context ) : CreateFirewallPolicyResponse => { return { FirewallPolicyResponse : output . FirewallPolicyResponse !== undefined && output . FirewallPolicyResponse !== null ? deserializeAws_json1_0FirewallPolicyResponse ( output . FirewallPolicyResponse , context ) : undefined , UpdateToken : __expectString ( output . UpdateToken ) , } as any ; } ; const deserializeAws_json1_0CreateFirewallResponse = ( output , context ) : CreateFirewallResponse => { return { Firewall : output . Firewall !== undefined && output . Firewall !== null ? deserializeAws_json1_0Firewall ( output . Firewall , context ) : undefined , FirewallStatus : output . FirewallStatus !== undefined && output . FirewallStatus !== null ? deserializeAws_json1_0FirewallStatus ( output . FirewallStatus , context ) : undefined , } as any ; } ; const deserializeAws_json1_0CreateRuleGroupResponse = ( output , context ) : CreateRuleGroupResponse => { return { RuleGroupResponse : output . RuleGroupResponse !== undefined && output . RuleGroupResponse !== null ? deserializeAws_json1_0RuleGroupResponse ( output . RuleGroupResponse , context ) : undefined , UpdateToken : __expectString ( output . UpdateToken ) , } as any ; } ; const deserializeAws_json1_0CustomAction = ( output , context ) : CustomAction => { return { ActionDefinition : output . ActionDefinition !== undefined && output . ActionDefinition !== null ? deserializeAws_json1_0ActionDefinition ( output . ActionDefinition , context ) : undefined , ActionName : __expectString ( output . ActionName ) , } as any ; } ; const deserializeAws_json1_0CustomActions = ( output , context ) : CustomAction [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_0CustomAction ( entry , context ) ; } ) ; } ; const deserializeAws_json1_0DeleteFirewallPolicyResponse = ( output , context ) : DeleteFirewallPolicyResponse => { return { FirewallPolicyResponse : output . FirewallPolicyResponse !== undefined && output . FirewallPolicyResponse !== null ? deserializeAws_json1_0FirewallPolicyResponse ( output . FirewallPolicyResponse , context ) : undefined , } as any ; } ; const deserializeAws_json1_0DeleteFirewallResponse = ( output , context ) : DeleteFirewallResponse => { return { Firewall : output . Firewall !== undefined && output . Firewall !== null ? deserializeAws_json1_0Firewall ( output . Firewall , context ) : undefined , FirewallStatus : output . FirewallStatus !== undefined && output . FirewallStatus !== null ? deserializeAws_json1_0FirewallStatus ( output . FirewallStatus , context ) : undefined , } as any ; } ; const deserializeAws_json1_0DeleteResourcePolicyResponse = ( output , context ) : DeleteResourcePolicyResponse => { return { } as any ; } ; const deserializeAws_json1_0DeleteRuleGroupResponse = ( output , context ) : DeleteRuleGroupResponse => { return { RuleGroupResponse : output . RuleGroupResponse !== undefined && output . RuleGroupResponse !== null ? deserializeAws_json1_0RuleGroupResponse ( output . RuleGroupResponse , context ) : undefined , } as any ; } ; const deserializeAws_json1_0DescribeFirewallPolicyResponse = ( output , context ) : DescribeFirewallPolicyResponse => { return { FirewallPolicy : output . FirewallPolicy !== undefined && output . FirewallPolicy !== null ? deserializeAws_json1_0FirewallPolicy ( output . FirewallPolicy , context ) : undefined , FirewallPolicyResponse : output . FirewallPolicyResponse !== undefined && output . FirewallPolicyResponse !== null ? deserializeAws_json1_0FirewallPolicyResponse ( output . FirewallPolicyResponse , context ) : undefined , UpdateToken : __expectString ( output . UpdateToken ) , } as any ; } ; const deserializeAws_json1_0DescribeFirewallResponse = ( output , context ) : DescribeFirewallResponse => { return { Firewall : output . Firewall !== undefined && output . Firewall !== null ? deserializeAws_json1_0Firewall ( output . Firewall , context ) : undefined , FirewallStatus : output . FirewallStatus !== undefined && output . FirewallStatus !== null ? deserializeAws_json1_0FirewallStatus ( output . FirewallStatus , context ) : undefined , UpdateToken : __expectString ( output . UpdateToken ) , } as any ; } ; const deserializeAws_json1_0DescribeLoggingConfigurationResponse = ( output , context ) : DescribeLoggingConfigurationResponse => { return { FirewallArn : __expectString ( output . FirewallArn ) , LoggingConfiguration : output . LoggingConfiguration !== undefined && output . LoggingConfiguration !== null ? deserializeAws_json1_0LoggingConfiguration ( output . LoggingConfiguration , context ) : undefined , } as any ; } ; const deserializeAws_json1_0DescribeResourcePolicyResponse = ( output , context ) : DescribeResourcePolicyResponse => { return { Policy : __expectString ( output . Policy ) , } as any ; } ; const deserializeAws_json1_0DescribeRuleGroupMetadataResponse = ( output , context ) : DescribeRuleGroupMetadataResponse => { return { Capacity : __expectInt32 ( output . Capacity ) , Description : __expectString ( output . Description ) , RuleGroupArn : __expectString ( output . RuleGroupArn ) , RuleGroupName : __expectString ( output . RuleGroupName ) , StatefulRuleOptions : output . StatefulRuleOptions !== undefined && output . StatefulRuleOptions !== null ? deserializeAws_json1_0StatefulRuleOptions ( output . StatefulRuleOptions , context ) : undefined , Type : __expectString ( output . Type ) , } as any ; } ; const deserializeAws_json1_0DescribeRuleGroupResponse = ( output , context ) : DescribeRuleGroupResponse => { return { RuleGroup : output . RuleGroup !== undefined && output . RuleGroup !== null ? deserializeAws_json1_0RuleGroup ( output . RuleGroup , context ) : undefined , RuleGroupResponse : output . RuleGroupResponse !== undefined && output . RuleGroupResponse !== null ? deserializeAws_json1_0RuleGroupResponse ( output . RuleGroupResponse , context ) : undefined , UpdateToken : __expectString ( output . UpdateToken ) , } as any ; } ; const deserializeAws_json1_0Dimension = ( output , context ) : Dimension => { return { Value : __expectString ( output . Value ) , } as any ; } ; const deserializeAws_json1_0Dimensions = ( output , context ) : Dimension [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_0Dimension ( entry , context ) ; } ) ; } ; const deserializeAws_json1_0DisassociateSubnetsResponse = ( output , context ) : DisassociateSubnetsResponse => { return { FirewallArn : __expectString ( output . FirewallArn ) , FirewallName : __expectString ( output . FirewallName ) , SubnetMappings : output . SubnetMappings !== undefined && output . SubnetMappings !== null ? deserializeAws_json1_0SubnetMappings ( output . SubnetMappings , context ) : undefined , UpdateToken : __expectString ( output . UpdateToken ) , } as any ; } ; const deserializeAws_json1_0Firewall = ( output , context ) : Firewall => { return { DeleteProtection : __expectBoolean ( output . DeleteProtection ) , Description : __expectString ( output . Description ) , FirewallArn : __expectString ( output . FirewallArn ) , FirewallId : __expectString ( output . FirewallId ) , FirewallName : __expectString ( output . FirewallName ) , FirewallPolicyArn : __expectString ( output . FirewallPolicyArn ) , FirewallPolicyChangeProtection : __expectBoolean ( output . FirewallPolicyChangeProtection ) , SubnetChangeProtection : __expectBoolean ( output . SubnetChangeProtection ) , SubnetMappings : output . SubnetMappings !== undefined && output . SubnetMappings !== null ? deserializeAws_json1_0SubnetMappings ( output . SubnetMappings , context ) : undefined , Tags : output . Tags !== undefined && output . Tags !== null ? deserializeAws_json1_0TagList ( output . Tags , context ) : undefined , VpcId : __expectString ( output . VpcId ) , } as any ; } ; const deserializeAws_json1_0FirewallMetadata = ( output , context ) : FirewallMetadata => { return { FirewallArn : __expectString ( output . FirewallArn ) , FirewallName : __expectString ( output . FirewallName ) , } as any ; } ; const deserializeAws_json1_0FirewallPolicies = ( output , context ) : FirewallPolicyMetadata [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_0FirewallPolicyMetadata ( entry , context ) ; } ) ; } ; const deserializeAws_json1_0FirewallPolicy = ( output , context ) : FirewallPolicy => { return { StatefulDefaultActions : output . StatefulDefaultActions !== undefined && output . StatefulDefaultActions !== null ? deserializeAws_json1_0StatefulActions ( output . StatefulDefaultActions , context ) : undefined , StatefulEngineOptions : output . StatefulEngineOptions !== undefined && output . StatefulEngineOptions !== null ? deserializeAws_json1_0StatefulEngineOptions ( output . StatefulEngineOptions , context ) : undefined , StatefulRuleGroupReferences : output . StatefulRuleGroupReferences !== undefined && output . StatefulRuleGroupReferences !== null ? deserializeAws_json1_0StatefulRuleGroupReferences ( output . StatefulRuleGroupReferences , context ) : undefined , StatelessCustomActions : output . StatelessCustomActions !== undefined && output . StatelessCustomActions !== null ? deserializeAws_json1_0CustomActions ( output . StatelessCustomActions , context ) : undefined , StatelessDefaultActions : output . StatelessDefaultActions !== undefined && output . StatelessDefaultActions !== null ? deserializeAws_json1_0StatelessActions ( output . StatelessDefaultActions , context ) : undefined , StatelessFragmentDefaultActions : output . StatelessFragmentDefaultActions !== undefined && output . StatelessFragmentDefaultActions !== null ? deserializeAws_json1_0StatelessActions ( output . StatelessFragmentDefaultActions , context ) : undefined , StatelessRuleGroupReferences : output . StatelessRuleGroupReferences !== undefined && output . StatelessRuleGroupReferences !== null ? deserializeAws_json1_0StatelessRuleGroupReferences ( output . StatelessRuleGroupReferences , context ) : undefined , } as any ; } ; const deserializeAws_json1_0FirewallPolicyMetadata = ( output , context ) : FirewallPolicyMetadata => { return { Arn : __expectString ( output . Arn ) , Name : __expectString ( output . Name ) , } as any ; } ; const deserializeAws_json1_0FirewallPolicyResponse = ( output , context ) : FirewallPolicyResponse => { return { ConsumedStatefulRuleCapacity : __expectInt32 ( output . ConsumedStatefulRuleCapacity ) , ConsumedStatelessRuleCapacity : __expectInt32 ( output . ConsumedStatelessRuleCapacity ) , Description : __expectString ( output . Description ) , FirewallPolicyArn : __expectString ( output . FirewallPolicyArn ) , FirewallPolicyId : __expectString ( output . FirewallPolicyId ) , FirewallPolicyName : __expectString ( output . FirewallPolicyName ) , FirewallPolicyStatus : __expectString ( output . FirewallPolicyStatus ) , NumberOfAssociations : __expectInt32 ( output . NumberOfAssociations ) , Tags : output . Tags !== undefined && output . Tags !== null ? deserializeAws_json1_0TagList ( output . Tags , context ) : undefined , } as any ; } ; const deserializeAws_json1_0Firewalls = ( output , context ) : FirewallMetadata [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_0FirewallMetadata ( entry , context ) ; } ) ; } ; const deserializeAws_json1_0FirewallStatus = ( output , context ) : FirewallStatus => { return { ConfigurationSyncStateSummary : __expectString ( output . ConfigurationSyncStateSummary ) , Status : __expectString ( output . Status ) , SyncStates : output . SyncStates !== undefined && output . SyncStates !== null ? deserializeAws_json1_0SyncStates ( output . SyncStates , context ) : undefined , } as any ; } ; const deserializeAws_json1_0Flags = ( output , context ) : ( TCPFlag | string ) [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return __expectString ( entry ) as any ; } ) ; } ; const deserializeAws_json1_0Header = ( output , context ) : Header => { return { Destination : __expectString ( output . Destination ) , DestinationPort : __expectString ( output . DestinationPort ) , Direction : __expectString ( output . Direction ) , Protocol : __expectString ( output . Protocol ) , Source : __expectString ( output . Source ) , SourcePort : __expectString ( output . SourcePort ) , } as any ; } ; const deserializeAws_json1_0InsufficientCapacityException = ( output , context ) : InsufficientCapacityException => { return { Message : __expectString ( output . Message ) , } as any ; } ; const deserializeAws_json1_0InternalServerError = ( output , context ) : InternalServerError => { return { Message : __expectString ( output . Message ) , } as any ; } ; const deserializeAws_json1_0InvalidOperationException = ( output , context ) : InvalidOperationException => { return { Message : __expectString ( output . Message ) , } as any ; } ; const deserializeAws_json1_0InvalidRequestException = ( output , context ) : InvalidRequestException => { return { Message : __expectString ( output . Message ) , } as any ; } ; const deserializeAws_json1_0InvalidResourcePolicyException = ( output , context ) : InvalidResourcePolicyException => { return { Message : __expectString ( output . Message ) , } as any ; } ; const deserializeAws_json1_0InvalidTokenException = ( output , context ) : InvalidTokenException => { return { Message : __expectString ( output . Message ) , } as any ; } ; const deserializeAws_json1_0IPSet = ( output , context ) : IPSet => { return { Definition : output . Definition !== undefined && output . Definition !== null ? deserializeAws_json1_0VariableDefinitionList ( output . Definition , context ) : undefined , } as any ; } ; const deserializeAws_json1_0IPSets = ( output , context ) : { [ key ] : IPSet ; } => { return Object . entries ( output ) . reduce ( ( acc , [ key , value ] ) => { if ( value === null ) { return acc ; } return { ... acc , [ key ] : deserializeAws_json1_0IPSet ( value , context ) , } ; } , { } ) ; } ; const deserializeAws_json1_0LimitExceededException = ( output , context ) : LimitExceededException => { return { Message : __expectString ( output . Message ) , } as any ; } ; const deserializeAws_json1_0ListFirewallPoliciesResponse = ( output , context ) : ListFirewallPoliciesResponse => { return { FirewallPolicies : output . FirewallPolicies !== undefined && output . FirewallPolicies !== null ? deserializeAws_json1_0FirewallPolicies ( output . FirewallPolicies , context ) : undefined , NextToken : __expectString ( output . NextToken ) , } as any ; } ; const deserializeAws_json1_0ListFirewallsResponse = ( output , context ) : ListFirewallsResponse => { return { Firewalls : output . Firewalls !== undefined && output . Firewalls !== null ? deserializeAws_json1_0Firewalls ( output . Firewalls , context ) : undefined , NextToken : __expectString ( output . NextToken ) , } as any ; } ; const deserializeAws_json1_0ListRuleGroupsResponse = ( output , context ) : ListRuleGroupsResponse => { return { NextToken : __expectString ( output . NextToken ) , RuleGroups : output . RuleGroups !== undefined && output . RuleGroups !== null ? deserializeAws_json1_0RuleGroups ( output . RuleGroups , context ) : undefined , } as any ; } ; const deserializeAws_json1_0ListTagsForResourceResponse = ( output , context ) : ListTagsForResourceResponse => { return { NextToken : __expectString ( output . NextToken ) , Tags : output . Tags !== undefined && output . Tags !== null ? deserializeAws_json1_0TagList ( output . Tags , context ) : undefined , } as any ; } ; const deserializeAws_json1_0LogDestinationConfig = ( output , context ) : LogDestinationConfig => { return { LogDestination : output . LogDestination !== undefined && output . LogDestination !== null ? deserializeAws_json1_0LogDestinationMap ( output . LogDestination , context ) : undefined , LogDestinationType : __expectString ( output . LogDestinationType ) , LogType : __expectString ( output . LogType ) , } as any ; } ; const deserializeAws_json1_0LogDestinationConfigs = ( output , context ) : LogDestinationConfig [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_0LogDestinationConfig ( entry , context ) ; } ) ; } ; const deserializeAws_json1_0LogDestinationMap = ( output , context ) : { [ key ] : string ; } => { return Object . entries ( output ) . reduce ( ( acc , [ key , value ] ) => { if ( value === null ) { return acc ; } return { ... acc , [ key ] : __expectString ( value ) as any , } ; } , { } ) ; } ; const deserializeAws_json1_0LogDestinationPermissionException = ( output , context ) : LogDestinationPermissionException => { return { Message : __expectString ( output . Message ) , } as any ; } ; const deserializeAws_json1_0LoggingConfiguration = ( output , context ) : LoggingConfiguration => { return { LogDestinationConfigs : output . LogDestinationConfigs !== undefined && output . LogDestinationConfigs !== null ? deserializeAws_json1_0LogDestinationConfigs ( output . LogDestinationConfigs , context ) : undefined , } as any ; } ; const deserializeAws_json1_0MatchAttributes = ( output , context ) : MatchAttributes => { return { DestinationPorts : output . DestinationPorts !== undefined && output . DestinationPorts !== null ? deserializeAws_json1_0PortRanges ( output . DestinationPorts , context ) : undefined , Destinations : output . Destinations !== undefined && output . Destinations !== null ? deserializeAws_json1_0Addresses ( output . Destinations , context ) : undefined , Protocols : output . Protocols !== undefined && output . Protocols !== null ? deserializeAws_json1_0ProtocolNumbers ( output . Protocols , context ) : undefined , SourcePorts : output . SourcePorts !== undefined && output . SourcePorts !== null ? deserializeAws_json1_0PortRanges ( output . SourcePorts , context ) : undefined , Sources : output . Sources !== undefined && output . Sources !== null ? deserializeAws_json1_0Addresses ( output . Sources , context ) : undefined , TCPFlags : output . TCPFlags !== undefined && output . TCPFlags !== null ? deserializeAws_json1_0TCPFlags ( output . TCPFlags , context ) : undefined , } as any ; } ; const deserializeAws_json1_0PerObjectStatus = ( output , context ) : PerObjectStatus => { return { SyncStatus : __expectString ( output . SyncStatus ) , UpdateToken : __expectString ( output . UpdateToken ) , } as any ; } ; const deserializeAws_json1_0PortRange = ( output , context ) : PortRange => { return { FromPort : __expectInt32 ( output . FromPort ) , ToPort : __expectInt32 ( output . ToPort ) , } as any ; } ; const deserializeAws_json1_0PortRanges = ( output , context ) : PortRange [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_0PortRange ( entry , context ) ; } ) ; } ; const deserializeAws_json1_0PortSet = ( output , context ) : PortSet => { return { Definition : output . Definition !== undefined && output . Definition !== null ? deserializeAws_json1_0VariableDefinitionList ( output . Definition , context ) : undefined , } as any ; } ; const deserializeAws_json1_0PortSets = ( output , context ) : { [ key ] : PortSet ; } => { return Object . entries ( output ) . reduce ( ( acc , [ key , value ] ) => { if ( value === null ) { return acc ; } return { ... acc , [ key ] : deserializeAws_json1_0PortSet ( value , context ) , } ; } , { } ) ; } ; const deserializeAws_json1_0ProtocolNumbers = ( output , context ) : number [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return __expectInt32 ( entry ) as any ; } ) ; } ; const deserializeAws_json1_0PublishMetricAction = ( output , context ) : PublishMetricAction => { return { Dimensions : output . Dimensions !== undefined && output . Dimensions !== null ? deserializeAws_json1_0Dimensions ( output . Dimensions , context ) : undefined , } as any ; } ; const deserializeAws_json1_0PutResourcePolicyResponse = ( output , context ) : PutResourcePolicyResponse => { return { } as any ; } ; const deserializeAws_json1_0ResourceNotFoundException = ( output , context ) : ResourceNotFoundException => { return { Message : __expectString ( output . Message ) , } as any ; } ; const deserializeAws_json1_0ResourceOwnerCheckException = ( output , context ) : ResourceOwnerCheckException => { return { Message : __expectString ( output . Message ) , } as any ; } ; const deserializeAws_json1_0RuleDefinition = ( output , context ) : RuleDefinition => { return { Actions : output . Actions !== undefined && output . Actions !== null ? deserializeAws_json1_0StatelessActions ( output . Actions , context ) : undefined , MatchAttributes : output . MatchAttributes !== undefined && output . MatchAttributes !== null ? deserializeAws_json1_0MatchAttributes ( output . MatchAttributes , context ) : undefined , } as any ; } ; const deserializeAws_json1_0RuleGroup = ( output , context ) : RuleGroup => { return { RuleVariables : output . RuleVariables !== undefined && output . RuleVariables !== null ? deserializeAws_json1_0RuleVariables ( output . RuleVariables , context ) : undefined , RulesSource : output . RulesSource !== undefined && output . RulesSource !== null ? deserializeAws_json1_0RulesSource ( output . RulesSource , context ) : undefined , StatefulRuleOptions : output . StatefulRuleOptions !== undefined && output . StatefulRuleOptions !== null ? deserializeAws_json1_0StatefulRuleOptions ( output . StatefulRuleOptions , context ) : undefined , } as any ; } ; const deserializeAws_json1_0RuleGroupMetadata = ( output , context ) : RuleGroupMetadata => { return { Arn : __expectString ( output . Arn ) , Name : __expectString ( output . Name ) , } as any ; } ; const deserializeAws_json1_0RuleGroupResponse = ( output , context ) : RuleGroupResponse => { return { Capacity : __expectInt32 ( output . Capacity ) , ConsumedCapacity : __expectInt32 ( output . ConsumedCapacity ) , Description : __expectString ( output . Description ) , NumberOfAssociations : __expectInt32 ( output . NumberOfAssociations ) , RuleGroupArn : __expectString ( output . RuleGroupArn ) , RuleGroupId : __expectString ( output . RuleGroupId ) , RuleGroupName : __expectString ( output . RuleGroupName ) , RuleGroupStatus : __expectString ( output . RuleGroupStatus ) , Tags : output . Tags !== undefined && output . Tags !== null ? deserializeAws_json1_0TagList ( output . Tags , context ) : undefined , Type : __expectString ( output . Type ) , } as any ; } ; const deserializeAws_json1_0RuleGroups = ( output , context ) : RuleGroupMetadata [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_0RuleGroupMetadata ( entry , context ) ; } ) ; } ; const deserializeAws_json1_0RuleOption = ( output , context ) : RuleOption => { return { Keyword : __expectString ( output . Keyword ) , Settings : output . Settings !== undefined && output . Settings !== null ? deserializeAws_json1_0Settings ( output . Settings , context ) : undefined , } as any ; } ; const deserializeAws_json1_0RuleOptions = ( output , context ) : RuleOption [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_0RuleOption ( entry , context ) ; } ) ; } ; const deserializeAws_json1_0RulesSource = ( output , context ) : RulesSource => { return { RulesSourceList : output . RulesSourceList !== undefined && output . RulesSourceList !== null ? deserializeAws_json1_0RulesSourceList ( output . RulesSourceList , context ) : undefined , RulesString : __expectString ( output . RulesString ) , StatefulRules : output . StatefulRules !== undefined && output . StatefulRules !== null ? deserializeAws_json1_0StatefulRules ( output . StatefulRules , context ) : undefined , StatelessRulesAndCustomActions : output . StatelessRulesAndCustomActions !== undefined && output . StatelessRulesAndCustomActions !== null ? deserializeAws_json1_0StatelessRulesAndCustomActions ( output . StatelessRulesAndCustomActions , context ) : undefined , } as any ; } ; const deserializeAws_json1_0RulesSourceList = ( output , context ) : RulesSourceList => { return { GeneratedRulesType : __expectString ( output . GeneratedRulesType ) , TargetTypes : output . TargetTypes !== undefined && output . TargetTypes !== null ? deserializeAws_json1_0TargetTypes ( output . TargetTypes , context ) : undefined , Targets : output . Targets !== undefined && output . Targets !== null ? deserializeAws_json1_0RuleTargets ( output . Targets , context ) : undefined , } as any ; } ; const deserializeAws_json1_0RuleTargets = ( output , context ) : string [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return __expectString ( entry ) as any ; } ) ; } ; const deserializeAws_json1_0RuleVariables = ( output , context ) : RuleVariables => { return { IPSets : output . IPSets !== undefined && output . IPSets !== null ? deserializeAws_json1_0IPSets ( output . IPSets , context ) : undefined , PortSets : output . PortSets !== undefined && output . PortSets !== null ? deserializeAws_json1_0PortSets ( output . PortSets , context ) : undefined , } as any ; } ; const deserializeAws_json1_0Settings = ( output , context ) : string [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return __expectString ( entry ) as any ; } ) ; } ; const deserializeAws_json1_0StatefulActions = ( output , context ) : string [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return __expectString ( entry ) as any ; } ) ; } ; const deserializeAws_json1_0StatefulEngineOptions = ( output , context ) : StatefulEngineOptions => { return { RuleOrder : __expectString ( output . RuleOrder ) , } as any ; } ; const deserializeAws_json1_0StatefulRule = ( output , context ) : StatefulRule => { return { Action : __expectString ( output . Action ) , Header : output . Header !== undefined && output . Header !== null ? deserializeAws_json1_0Header ( output . Header , context ) : undefined , RuleOptions : output . RuleOptions !== undefined && output . RuleOptions !== null ? deserializeAws_json1_0RuleOptions ( output . RuleOptions , context ) : undefined , } as any ; } ; const deserializeAws_json1_0StatefulRuleGroupOverride = ( output , context ) : StatefulRuleGroupOverride => { return { Action : __expectString ( output . Action ) , } as any ; } ; const deserializeAws_json1_0StatefulRuleGroupReference = ( output , context ) : StatefulRuleGroupReference => { return { Override : output . Override !== undefined && output . Override !== null ? deserializeAws_json1_0StatefulRuleGroupOverride ( output . Override , context ) : undefined , Priority : __expectInt32 ( output . Priority ) , ResourceArn : __expectString ( output . ResourceArn ) , } as any ; } ; const deserializeAws_json1_0StatefulRuleGroupReferences = ( output , context ) : StatefulRuleGroupReference [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_0StatefulRuleGroupReference ( entry , context ) ; } ) ; } ; const deserializeAws_json1_0StatefulRuleOptions = ( output , context ) : StatefulRuleOptions => { return { RuleOrder : __expectString ( output . RuleOrder ) , } as any ; } ; const deserializeAws_json1_0StatefulRules = ( output , context ) : StatefulRule [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_0StatefulRule ( entry , context ) ; } ) ; } ; const deserializeAws_json1_0StatelessActions = ( output , context ) : string [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return __expectString ( entry ) as any ; } ) ; } ; const deserializeAws_json1_0StatelessRule = ( output , context ) : StatelessRule => { return { Priority : __expectInt32 ( output . Priority ) , RuleDefinition : output . RuleDefinition !== undefined && output . RuleDefinition !== null ? deserializeAws_json1_0RuleDefinition ( output . RuleDefinition , context ) : undefined , } as any ; } ; const deserializeAws_json1_0StatelessRuleGroupReference = ( output , context ) : StatelessRuleGroupReference => { return { Priority : __expectInt32 ( output . Priority ) , ResourceArn : __expectString ( output . ResourceArn ) , } as any ; } ; const deserializeAws_json1_0StatelessRuleGroupReferences = ( output , context ) : StatelessRuleGroupReference [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_0StatelessRuleGroupReference ( entry , context ) ; } ) ; } ; const deserializeAws_json1_0StatelessRules = ( output , context ) : StatelessRule [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_0StatelessRule ( entry , context ) ; } ) ; } ; const deserializeAws_json1_0StatelessRulesAndCustomActions = ( output , context ) : StatelessRulesAndCustomActions => { return { CustomActions : output . CustomActions !== undefined && output . CustomActions !== null ? deserializeAws_json1_0CustomActions ( output . CustomActions , context ) : undefined , StatelessRules : output . StatelessRules !== undefined && output . StatelessRules !== null ? deserializeAws_json1_0StatelessRules ( output . StatelessRules , context ) : undefined , } as any ; } ; const deserializeAws_json1_0SubnetMapping = ( output , context ) : SubnetMapping => { return { SubnetId : __expectString ( output . SubnetId ) , } as any ; } ; const deserializeAws_json1_0SubnetMappings = ( output , context ) : SubnetMapping [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_0SubnetMapping ( entry , context ) ; } ) ; } ; const deserializeAws_json1_0SyncState = ( output , context ) : SyncState => { return { Attachment : output . Attachment !== undefined && output . Attachment !== null ? deserializeAws_json1_0Attachment ( output . Attachment , context ) : undefined , Config : output . Config !== undefined && output . Config !== null ? deserializeAws_json1_0SyncStateConfig ( output . Config , context ) : undefined , } as any ; } ; const deserializeAws_json1_0SyncStateConfig = ( output , context ) : { [ key ] : PerObjectStatus ; } => { return Object . entries ( output ) . reduce ( ( acc , [ key , value ] ) => { if ( value === null ) { return acc ; } return { ... acc , [ key ] : deserializeAws_json1_0PerObjectStatus ( value , context ) , } ; } , { } ) ; } ; const deserializeAws_json1_0SyncStates = ( output , context ) : { [ key ] : SyncState ; } => { return Object . entries ( output ) . reduce ( ( acc , [ key , value ] ) => { if ( value === null ) { return acc ; } return { ... acc , [ key ] : deserializeAws_json1_0SyncState ( value , context ) , } ; } , { } ) ; } ; const deserializeAws_json1_0Tag = ( output , context ) : Tag => { return { Key : __expectString ( output . Key ) , Value : __expectString ( output . Value ) , } as any ; } ; const deserializeAws_json1_0TagList = ( output , context ) : Tag [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_0Tag ( entry , context ) ; } ) ; } ; const deserializeAws_json1_0TagResourceResponse = ( output , context ) : TagResourceResponse => { return { } as any ; } ; const deserializeAws_json1_0TargetTypes = ( output , context ) : ( TargetType | string ) [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return __expectString ( entry ) as any ; } ) ; } ; const deserializeAws_json1_0TCPFlagField = ( output , context ) : TCPFlagField => { return { Flags : output . Flags !== undefined && output . Flags !== null ? deserializeAws_json1_0Flags ( output . Flags , context ) : undefined , Masks : output . Masks !== undefined && output . Masks !== null ? deserializeAws_json1_0Flags ( output . Masks , context ) : undefined , } as any ; } ; const deserializeAws_json1_0TCPFlags = ( output , context ) : TCPFlagField [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_0TCPFlagField ( entry , context ) ; } ) ; } ; const deserializeAws_json1_0ThrottlingException = ( output , context ) : ThrottlingException => { return { Message : __expectString ( output . Message ) , } as any ; } ; const deserializeAws_json1_0UnsupportedOperationException = ( output , context ) : UnsupportedOperationException => { return { Message : __expectString ( output . Message ) , } as any ; } ; const deserializeAws_json1_0UntagResourceResponse = ( output , context ) : UntagResourceResponse => { return { } as any ; } ; const deserializeAws_json1_0UpdateFirewallDeleteProtectionResponse = ( output , context ) : UpdateFirewallDeleteProtectionResponse => { return { DeleteProtection : __expectBoolean ( output . DeleteProtection ) , FirewallArn : __expectString ( output . FirewallArn ) , FirewallName : __expectString ( output . FirewallName ) , UpdateToken : __expectString ( output . UpdateToken ) , } as any ; } ; const deserializeAws_json1_0UpdateFirewallDescriptionResponse = ( output , context ) : UpdateFirewallDescriptionResponse => { return { Description : __expectString ( output . Description ) , FirewallArn : __expectString ( output . FirewallArn ) , FirewallName : __expectString ( output . FirewallName ) , UpdateToken : __expectString ( output . UpdateToken ) , } as any ; } ; const deserializeAws_json1_0UpdateFirewallPolicyChangeProtectionResponse = ( output , context ) : UpdateFirewallPolicyChangeProtectionResponse => { return { FirewallArn : __expectString ( output . FirewallArn ) , FirewallName : __expectString ( output . FirewallName ) , FirewallPolicyChangeProtection : __expectBoolean ( output . FirewallPolicyChangeProtection ) , UpdateToken : __expectString ( output . UpdateToken ) , } as any ; } ; const deserializeAws_json1_0UpdateFirewallPolicyResponse = ( output , context ) : UpdateFirewallPolicyResponse => { return { FirewallPolicyResponse : output . FirewallPolicyResponse !== undefined && output . FirewallPolicyResponse !== null ? deserializeAws_json1_0FirewallPolicyResponse ( output . FirewallPolicyResponse , context ) : undefined , UpdateToken : __expectString ( output . UpdateToken ) , } as any ; } ; const deserializeAws_json1_0UpdateLoggingConfigurationResponse = ( output , context ) : UpdateLoggingConfigurationResponse => { return { FirewallArn : __expectString ( output . FirewallArn ) , FirewallName : __expectString ( output . FirewallName ) , LoggingConfiguration : output . LoggingConfiguration !== undefined && output . LoggingConfiguration !== null ? deserializeAws_json1_0LoggingConfiguration ( output . LoggingConfiguration , context ) : undefined , } as any ; } ; const deserializeAws_json1_0UpdateRuleGroupResponse = ( output , context ) : UpdateRuleGroupResponse => { return { RuleGroupResponse : output . RuleGroupResponse !== undefined && output . RuleGroupResponse !== null ? deserializeAws_json1_0RuleGroupResponse ( output . RuleGroupResponse , context ) : undefined , UpdateToken : __expectString ( output . UpdateToken ) , } as any ; } ; const deserializeAws_json1_0UpdateSubnetChangeProtectionResponse = ( output , context ) : UpdateSubnetChangeProtectionResponse => { return { FirewallArn : __expectString ( output . FirewallArn ) , FirewallName : __expectString ( output . FirewallName ) , SubnetChangeProtection : __expectBoolean ( output . SubnetChangeProtection ) , UpdateToken : __expectString ( output . UpdateToken ) , } as any ; } ; const deserializeAws_json1_0VariableDefinitionList = ( output , context ) : string [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return __expectString ( entry ) as any ; } ) ; } ; const deserializeMetadata = ( output ) : __ResponseMetadata => ( { httpStatusCode : output . statusCode , requestId : output . headers [ "x-amzn-requestid" ] ?? output . headers [ "x-amzn-request-id" ] , extendedRequestId : output . headers [ "x-amz-id-2" ] , cfId : output . headers [ "x-amz-cf-id" ] , } ) ; const collectBody = ( streamBody = new Uint8Array ( ) , context ) : Promise < Uint8Array > => { if ( streamBody instanceof Uint8Array ) { return Promise . resolve ( streamBody ) ; } return context . streamCollector ( streamBody ) || Promise . resolve ( new Uint8Array ( ) ) ; } ; const collectBodyString = ( streamBody , context ) : Promise < string > => collectBody ( streamBody , context ) . then ( ( body ) => context . utf8Encoder ( body ) ) ; const buildHttpRpcRequest = async ( context , headers , path , resolvedHostname , body ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const contents = { protocol , hostname , port , method : "POST" , path : basePath . endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) + path : basePath + path , headers , } ; if ( resolvedHostname !== undefined ) { contents . hostname = resolvedHostname ; } if ( body !== undefined ) { contents . body = body ; } return new __HttpRequest ( contents ) ; } ; const parseBody = ( streamBody , context ) : any => collectBodyString ( streamBody , context ) . then ( ( encoded ) => { if ( encoded . length ) { return JSON . parse ( encoded ) ; } return { } ; } ) ; /**
 * Load an error code for the aws.rest-json-1.1 protocol.
 */ const loadRestJsonErrorCode = ( output , data ) : string => { const findKey = ( object , key ) => Object . keys ( object ) . find ( ( k ) => k . toLowerCase ( ) === key . toLowerCase ( ) ) ; const sanitizeErrorCode = ( rawValue ) : string => { let cleanValue = rawValue ; if ( cleanValue . indexOf ( ":" ) >= 0 ) { cleanValue = cleanValue . split ( ":" ) [ 0 ] ; } if ( cleanValue . indexOf ( "#" ) >= 0 ) { cleanValue = cleanValue . split ( "#" ) [ 1 ] ; } return cleanValue ; } ; const headerKey = findKey ( output . headers , "x-amzn-errortype" ) ; if ( headerKey !== undefined ) { return sanitizeErrorCode ( output . headers [ headerKey ] ) ; } if ( data . code !== undefined ) { return sanitizeErrorCode ( data . code ) ; } if ( data [ "__type" ] !== undefined ) { return sanitizeErrorCode ( data [ "__type" ] ) ; } return "" ; } ;