betacode / unity-cloud-build-api

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

unity-cloud-build-api

How to generate Unity Cloud API code

Install Swagger Codegen locally

brew install swagger-codegen

Check which version is installed. Anything higher than 3.0.0 should work

swagger-codegen version
3.0.34

config.json just contains the name of the project and the version

{
  "packageName": "unity_cloud_build_api",
  "projectName": "unity-cloud-build-api",
  "packageVersion": "1.0.0"
}

Generate API code for python.

swagger-codegen generate -l python -i https://build-api.cloud.unity3d.com/api/v1/api.json -c config.json

bug fix

There is a bug in the generated python code.
response_type should 'InlineResponse20011' not 'object'
file: unity_cloud_build_api/api/builds_api.py
line: 1189

-            response_type='object',  # noqa: E501
+            response_type='InlineResponse20011',  # noqa: E501

VVVV Everything below here was generated by Swagger Codegen VVVV


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 by selecting Settings under DevOps > Cloud Build at https://dashboard.unity3d.com/cloud-build 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 ## Identifiers It should not be assumed that any of the identifiers used in paths will be a perfect match for your user-entered information. If you see unexpected 403s or 404s from API calls then check your identifiers match the ones used by the API. In particular, projectId does NOT typically change when the project is renamed and in fact may not be a direct match for the project name even at initial creation time. To avoid confusion we recommend that instead of using the human-readable autogenerated orgId and projectId available from the API you should instead use: * org foreign key for orgId (available from project APIs as orgFk and org APIs as coreForeignKey) * guid for projectId All links generated by the API and the Dashboard should follow this format already, making it easy to figure out the correct parameters by making a comparison. ## 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 cloudbuild@unity3d.com 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\" }

This Python package is automatically generated by the Swagger Codegen project:

  • API version: 1.0.0
  • Package version: 1.0.0
  • Build package: io.swagger.codegen.v3.generators.python.PythonClientCodegen

Requirements.

Python 2.7 and 3.4+

Installation & Usage

pip install

If the python package is hosted on Github, you can install directly from Github

pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git

(you may need to run pip with root permission: sudo pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git)

Then import the package:

import unity_cloud_build_api 

Setuptools

Install via Setuptools.

python setup.py install --user

(or sudo python setup.py install to install the package for all users)

Then import the package:

import unity_cloud_build_api

Getting Started

Please follow the installation procedure and then run the following:

from __future__ import print_function
import time
import unity_cloud_build_api
from unity_cloud_build_api.rest import ApiException
from pprint import pprint
# Configure HTTP basic authorization: apikey
configuration = unity_cloud_build_api.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'
# Configure OAuth2 access token for authorization: permissions
configuration = unity_cloud_build_api.Configuration()
configuration.access_token = 'YOUR_ACCESS_TOKEN'

# create an instance of the API class
api_instance = unity_cloud_build_api.BillingApi(unity_cloud_build_api.ApiClient(configuration))
orgid = 'orgid_example' # str | Organization identifier
projectid = 'projectid_example' # str | Project identifier

try:
    # Get billing plan
    api_response = api_instance.billing_plan(orgid, projectid)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling BillingApi->billing_plan: %s\n" % e)

Documentation for API Endpoints

All URIs are relative to /api/v1

Class Method HTTP request Description
BillingApi billing_plan GET /orgs/{orgid}/projects/{projectid}/billingplan_alpha Get billing plan
BuildsApi batch_delete_build_artifacts POST /orgs/{orgid}/projects/{projectid}/artifacts/delete Delete artifacts for a batch of builds
BuildsApi cancel_all_builds DELETE /orgs/{orgid}/projects/{projectid}/buildtargets/{buildtargetid}/builds Cancel all builds
BuildsApi cancel_build DELETE /orgs/{orgid}/projects/{projectid}/buildtargets/{buildtargetid}/builds/{number} Cancel build
BuildsApi cancel_builds_for_org DELETE /orgs/{orgid}/builds Cancel builds for org
BuildsApi create_share POST /orgs/{orgid}/projects/{projectid}/buildtargets/{buildtargetid}/builds/{number}/share Create a new link to share a project
BuildsApi delete_all_build_artifacts DELETE /orgs/{orgid}/projects/{projectid}/buildtargets/{buildtargetid}/builds/artifacts Delete all artifacts associated with all non-favorited builds for a specified buildtargetid (_all is allowed).
BuildsApi delete_build_artifacts DELETE /orgs/{orgid}/projects/{projectid}/buildtargets/{buildtargetid}/builds/{number}/artifacts Delete all artifacts associated with a specific build
BuildsApi get_audit_log GET /orgs/{orgid}/projects/{projectid}/buildtargets/{buildtargetid}/builds/{number}/auditlog Get audit log
BuildsApi get_audit_log_for_build_target GET /orgs/{orgid}/projects/{projectid}/buildtargets/{buildtargetid}/auditlog Get audit log
BuildsApi get_build GET /orgs/{orgid}/projects/{projectid}/buildtargets/{buildtargetid}/builds/{number} Build Status
BuildsApi get_build_log GET /orgs/{orgid}/projects/{projectid}/buildtargets/{buildtargetid}/builds/{number}/log Get build log
BuildsApi get_build_steps GET /orgs/{orgid}/projects/{projectid}/buildtargets/{buildtargetid}/builds/{number}/steps Get the build steps for a given build
BuildsApi get_builds GET /orgs/{orgid}/projects/{projectid}/buildtargets/{buildtargetid}/builds List all builds
BuildsApi get_builds_for_org GET /orgs/{orgid}/builds List all builds for org
BuildsApi get_share GET /orgs/{orgid}/projects/{projectid}/buildtargets/{buildtargetid}/builds/{number}/share Get the share link
BuildsApi modify_share PUT /orgs/{orgid}/projects/{projectid}/buildtargets/{buildtargetid}/builds/{number}/share Modify existing share link
BuildsApi resign_build_artifact POST /orgs/{orgid}/projects/{projectid}/buildtargets/{buildtargetid}/builds/{number}/resign Re-sign a build artifact
BuildsApi revoke_share DELETE /orgs/{orgid}/projects/{projectid}/buildtargets/{buildtargetid}/builds/{number}/share Revoke a shared link
BuildsApi start_builds POST /orgs/{orgid}/projects/{projectid}/buildtargets/{buildtargetid}/builds Create new build
BuildsApi update_build PUT /orgs/{orgid}/projects/{projectid}/buildtargets/{buildtargetid}/builds/{number} Update build information
BuildtargetsApi add_build_target POST /orgs/{orgid}/projects/{projectid}/buildtargets Create build target for a project
BuildtargetsApi delete_build_target DELETE /orgs/{orgid}/projects/{projectid}/buildtargets/{buildtargetid} Delete build target
BuildtargetsApi get_build_target GET /orgs/{orgid}/projects/{projectid}/buildtargets/{buildtargetid} Get a build target
BuildtargetsApi get_build_targets GET /orgs/{orgid}/projects/{projectid}/buildtargets List all build targets for a project
BuildtargetsApi get_build_targets_for_org GET /orgs/{orgid}/buildtargets List all build targets for an org
BuildtargetsApi get_env_variables_for_build_target GET /orgs/{orgid}/projects/{projectid}/buildtargets/{buildtargetid}/envvars Get environment variables
BuildtargetsApi get_stats_for_build_target GET /orgs/{orgid}/projects/{projectid}/buildtargets/{buildtargetid}/stats Get build target statistics
BuildtargetsApi set_env_variables_for_build_target PUT /orgs/{orgid}/projects/{projectid}/buildtargets/{buildtargetid}/envvars Set environment variables
BuildtargetsApi update_build_target PUT /orgs/{orgid}/projects/{projectid}/buildtargets/{buildtargetid} Update build target details
ConfigApi get_version GET /versions/unity/{key} Get a unity version by value
ConfigApi list_scms_supporting_version_auto_detect GET /versions/auto_detect_supported_scms List all SCM types supporting auto detecting the project Unity version
ConfigApi list_unity_versions GET /versions/unity List all unity versions
ConfigApi list_xcode_versions GET /versions/xcode List all xcode versions
CredentialsApi add_credentials_android POST /orgs/{orgid}/projects/{projectid}/credentials/signing/android Upload Android Credentials
CredentialsApi add_credentials_android_for_org POST /orgs/{orgid}/credentials/signing/android Upload Android Credentials
CredentialsApi add_credentials_ios POST /orgs/{orgid}/projects/{projectid}/credentials/signing/ios Upload iOS Credentials
CredentialsApi add_credentials_ios_for_org POST /orgs/{orgid}/credentials/signing/ios Upload iOS Credentials for organization
CredentialsApi add_credentials_osx POST /orgs/{orgid}/projects/{projectid}/credentials/signing/osx Upload OSX Credentials
CredentialsApi add_credentials_osx_for_org POST /orgs/{orgid}/credentials/signing/osx Upload OSX Credentials for organization
CredentialsApi delete_android DELETE /orgs/{orgid}/projects/{projectid}/credentials/signing/android/{credentialid} Delete Android Credentials
CredentialsApi delete_android_for_org DELETE /orgs/{orgid}/credentials/signing/android/{credentialid} Delete Android Credentials for organization
CredentialsApi delete_ios DELETE /orgs/{orgid}/projects/{projectid}/credentials/signing/ios/{credentialid} Delete iOS Credentials
CredentialsApi delete_ios_for_org DELETE /orgs/{orgid}/credentials/signing/ios/{credentialid} Delete iOS Credentials for organization
CredentialsApi delete_osx DELETE /orgs/{orgid}/projects/{projectid}/credentials/signing/osx/{credentialid} Delete OSX Credentials
CredentialsApi delete_osx_for_org DELETE /orgs/{orgid}/credentials/signing/osx/{credentialid} Delete OSX Credentials for organization
CredentialsApi get_all_android GET /orgs/{orgid}/projects/{projectid}/credentials/signing/android Get All Android Credentials
CredentialsApi get_all_android_for_org GET /orgs/{orgid}/credentials/signing/android Get All Android Credentials for an organization
CredentialsApi get_all_ios GET /orgs/{orgid}/projects/{projectid}/credentials/signing/ios Get All iOS Credentials
CredentialsApi get_all_ios_for_org GET /orgs/{orgid}/credentials/signing/ios Get All iOS Credentials for an oganization
CredentialsApi get_all_osx GET /orgs/{orgid}/projects/{projectid}/credentials/signing/osx Get All OSX Credentials
CredentialsApi get_all_osx_for_org GET /orgs/{orgid}/credentials/signing/osx Get All OSX Credentials for an oganization
CredentialsApi get_one_android GET /orgs/{orgid}/projects/{projectid}/credentials/signing/android/{credentialid} Get Android Credential Details
CredentialsApi get_one_android_for_org GET /orgs/{orgid}/credentials/signing/android/{credentialid} Get Android Credential Details for organization
CredentialsApi get_one_ios GET /orgs/{orgid}/projects/{projectid}/credentials/signing/ios/{credentialid} Get iOS Credential Details
CredentialsApi get_one_ios_for_org GET /orgs/{orgid}/credentials/signing/ios/{credentialid} Get iOS Credential Details for organization
CredentialsApi get_one_osx GET /orgs/{orgid}/projects/{projectid}/credentials/signing/osx/{credentialid} Get OSX Credential Details
CredentialsApi get_one_osx_for_org GET /orgs/{orgid}/credentials/signing/osx/{credentialid} Get OSX Credential Details for organization
CredentialsApi update_android PUT /orgs/{orgid}/projects/{projectid}/credentials/signing/android/{credentialid} Update Android Credentials
CredentialsApi update_android_for_org PUT /orgs/{orgid}/credentials/signing/android/{credentialid} Update Android Credentials for organization
CredentialsApi update_ios PUT /orgs/{orgid}/projects/{projectid}/credentials/signing/ios/{credentialid} Update iOS Credentials
CredentialsApi update_ios_for_org PUT /orgs/{orgid}/credentials/signing/ios/{credentialid} Update iOS Credentials for organization
CredentialsApi update_osx PUT /orgs/{orgid}/projects/{projectid}/credentials/signing/osx/{credentialid} Update OSX Credentials
CredentialsApi update_osx_for_org PUT /orgs/{orgid}/credentials/signing/osx/{credentialid} Update OSX Credentials for organization
OrgsApi get_billing_plans GET /orgs/{orgid}/billingplan Get billing plan
OrgsApi get_ssh_key_for_org GET /orgs/{orgid}/sshkey Get SSH Key
OrgsApi regenerate_ssh_key POST /orgs/{orgid}/sshkey Regenerate SSH Key
ProjectsApi add_project POST /orgs/{orgid}/projects Create project
ProjectsApi archive_project DELETE /orgs/{orgid}/projects/{projectid} Archive project
ProjectsApi billing_plan GET /orgs/{orgid}/projects/{projectid}/billingplan_alpha Get billing plan
ProjectsApi get_audit_log_for_project GET /orgs/{orgid}/projects/{projectid}/auditlog Get audit log
ProjectsApi get_billing_plans_for_project GET /orgs/{orgid}/projects/{projectid}/billingplan Get billing plan
ProjectsApi get_env_variables_for_project GET /orgs/{orgid}/projects/{projectid}/envvars Get environment variables
ProjectsApi get_project GET /orgs/{orgid}/projects/{projectid} Get project details
ProjectsApi get_project_by_upid GET /projects/{projectupid} Get project details
ProjectsApi get_ssh_key_for_project GET /orgs/{orgid}/projects/{projectid}/sshkey Get SSH Key
ProjectsApi get_stats_for_project GET /orgs/{orgid}/projects/{projectid}/stats Get project statistics
ProjectsApi list_projects_for_org GET /orgs/{orgid}/projects List all projects (org)
ProjectsApi list_projects_for_user GET /projects List all projects (user)
ProjectsApi set_env_variables_for_project PUT /orgs/{orgid}/projects/{projectid}/envvars Set environment variables
ProjectsApi update_project PUT /orgs/{orgid}/projects/{projectid} Update project details
PublicApi get_change_logs GET /changelogs Get the Unity Cloud Build changelogs
SharesApi get_share_metadata GET /shares/{shareid} Get details on shared build including download link
StatusApi get_status GET /status Get Cloud Build Status
UserdevicesApi create_device POST /users/me/devices Create iOS device profile
UserdevicesApi list_devices_for_user GET /users/me/devices List iOS device profiles
UsersApi get_user_api_key GET /users/me/apikey Get current user's API key
UsersApi get_user_self GET /users/me Get current user
UsersApi regen_api_key POST /users/me/apikey Regenerate API Key
UsersApi update_user_self PUT /users/me Update current user
WebhooksApi add_hook_for_org POST /orgs/{orgid}/hooks Add hook for organization
WebhooksApi add_hook_for_project POST /orgs/{orgid}/projects/{projectid}/hooks Add hook for project
WebhooksApi delete_hook_for_org DELETE /orgs/{orgid}/hooks/{id} Delete organization hook
WebhooksApi delete_hook_for_project DELETE /orgs/{orgid}/projects/{projectid}/hooks/{id} Delete project hook
WebhooksApi get_hook_for_org GET /orgs/{orgid}/hooks/{id} Get organization hook details
WebhooksApi get_hook_for_project GET /orgs/{orgid}/projects/{projectid}/hooks/{id} Get project hook details
WebhooksApi list_hooks_for_org GET /orgs/{orgid}/hooks List hooks for organization
WebhooksApi list_hooks_for_project GET /orgs/{orgid}/projects/{projectid}/hooks List hooks for project
WebhooksApi ping_hook_for_org POST /orgs/{orgid}/hooks/{id}/ping Ping an org hook
WebhooksApi ping_hook_for_project POST /orgs/{orgid}/projects/{projectid}/hooks/{id}/ping Ping a project hook
WebhooksApi update_hook_for_org PUT /orgs/{orgid}/hooks/{id} Update hook for organization
WebhooksApi update_hook_for_project PUT /orgs/{orgid}/projects/{projectid}/hooks/{id} Update hook for project

Documentation For Models

Documentation For Authorization

apikey

  • Type: HTTP basic authentication

filetoken

  • Type: HTTP basic authentication

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

Author

About


Languages

Language:Python 99.9%Language:Shell 0.1%