forked from cloudfoundry/cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
buildpacks.go
31 lines (27 loc) · 839 Bytes
/
buildpacks.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package resources
import "code.cloudfoundry.org/cli/cf/models"
type BuildpackResource struct {
Resource
Entity BuildpackEntity
}
type BuildpackEntity struct {
Name string `json:"name"`
Stack string `json:"stack,omitempty"`
Position *int `json:"position,omitempty"`
Enabled *bool `json:"enabled,omitempty"`
Key string `json:"key,omitempty"`
Filename string `json:"filename,omitempty"`
Locked *bool `json:"locked,omitempty"`
}
func (resource BuildpackResource) ToFields() models.Buildpack {
return models.Buildpack{
GUID: resource.Metadata.GUID,
Name: resource.Entity.Name,
Stack: resource.Entity.Stack,
Position: resource.Entity.Position,
Enabled: resource.Entity.Enabled,
Key: resource.Entity.Key,
Filename: resource.Entity.Filename,
Locked: resource.Entity.Locked,
}
}