Create a gist now

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("https://build-api.cloud.unity3d.com/api/v1");
var config = new UnityCloudBuildApi.IO.Swagger.Client.Configuration(client, accessToken: apiKey);
#region Project Api
// Get Project
var projectApi = new UnityCloudBuildApi.IO.Swagger.Api.ProjectsApi(config);
var proejct = await projectApi.GetBillingPlansAsync(orgId, projectId);
proejct.Dump();
// List Project
var listProject = await projectApi.ListProjectsForOrgAsync(orgId);
listProject.Dump();
// Add Project
var options = new UnityCloudBuildApi.IO.Swagger.Model.Options
{
Name = "Test",
Settings = new UnityCloudBuildApi.IO.Swagger.Model.OrgsorgidprojectsSettings
{
Scm = new UnityCloudBuildApi.IO.Swagger.Model.OrgsorgidprojectsSettingsScm
{
Url = "https://github.com/username/repositoryname.git",
Type = "git",
User = "github user name",
Pass = "github api token",
},
},
};
var addProject = await projectApi.AddProjectAsync(orgId, options);
addProject.Dump();
#endregion
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment