Created
February 13, 2016 00:31
-
-
Save guitarrapc/7d705846341a17cc1b38 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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