code: func (p Package) MarshalJSON() ([]byte, error) {
  	type ccPackageData struct {
  		Image    string `json:"image,omitempty"`
  		Username string `json:"username,omitempty"`
  		Password string `json:"password,omitempty"`
  	}
  	var ccPackage struct {
  		GUID          string                `json:"guid,omitempty"`
  		CreatedAt     string                `json:"created_at,omitempty"`
  		Links         APILinks              `json:"links,omitempty"`
  		Relationships Relationships         `json:"relationships,omitempty"`
  		State         constant.PackageState `json:"state,omitempty"`
  		Type          constant.PackageType  `json:"type,omitempty"`
  		Data          *ccPackageData        `json:"data,omitempty"`
  	}
  
  	ccPackage.GUID = p.GUID
  	ccPackage.CreatedAt = p.CreatedAt
  	ccPackage.Links = p.Links
  	ccPackage.Relationships = p.Relationships
  	ccPackage.State = p.State
  	ccPackage.Type = p.Type
  	if p.DockerImage != "" {
  		ccPackage.Data = &ccPackageData{
  			Image:    p.DockerImage,
  			Username: p.DockerUsername,
  			Password: p.DockerPassword,
  		}
  	}
  
  	return json.Marshal(ccPackage)
  }
docs: // MarshalJSON converts a Package into a Cloud Controller Package.