Skip to content

chore(clients): strictly parse booleans #2514

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Jun 25, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 14 additions & 13 deletions clients/client-auto-scaling/protocols/Aws_query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,7 @@ import {
extendedEncodeURIComponent as __extendedEncodeURIComponent,
getArrayIfSingleItem as __getArrayIfSingleItem,
getValueFromTextNode as __getValueFromTextNode,
parseBoolean as __parseBoolean,
} from "@aws-sdk/smithy-client";
import {
Endpoint as __Endpoint,
Expand Down Expand Up @@ -7590,7 +7591,7 @@ const deserializeAws_queryAutoScalingGroup = (output: any, context: __SerdeConte
);
}
if (output["NewInstancesProtectedFromScaleIn"] !== undefined) {
contents.NewInstancesProtectedFromScaleIn = output["NewInstancesProtectedFromScaleIn"] == "true";
contents.NewInstancesProtectedFromScaleIn = __parseBoolean(output["NewInstancesProtectedFromScaleIn"]);
}
if (output["ServiceLinkedRoleARN"] !== undefined) {
contents.ServiceLinkedRoleARN = output["ServiceLinkedRoleARN"];
Expand All @@ -7599,7 +7600,7 @@ const deserializeAws_queryAutoScalingGroup = (output: any, context: __SerdeConte
contents.MaxInstanceLifetime = parseInt(output["MaxInstanceLifetime"]);
}
if (output["CapacityRebalance"] !== undefined) {
contents.CapacityRebalance = output["CapacityRebalance"] == "true";
contents.CapacityRebalance = __parseBoolean(output["CapacityRebalance"]);
}
if (output["WarmPoolConfiguration"] !== undefined) {
contents.WarmPoolConfiguration = deserializeAws_queryWarmPoolConfiguration(
Expand Down Expand Up @@ -7685,7 +7686,7 @@ const deserializeAws_queryAutoScalingInstanceDetails = (
contents.LaunchTemplate = deserializeAws_queryLaunchTemplateSpecification(output["LaunchTemplate"], context);
}
if (output["ProtectedFromScaleIn"] !== undefined) {
contents.ProtectedFromScaleIn = output["ProtectedFromScaleIn"] == "true";
contents.ProtectedFromScaleIn = __parseBoolean(output["ProtectedFromScaleIn"]);
}
if (output["WeightedCapacity"] !== undefined) {
contents.WeightedCapacity = output["WeightedCapacity"];
Expand Down Expand Up @@ -7810,7 +7811,7 @@ const deserializeAws_queryBlockDeviceMapping = (output: any, context: __SerdeCon
contents.Ebs = deserializeAws_queryEbs(output["Ebs"], context);
}
if (output["NoDevice"] !== undefined) {
contents.NoDevice = output["NoDevice"] == "true";
contents.NoDevice = __parseBoolean(output["NoDevice"]);
}
return contents;
};
Expand Down Expand Up @@ -8255,13 +8256,13 @@ const deserializeAws_queryEbs = (output: any, context: __SerdeContext): Ebs => {
contents.VolumeType = output["VolumeType"];
}
if (output["DeleteOnTermination"] !== undefined) {
contents.DeleteOnTermination = output["DeleteOnTermination"] == "true";
contents.DeleteOnTermination = __parseBoolean(output["DeleteOnTermination"]);
}
if (output["Iops"] !== undefined) {
contents.Iops = parseInt(output["Iops"]);
}
if (output["Encrypted"] !== undefined) {
contents.Encrypted = output["Encrypted"] == "true";
contents.Encrypted = __parseBoolean(output["Encrypted"]);
}
if (output["Throughput"] !== undefined) {
contents.Throughput = parseInt(output["Throughput"]);
Expand Down Expand Up @@ -8422,7 +8423,7 @@ const deserializeAws_queryInstance = (output: any, context: __SerdeContext): Ins
contents.LaunchTemplate = deserializeAws_queryLaunchTemplateSpecification(output["LaunchTemplate"], context);
}
if (output["ProtectedFromScaleIn"] !== undefined) {
contents.ProtectedFromScaleIn = output["ProtectedFromScaleIn"] == "true";
contents.ProtectedFromScaleIn = __parseBoolean(output["ProtectedFromScaleIn"]);
}
if (output["WeightedCapacity"] !== undefined) {
contents.WeightedCapacity = output["WeightedCapacity"];
Expand Down Expand Up @@ -8453,7 +8454,7 @@ const deserializeAws_queryInstanceMonitoring = (output: any, context: __SerdeCon
Enabled: undefined,
};
if (output["Enabled"] !== undefined) {
contents.Enabled = output["Enabled"] == "true";
contents.Enabled = __parseBoolean(output["Enabled"]);
}
return contents;
};
Expand Down Expand Up @@ -8725,10 +8726,10 @@ const deserializeAws_queryLaunchConfiguration = (output: any, context: __SerdeCo
contents.CreatedTime = new Date(output["CreatedTime"]);
}
if (output["EbsOptimized"] !== undefined) {
contents.EbsOptimized = output["EbsOptimized"] == "true";
contents.EbsOptimized = __parseBoolean(output["EbsOptimized"]);
}
if (output["AssociatePublicIpAddress"] !== undefined) {
contents.AssociatePublicIpAddress = output["AssociatePublicIpAddress"] == "true";
contents.AssociatePublicIpAddress = __parseBoolean(output["AssociatePublicIpAddress"]);
}
if (output["PlacementTenancy"] !== undefined) {
contents.PlacementTenancy = output["PlacementTenancy"];
Expand Down Expand Up @@ -9519,7 +9520,7 @@ const deserializeAws_queryScalingPolicy = (output: any, context: __SerdeContext)
);
}
if (output["Enabled"] !== undefined) {
contents.Enabled = output["Enabled"] == "true";
contents.Enabled = __parseBoolean(output["Enabled"]);
}
if (output["PredictiveScalingConfiguration"] !== undefined) {
contents.PredictiveScalingConfiguration = deserializeAws_queryPredictiveScalingConfiguration(
Expand Down Expand Up @@ -9740,7 +9741,7 @@ const deserializeAws_queryTagDescription = (output: any, context: __SerdeContext
contents.Value = output["Value"];
}
if (output["PropagateAtLaunch"] !== undefined) {
contents.PropagateAtLaunch = output["PropagateAtLaunch"] == "true";
contents.PropagateAtLaunch = __parseBoolean(output["PropagateAtLaunch"]);
}
return contents;
};
Expand Down Expand Up @@ -9810,7 +9811,7 @@ const deserializeAws_queryTargetTrackingConfiguration = (
contents.TargetValue = parseFloat(output["TargetValue"]);
}
if (output["DisableScaleIn"] !== undefined) {
contents.DisableScaleIn = output["DisableScaleIn"] == "true";
contents.DisableScaleIn = __parseBoolean(output["DisableScaleIn"]);
}
return contents;
};
Expand Down
25 changes: 13 additions & 12 deletions clients/client-cloudformation/protocols/Aws_query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,7 @@ import {
extendedEncodeURIComponent as __extendedEncodeURIComponent,
getArrayIfSingleItem as __getArrayIfSingleItem,
getValueFromTextNode as __getValueFromTextNode,
parseBoolean as __parseBoolean,
} from "@aws-sdk/smithy-client";
import {
Endpoint as __Endpoint,
Expand Down Expand Up @@ -6449,10 +6450,10 @@ const deserializeAws_queryAutoDeployment = (output: any, context: __SerdeContext
RetainStacksOnAccountRemoval: undefined,
};
if (output["Enabled"] !== undefined) {
contents.Enabled = output["Enabled"] == "true";
contents.Enabled = __parseBoolean(output["Enabled"]);
}
if (output["RetainStacksOnAccountRemoval"] !== undefined) {
contents.RetainStacksOnAccountRemoval = output["RetainStacksOnAccountRemoval"] == "true";
contents.RetainStacksOnAccountRemoval = __parseBoolean(output["RetainStacksOnAccountRemoval"]);
}
return contents;
};
Expand Down Expand Up @@ -6570,7 +6571,7 @@ const deserializeAws_queryChangeSetSummary = (output: any, context: __SerdeConte
contents.Description = output["Description"];
}
if (output["IncludeNestedStacks"] !== undefined) {
contents.IncludeNestedStacks = output["IncludeNestedStacks"] == "true";
contents.IncludeNestedStacks = __parseBoolean(output["IncludeNestedStacks"]);
}
if (output["ParentChangeSetId"] !== undefined) {
contents.ParentChangeSetId = output["ParentChangeSetId"];
Expand Down Expand Up @@ -6825,7 +6826,7 @@ const deserializeAws_queryDescribeChangeSetOutput = (output: any, context: __Ser
contents.NextToken = output["NextToken"];
}
if (output["IncludeNestedStacks"] !== undefined) {
contents.IncludeNestedStacks = output["IncludeNestedStacks"] == "true";
contents.IncludeNestedStacks = __parseBoolean(output["IncludeNestedStacks"]);
}
if (output["ParentChangeSetId"] !== undefined) {
contents.ParentChangeSetId = output["ParentChangeSetId"];
Expand Down Expand Up @@ -7036,7 +7037,7 @@ const deserializeAws_queryDescribeTypeOutput = (output: any, context: __SerdeCon
contents.DefaultVersionId = output["DefaultVersionId"];
}
if (output["IsDefaultVersion"] !== undefined) {
contents.IsDefaultVersion = output["IsDefaultVersion"] == "true";
contents.IsDefaultVersion = __parseBoolean(output["IsDefaultVersion"]);
}
if (output["Description"] !== undefined) {
contents.Description = output["Description"];
Expand Down Expand Up @@ -7785,7 +7786,7 @@ const deserializeAws_queryParameter = (output: any, context: __SerdeContext): Pa
contents.ParameterValue = output["ParameterValue"];
}
if (output["UsePreviousValue"] !== undefined) {
contents.UsePreviousValue = output["UsePreviousValue"] == "true";
contents.UsePreviousValue = __parseBoolean(output["UsePreviousValue"]);
}
if (output["ResolvedValue"] !== undefined) {
contents.ResolvedValue = output["ResolvedValue"];
Expand Down Expand Up @@ -7828,7 +7829,7 @@ const deserializeAws_queryParameterDeclaration = (output: any, context: __SerdeC
contents.ParameterType = output["ParameterType"];
}
if (output["NoEcho"] !== undefined) {
contents.NoEcho = output["NoEcho"] == "true";
contents.NoEcho = __parseBoolean(output["NoEcho"]);
}
if (output["Description"] !== undefined) {
contents.Description = output["Description"];
Expand Down Expand Up @@ -8271,7 +8272,7 @@ const deserializeAws_queryStack = (output: any, context: __SerdeContext): Stack
contents.StackStatusReason = output["StackStatusReason"];
}
if (output["DisableRollback"] !== undefined) {
contents.DisableRollback = output["DisableRollback"] == "true";
contents.DisableRollback = __parseBoolean(output["DisableRollback"]);
}
if (output.NotificationARNs === "") {
contents.NotificationARNs = [];
Expand Down Expand Up @@ -8310,7 +8311,7 @@ const deserializeAws_queryStack = (output: any, context: __SerdeContext): Stack
contents.Tags = deserializeAws_queryTags(__getArrayIfSingleItem(output["Tags"]["member"]), context);
}
if (output["EnableTerminationProtection"] !== undefined) {
contents.EnableTerminationProtection = output["EnableTerminationProtection"] == "true";
contents.EnableTerminationProtection = __parseBoolean(output["EnableTerminationProtection"]);
}
if (output["ParentId"] !== undefined) {
contents.ParentId = output["ParentId"];
Expand Down Expand Up @@ -9040,7 +9041,7 @@ const deserializeAws_queryStackSetOperation = (output: any, context: __SerdeCont
);
}
if (output["RetainStacks"] !== undefined) {
contents.RetainStacks = output["RetainStacks"] == "true";
contents.RetainStacks = __parseBoolean(output["RetainStacks"]);
}
if (output["AdministrationRoleARN"] !== undefined) {
contents.AdministrationRoleARN = output["AdministrationRoleARN"];
Expand Down Expand Up @@ -9373,7 +9374,7 @@ const deserializeAws_queryTemplateParameter = (output: any, context: __SerdeCont
contents.DefaultValue = output["DefaultValue"];
}
if (output["NoEcho"] !== undefined) {
contents.NoEcho = output["NoEcho"] == "true";
contents.NoEcho = __parseBoolean(output["NoEcho"]);
}
if (output["Description"] !== undefined) {
contents.Description = output["Description"];
Expand Down Expand Up @@ -9498,7 +9499,7 @@ const deserializeAws_queryTypeVersionSummary = (output: any, context: __SerdeCon
contents.VersionId = output["VersionId"];
}
if (output["IsDefaultVersion"] !== undefined) {
contents.IsDefaultVersion = output["IsDefaultVersion"] == "true";
contents.IsDefaultVersion = __parseBoolean(output["IsDefaultVersion"]);
}
if (output["Arn"] !== undefined) {
contents.Arn = output["Arn"];
Expand Down
Loading