MCPcopy Create free account
hub / github.com/UiPath/uipathcli / UpdateRelease

Method UpdateRelease

utils/api/orchestrator_client.go:255–274  ·  view source on GitHub ↗
(folderId int, releaseId int, processKey string, processVersion string)

Source from the content-addressed store, hash-verified

253}
254
255func (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
276func (c OrchestratorClient) createUpdateReleaseRequest(folderId int, releaseId int, processKey string, processVersion string) (*network.HttpRequest, error) {
277 json, err := json.Marshal(createReleaseRequestJson{

Callers 1

CreateOrUpdateReleaseMethod · 0.95

Calls 5

httpClientSettingsMethod · 0.95
SendMethod · 0.95
NewHttpClientFunction · 0.92
CloseMethod · 0.80

Tested by

no test coverage detected