Categorygithub.com/saltatory/go-ucb-cli/ucbapi
package
1.0.0
Repository: https://github.com/saltatory/go-ucb-cli.git
Documentation: pkg.go.dev

# README

Go API client for openapi

This API is intended to be used in conjunction with the Unity Cloud Build service. A tool for building your Unity projects in the Cloud. See https://developer.cloud.unity3d.com for more information. ## Making requests This website is built to allow requests to be made against the API. If you are currently logged into Cloud Build you should be able to make requests without entering an API key. You can find your API key in the Unity Cloud Services portal by clicking on 'Cloud Build Preferences' in the sidebar. Copy the API Key and paste it into the upper left corner of this website. It will be used in all subsequent requests. ## Clients The Unity Cloud Build API is based upon Swagger. Client libraries to integrate with your projects can easily be generated with the Swagger Code Generator. The JSON schema required to generate a client for this API version is located here: [API_URL][BASE_PATH]/api.json ## Authorization The Unity Cloud Build API requires an access token from your Unity Cloud Build account, which can be found at https://build.cloud.unity3d.com/login/me To authenticate requests, include a Basic Authentication header with your API key as the value. e.g. Authorization: Basic [YOUR API KEY] ## Pagination Paged results will take two parameters. A page number that is calculated based upon the per_page amount. For instance if there are 40 results and you specify page 2 with per_page set to 10 you will receive records 11-20. Paged results will also return a Content-Range header. For the example above the content range header would look like this: Content-Range: items 11-20/40 ## Versioning The API version is indicated in the request URL. Upgrading to a newer API version can be done by changing the path. The API will receive a new version in the following cases: * removal of a path or request type * addition of a required field * removal of a required field The following changes are considered backwards compatible and will not trigger a new API version: * addition of an endpoint or request type * addition of an optional field * removal of an optional field * changes to the format of ids ## Rate Limiting Requests against the Cloud Build API are limited to a rate of 100 per minute. To preserve the quality of service throughout Cloud Build, additional rate limits may apply to some actions. For example, polling aggressively instead of using webhooks or making API calls with a high concurrency may result in rate limiting. It is not intended for these rate limits to interfere with any legitimate use of the API. Please contact support at [email protected] if your use is affected by this rate limit. You can check the returned HTTP headers for any API request to see your current rate limit status. * X-RateLimit-Limit: maximum number of requests per minute * X-RateLimit-Remaining: remaining number of requests in the current window * X-RateLimit-Reset: time at which the current window will reset (UTC epoch seconds) Once you go over the rate limit you will receive an error response: HTTP Status: 429 { \"error\": \"Rate limit exceeded, retry in XX seconds\" }

Overview

This API client was generated by the OpenAPI Generator project. By using the OpenAPI-spec from a remote server, you can easily generate an API client.

  • API version: 1.0.0
  • Package version: 1.0.0
  • Build package: org.openapitools.codegen.languages.GoClientCodegen

Installation

Install the following dependencies:

go get github.com/stretchr/testify/assert
go get golang.org/x/oauth2
go get golang.org/x/net/context
go get github.com/antihax/optional

Put the package under your project folder and add the following in import:

import "./openapi"

Documentation for API Endpoints

All URIs are relative to http://localhost/api/v1

ClassMethodHTTP requestDescription
BuildsApiBatchDeleteBuildArtifactsPost /orgs/{orgid}/projects/{projectid}/artifacts/deleteDelete artifacts for a batch of builds
BuildsApiCancelAllBuildsDelete /orgs/{orgid}/projects/{projectid}/buildtargets/{buildtargetid}/buildsCancel all builds
BuildsApiCancelBuildDelete /orgs/{orgid}/projects/{projectid}/buildtargets/{buildtargetid}/builds/{number}Cancel build
BuildsApiCancelBuildsForOrgDelete /orgs/{orgid}/buildsCancel builds for org
BuildsApiCreateSharePost /orgs/{orgid}/projects/{projectid}/buildtargets/{buildtargetid}/builds/{number}/shareCreate a new link to share a project
BuildsApiDeleteAllBuildArtifactsDelete /orgs/{orgid}/projects/{projectid}/buildtargets/{buildtargetid}/builds/artifactsDelete all artifacts associated with all non-favorited builds for a specified buildtargetid (_all is allowed).
BuildsApiDeleteBuildArtifactsDelete /orgs/{orgid}/projects/{projectid}/buildtargets/{buildtargetid}/builds/{number}/artifactsDelete all artifacts associated with a specific build
BuildsApiGetBuildGet /orgs/{orgid}/projects/{projectid}/buildtargets/{buildtargetid}/builds/{number}Build Status
BuildsApiGetBuildLogGet /orgs/{orgid}/projects/{projectid}/buildtargets/{buildtargetid}/builds/{number}/logGet build log
BuildsApiGetBuildStepsGet /orgs/{orgid}/projects/{projectid}/buildtargets/{buildtargetid}/builds/{number}/stepsGet the build steps for a given build
BuildsApiGetBuildsGet /orgs/{orgid}/projects/{projectid}/buildtargets/{buildtargetid}/buildsList all builds
BuildsApiGetBuildsForOrgGet /orgs/{orgid}/buildsList all builds for org
BuildsApiGetProjectsBuildTargetsAuditLogGet /orgs/{orgid}/projects/{projectid}/buildtargets/{buildtargetid}/auditlogGet audit log
BuildsApiGetProjectsBuildTargetsBuildsAuditLogGet /orgs/{orgid}/projects/{projectid}/buildtargets/{buildtargetid}/builds/{number}/auditlogGet audit log
BuildsApiGetShareGet /orgs/{orgid}/projects/{projectid}/buildtargets/{buildtargetid}/builds/{number}/shareGet the share link
BuildsApiResignBuildArtifactPost /orgs/{orgid}/projects/{projectid}/buildtargets/{buildtargetid}/builds/{number}/resignRe-sign a build artifact
BuildsApiRevokeShareDelete /orgs/{orgid}/projects/{projectid}/buildtargets/{buildtargetid}/builds/{number}/shareRevoke a shared link
BuildsApiStartBuildsPost /orgs/{orgid}/projects/{projectid}/buildtargets/{buildtargetid}/buildsCreate new build
BuildsApiUpdateBuildPut /orgs/{orgid}/projects/{projectid}/buildtargets/{buildtargetid}/builds/{number}Update build information
BuildtargetsApiGetBuildTargetsForOrgGet /orgs/{orgid}/buildtargetsList all build targets for an org
BuildtargetsApiGetProjectsBuildTargetsStatsGet /orgs/{orgid}/projects/{projectid}/buildtargets/{buildtargetid}/statsGet build target statistics
BuildtargetsApiOrgsOrgidProjectsProjectidBuildtargetsBuildtargetidDeleteDelete /orgs/{orgid}/projects/{projectid}/buildtargets/{buildtargetid}Delete build target
BuildtargetsApiOrgsOrgidProjectsProjectidBuildtargetsBuildtargetidEnvvarsGetGet /orgs/{orgid}/projects/{projectid}/buildtargets/{buildtargetid}/envvarsGet environment variables
BuildtargetsApiOrgsOrgidProjectsProjectidBuildtargetsBuildtargetidEnvvarsPutPut /orgs/{orgid}/projects/{projectid}/buildtargets/{buildtargetid}/envvarsSet environment variables
BuildtargetsApiOrgsOrgidProjectsProjectidBuildtargetsBuildtargetidGetGet /orgs/{orgid}/projects/{projectid}/buildtargets/{buildtargetid}Get a build target
BuildtargetsApiOrgsOrgidProjectsProjectidBuildtargetsBuildtargetidPutPut /orgs/{orgid}/projects/{projectid}/buildtargets/{buildtargetid}Update build target details
BuildtargetsApiOrgsOrgidProjectsProjectidBuildtargetsGetGet /orgs/{orgid}/projects/{projectid}/buildtargetsList all build targets for a project
BuildtargetsApiOrgsOrgidProjectsProjectidBuildtargetsPostPost /orgs/{orgid}/projects/{projectid}/buildtargetsCreate build target for a project
ConfigApiListScmsSupportingVersionAutoDetectGet /versions/auto_detect_supported_scmsList all SCM types supporting auto detecting the project Unity version
ConfigApiListUnityVersionsGet /versions/unityList all unity versions
ConfigApiListXcodeVersionsGet /versions/xcodeList all xcode versions
CredentialsApiAddCredentialsAndroidPost /orgs/{orgid}/projects/{projectid}/credentials/signing/androidUpload Android Credentials
CredentialsApiAddCredentialsAndroidForOrgPost /orgs/{orgid}/credentials/signing/androidUpload Android Credentials
CredentialsApiAddCredentialsIosPost /orgs/{orgid}/projects/{projectid}/credentials/signing/iosUpload iOS Credentials
CredentialsApiAddCredentialsIosForOrgPost /orgs/{orgid}/credentials/signing/iosUpload iOS Credentials for organization
CredentialsApiDeleteAndroidDelete /orgs/{orgid}/projects/{projectid}/credentials/signing/android/{credentialid}Delete Android Credentials
CredentialsApiDeleteAndroidForOrgDelete /orgs/{orgid}/credentials/signing/android/{credentialid}Delete Android Credentials for organization
CredentialsApiDeleteIosDelete /orgs/{orgid}/projects/{projectid}/credentials/signing/ios/{credentialid}Delete iOS Credentials
CredentialsApiDeleteIosForOrgDelete /orgs/{orgid}/credentials/signing/ios/{credentialid}Delete iOS Credentials for organization
CredentialsApiGetAllAndroidGet /orgs/{orgid}/projects/{projectid}/credentials/signing/androidGet All Android Credentials
CredentialsApiGetAllAndroidForOrgGet /orgs/{orgid}/credentials/signing/androidGet All Android Credentials for an organization
CredentialsApiGetAllIosGet /orgs/{orgid}/projects/{projectid}/credentials/signing/iosGet All iOS Credentials
CredentialsApiGetAllIosForOrgGet /orgs/{orgid}/credentials/signing/iosGet All iOS Credentials for an oganization
CredentialsApiGetOneAndroidGet /orgs/{orgid}/projects/{projectid}/credentials/signing/android/{credentialid}Get Android Credential Details
CredentialsApiGetOneAndroidForOrgGet /orgs/{orgid}/credentials/signing/android/{credentialid}Get Android Credential Details for organization
CredentialsApiGetOneIosGet /orgs/{orgid}/projects/{projectid}/credentials/signing/ios/{credentialid}Get iOS Credential Details
CredentialsApiGetOneIosForOrgGet /orgs/{orgid}/credentials/signing/ios/{credentialid}Get iOS Credential Details for organization
CredentialsApiUpdateAndroidPut /orgs/{orgid}/projects/{projectid}/credentials/signing/android/{credentialid}Update Android Credentials
CredentialsApiUpdateAndroidForOrgPut /orgs/{orgid}/credentials/signing/android/{credentialid}Update Android Credentials for organization
CredentialsApiUpdateIosPut /orgs/{orgid}/projects/{projectid}/credentials/signing/ios/{credentialid}Update iOS Credentials
CredentialsApiUpdateIosForOrgPut /orgs/{orgid}/credentials/signing/ios/{credentialid}Update iOS Credentials for organization
OrgsApiGetBillingPlansGet /orgs/{orgid}/billingplanGet billing plan
OrgsApiGetSSHKeyGet /orgs/{orgid}/sshkeyGet SSH Key
OrgsApiRegenerateSSHKeyPost /orgs/{orgid}/sshkeyRegenerate SSH Key
ProjectsApiAddProjectPost /orgs/{orgid}/projectsCreate project
ProjectsApiArchiveProjectDelete /orgs/{orgid}/projects/{projectid}Archive project
ProjectsApiGetAuditLogGet /orgs/{orgid}/projects/{projectid}/auditlogGet audit log
ProjectsApiGetProjectGet /orgs/{orgid}/projects/{projectid}Get project details
ProjectsApiGetProjectByUpidGet /projects/{projectupid}Get project details
ProjectsApiGetProjectsBillingPlansGet /orgs/{orgid}/projects/{projectid}/billingplanGet billing plan
ProjectsApiGetProjectsSSHKeyGet /orgs/{orgid}/projects/{projectid}/sshkeyGet SSH Key
ProjectsApiGetStatsGet /orgs/{orgid}/projects/{projectid}/statsGet project statistics
ProjectsApiListProjectsForOrgGet /orgs/{orgid}/projectsList all projects (org)
ProjectsApiListProjectsForUserGet /projectsList all projects (user)
ProjectsApiOrgsOrgidProjectsProjectidEnvvarsGetGet /orgs/{orgid}/projects/{projectid}/envvarsGet environment variables
ProjectsApiOrgsOrgidProjectsProjectidEnvvarsPutPut /orgs/{orgid}/projects/{projectid}/envvarsSet environment variables
ProjectsApiUpdateProjectPut /orgs/{orgid}/projects/{projectid}Update project details
SharesApiGetShareMetadataGet /shares/{shareid}Get details on shared build including download link
StatusApiGetStatusGet /statusGet Cloud Build Status
UserdevicesApiCreateDevicePost /users/me/devicesCreate iOS device profile
UserdevicesApiListDevicesForUserGet /users/me/devicesList iOS device profiles
UsersApiGetUserApiKeyGet /users/me/apikeyGet current user's API key
UsersApiGetUserSelfGet /users/meGet current user
UsersApiRegenApiKeyPost /users/me/apikeyRegenerate API Key
UsersApiUpdateUserSelfPut /users/meUpdate current user
WebhooksApiAddHookForOrgPost /orgs/{orgid}/hooksAdd hook for organization
WebhooksApiAddHookForProjectPost /orgs/{orgid}/projects/{projectid}/hooksAdd hook for project
WebhooksApiDeleteHookDelete /orgs/{orgid}/hooks/{id}Delete organization hook
WebhooksApiGetHookGet /orgs/{orgid}/hooks/{id}Get organization hook details
WebhooksApiGetProjectsHookGet /orgs/{orgid}/projects/{projectid}/hooks/{id}Get project hook details
WebhooksApiListHooksForOrgGet /orgs/{orgid}/hooksList hooks for organization
WebhooksApiListHooksForProjectGet /orgs/{orgid}/projects/{projectid}/hooksList hooks for project
WebhooksApiOrgsOrgidProjectsProjectidHooksIdDeleteDelete /orgs/{orgid}/projects/{projectid}/hooks/{id}Delete project hook
WebhooksApiOrgsOrgidProjectsProjectidHooksIdPingPostPost /orgs/{orgid}/projects/{projectid}/hooks/{id}/pingPing a project hook
WebhooksApiOrgsOrgidProjectsProjectidHooksIdPutPut /orgs/{orgid}/projects/{projectid}/hooks/{id}Update hook for project
WebhooksApiPingHookPost /orgs/{orgid}/hooks/{id}/pingPing an org hook
WebhooksApiUpdateHookPut /orgs/{orgid}/hooks/{id}Update hook for organization

Documentation For Models

Documentation For Authorization

apikey

  • Type: HTTP basic authentication

Example

auth := context.WithValue(context.Background(), sw.ContextBasicAuth, sw.BasicAuth{
    UserName: "username",
    Password: "password",
})
r, err := client.Service.Operation(auth, args)

filetoken

  • Type: HTTP basic authentication

Example

auth := context.WithValue(context.Background(), sw.ContextBasicAuth, sw.BasicAuth{
    UserName: "username",
    Password: "password",
})
r, err := client.Service.Operation(auth, args)

permissions

  • Type: OAuth
  • Flow: implicit
  • Authorization URL: https://build.cloud.unity3d.com/login/
  • Scopes:
  • org:user: must have at least user permissions in the organization
  • org:manager: must have at least manager permissions in the organization
  • project:user: must have at least user permissions in the project
  • project:manager: must have at least manager permissions in the project
  • admin: administrative privileges
  • admin_readstats: administrative read stats privileges

Example

auth := context.WithValue(context.Background(), sw.ContextAccessToken, "ACCESSTOKENSTRING")
r, err := client.Service.Operation(auth, args)

Or via OAuth2 module to automatically refresh tokens and perform user authentication.

import "golang.org/x/oauth2"

/* Perform OAuth2 round trip request and obtain a token */

tokenSource := oauth2cfg.TokenSource(createContext(httpClient), &token)
auth := context.WithValue(oauth2.NoContext, sw.ContextOAuth2, tokenSource)
r, err := client.Service.Operation(auth, args)

Author