func (cgroup *CgroupResource) UnmarshalJSON(b []byte) error {
	temp := cgroupResourceJSON{}

	if err := json.Unmarshal(b, &temp); err != nil {
		return err
	}

	cgroup.cgroupRoot = temp.CgroupRoot
	cgroup.cgroupMountPath = temp.CgroupMountPath
	cgroup.resourceSpec = temp.LinuxSpec
	if temp.DesiredStatus != nil {
		cgroup.SetDesiredStatus(resourcestatus.ResourceStatus(*temp.DesiredStatus))
	}
	if temp.KnownStatus != nil {
		cgroup.SetKnownStatus(resourcestatus.ResourceStatus(*temp.KnownStatus))
	}
	return nil
}
func (cgroup *CgroupResource) UnmarshalJSON(b []byte) error {
	temp := cgroupResourceJSON{}

	if err := json.Unmarshal(b, &temp); err != nil {
		return err
	}

	cgroup.cgroupRoot = temp.CgroupRoot
	cgroup.cgroupMountPath = temp.CgroupMountPath
	cgroup.resourceSpec = temp.LinuxSpec
	if temp.DesiredStatus != nil {
		cgroup.SetDesiredStatus(resourcestatus.ResourceStatus(*temp.DesiredStatus))
	}
	if temp.KnownStatus != nil {
		cgroup.SetKnownStatus(resourcestatus.ResourceStatus(*temp.KnownStatus))
	}
	return nil
}
func ( cgroup * CgroupResource ) UnmarshalJSON ( b [ ] byte ) error { temp := cgroupResourceJSON { } if err := json . Unmarshal ( b , & temp ) ; err != nil { return err } cgroup . cgroupRoot = temp . CgroupRoot cgroup . cgroupMountPath = temp . CgroupMountPath cgroup . resourceSpec = temp . LinuxSpec if temp . DesiredStatus != nil { cgroup . SetDesiredStatus ( resourcestatus . ResourceStatus ( * temp . DesiredStatus ) ) } if temp . KnownStatus != nil { cgroup . SetKnownStatus ( resourcestatus . ResourceStatus ( * temp . KnownStatus ) ) } return nil }
// UnmarshalJSON unmarshals CgroupResource object using duplicate struct CgroupResourceJSON
UnmarshalJSON unmarshals CgroupResource object using duplicate struct CgroupResourceJSON