Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
async Task Main()
var apiKey = "Input your Api Key";
var orgId = "Input Target OrgId";
var projectId = "Input ProjectId";
var client = new UnityCloudBuildApi.IO.Swagger.Client.ApiClient("");
var config = new UnityCloudBuildApi.IO.Swagger.Client.Configuration(client, accessToken: apiKey);
#region Build Api
// Get Build Detail
var buildApi = new UnityCloudBuildApi.IO.Swagger.Api.BuildsApi(config);
var build = await buildApi.GetBuildsAsync(orgId, projectId, buildTargets.FirstOrDefault().Buildtargetid);
// Start Build
var option = new UnityCloudBuildApi.IO.Swagger.Model.Options4
Clean = false,
Delay = 0,
var startBuild = await buildApi.StartBuildsAsync(orgId, projectId, buildTargets.FirstOrDefault().Buildtargetid, option);
// Cancel All Build
foreach (var item in build.Where(x => x.BuildStatus == "queued"))
var cancelBuilds = await buildApi.CancelAllBuildsAsync(orgId, projectId, item.Buildtargetid);
// Cancel Specific Builds
var cancelBuild = await buildApi.CancelBuildAsync(orgId, projectId, buildTargets.FirstOrDefault().Buildtargetid, startBuild.FirstOrDefault().Build.ToString());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.