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

Method CreateRelease

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

Source from the content-addressed store, hash-verified

207}
208
209func (c OrchestratorClient) CreateRelease(folderId int, processKey string, processVersion string) (int, error) {
210 request, err := c.createNewReleaseRequest(folderId, processKey, processVersion)
211 if err != nil {
212 return -1, err
213 }
214 client := network.NewHttpClient(c.logger, c.httpClientSettings())
215 response, err := client.Send(request)
216 if err != nil {
217 return -1, err
218 }
219 defer func() { _ = response.Body.Close() }()
220 body, err := io.ReadAll(response.Body)
221 if err != nil {
222 return -1, fmt.Errorf("Error reading response: %w", err)
223 }
224 if response.StatusCode != http.StatusCreated {
225 return -1, fmt.Errorf("Orchestrator returned status code '%v' and body '%v'", response.StatusCode, string(body))
226 }
227
228 var result createReleaseResponseJson
229 err = json.Unmarshal(body, &result)
230 if err != nil {
231 return -1, fmt.Errorf("Orchestrator returned invalid response body '%v'", string(body))
232 }
233 return result.Id, nil
234}
235
236func (c OrchestratorClient) createNewReleaseRequest(folderId int, processKey string, processVersion string) (*network.HttpRequest, error) {
237 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