// UnmarshalOpts unmarshal JSON string opts to object v
558174
func UnmarshalOpts(opts string, v interface{}) error {
	opts = strings.TrimSpace(opts)
	if opts == "" {
		return nil
	}
	if opts[0] != '[' && opts[0] != '{' {
		jsonString, err := form2JSON(opts)
		if err != nil {
			return err
		}
		opts = jsonString
	}
	return json.Unmarshal([]byte(opts), v)
}
152378
func (l *EMRInstanceGroupConfigScalingConstraintsList) UnmarshalJSON(buf []byte) error {
	// Cloudformation allows a single object when a list of objects is expected
	item := EMRInstanceGroupConfigScalingConstraints{}
	if err := json.Unmarshal(buf, &item); err == nil {
		*l = EMRInstanceGroupConfigScalingConstraintsList{item}
		return nil
	}
	list := []EMRInstanceGroupConfigScalingConstraints{}
	err := json.Unmarshal(buf, &list)
	if err == nil {
		*l = EMRInstanceGroupConfigScalingConstraintsList(list)
		return nil
	}
	return err
}
1232122
func (l *LambdaFunctionEnvironmentList) UnmarshalJSON(buf []byte) error {
	// Cloudformation allows a single object when a list of objects is expected
	item := LambdaFunctionEnvironment{}
	if err := json.Unmarshal(buf, &item); err == nil {
		*l = LambdaFunctionEnvironmentList{item}
		return nil
	}
	list := []LambdaFunctionEnvironment{}
	err := json.Unmarshal(buf, &list)
	if err == nil {
		*l = LambdaFunctionEnvironmentList(list)
		return nil
	}
	return err
}
382577
func (l *SSMPatchBaselinePatchFilterList) UnmarshalJSON(buf []byte) error {
	// Cloudformation allows a single object when a list of objects is expected
	item := SSMPatchBaselinePatchFilter{}
	if err := json.Unmarshal(buf, &item); err == nil {
		*l = SSMPatchBaselinePatchFilterList{item}
		return nil
	}
	list := []SSMPatchBaselinePatchFilter{}
	err := json.Unmarshal(buf, &list)
	if err == nil {
		*l = SSMPatchBaselinePatchFilterList(list)
		return nil
	}
	return err
}
208126
func (l *BatchJobDefinitionMountPointsList) UnmarshalJSON(buf []byte) error {
	// Cloudformation allows a single object when a list of objects is expected
	item := BatchJobDefinitionMountPoints{}
	if err := json.Unmarshal(buf, &item); err == nil {
		*l = BatchJobDefinitionMountPointsList{item}
		return nil
	}
	list := []BatchJobDefinitionMountPoints{}
	err := json.Unmarshal(buf, &list)
	if err == nil {
		*l = BatchJobDefinitionMountPointsList(list)
		return nil
	}
	return err
}
675962
func (l *GluePartitionOrderList) UnmarshalJSON(buf []byte) error {
	// Cloudformation allows a single object when a list of objects is expected
	item := GluePartitionOrder{}
	if err := json.Unmarshal(buf, &item); err == nil {
		*l = GluePartitionOrderList{item}
		return nil
	}
	list := []GluePartitionOrder{}
	err := json.Unmarshal(buf, &list)
	if err == nil {
		*l = GluePartitionOrderList(list)
		return nil
	}
	return err
}
1020895
func (l *OpsWorksLayerRecipesList) UnmarshalJSON(buf []byte) error {
	// Cloudformation allows a single object when a list of objects is expected
	item := OpsWorksLayerRecipes{}
	if err := json.Unmarshal(buf, &item); err == nil {
		*l = OpsWorksLayerRecipesList{item}
		return nil
	}
	list := []OpsWorksLayerRecipes{}
	err := json.Unmarshal(buf, &list)
	if err == nil {
		*l = OpsWorksLayerRecipesList(list)
		return nil
	}
	return err
}
60384
func (l *BudgetsBudgetSpendList) UnmarshalJSON(buf []byte) error {
	// Cloudformation allows a single object when a list of objects is expected
	item := BudgetsBudgetSpend{}
	if err := json.Unmarshal(buf, &item); err == nil {
		*l = BudgetsBudgetSpendList{item}
		return nil
	}
	list := []BudgetsBudgetSpend{}
	err := json.Unmarshal(buf, &list)
	if err == nil {
		*l = BudgetsBudgetSpendList(list)
		return nil
	}
	return err
}
528671
func (l *CloudWatchAlarmDimensionList) UnmarshalJSON(buf []byte) error {
	// Cloudformation allows a single object when a list of objects is expected
	item := CloudWatchAlarmDimension{}
	if err := json.Unmarshal(buf, &item); err == nil {
		*l = CloudWatchAlarmDimensionList{item}
		return nil
	}
	list := []CloudWatchAlarmDimension{}
	err := json.Unmarshal(buf, &list)
	if err == nil {
		*l = CloudWatchAlarmDimensionList(list)
		return nil
	}
	return err
}
514339
func (l *ElasticsearchDomainEncryptionAtRestOptionsList) UnmarshalJSON(buf []byte) error {
	// Cloudformation allows a single object when a list of objects is expected
	item := ElasticsearchDomainEncryptionAtRestOptions{}
	if err := json.Unmarshal(buf, &item); err == nil {
		*l = ElasticsearchDomainEncryptionAtRestOptionsList{item}
		return nil
	}
	list := []ElasticsearchDomainEncryptionAtRestOptions{}
	err := json.Unmarshal(buf, &list)
	if err == nil {
		*l = ElasticsearchDomainEncryptionAtRestOptionsList(list)
		return nil
	}
	return err
}
992584
func (l *CognitoUserPoolPoliciesList) UnmarshalJSON(buf []byte) error {
	// Cloudformation allows a single object when a list of objects is expected
	item := CognitoUserPoolPolicies{}
	if err := json.Unmarshal(buf, &item); err == nil {
		*l = CognitoUserPoolPoliciesList{item}
		return nil
	}
	list := []CognitoUserPoolPolicies{}
	err := json.Unmarshal(buf, &list)
	if err == nil {
		*l = CognitoUserPoolPoliciesList(list)
		return nil
	}
	return err
}
1343926
func (l *SSMPatchBaselinePatchFilterGroupList) UnmarshalJSON(buf []byte) error {
	// Cloudformation allows a single object when a list of objects is expected
	item := SSMPatchBaselinePatchFilterGroup{}
	if err := json.Unmarshal(buf, &item); err == nil {
		*l = SSMPatchBaselinePatchFilterGroupList{item}
		return nil
	}
	list := []SSMPatchBaselinePatchFilterGroup{}
	err := json.Unmarshal(buf, &list)
	if err == nil {
		*l = SSMPatchBaselinePatchFilterGroupList(list)
		return nil
	}
	return err
}
1036766
func (m *Manager) UnmarshalOption(name string, v interface{}) error {
	value := m.Get(name)
	if value == nil {
		return errors.Format("option [%v] is not found", name)
	}

	vt := reflect.TypeOf(v)
	if vt.Kind() != reflect.Ptr {
		return errors.New("v must be a pointer")
	}

	vv := reflect.ValueOf(v).Elem()
	return unmarshalValue(vv, value)
}
421643
func (p *SetCollectionPropertiesOptions) UnmarshalJSON(d []byte) error {
	var internal setCollectionPropertiesOptionsInternal
	if err := json.Unmarshal(d, &internal); err != nil {
		return err
	}

	p.fromInternal(&internal)
	return nil
}
816448
func (l *Route53RecordSetGeoLocationList) UnmarshalJSON(buf []byte) error {
	// Cloudformation allows a single object when a list of objects is expected
	item := Route53RecordSetGeoLocation{}
	if err := json.Unmarshal(buf, &item); err == nil {
		*l = Route53RecordSetGeoLocationList{item}
		return nil
	}
	list := []Route53RecordSetGeoLocation{}
	err := json.Unmarshal(buf, &list)
	if err == nil {
		*l = Route53RecordSetGeoLocationList(list)
		return nil
	}
	return err
}
37012
func (l *EMRInstanceFleetConfigVolumeSpecificationList) UnmarshalJSON(buf []byte) error {
	// Cloudformation allows a single object when a list of objects is expected
	item := EMRInstanceFleetConfigVolumeSpecification{}
	if err := json.Unmarshal(buf, &item); err == nil {
		*l = EMRInstanceFleetConfigVolumeSpecificationList{item}
		return nil
	}
	list := []EMRInstanceFleetConfigVolumeSpecification{}
	err := json.Unmarshal(buf, &list)
	if err == nil {
		*l = EMRInstanceFleetConfigVolumeSpecificationList(list)
		return nil
	}
	return err
}
517051
func (l *IoTTopicRuleTopicRulePayloadList) UnmarshalJSON(buf []byte) error {
	// Cloudformation allows a single object when a list of objects is expected
	item := IoTTopicRuleTopicRulePayload{}
	if err := json.Unmarshal(buf, &item); err == nil {
		*l = IoTTopicRuleTopicRulePayloadList{item}
		return nil
	}
	list := []IoTTopicRuleTopicRulePayload{}
	err := json.Unmarshal(buf, &list)
	if err == nil {
		*l = IoTTopicRuleTopicRulePayloadList(list)
		return nil
	}
	return err
}