code: func (securityGroup *SecurityGroup) UnmarshalJSON(data []byte) error {
  	var ccSecurityGroup struct {
  		Metadata internal.Metadata `json:"metadata"`
  		Entity   struct {
  			GUID  string `json:"guid"`
  			Name  string `json:"name"`
  			Rules []struct {
  				Description string `json:"description"`
  				Destination string `json:"destination"`
  				Ports       string `json:"ports"`
  				Protocol    string `json:"protocol"`
  			} `json:"rules"`
  			RunningDefault bool `json:"running_default"`
  			StagingDefault bool `json:"staging_default"`
  		} `json:"entity"`
  	}
  	err := cloudcontroller.DecodeJSON(data, &ccSecurityGroup)
  	if err != nil {
  		return err
  	}
  
  	securityGroup.GUID = ccSecurityGroup.Metadata.GUID
  	securityGroup.Name = ccSecurityGroup.Entity.Name
  	securityGroup.Rules = make([]SecurityGroupRule, len(ccSecurityGroup.Entity.Rules))
  	for i, ccRule := range ccSecurityGroup.Entity.Rules {
  		securityGroup.Rules[i].Description = ccRule.Description
  		securityGroup.Rules[i].Destination = ccRule.Destination
  		securityGroup.Rules[i].Ports = ccRule.Ports
  		securityGroup.Rules[i].Protocol = ccRule.Protocol
  	}
  	securityGroup.RunningDefault = ccSecurityGroup.Entity.RunningDefault
  	securityGroup.StagingDefault = ccSecurityGroup.Entity.StagingDefault
  	return nil
  }
docs: // UnmarshalJSON helps unmarshal a Cloud Controller Security Group response