// UnmarshalJSON sets the object from the provided JSON representation. This has
// been added to handle the special case of a single statement versus an array.
775275
func (i *IAMPolicyDocument) UnmarshalJSON(data []byte) error {
	// Handle single statement policy documents
	var v iamPolicyDocumentSingleStatement
	err := json.Unmarshal(data, &v)
	if err == nil {
		i.Version = v.Version
		i.Statement = []IAMPolicyStatement{v.Statement}
		return nil
	}

	// Handle multiple statements
	var v2 iamPolicyDocumentCopy
	err = json.Unmarshal(data, &v2)
	if err != nil {
		return err
	}

	i.Version = v2.Version
	i.Statement = v2.Statement

	return nil
}
571376
func (l *AutoScalingPlansScalingPlanApplicationSourceList) UnmarshalJSON(buf []byte) error {
	// Cloudformation allows a single object when a list of objects is expected
	item := AutoScalingPlansScalingPlanApplicationSource{}
	if err := json.Unmarshal(buf, &item); err == nil {
		*l = AutoScalingPlansScalingPlanApplicationSourceList{item}
		return nil
	}
	list := []AutoScalingPlansScalingPlanApplicationSource{}
	err := json.Unmarshal(buf, &list)
	if err == nil {
		*l = AutoScalingPlansScalingPlanApplicationSourceList(list)
		return nil
	}
	return err
}
340571
func (l *WAFSizeConstraintSetFieldToMatchList) UnmarshalJSON(buf []byte) error {
	// Cloudformation allows a single object when a list of objects is expected
	item := WAFSizeConstraintSetFieldToMatch{}
	if err := json.Unmarshal(buf, &item); err == nil {
		*l = WAFSizeConstraintSetFieldToMatchList{item}
		return nil
	}
	list := []WAFSizeConstraintSetFieldToMatch{}
	err := json.Unmarshal(buf, &list)
	if err == nil {
		*l = WAFSizeConstraintSetFieldToMatchList(list)
		return nil
	}
	return err
}
989342
func (l *EMRInstanceFleetConfigInstanceTypeConfigList) UnmarshalJSON(buf []byte) error {
	// Cloudformation allows a single object when a list of objects is expected
	item := EMRInstanceFleetConfigInstanceTypeConfig{}
	if err := json.Unmarshal(buf, &item); err == nil {
		*l = EMRInstanceFleetConfigInstanceTypeConfigList{item}
		return nil
	}
	list := []EMRInstanceFleetConfigInstanceTypeConfig{}
	err := json.Unmarshal(buf, &list)
	if err == nil {
		*l = EMRInstanceFleetConfigInstanceTypeConfigList(list)
		return nil
	}
	return err
}
292672
func (l *CloudFrontStreamingDistributionS3OriginList) UnmarshalJSON(buf []byte) error {
	// Cloudformation allows a single object when a list of objects is expected
	item := CloudFrontStreamingDistributionS3Origin{}
	if err := json.Unmarshal(buf, &item); err == nil {
		*l = CloudFrontStreamingDistributionS3OriginList{item}
		return nil
	}
	list := []CloudFrontStreamingDistributionS3Origin{}
	err := json.Unmarshal(buf, &list)
	if err == nil {
		*l = CloudFrontStreamingDistributionS3OriginList(list)
		return nil
	}
	return err
}
1171805
func (l *EMRInstanceGroupConfigConfigurationList) UnmarshalJSON(buf []byte) error {
	// Cloudformation allows a single object when a list of objects is expected
	item := EMRInstanceGroupConfigConfiguration{}
	if err := json.Unmarshal(buf, &item); err == nil {
		*l = EMRInstanceGroupConfigConfigurationList{item}
		return nil
	}
	list := []EMRInstanceGroupConfigConfiguration{}
	err := json.Unmarshal(buf, &list)
	if err == nil {
		*l = EMRInstanceGroupConfigConfigurationList(list)
		return nil
	}
	return err
}
803494
func (l *EMRInstanceGroupConfigEbsConfigurationList) UnmarshalJSON(buf []byte) error {
	// Cloudformation allows a single object when a list of objects is expected
	item := EMRInstanceGroupConfigEbsConfiguration{}
	if err := json.Unmarshal(buf, &item); err == nil {
		*l = EMRInstanceGroupConfigEbsConfigurationList{item}
		return nil
	}
	list := []EMRInstanceGroupConfigEbsConfiguration{}
	err := json.Unmarshal(buf, &list)
	if err == nil {
		*l = EMRInstanceGroupConfigEbsConfigurationList(list)
		return nil
	}
	return err
}
99461
func (l *ApplicationAutoScalingScalingPolicyCustomizedMetricSpecificationList) UnmarshalJSON(buf []byte) error {
	// Cloudformation allows a single object when a list of objects is expected
	item := ApplicationAutoScalingScalingPolicyCustomizedMetricSpecification{}
	if err := json.Unmarshal(buf, &item); err == nil {
		*l = ApplicationAutoScalingScalingPolicyCustomizedMetricSpecificationList{item}
		return nil
	}
	list := []ApplicationAutoScalingScalingPolicyCustomizedMetricSpecification{}
	err := json.Unmarshal(buf, &list)
	if err == nil {
		*l = ApplicationAutoScalingScalingPolicyCustomizedMetricSpecificationList(list)
		return nil
	}
	return err
}
922568
func (l *CodePipelinePipelineInputArtifactList) UnmarshalJSON(buf []byte) error {
	// Cloudformation allows a single object when a list of objects is expected
	item := CodePipelinePipelineInputArtifact{}
	if err := json.Unmarshal(buf, &item); err == nil {
		*l = CodePipelinePipelineInputArtifactList{item}
		return nil
	}
	list := []CodePipelinePipelineInputArtifact{}
	err := json.Unmarshal(buf, &list)
	if err == nil {
		*l = CodePipelinePipelineInputArtifactList(list)
		return nil
	}
	return err
}
477189
func (l *EMRClusterInstanceFleetProvisioningSpecificationsList) UnmarshalJSON(buf []byte) error {
	// Cloudformation allows a single object when a list of objects is expected
	item := EMRClusterInstanceFleetProvisioningSpecifications{}
	if err := json.Unmarshal(buf, &item); err == nil {
		*l = EMRClusterInstanceFleetProvisioningSpecificationsList{item}
		return nil
	}
	list := []EMRClusterInstanceFleetProvisioningSpecifications{}
	err := json.Unmarshal(buf, &list)
	if err == nil {
		*l = EMRClusterInstanceFleetProvisioningSpecificationsList(list)
		return nil
	}
	return err
}
634638
func (l *ApplicationAutoScalingScalingPolicyStepAdjustmentList) UnmarshalJSON(buf []byte) error {
	// Cloudformation allows a single object when a list of objects is expected
	item := ApplicationAutoScalingScalingPolicyStepAdjustment{}
	if err := json.Unmarshal(buf, &item); err == nil {
		*l = ApplicationAutoScalingScalingPolicyStepAdjustmentList{item}
		return nil
	}
	list := []ApplicationAutoScalingScalingPolicyStepAdjustment{}
	err := json.Unmarshal(buf, &list)
	if err == nil {
		*l = ApplicationAutoScalingScalingPolicyStepAdjustmentList(list)
		return nil
	}
	return err
}
840535
func (l *ApplicationAutoScalingScalingPolicyPredefinedMetricSpecificationList) UnmarshalJSON(buf []byte) error {
	// Cloudformation allows a single object when a list of objects is expected
	item := ApplicationAutoScalingScalingPolicyPredefinedMetricSpecification{}
	if err := json.Unmarshal(buf, &item); err == nil {
		*l = ApplicationAutoScalingScalingPolicyPredefinedMetricSpecificationList{item}
		return nil
	}
	list := []ApplicationAutoScalingScalingPolicyPredefinedMetricSpecification{}
	err := json.Unmarshal(buf, &list)
	if err == nil {
		*l = ApplicationAutoScalingScalingPolicyPredefinedMetricSpecificationList(list)
		return nil
	}
	return err
}
1105317
func (l *ServiceDiscoveryServiceDNSRecordList) UnmarshalJSON(buf []byte) error {
	// Cloudformation allows a single object when a list of objects is expected
	item := ServiceDiscoveryServiceDNSRecord{}
	if err := json.Unmarshal(buf, &item); err == nil {
		*l = ServiceDiscoveryServiceDNSRecordList{item}
		return nil
	}
	list := []ServiceDiscoveryServiceDNSRecord{}
	err := json.Unmarshal(buf, &list)
	if err == nil {
		*l = ServiceDiscoveryServiceDNSRecordList(list)
		return nil
	}
	return err
}
635082
func (l *EMRClusterSimpleScalingPolicyConfigurationList) UnmarshalJSON(buf []byte) error {
	// Cloudformation allows a single object when a list of objects is expected
	item := EMRClusterSimpleScalingPolicyConfiguration{}
	if err := json.Unmarshal(buf, &item); err == nil {
		*l = EMRClusterSimpleScalingPolicyConfigurationList{item}
		return nil
	}
	list := []EMRClusterSimpleScalingPolicyConfiguration{}
	err := json.Unmarshal(buf, &list)
	if err == nil {
		*l = EMRClusterSimpleScalingPolicyConfigurationList(list)
		return nil
	}
	return err
}
385847
func (l *SSMAssociationInstanceAssociationOutputLocationList) UnmarshalJSON(buf []byte) error {
	// Cloudformation allows a single object when a list of objects is expected
	item := SSMAssociationInstanceAssociationOutputLocation{}
	if err := json.Unmarshal(buf, &item); err == nil {
		*l = SSMAssociationInstanceAssociationOutputLocationList{item}
		return nil
	}
	list := []SSMAssociationInstanceAssociationOutputLocation{}
	err := json.Unmarshal(buf, &list)
	if err == nil {
		*l = SSMAssociationInstanceAssociationOutputLocationList(list)
		return nil
	}
	return err
}
1324432
func (l *DynamoDBTableProvisionedThroughputList) UnmarshalJSON(buf []byte) error {
	// Cloudformation allows a single object when a list of objects is expected
	item := DynamoDBTableProvisionedThroughput{}
	if err := json.Unmarshal(buf, &item); err == nil {
		*l = DynamoDBTableProvisionedThroughputList{item}
		return nil
	}
	list := []DynamoDBTableProvisionedThroughput{}
	err := json.Unmarshal(buf, &list)
	if err == nil {
		*l = DynamoDBTableProvisionedThroughputList(list)
		return nil
	}
	return err
}
1293757
func (l *KinesisFirehoseDeliveryStreamExtendedS3DestinationConfigurationList) UnmarshalJSON(buf []byte) error {
	// Cloudformation allows a single object when a list of objects is expected
	item := KinesisFirehoseDeliveryStreamExtendedS3DestinationConfiguration{}
	if err := json.Unmarshal(buf, &item); err == nil {
		*l = KinesisFirehoseDeliveryStreamExtendedS3DestinationConfigurationList{item}
		return nil
	}
	list := []KinesisFirehoseDeliveryStreamExtendedS3DestinationConfiguration{}
	err := json.Unmarshal(buf, &list)
	if err == nil {
		*l = KinesisFirehoseDeliveryStreamExtendedS3DestinationConfigurationList(list)
		return nil
	}
	return err
}