(folderId int, releaseId int, processKey string, processVersion string)
| 253 | } |
| 254 | |
| 255 | func (c OrchestratorClient) UpdateRelease(folderId int, releaseId int, processKey string, processVersion string) (int, error) { |
| 256 | request, err := c.createUpdateReleaseRequest(folderId, releaseId, processKey, processVersion) |
| 257 | if err != nil { |
| 258 | return -1, err |
| 259 | } |
| 260 | client := network.NewHttpClient(c.logger, c.httpClientSettings()) |
| 261 | response, err := client.Send(request) |
| 262 | if err != nil { |
| 263 | return -1, err |
| 264 | } |
| 265 | defer func() { _ = response.Body.Close() }() |
| 266 | body, err := io.ReadAll(response.Body) |
| 267 | if err != nil { |
| 268 | return -1, fmt.Errorf("Error reading response: %w", err) |
| 269 | } |
| 270 | if response.StatusCode != http.StatusOK { |
| 271 | return -1, fmt.Errorf("Orchestrator returned status code '%v' and body '%v'", response.StatusCode, string(body)) |
| 272 | } |
| 273 | return releaseId, nil |
| 274 | } |
| 275 | |
| 276 | func (c OrchestratorClient) createUpdateReleaseRequest(folderId int, releaseId int, processKey string, processVersion string) (*network.HttpRequest, error) { |
| 277 | json, err := json.Marshal(createReleaseRequestJson{ |
no test coverage detected