github.com/jenspinney/cli@v6.42.1-0.20190207184520-7450c600020e+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  	Stack    string `json:"stack,omitempty"`
    13  	Position *int   `json:"position,omitempty"`
    14  	Enabled  *bool  `json:"enabled,omitempty"`
    15  	Key      string `json:"key,omitempty"`
    16  	Filename string `json:"filename,omitempty"`
    17  	Locked   *bool  `json:"locked,omitempty"`
    18  }
    19  
    20  func (resource BuildpackResource) ToFields() models.Buildpack {
    21  	return models.Buildpack{
    22  		GUID:     resource.Metadata.GUID,
    23  		Name:     resource.Entity.Name,
    24  		Stack:    resource.Entity.Stack,
    25  		Position: resource.Entity.Position,
    26  		Enabled:  resource.Entity.Enabled,
    27  		Key:      resource.Entity.Key,
    28  		Filename: resource.Entity.Filename,
    29  		Locked:   resource.Entity.Locked,
    30  	}
    31  }