(name string, position *int, enabled *bool, locked *bool)
| 108 | } |
| 109 | |
| 110 | func (repo CloudControllerBuildpackRepository) Create(name string, position *int, enabled *bool, locked *bool) (createdBuildpack models.Buildpack, apiErr error) { |
| 111 | entity := resources.BuildpackEntity{Name: name, Position: position, Enabled: enabled, Locked: locked} |
| 112 | body, err := json.Marshal(entity) |
| 113 | if err != nil { |
| 114 | apiErr = fmt.Errorf("%s: %s", T("Could not serialize information"), err.Error()) |
| 115 | return |
| 116 | } |
| 117 | |
| 118 | resource := new(resources.BuildpackResource) |
| 119 | apiErr = repo.gateway.CreateResource(repo.config.APIEndpoint(), buildpacksPath, bytes.NewReader(body), resource) |
| 120 | if apiErr != nil { |
| 121 | return |
| 122 | } |
| 123 | |
| 124 | createdBuildpack = resource.ToFields() |
| 125 | return |
| 126 | } |
| 127 | |
| 128 | func (repo CloudControllerBuildpackRepository) Delete(buildpackGUID string) (apiErr error) { |
| 129 | path := fmt.Sprintf("%s/%s", buildpacksPath, buildpackGUID) |
nothing calls this directly
no test coverage detected