// UnmarshalJSON loads SetCollectionPropertiesOptions from json
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
}
196777
func (p *InventoryCollectionParameters) UnmarshalJSON(d []byte) error {
	var internal inventoryCollectionParametersInternal
	if err := json.Unmarshal(d, &internal); err != nil {
		return err
	}

	p.fromInternal(internal)
	return nil
}
416835
func (v *VolumeSnapshot) UnmarshalJSON(data []byte) error {
	tmp := VolumeSnapshotCopy{}
	err := json.Unmarshal(data, &tmp)
	if err != nil {
		return err
	}
	tmp2 := VolumeSnapshot(tmp)
	*v = tmp2
	return nil
}
965991
func (l *CodeBuildProjectEnvironmentVariableList) UnmarshalJSON(buf []byte) error {
	// Cloudformation allows a single object when a list of objects is expected
	item := CodeBuildProjectEnvironmentVariable{}
	if err := json.Unmarshal(buf, &item); err == nil {
		*l = CodeBuildProjectEnvironmentVariableList{item}
		return nil
	}
	list := []CodeBuildProjectEnvironmentVariable{}
	err := json.Unmarshal(buf, &list)
	if err == nil {
		*l = CodeBuildProjectEnvironmentVariableList(list)
		return nil
	}
	return err
}
77297
func (o *InstanceTemplate) UnmarshalJSON(data []byte) error {
	var jsonName string
	if err := json.Unmarshal(data, &jsonName); err == nil {
		o.Name = &jsonName
		return nil
	}

	var r realInstanceTemplate
	if err := json.Unmarshal(data, &r); err != nil {
		return err
	}
	*o = InstanceTemplate(r)
	return nil
}
675625
func (o *DisablePrefixOnAttributesOption) UnmarshalJSON(data []byte) error {
	if string(data) == "null" {
		o.value = []string{}
		return nil
	}
	return json.Unmarshal(data, &o.value)
}
212916
func (l *CloudFrontDistributionLambdaFunctionAssociationList) UnmarshalJSON(buf []byte) error {
	// Cloudformation allows a single object when a list of objects is expected
	item := CloudFrontDistributionLambdaFunctionAssociation{}
	if err := json.Unmarshal(buf, &item); err == nil {
		*l = CloudFrontDistributionLambdaFunctionAssociationList{item}
		return nil
	}
	list := []CloudFrontDistributionLambdaFunctionAssociation{}
	err := json.Unmarshal(buf, &list)
	if err == nil {
		*l = CloudFrontDistributionLambdaFunctionAssociationList(list)
		return nil
	}
	return err
}
1086871
func (servicePlan *ServicePlan) UnmarshalJSON(data []byte) error {
	var ccServicePlan struct {
		Metadata internal.Metadata
		Entity   struct {
			Name        string `json:"name"`
			ServiceGUID string `json:"service_guid"`
			Public      bool   `json:"public"`
			Description string `json:"description"`
			Free        bool   `json:"free"`
		}
	}
	err := cloudcontroller.DecodeJSON(data, &ccServicePlan)
	if err != nil {
		return err
	}

	servicePlan.GUID = ccServicePlan.Metadata.GUID
	servicePlan.Name = ccServicePlan.Entity.Name
	servicePlan.ServiceGUID = ccServicePlan.Entity.ServiceGUID
	servicePlan.Public = ccServicePlan.Entity.Public
	servicePlan.Description = ccServicePlan.Entity.Description
	servicePlan.Free = ccServicePlan.Entity.Free
	return nil
}
508078
func (x *ImagingObjectSelection) UnmarshalJSON(data []byte) (err error) {
	x2 := imagingObjectSelection{}
	if err = json.Unmarshal(data, &x2); err == nil {
		if x2.Contained != nil {
			for i := range x2.Contained {
				x2.Contained[i] = MapToResource(x2.Contained[i], true)
			}
		}
		*x = ImagingObjectSelection(x2)
		return x.checkResourceType()
	}
	return
}
984541
func (o *ExternalLoadBalancerAttachment) UnmarshalJSON(data []byte) error {
	var jsonName string
	if err := json.Unmarshal(data, &jsonName); err == nil {
		o.Name = &jsonName
		return nil
	}

	var r realExternalLoadBalancerAttachment
	if err := json.Unmarshal(data, &r); err != nil {
		return err
	}
	*o = ExternalLoadBalancerAttachment(r)
	return nil
}
875837
func (l *WAFRegionalSizeConstraintSetFieldToMatchList) UnmarshalJSON(buf []byte) error {
	// Cloudformation allows a single object when a list of objects is expected
	item := WAFRegionalSizeConstraintSetFieldToMatch{}
	if err := json.Unmarshal(buf, &item); err == nil {
		*l = WAFRegionalSizeConstraintSetFieldToMatchList{item}
		return nil
	}
	list := []WAFRegionalSizeConstraintSetFieldToMatch{}
	err := json.Unmarshal(buf, &list)
	if err == nil {
		*l = WAFRegionalSizeConstraintSetFieldToMatchList(list)
		return nil
	}
	return err
}
155264
func (x *ValueSet) UnmarshalJSON(data []byte) (err error) {
	x2 := valueSet{}
	if err = json.Unmarshal(data, &x2); err == nil {
		if x2.Contained != nil {
			for i := range x2.Contained {
				x2.Contained[i] = MapToResource(x2.Contained[i], true)
			}
		}
		*x = ValueSet(x2)
		return x.checkResourceType()
	}
	return
}
1119344
func (a *AgendaStatusType) UnmarshalJSON(b []byte) error {
	var str string
	if err := json.Unmarshal(b, &str); err != nil {
		return err
	}
	*a = AgendaStatusFromStr(str)
	return nil
}
39670
func (l *WAFRegionalIPSetIPSetDescriptorList) UnmarshalJSON(buf []byte) error {
	// Cloudformation allows a single object when a list of objects is expected
	item := WAFRegionalIPSetIPSetDescriptor{}
	if err := json.Unmarshal(buf, &item); err == nil {
		*l = WAFRegionalIPSetIPSetDescriptorList{item}
		return nil
	}
	list := []WAFRegionalIPSetIPSetDescriptor{}
	err := json.Unmarshal(buf, &list)
	if err == nil {
		*l = WAFRegionalIPSetIPSetDescriptorList(list)
		return nil
	}
	return err
}
366609
func (spaceQuota *SpaceQuota) UnmarshalJSON(data []byte) error {
	var ccSpaceQuota struct {
		Metadata internal.Metadata `json:"metadata"`
		Entity   struct {
			Name string `json:"name"`
		} `json:"entity"`
	}
	err := cloudcontroller.DecodeJSON(data, &ccSpaceQuota)
	if err != nil {
		return err
	}

	spaceQuota.GUID = ccSpaceQuota.Metadata.GUID
	spaceQuota.Name = ccSpaceQuota.Entity.Name
	return nil
}
181750
func (l *APIGatewayDomainNameEndpointConfigurationList) UnmarshalJSON(buf []byte) error {
	// Cloudformation allows a single object when a list of objects is expected
	item := APIGatewayDomainNameEndpointConfiguration{}
	if err := json.Unmarshal(buf, &item); err == nil {
		*l = APIGatewayDomainNameEndpointConfigurationList{item}
		return nil
	}
	list := []APIGatewayDomainNameEndpointConfiguration{}
	err := json.Unmarshal(buf, &list)
	if err == nil {
		*l = APIGatewayDomainNameEndpointConfigurationList(list)
		return nil
	}
	return err
}
1124315
func (l *RDSOptionGroupOptionConfigurationList) UnmarshalJSON(buf []byte) error {
	// Cloudformation allows a single object when a list of objects is expected
	item := RDSOptionGroupOptionConfiguration{}
	if err := json.Unmarshal(buf, &item); err == nil {
		*l = RDSOptionGroupOptionConfigurationList{item}
		return nil
	}
	list := []RDSOptionGroupOptionConfiguration{}
	err := json.Unmarshal(buf, &list)
	if err == nil {
		*l = RDSOptionGroupOptionConfigurationList(list)
		return nil
	}
	return err
}