github.com/loggregator/cli@v6.33.1-0.20180224010324-82334f081791+incompatible/cf/api/resources/buildpacks.go (about)

     1  package resources
     2  
     3  import "code.cloudfoundry.org/cli/cf/models"
     4  
     5  type BuildpackResource struct {
     6  	Resource
     7  	Entity BuildpackEntity
     8  }
     9  
    10  type BuildpackEntity struct {
    11  	Name     string `json:"name"`
    12  	Position *int   `json:"position,omitempty"`
    13  	Enabled  *bool  `json:"enabled,omitempty"`
    14  	Key      string `json:"key,omitempty"`
    15  	Filename string `json:"filename,omitempty"`
    16  	Locked   *bool  `json:"locked,omitempty"`
    17  }
    18  
    19  func (resource BuildpackResource) ToFields() models.Buildpack {
    20  	return models.Buildpack{
    21  		GUID:     resource.Metadata.GUID,
    22  		Name:     resource.Entity.Name,
    23  		Position: resource.Entity.Position,
    24  		Enabled:  resource.Entity.Enabled,
    25  		Key:      resource.Entity.Key,
    26  		Filename: resource.Entity.Filename,
    27  		Locked:   resource.Entity.Locked,
    28  	}
    29  }