diff --git a/.gitignore b/.gitignore index 7f913291a6..bcf7a5ee7c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,20 @@ -.DS_Store -0.0.1.seed node_modules + +logs +*.log +npm-debug.log* + +*.orig + .settings.xml .settings + .c9revisions -/nbproject/private/ \ No newline at end of file +.DS_Store +.idea + +testAuth.json + +apidoc/ + +tsconfig.json diff --git a/.npmignore b/.npmignore index 988771c171..85688b9e5c 100644 --- a/.npmignore +++ b/.npmignore @@ -1,5 +1,18 @@ +node_modules + +logs +*.log +npm-debug.log* + +*.orig + .settings.xml .settings + .c9revisions -doc/ -node_modules/ +.DS_Store +.idea + +testAuth.json + +apidoc/ diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000000..e4a7229cfc --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,333 @@ +# CHANGELOG + +## 9.0.0 + +Breaking changes: + * Always return a response as an object with data and meta attributes. + +Features: + * Add getReference example. + * Add note to createReference description. + +Bug fixes: + * Encode hash in ref param. + +## 8.2.1 + +Features: + * Add community health preview api. + +## 8.1.1 + +Bug fixes: + * Typescript: only set generated Array body properties to string[]. + +## 8.1.0 + +Features: + * Add `maintainer_can_modify` flag to create pull request. + +## 8.0.0 + +Breaking changes: + * Changes to pullRequests.getReview, pullRequests.getReviewComments. + +Features: + * Allow pull request comment endpoints to include reactions. + * Add pull request review examples. + +## 7.3.2 + +Bug fixes: + * Make base param not required for updating pull request. + +## 7.3.1 + +Features: + * Add search commits preview api. + +## 7.2.1 + +Bug fixes: + * Fix typescript bindings. + +## 7.2.0 + +Features: + * Preview Review Requests API. + * Preview pull request reviews. + * Traffic api now official. + +Bug fixes: + * Fix link for accept header example in README. + +## 7.1.0 + +Features: + * Add a TypeScript generator. + * Update protected branches api changes. + +Bug fixes: + * Provide correct values for moveProjectsCard "position" parameter. + +## 7.0.1 + +Bug fixes: + * Fix enterprise uploadAsset edge case. + +## 7.0.0 + +Breaking changes: + * Rename listAssets() to getAssets() for consistency. + +Features: + * Add support for .netrc authentication. + * Add netrc auth example. + * Organization membership API changes. + +## 6.1.0 + +Features: + * Add X-GitHub-RequestId, Retry-After request headers. + * Add trailing slash to getReferences url to return all references. + * Allow the ref param to be the empty string. + +Bug fixes: + * Some example fixes. + +## 6.0.4 + +Bug fixes: + * Don't trim endpoint params. + +## 6.0.3 + +Features: + * Generate flow-type type definitions. + +Bug fixes: + * Fix ref params being uri encoded. + +## 6.0.2 + +Bug fixes: + * Fix validation regex for get-org-membership. + +## 6.0.1 + +Bug fixes: + * Fix accept header management for updated endpoint urls. + +## 6.0.0 + +Breaking changes: + * Move projects to its own section. + * Project endpoint url changes. + * Several additional breaking endpoint url changes. + +Features: + * Add installation repository endpoints. + * Add fingerprint param to update-authorization endpoint. + +## 5.3.3 + +Features: + * Add /installations/repositories endpoint. + +## 5.2.3 + +Bug fixes: + * Reject promise for missing parameters. + +## 5.2.2 + +Bug fixes: + * Replace ES6 code so the library runs for versions of node < v4. + * Make `team_id` required for update ldap endpoints. + +## 5.2.1 + +Bug fixes: + * Fix enterprise ldap update endpoints by adding `ldap_dn` param. + +## 5.2.0 + +Features: + * Add pre-receive endpoints. + * Add params for editGist endpoint. + +Bug fixes: + * Adjust params for updateProtectedBranchRequiredStatusChecks. + * Use body by default for non head/get/delete requests. + * Fix mismatched endpoints in acceptTree object. + * Prevent `accept` and `Accept` mixing in headers. + * Adjust getFollowers endpoint url. + * Adjust testHook endpoint url. + +## 5.1.0 + +Features: + * All pagination-related functions now promisified. + +## 5.0.1 + +Bugfixes: + * Fix for remove assignees from issue. + +## 5.0.0 + +Breaking changes: + * Replace user with owner in endpoints + +## 4.1.0 + +Features: + * Take care of accept headers for preview APIs in the library so there's no need to manually provide it on a per-request basis. + +Bugfixes: + * Change removeAssigneesFromIssue assignees param to body json input. + +## 4.0.0 + +Breaking changes: + * Merge button squash boolean param has been renamed to merge_method string param. + +Features: + * Add some integration-related endpoints. + * Add support for integration authentication. + * Add preview merge params to edit user repo endpoint. + * Add preview merge params to org repos endpoint. + * Add preview merge params to user repos endpoint. + * Add filter to apidoc. + * Add basic getNextPage example. + +## 3.1.1 + +Bugfixes: + * Fix permissions param. + +## 3.1.0 + +Features: + * Add projects api. + +## 3.0.0 + +Breaking changes: + * Fix issues.updateLabel endpoint. Change first `name` param to `oldname` and add new `name` param. + +## 2.6.0 + +Features: + * Add X-Poll-Interval header for events API. + +## 2.5.2 + +Bugfixes: + * Fix reactions validation regex. + +## 2.5.1 + +Features: + * Add repository traffic api + +## 2.4.1 + +Bugfixes: + * Allow for passing some required parameters as null + +## 2.4.0 + +Features: + * Add github pages preview endpoints. + * Add preview apis section to readme. + +Bugfixes: + * Avoid parsing non json data. (Fixes renderMarkdown, getRawBlob) + +## 2.3.0 + +Features: + * Remove preview notes for multiple assignees api. + * Remove preview notes for issue locking/unlocking api. + * Add protected branch api endpoints. + * Destroy socket on timeout. + +## 2.2.0 + +Features: + * Add repos.getShaOfCommitRef. + +Bugfixes: + * Remove repos.getAll affiliation regex validation. + +## 2.1.0 + +Features: + * Add add-assignees-to-issue, remove-assignees-from-issue endpoints. + * Add note that licenses api is in preview period. + * Add get-tag-signature-verification endpoint. + * Add commit-signature-verification endpoint. + * Add params for create-deployment-status, create-deployment endpoints. + * Allow lazy instantiation. + * Add promise support. + +## 2.0.1 + +Features: + * Add get raw blob example. + +Bugfixes: + * Make createDeployment task param optional. + * Add missing org param for issues.getForOrg. + +## 2.0.0 + +Breaking changes: + * Remove getAllPages utility method. + * Move migration-related endpoints to its own section. + +Features: + * Add source import endpoints. + * Add enterprise search indexing endpoint. + +## 1.4.0 + +Features: + * Add repo invite endpoints. + * Add permission param to add-collaborator. + * Add GPG endpoints. + +## 1.3.0 + +Features: + * Add reaction endpoints. + +Bugfixes: + * Fix custom headers not being used. + * Fix includePreview config flag not working properly. (Removed and need to use custom headers.) + +## 1.2.1 + +Bugfixes: + * Allow empty string for path param for getContent. + +## 1.2.0 + +Features: + * Add support to allow api stuff under preview period. + * Add assignees preview param for issues endpoints. + * Add issues#lock/unlock. + * Add some more examples. + * Add pull request merge squash preview params. + * Add list/get/delete grant(s) endpoints. + * Add params for create authorization. + * Add get-or-create-authorization-for-app endpoint. + * Add add get-or-create-authorization-for-app-and-fingerprint. + * Add check/reset/revoke authorization endpoints. + * Add get-events-timeline endpoint. + +Bugfixes: + * Fix custom headers not persisting across pages. + * Make path param required for get-content. + * If user specifies protocol = http, use port 80 rather than default 443. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000000..ed1c7c0519 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,28 @@ +# How to contribute + +Support and contributions from the open source community are essential for keeping +node-github up to date and always improving! There are a few guidelines that we need +contributors to follow to keep the project consistent, as well as allow us to keep +maintaining node-github in a reasonable amount of time. + +## Creating an Issue + +Before you create a new Issue: +* Check the [Issues](https://github.com/mikedeboer/node-github/issues) on Github to ensure one doesn't already exist. +* Clearly describe the issue, including the steps to reproduce the issue. +* Please include links to the corresponding github documentation. + +## Making Changes + +* Create a topic branch from the master branch. +* Check for unnecessary whitespace / changes with `git diff --check` before committing. +* If modifying `routes.json`, be sure to run `node lib/generate.js` to generate/update docs/tests. +* Keep git commit messages clear and appropriate + * Please "squash" your commits down to one commit. + +## Submitting the Pull Request + +* Push your changes to your topic branch on your fork of the repo. +* Submit a pull request from your topic branch to the master branch on the node-github repository. +* Be sure to tag any issues your pull request is taking care of / contributing to. + * Adding "Closes #xyz" to a commit message will auto close the issue once the pull request is merged in. diff --git a/ISSUE_TEMPLATE.md b/ISSUE_TEMPLATE.md new file mode 100644 index 0000000000..acfa9a4c93 --- /dev/null +++ b/ISSUE_TEMPLATE.md @@ -0,0 +1 @@ +Please provide a minimal code sample to reproduce the issue if possible. diff --git a/README.md b/README.md index 7535f3676c..97db04ba51 100644 --- a/README.md +++ b/README.md @@ -1,119 +1,140 @@ -# JavaScript GitHub API for Node.JS +**NOTE: The `node-github` npm package is deprecated. You want the `github` npm package (see Installation).** -A Node.JS module, which provides an object oriented wrapper for the GitHub v3 API. +# Node-github + +[![npm](https://img.shields.io/npm/v/github.svg)](https://www.npmjs.com/package/github) +Gratipay donate button + +A Node.js wrapper for GitHub API. ## Installation - Install with the Node.JS package manager [npm](http://npmjs.org/) ![NPM version](https://badge.fury.io/js/github.png): +Install via npm. - $ npm install github +```bash +$ npm install github +``` or - Install via git clone: +Install via git clone - $ git clone git://github.com/mikedeboer/node-github.git - $ cd node-github - $ npm install +```bash +$ git clone https://github.com/mikedeboer/node-github.git +$ cd node-github +$ npm install +``` ## Documentation -You can find the docs for the API of this client at [http://mikedeboer.github.com/node-github/](http://mikedeboer.github.com/node-github/) - -Additionally, the [official Github documentation](http://developer.github.com/) -is a very useful resource. +Client API: [https://mikedeboer.github.io/node-github/](https://mikedeboer.github.io/node-github/) +GitHub API: [https://developer.github.com/v3/](https://developer.github.com/v3/) ## Example -Print all followers of the user "mikedeboer" to the console. +Get all followers for user "defunkt": ```javascript var GitHubApi = require("github"); var github = new GitHubApi({ - // required - version: "3.0.0", // optional debug: true, protocol: "https", - host: "github.my-GHE-enabled-company.com", - pathPrefix: "/api/v3", // for some GHEs + host: "github.my-GHE-enabled-company.com", // should be api.github.com for GitHub + pathPrefix: "/api/v3", // for some GHEs; none for GitHub + headers: { + "user-agent": "My-Cool-GitHub-App" // GitHub is happy with a unique user agent + }, + Promise: require('bluebird'), + followRedirects: false, // default: true; there's currently an issue with non-get redirects, so allow ability to disable follow-redirects timeout: 5000 }); -github.user.getFollowingFromUser({ - // optional: + +// TODO: optional authentication here depending on desired endpoints. See below in README. + +github.users.getFollowingForUser({ + // optional // headers: { // "cookie": "blahblah" // }, - user: "mikedeboer" + username: "defunkt" }, function(err, res) { console.log(JSON.stringify(res)); }); ``` -First the _GitHubApi_ class is imported from the _node-github_ module. This class provides -access to all of GitHub's APIs (e.g. user, issues or repo APIs). The _getFollowingFromUser_ -method lists all followers of a given GitHub user. Is is part of the user API. It -takes the user name as first argument and a callback as last argument. Once the -follower list is returned from the server, the callback is called. +## Pagination -Like in Node.JS, callbacks are always the last argument. If the functions fails an -error object is passed as first argument to the callback. +There are a few pagination-related methods: + +``` +hasNextPage(link) +hasPreviousPage(link) +hasFirstPage(link) +hasLastPage(link) + +getNextPage(link, headers, callback) +getPreviousPage(link, headers, callback) +getFirstPage(link, headers, callback) +getLastPage(link, headers, callback) + +NOTE: link is the response object or the contents of the Link header +``` + +See [here](https://github.com/mikedeboer/node-github/blob/master/examples/paginationCustomHeaders.js) and [here](https://github.com/mikedeboer/node-github/blob/master/examples/getStarred.js) for examples. ## Authentication -Most GitHub API calls don't require authentication. As a rule of thumb: If you -can see the information by visiting the site without being logged in, you don't -have to be authenticated to retrieve the same information through the API. Of -course calls, which change data or read sensitive information have to be authenticated. +Most GitHub API calls don't require authentication. As a rule of thumb: If you can see the information by visiting the site without being logged in, you don't have to be authenticated to retrieve the same information through the API. Of course calls, which change data or read sensitive information have to be authenticated. -You need the GitHub user name and the API key for authentication. The API key can -be found in the user's _Account Settings_ page. +You need the GitHub user name and the API key for authentication. The API key can be found in the user's _Account Settings_. -This example shows how to authenticate and then change _location_ field of the -account settings to _Argentina_: ```javascript +// basic github.authenticate({ type: "basic", - username: username, - password: password -}); -github.user.update({ - location: "Argentina" -}, function(err) { - console.log("done!"); + username: USERNAME, + password: PASSWORD }); -``` -Note that the _authenticate_ method is synchronous because it only stores the -credentials for the next request. -Other examples for the various authentication methods: -```javascript -// OAuth2 +// oauth github.authenticate({ type: "oauth", - token: token + token: AUTH_TOKEN }); -// OAuth2 Key/Secret +// oauth key/secret (to get a token) github.authenticate({ type: "oauth", - key: "clientID", - secret: "clientSecret" + key: CLIENT_ID, + secret: CLIENT_SECRET }) -// Deprecated Gihub API token (seems not to be working with the v3 API) +// user token github.authenticate({ type: "token", - token: token + token: "userToken", +}); + +// integration (jwt) +github.authenticate({ + type: "integration", + token: "jwt", +}); + +// ~/.netrc +github.authenticate({ + type: "netrc" }); ``` -### Creating tokens for your application -[Create a new authorization](http://developer.github.com/v3/oauth/#create-a-new-authorization) for your application giving it access to the wanted scopes you need instead of relying on username / password and is the way to go if you have [two-factor authentication](https://github.com/blog/1614-two-factor-authentication) on. +Note: `authenticate` is synchronous because it only stores the +credentials for the next request. -For example: +### Creating a token for your application +[Create a new authorization](https://developer.github.com/v3/oauth_authorizations/#create-a-new-authorization). -1. Use github.authenticate() to auth with GitHub using your username / password +1. Use github.authenticate() to authenticate with GitHub using your username / password. 2. Create an application token programmatically with the scopes you need and, if you use two-factor authentication send the `X-GitHub-OTP` header with the one-time-password you get on your token device. ```javascript @@ -131,39 +152,77 @@ github.authorization.create({ }); ``` -## Implemented GitHub APIs - -* Gists: 100% -* Git Data: 100% -* Issues: 100% -* Orgs: 100% -* Pull Requests: 100% -* Repos: 100% -* Users: 100% -* Events: 100% -* Search: 100% -* Markdown: 100% -* Rate Limit: 100% -* Releases: 90% -* Gitignore: 100% -* Meta: 100% -* Emojis: 100% - -## Running the Tests - -The unit tests are based on the [mocha](http://visionmedia.github.com/mocha/) -module, which may be installed via npm. To run the tests make sure that the -npm dependencies are installed by running `npm install` from the project directory. - -Before running unit tests: -```shell -npm install mocha -g +## Create test auth file + +Create test auth file for running tests/examples. + +```bash +$ > testAuth.json +{ + "token": "" +} ``` -At the moment, test classes can only be run separately. This will e.g. run the Issues Api test: -```shell -mocha api/v3.0.0/issuesTest.js + +## Promises + +For using bluebird, see [here](https://github.com/mikedeboer/node-github/blob/master/examples/testPromise.js). +For using Q, see [here](https://github.com/mikedeboer/node-github/blob/master/examples/testPromiseQ.js). + +## Tests + +Run all tests + +```bash +$ npm test +``` + +Or run a specific test + +```bash +$ npm test test/issuesTest.js +``` + +## Preview APIs + +Accept headers for the preview APIs should be taken care of behind the scenes, but in the event a preview endpoint isn't working, see [here](https://github.com/mikedeboer/node-github/blob/master/examples/getRawBlob.js) for an example on how to add the required custom accept header. + +For updates on endpoints under preview, see https://developer.github.com/changes/. + +| Preview API | Accept header val | +| ------------------- | ----------------------------------------------- | +| Commit Search | application/vnd.github.cloak-preview+json | +| Community | application/vnd.github.black-panther-preview+json | +| Deployment | application/vnd.github.ant-man-preview+json | +| Git signing | application/vnd.github.cryptographer-preview | +| Imports | application/vnd.github.barred-rock-preview | +| Integrations | application/vnd.github.machine-man-preview | +| License | application/vnd.github.drax-preview+json | +| Migrations | application/vnd.github.wyandotte-preview+json | +| Organization Membership | application/vnd.github.korra-preview+json | +| Pages | application/vnd.github.mister-fantastic-preview | +| Pre-receive | application/vnd.github.eye-scream-preview | +| Projects | application/vnd.github.inertia-preview+json | +| Protected Branches | application/vnd.github.loki-preview+json | +| Pull Request Squash | application/vnd.github.polaris-preview | +| Reactions | application/vnd.github.squirrel-girl-preview | +| Timeline | application/vnd.github.mockingbird-preview | + +## Dev notes + +When updating routes.json, you'll want to update the generated docs/tests: + +```bash +$ node lib/generate.js ``` -Note that a connection to the internet is required to run the tests. + +To update the apidoc for github pages: + +```bash +$ npm install apidoc -g +$ apidoc -i doc/ -o apidoc/ +``` + +Just a reminder, since an ad-hoc filter was added to the apidoc, don't overwrite index.html, main.js. ## LICENSE diff --git a/api/v2.0.0/routes.json b/api/v2.0.0/routes.json deleted file mode 100644 index 49d1a202ff..0000000000 --- a/api/v2.0.0/routes.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - -} diff --git a/api/v3.0.0/authorization.js b/api/v3.0.0/authorization.js deleted file mode 100644 index f5a63e6836..0000000000 --- a/api/v3.0.0/authorization.js +++ /dev/null @@ -1,230 +0,0 @@ -/** - * mixin authorization - * - * Copyright 2012 Cloud9 IDE, Inc. - * - * This product includes software developed by - * Cloud9 IDE, Inc (http://c9.io). - * - * Author: Mike de Boer - **/ - -"use strict"; - -var error = require("./../../error"); -var Util = require("./../../util"); - -var authorization = module.exports = { - authorization: {} -}; - -(function() { - /** section: github - * authorization#getAll(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. - * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. - **/ - this.getAll = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * authorization#get(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - id (String): Required. - **/ - this.get = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * authorization#create(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - scopes (Array): Optional. A list of scopes that this authorization is in. - * - note (String): Optional. A note to remind you what the OAuth token is for. - * - note_url (String): Optional. A URL to remind you what app the OAuth token is for. - **/ - this.create = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * authorization#update(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - id (String): Required. - * - scopes (Array): Optional. A list of scopes that this authorization is in. - * - add_scopes (Array): Optional. A list of scopes to add to this authorization. - * - remove_scopes (Array): Optional. A list of scopes to remove from this authorization. - * - note (String): Optional. A note to remind you what the OAuth token is for. - * - note_url (String): Optional. A URL to remind you what app the OAuth token is for. - **/ - this.update = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * authorization#delete(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - id (String): Required. - **/ - this.delete = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - -}).call(authorization.authorization); diff --git a/api/v3.0.0/authorizationTest.js b/api/v3.0.0/authorizationTest.js deleted file mode 100644 index 29b0b8dab2..0000000000 --- a/api/v3.0.0/authorizationTest.js +++ /dev/null @@ -1,258 +0,0 @@ -/* - * Copyright 2012 Cloud9 IDE, Inc. - * - * This product includes software developed by - * Cloud9 IDE, Inc (http://c9.io). - * - * Author: Mike de Boer - */ - -"use strict"; - -var Assert = require("assert"); -var Client = require("./../../index"); - -describe("[authorization]", function() { - var client; - var token = "c286e38330e15246a640c2cf32a45ea45d93b2ba"; - - this.timeout(10000); - - beforeEach(function() { - client = new Client({ - version: "3.0.0" - }); - client.authenticate({ - type: "basic", - username: "mikedeboertest", - password: "test1324" - }); - }); - - it("should successfully execute GET /authorizations (getAll)", function(next) { - client.authorization.create( - { - scopes: ["user", "public_repo", "repo", "repo:status", "delete_repo", "gist"], - note: "Authorization created to unit tests auth", - note_url: "https://github.com/ajaxorg/node-github" - }, - function(err, res) { - Assert.equal(err, null); - var id = res.id; - - client.authorization.getAll( - { - page: "1", - per_page: "100" - }, - function(err, res) { - Assert.equal(err, null); - Assert.equal(res.length, 1); - - client.authorization["delete"]( - { - id: id - }, - function(err, res) { - Assert.equal(err, null); - - client.authorization.getAll( - { - page: "1", - per_page: "100" - }, - function(err, res) { - Assert.equal(err, null); - Assert.equal(res.length, 0); - - next(); - } - ); - } - ); - } - ); - } - ); - }); - - it("should successfully execute GET /authorizations/:id (get)", function(next) { - client.authorization.create( - { - scopes: ["user", "public_repo", "repo", "repo:status", "delete_repo", "gist"], - note: "Authorization created to unit tests auth", - note_url: "https://github.com/ajaxorg/node-github" - }, - function(err, res) { - Assert.equal(err, null); - var id = res.id; - - client.authorization.get( - { - id: id - }, - function(err, res) { - Assert.equal(err, null); - Assert.equal(res.id, id); - Assert.equal(res.note, "Authorization created to unit tests auth"); - Assert.equal(res.note_url, "https://github.com/ajaxorg/node-github"); - - client.authorization["delete"]( - { - id: id - }, - function(err, res) { - Assert.equal(err, null); - - client.authorization.get( - { - id: id - }, - function(err, res) { - Assert.equal(err.code, 404); - next(); - } - ); - } - ); - } - ); - } - ); - }); - - it("should successfully execute POST /authorizations (create)", function(next) { - client.authorization.create( - { - scopes: ["user", "public_repo", "repo", "repo:status", "delete_repo", "gist"], - note: "Authorization created to unit tests auth", - note_url: "https://github.com/ajaxorg/node-github" - }, - function(err, res) { - Assert.equal(err, null); - var id = res.id; - - client.authorization.get( - { - id: id - }, - function(err, res) { - Assert.equal(err, null); - Assert.equal(res.id, id); - Assert.equal(res.note, "Authorization created to unit tests auth"); - Assert.equal(res.note_url, "https://github.com/ajaxorg/node-github"); - - client.authorization["delete"]( - { - id: id - }, - function(err, res) { - Assert.equal(err, null); - - client.authorization.get( - { - id: id - }, - function(err, res) { - Assert.equal(err.code, 404); - next(); - } - ); - } - ); - } - ); - } - ); - }); - - it("should successfully execute PATCH /authorizations/:id (update)", function(next) { - client.authorization.create( - { - scopes: ["user", "public_repo", "repo", "repo:status", "delete_repo", "gist"], - note: "Authorization created to unit tests auth", - note_url: "https://github.com/ajaxorg/node-github" - }, - function(err, res) { - Assert.equal(err, null); - var id = res.id; - - client.authorization.update( - { - id: id, - remove_scopes: ["repo"], - note: "changed" - }, - function(err, res) { - Assert.equal(err, null); - - client.authorization.get( - { - id: id - }, - function(err, res) { - Assert.equal(err, null); - Assert.equal(res.id, id); - Assert.ok(res.scopes.indexOf("repo") === -1); - Assert.equal(res.note, "changed"); - Assert.equal(res.note_url, "https://github.com/ajaxorg/node-github"); - - client.authorization["delete"]( - { - id: id - }, - function(err, res) { - Assert.equal(err, null); - - client.authorization.get( - { - id: id - }, - function(err, res) { - Assert.equal(err.code, 404); - next(); - } - ); - } - ); - } - ); - } - ); - } - ); - }); - - it("should successfully execute DELETE /authorizations/:id (delete)", function(next) { - client.authorization.create( - { - scopes: ["user", "public_repo", "repo", "repo:status", "delete_repo", "gist"], - note: "Authorization created to unit tests auth", - note_url: "https://github.com/ajaxorg/node-github" - }, - function(err, res) { - Assert.equal(err, null); - var id = res.id; - - client.authorization["delete"]( - { - id: id - }, - function(err, res) { - Assert.equal(err, null); - - client.authorization.get( - { - id: id - }, - function(err, res) { - Assert.equal(err.code, 404); - next(); - } - ); - } - ); - } - ); - }); -}); diff --git a/api/v3.0.0/events.js b/api/v3.0.0/events.js deleted file mode 100644 index ef1e836613..0000000000 --- a/api/v3.0.0/events.js +++ /dev/null @@ -1,445 +0,0 @@ -/** - * mixin events - * - * Copyright 2012 Cloud9 IDE, Inc. - * - * This product includes software developed by - * Cloud9 IDE, Inc (http://c9.io). - * - * Author: Mike de Boer - **/ - -"use strict"; - -var error = require("./../../error"); -var Util = require("./../../util"); - -var events = module.exports = { - events: {} -}; - -(function() { - /** section: github - * events#get(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. - * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. - **/ - this.get = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * events#getFromRepo(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. - * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. - **/ - this.getFromRepo = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * events#getFromRepoIssues(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. - * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. - **/ - this.getFromRepoIssues = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * events#getFromRepoNetwork(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. - * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. - **/ - this.getFromRepoNetwork = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * events#getFromOrg(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - org (String): Required. - * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. - * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. - **/ - this.getFromOrg = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * events#getReceived(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. - * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. - **/ - this.getReceived = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * events#getReceivedPublic(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. - * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. - **/ - this.getReceivedPublic = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * events#getFromUser(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. - * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. - **/ - this.getFromUser = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * events#getFromUserPublic(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. - * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. - **/ - this.getFromUserPublic = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * events#getFromUserOrg(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - org (String): Required. - * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. - * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. - **/ - this.getFromUserOrg = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - -}).call(events.events); diff --git a/api/v3.0.0/eventsTest.js b/api/v3.0.0/eventsTest.js deleted file mode 100644 index 0c4a7320bc..0000000000 --- a/api/v3.0.0/eventsTest.js +++ /dev/null @@ -1,212 +0,0 @@ -/* - * Copyright 2012 Cloud9 IDE, Inc. - * - * This product includes software developed by - * Cloud9 IDE, Inc (http://c9.io). - * - * Author: Mike de Boer - */ - -"use strict"; - -var Assert = require("assert"); -var Client = require("./../../index"); - -describe("[events]", function() { - var client; - var token = "c286e38330e15246a640c2cf32a45ea45d93b2ba"; - - beforeEach(function() { - client = new Client({ - version: "3.0.0" - }); - client.authenticate({ - type: "oauth", - token: token - }); - }); - - it("should successfully execute GET /events (get)", function(next) { - client.events.get( - { - page: 1, - per_page: 30 - }, - function(err, res) { - // other assertions go here - Assert.equal(err, null); - Assert.ok(res.length > 1); - Assert.equal(typeof res[0].type, "string"); - Assert.equal(typeof res[0].created_at, "string"); - Assert.equal(typeof res[0]["public"], "boolean"); - Assert.equal(typeof res[0].id, "string"); - Assert.ok("actor" in res[0]); - Assert.ok("repo" in res[0]); - next(); - } - ); - }); - - it("should successfully execute GET /repos/:user/:repo/events (getFromRepo)", function(next) { - client.events.getFromRepo( - { - user: "mikedeboertest", - repo: "node_chat" - }, - function(err, res) { - Assert.equal(err, null); - Assert.equal(res.length, 5); - // this is the lastly listed event - var last = res.pop(); - Assert.equal(last.type, "ForkEvent"); - Assert.equal(last.created_at, "2012-10-05T15:03:11Z"); - Assert.equal(last.id, "1607304921"); - Assert.equal(last["public"], true); - Assert.equal(last.actor.login, "mikedeboer"); - Assert.equal(last.repo.name, "mikedeboertest/node_chat"); - next(); - } - ); - }); - - it("should successfully execute GET /repos/:user/:repo/issues/events (getFromRepoIssues)", function(next) { - client.events.getFromRepoIssues( - { - user: "mikedeboertest", - repo: "node_chat" - }, - function(err, res) { - Assert.equal(err, null); - Assert.equal(res.length, 4); - // this is the lastly listed event - var last = res.pop(); - Assert.equal(last.event, "referenced"); - Assert.equal(last.created_at, "2012-10-05T15:05:31Z"); - Assert.equal(last.id, "26276344"); - Assert.equal(last.actor.login, "mikedeboertest"); - Assert.equal(last.issue.title, "Macaroni"); - Assert.equal(last.issue.number, 1); - Assert.equal(last.issue.state, "closed"); - next(); - } - ); - }); - - it("should successfully execute GET /networks/:user/:repo/events (getFromRepoNetwork)", function(next) { - client.events.getFromRepoNetwork( - { - user: "mikedeboertest", - repo: "node_chat" - }, - function(err, res) { - Assert.equal(err, null); - Assert.ok(res.length > 1); - var last = res.pop(); - Assert.equal(typeof last.id, "string"); - Assert.equal(typeof last.created_at, "string"); - Assert.equal(typeof last.actor, "object"); - next(); - } - ); - }); - - it("should successfully execute GET /orgs/:org/events (getFromOrg)", function(next) { - client.events.getFromOrg( - { - org: "ajaxorg" - }, - function(err, res) { - Assert.equal(err, null); - Assert.ok(res.length > 1); - var last = res.pop(); - Assert.equal(typeof last.id, "string"); - Assert.equal(typeof last.created_at, "string"); - Assert.equal(typeof last.actor, "object"); - next(); - } - ); - }); - - it("should successfully execute GET /users/:user/received_events (getReceived)", function(next) { - client.events.getReceived( - { - user: "mikedeboertest" - }, - function(err, res) { - Assert.equal(err, null); - Assert.ok(res.length > 0); - var last = res.pop(); - Assert.equal(typeof last.id, "string"); - Assert.equal(typeof last.created_at, "string"); - Assert.equal(typeof last.actor, "object"); - next(); - } - ); - }); - - it("should successfully execute GET /users/:user/received_events/public (getReceivedPublic)", function(next) { - client.events.getReceivedPublic( - { - user: "mikedeboertest" - }, - function(err, res) { - Assert.equal(err, null); - Assert.ok(res.length > 0); - var last = res.pop(); - Assert.equal(typeof last.id, "string"); - Assert.equal(typeof last.created_at, "string"); - Assert.equal(typeof last.actor, "object"); - next(); - } - ); - }); - - it("should successfully execute GET /users/:user/events (getFromUser)", function(next) { - client.events.getFromUser( - { - user: "mikedeboertest" - }, - function(err, res) { - Assert.equal(err, null); - Assert.ok(res.length > 1); - var last = res.pop(); - Assert.equal(typeof last.id, "string"); - Assert.equal(typeof last.created_at, "string"); - Assert.equal(typeof last.actor, "object"); - next(); - } - ); - }); - - it("should successfully execute GET /users/:user/events/public (getFromUserPublic)", function(next) { - client.events.getFromUserPublic( - { - user: "mikedeboertest" - }, - function(err, res) { - Assert.equal(err, null); - Assert.ok(res.length > 1); - var last = res.pop(); - Assert.equal(typeof last.id, "string"); - Assert.equal(typeof last.created_at, "string"); - Assert.equal(typeof last.actor, "object"); - next(); - } - ); - }); - - it("should successfully execute GET /users/:user/events/orgs/:org (getFromUserOrg)", function(next) { - client.events.getFromUserOrg( - { - user: "mikedeboer", - org: "ajaxorg" - }, - function(err, res) { - // we're not logged in as `mikedeboer` right now, so github API does not allow - // us to see the resource. - Assert.equal(err.code, 404); - next(); - } - ); - }); -}); diff --git a/api/v3.0.0/gists.js b/api/v3.0.0/gists.js deleted file mode 100644 index 3b270e33e2..0000000000 --- a/api/v3.0.0/gists.js +++ /dev/null @@ -1,716 +0,0 @@ -/** - * mixin gists - * - * Copyright 2012 Cloud9 IDE, Inc. - * - * This product includes software developed by - * Cloud9 IDE, Inc (http://c9.io). - * - * Author: Mike de Boer - **/ - -"use strict"; - -var error = require("./../../error"); -var Util = require("./../../util"); - -var gists = module.exports = { - gists: {} -}; - -(function() { - /** section: github - * gists#getAll(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. - * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. - * - since (Date): Optional. Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ - **/ - this.getAll = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * gists#getFromUser(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. - * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. - * - since (Date): Optional. Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ - **/ - this.getFromUser = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * gists#create(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - description (String): Optional. - * - public (Boolean): Required. - * - files (Json): Required. Files that make up this gist. The key of which should be a required string filename and the value another required hash with parameters: 'content' - **/ - this.create = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * gists#edit(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - id (String): Required. - * - description (String): Optional. - * - files (Json): Required. Files that make up this gist. The key of which should be a required string filename and the value another required hash with parameters: 'content' - **/ - this.edit = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * gists#public(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - since (Date): Optional. Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ - **/ - this.public = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * gists#starred(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - since (Date): Optional. Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ - **/ - this.starred = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * gists#get(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - id (String): Required. - **/ - this.get = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * gists#star(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - id (String): Required. - **/ - this.star = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * gists#deleteStar(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - id (String): Required. - **/ - this.deleteStar = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * gists#checkStar(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - id (String): Required. - **/ - this.checkStar = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * gists#fork(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - id (String): Required. - **/ - this.fork = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * gists#delete(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - id (String): Required. - **/ - this.delete = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * gists#getComments(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - gist_id (String): Required. Id (SHA1 hash) of the gist. - **/ - this.getComments = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * gists#getComment(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - gist_id (String): Required. Id (SHA1 hash) of the gist. - * - id (String): Required. - **/ - this.getComment = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * gists#createComment(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - gist_id (String): Required. Id (SHA1 hash) of the gist. - * - body (String): Required. - **/ - this.createComment = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * gists#editComment(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - gist_id (String): Required. Id (SHA1 hash) of the gist. - * - id (String): Required. - * - body (String): Required. - **/ - this.editComment = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * gists#deleteComment(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - gist_id (String): Required. Id (SHA1 hash) of the gist. - * - id (String): Required. - **/ - this.deleteComment = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - -}).call(gists.gists); diff --git a/api/v3.0.0/gistsTest.js b/api/v3.0.0/gistsTest.js deleted file mode 100644 index d47d28f371..0000000000 --- a/api/v3.0.0/gistsTest.js +++ /dev/null @@ -1,605 +0,0 @@ -/* - * Copyright 2012 Cloud9 IDE, Inc. - * - * This product includes software developed by - * Cloud9 IDE, Inc (http://c9.io). - * - * Author: Mike de Boer - */ - -"use strict"; - -var Assert = require("assert"); -var Client = require("./../../index"); - -describe("[gists]", function() { - var client; - var token = "c286e38330e15246a640c2cf32a45ea45d93b2ba"; - timeout(5000); - - beforeEach(function() { - client = new Client({ - version: "3.0.0" - }); - client.authenticate({ - type: "oauth", - token: token - }); - }); - - it("should successfully execute GET /gists (getAll)", function(next) { - client.gists.getAll( - {}, - function(err, res) { - Assert.equal(err, null); - Assert.equal(res.length, 1); - var gist = res.pop(); - Assert.equal(gist.user.login, "mikedeboertest"); - Assert.equal(gist.html_url, "https://gist.github.com/77dc15615eab09a79b61"); - Assert.equal(gist.created_at, "2012-10-05T16:10:40Z"); - Assert.equal(gist.public, false); - Assert.equal(gist.id, "77dc15615eab09a79b61"); - - next(); - } - ); - }); - - it("should successfully execute GET /users/:user/gists (getFromUser)", function(next) { - client.gists.getFromUser( - { - user: "mikedeboertest" - }, - function(err, res) { - Assert.equal(err, null); - Assert.equal(res.length, 1); - var gist = res.pop(); - Assert.equal(gist.user.login, "mikedeboertest"); - Assert.equal(gist.html_url, "https://gist.github.com/77dc15615eab09a79b61"); - Assert.equal(gist.created_at, "2012-10-05T16:10:40Z"); - Assert.equal(gist.public, false); - Assert.equal(gist.id, "77dc15615eab09a79b61"); - next(); - } - ); - }); - - it("should successfully execute POST /gists (create)", function(next) { - client.gists.create( - { - description: "Another bowl of pasta", - public: "false", - files: { - "ravioli.js": { - "content": "alert(\"want some ketchup with that?\");" - } - } - }, - function(err, res) { - Assert.equal(err, null); - var id = res.id; - - client.gists.get( - { - id: id - }, - function(err, res) { - Assert.equal(err, null); - Assert.equal(res.user.login, "mikedeboertest"); - Assert.equal(res.html_url, "https://gist.github.com/" + id); - Assert.equal(res.public, false); - Assert.equal(res.id, id); - Assert.equal(res.description, "Another bowl of pasta"); - - client.gists["delete"]( - { - id: id - }, - function(err, res) { - Assert.equal(err, null); - next(); - } - ); - } - ); - } - ); - }); - - it("should successfully execute PATCH /gists/:id (edit)", function(next) { - client.gists.create( - { - description: "Another bowl of pasta", - public: "false", - files: { - "ravioli.js": { - "content": "alert(\"want some ketchup with that?\");" - } - } - }, - function(err, res) { - Assert.equal(err, null); - var id = res.id; - - client.gists.edit( - { - id: id, - description: "changed", - files: { - "ravioli.js": { - "content": "alert(\"no ketchup, please.\");" - } - } - }, - function(err, res) { - Assert.equal(err, null); - - client.gists.get( - { - id: id - }, - function(err, res) { - Assert.equal(err, null); - Assert.equal(res.user.login, "mikedeboertest"); - Assert.equal(res.html_url, "https://gist.github.com/" + id); - Assert.equal(res.public, false); - Assert.equal(res.id, id); - Assert.equal(res.description, "changed"); - Assert.equal(res.files["ravioli.js"].content, "alert(\"no ketchup, please.\");"); - - client.gists["delete"]( - { - id: id - }, - function(err, res) { - Assert.equal(err, null); - next(); - } - ); - } - ); - } - ); - } - ); - }); -/* - it("should successfully execute GET /gists/public (public)", function(next) { - client.gists.public( - {}, - function(err, res) { - Assert.equal(err, null); - console.log(res); - next(); - } - ); - }); -*/ - it("should successfully execute GET /gists/starred (starred)", function(next) { - client.gists.starred( - {}, - function(err, res) { - Assert.equal(err, null); - Assert.equal(res.length, 1); - var gist = res.pop(); - Assert.equal(gist.user.login, "mikedeboertest"); - Assert.equal(gist.html_url, "https://gist.github.com/77dc15615eab09a79b61"); - Assert.equal(gist.created_at, "2012-10-05T16:10:40Z"); - Assert.equal(gist.public, false); - Assert.equal(gist.id, "77dc15615eab09a79b61"); - - next(); - } - ); - }); - - it("should successfully execute GET /gists/:id (get)", function(next) { - client.gists.create( - { - description: "Another bowl of pasta", - public: "false", - files: { - "ravioli.js": { - "content": "alert(\"want some ketchup with that?\");" - } - } - }, - function(err, res) { - Assert.equal(err, null); - var id = res.id; - - client.gists.get( - { - id: id - }, - function(err, res) { - Assert.equal(err, null); - Assert.equal(res.user.login, "mikedeboertest"); - Assert.equal(res.html_url, "https://gist.github.com/" + id); - Assert.equal(res.public, false); - Assert.equal(res.id, id); - Assert.equal(res.description, "Another bowl of pasta"); - - client.gists["delete"]( - { - id: id - }, - function(err, res) { - Assert.equal(err, null); - next(); - } - ); - } - ); - } - ); - }); - - it("should successfully execute PUT /gists/:id/star (star)", function(next) { - client.gists.create( - { - description: "Another bowl of pasta", - public: "false", - files: { - "ravioli.js": { - "content": "alert(\"want some ketchup with that?\");" - } - } - }, - function(err, res) { - Assert.equal(err, null); - var id = res.id; - - client.gists.star( - { - id: id - }, - function(err, res) { - Assert.equal(err, null); - - client.gists.checkStar( - { - id: id - }, - function(err, res) { - Assert.equal(err, null); - //TODO: NO RESULT HERE??? - - client.gists["delete"]( - { - id: id - }, - function(err, res) { - Assert.equal(err, null); - next(); - } - ); - } - ); - } - ); - } - ); - }); - - it("should successfully execute DELETE /gists/:id/star (deleteStar)", function(next) { - client.gists.create( - { - description: "Another bowl of pasta", - public: "false", - files: { - "ravioli.js": { - "content": "alert(\"want some ketchup with that?\");" - } - } - }, - function(err, res) { - Assert.equal(err, null); - var id = res.id; - - client.gists.star( - { - id: id - }, - function(err, res) { - Assert.equal(err, null); - - client.gists.deleteStar( - { - id: id - }, - function(err, res) { - Assert.equal(err, null); - - client.gists["delete"]( - { - id: id - }, - function(err, res) { - Assert.equal(err, null); - next(); - } - ); - } - ); - } - ); - } - ); - }); - - it("should successfully execute GET /gists/:id/star (checkStar)", function(next) { - client.gists.create( - { - description: "Another bowl of pasta", - public: "false", - files: { - "ravioli.js": { - "content": "alert(\"want some ketchup with that?\");" - } - } - }, - function(err, res) { - Assert.equal(err, null); - var id = res.id; - - client.gists.star( - { - id: id - }, - function(err, res) { - Assert.equal(err, null); - - client.gists["delete"]( - { - id: id - }, - function(err, res) { - Assert.equal(err, null); - next(); - } - ); - } - ); - } - ); - }); - - it("should successfully execute POST /gists/:id/fork (fork)", function(next) { - client.gists.fork( - { - id: "3047099" - }, - function(err, res) { - Assert.equal(err, null); - var id = res.id; - - Assert.equal(res.git_pull_url, "git://gist.github.com/" + id + ".git"); - Assert.equal(res.git_push_url, "git@gist.github.com:" + id + ".git"); - Assert.equal(res.description, "Why to call resume() after next()"); - Assert.equal(typeof res.files["resume_after_next.md"], "object"); - - client.gists["delete"]( - { - id: id - }, - function(err, res) { - Assert.equal(err, null); - next(); - } - ); - } - ); - }); - - it("should successfully execute DELETE /gists/:id (delete)", function(next) { - client.gists.create( - { - description: "Another bowl of pasta", - public: "false", - files: { - "ravioli.js": { - "content": "alert(\"want some ketchup with that?\");" - } - } - }, - function(err, res) { - Assert.equal(err, null); - var id = res.id; - - client.gists["delete"]( - { - id: id - }, - function(err, res) { - Assert.equal(err, null); - next(); - } - ); - } - ); - }); - - it("should successfully execute GET /gists/:gist_id/comments/:id (getComments)", function(next) { - client.gists.createComment( - { - gist_id: "3047099", - body: "This is a test comment.", - }, - function(err, res) { - Assert.equal(err, null); - var id = res.id; - - client.gists.getComments( - { - gist_id: "3047099" - }, - function(err, res) { - var comment = res.pop(); - Assert.equal(err, null); - Assert.equal(comment.user.login, "mikedeboertest"); - Assert.equal(comment.id, id); - Assert.equal(comment.body, "This is a test comment."); - - client.gists["deleteComment"]( - { - gist_id: "3047099", - id: id - }, - function(err, res) { - Assert.equal(err, null); - next(); - } - ); - } - ); - } - ); - }); - - it("should successfully execute GET /gists/:gist_id/comments/:id (getComment)", function(next) { - client.gists.createComment( - { - gist_id: "3047099", - body: "This is a test comment.", - }, - function(err, res) { - Assert.equal(err, null); - var id = res.id; - - client.gists.getComment( - { - gist_id: "3047099", - id: id - }, - function(err, res) { - Assert.equal(err, null); - Assert.equal(res.user.login, "mikedeboertest"); - Assert.equal(res.id, id); - Assert.equal(res.body, "This is a test comment."); - - client.gists["deleteComment"]( - { - gist_id: "3047099", - id: id - }, - function(err, res) { - Assert.equal(err, null); - next(); - } - ); - } - ); - } - ); - }); - - it("should successfully execute POST /gists/:gist_id/comments (createComment)", function(next) { - client.gists.createComment( - { - gist_id: "3047099", - body: "This is a test comment.", - }, - function(err, res) { - Assert.equal(err, null); - var id = res.id; - - client.gists.getComment( - { - gist_id: "3047099", - id: id - }, - function(err, res) { - Assert.equal(err, null); - Assert.equal(res.user.login, "mikedeboertest"); - Assert.equal(res.id, id); - Assert.equal(res.body, "This is a test comment."); - - client.gists["deleteComment"]( - { - gist_id: "3047099", - id: id - }, - function(err, res) { - Assert.equal(err, null); - next(); - } - ); - } - ); - } - ); - }); - - it("should successfully execute PATCH /gists/:gist_id/comments/:id (editComment)", function(next) { - client.gists.createComment( - { - gist_id: "3047099", - body: "This is a test comment.", - }, - function(err, res) { - Assert.equal(err, null); - var id = res.id; - - client.gists.editComment( - { - gist_id: "3047099", - id: id, - body: "This comment has been edited." - }, - function(err, res) { - Assert.equal(err, null); - var id = res.id; - client.gists.getComment( - { - gist_id: "3047099", - id: id - }, - function(err, res) { - Assert.equal(err, null); - Assert.equal(res.user.login, "mikedeboertest"); - Assert.equal(res.id, id); - Assert.equal(res.body, "This comment has been edited."); - - client.gists["deleteComment"]( - { - gist_id: "3047099", - id: id - }, - function(err, res) { - Assert.equal(err, null); - next(); - } - ); - } - ); - } - ); - } - ); - }); - - it("should successfully execute DELETE /gists/:gist_id/comments/:id (deleteComment)", function(next) { - client.gists.createComment( - { - gist_id: "3047099", - body: "This is a test comment.", - }, - function(err, res) { - Assert.equal(err, null); - var id = res.id; - - client.gists["deleteComment"]( - { - gist_id: "3047099", - id: id - }, - function(err, res) { - Assert.equal(err, null); - next(); - } - ); - } - ); - }); -}); diff --git a/api/v3.0.0/gitdata.js b/api/v3.0.0/gitdata.js deleted file mode 100644 index 14d5bd0411..0000000000 --- a/api/v3.0.0/gitdata.js +++ /dev/null @@ -1,585 +0,0 @@ -/** - * mixin gitdata - * - * Copyright 2012 Cloud9 IDE, Inc. - * - * This product includes software developed by - * Cloud9 IDE, Inc (http://c9.io). - * - * Author: Mike de Boer - **/ - -"use strict"; - -var error = require("./../../error"); -var Util = require("./../../util"); - -var gitdata = module.exports = { - gitdata: {} -}; - -(function() { - /** section: github - * gitdata#getBlob(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - sha (String): Required. - * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. - * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. - **/ - this.getBlob = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * gitdata#createBlob(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - content (String): Required. - * - encoding (String): Required. - **/ - this.createBlob = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * gitdata#getCommit(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - sha (String): Required. - **/ - this.getCommit = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * gitdata#createCommit(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - message (String): Required. String of the commit message - * - tree (String): Required. String of the SHA of the tree object this commit points to - * - parents (Array): Required. Array of the SHAs of the commits that were the parents of this commit. If omitted or empty, the commit will be written as a root commit. For a single parent, an array of one SHA should be provided, for a merge commit, an array of more than one should be provided. - * - author (Json): Optional. - * - committer (Json): Optional. - **/ - this.createCommit = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * gitdata#getReference(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - ref (String): Required. String of the name of the fully qualified reference (ie: heads/master). If it doesn’t have at least one slash, it will be rejected. - **/ - this.getReference = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * gitdata#getAllReferences(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. - * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. - **/ - this.getAllReferences = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * gitdata#createReference(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - ref (String): Required. String of the name of the fully qualified reference (ie: heads/master). If it doesn’t have at least one slash, it will be rejected. - * - sha (String): Required. - **/ - this.createReference = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * gitdata#updateReference(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - ref (String): Required. String of the name of the fully qualified reference (ie: heads/master). If it doesn’t have at least one slash, it will be rejected. - * - sha (String): Required. - * - force (Boolean): Optional. Boolean indicating whether to force the update or to make sure the update is a fast-forward update. The default is false, so leaving this out or setting it to false will make sure you’re not overwriting work. - **/ - this.updateReference = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * gitdata#deleteReference(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - ref (String): Required. String of the name of the fully qualified reference (ie: heads/master). If it doesn’t have at least one slash, it will be rejected. - **/ - this.deleteReference = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * gitdata#getTag(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - sha (String): Required. - **/ - this.getTag = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * gitdata#createTag(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - tag (String): Required. String of the tag - * - message (String): Required. String of the tag message - * - object (String): Required. String of the SHA of the git object this is tagging - * - type (String): Required. String of the type of the object we’re tagging. Normally this is a commit but it can also be a tree or a blob. - * - tagger (Json): Required. JSON object that contains the following keys: `name` - String of the name of the author of the tag, `email` - String of the email of the author of the tag, `date` - Timestamp of when this object was tagged - **/ - this.createTag = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * gitdata#getTree(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - sha (String): Required. - * - recursive (Boolean): Optional. - **/ - this.getTree = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * gitdata#createTree(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - tree (Json): Required. Array of Hash objects (of path, mode, type and sha) specifying a tree structure - * - base_tree (String): Optional. String of the SHA1 of the tree you want to update with new data - **/ - this.createTree = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - -}).call(gitdata.gitdata); diff --git a/api/v3.0.0/gitdataTest.js b/api/v3.0.0/gitdataTest.js deleted file mode 100644 index c9f7fbce0e..0000000000 --- a/api/v3.0.0/gitdataTest.js +++ /dev/null @@ -1,480 +0,0 @@ -/* - * Copyright 2012 Cloud9 IDE, Inc. - * - * This product includes software developed by - * Cloud9 IDE, Inc (http://c9.io). - * - * Author: Mike de Boer - */ - -"use strict"; - -var Assert = require("assert"); -var Client = require("./../../index"); - -describe("[gitdata]", function() { - var client; - var token = "c286e38330e15246a640c2cf32a45ea45d93b2ba"; - - beforeEach(function() { - client = new Client({ - version: "3.0.0" - }); - client.authenticate({ - type: "oauth", - token: token - }); - }); - - it("should successfully execute GET /repos/:user/:repo/git/blobs/:sha (getBlob)", function(next) { - // found an object after executing: - // git rev-list --all | xargs -l1 git diff-tree -r -c -M -C --no-commit-id | awk '{print $3}' - client.gitdata.getBlob( - { - user: "mikedeboertest", - repo: "node_chat", - sha: "8433b682c95edf3fd81f5ee217dc9c874db35e4b" - }, - function(err, res) { - Assert.equal(err, null); - Assert.equal(res.sha, "8433b682c95edf3fd81f5ee217dc9c874db35e4b"); - Assert.equal(res.size, 2654); - Assert.equal(res.encoding, "base64"); - - next(); - } - ); - }); - - it("should successfully execute POST /repos/:user/:repo/git/blobs (createBlob)", function(next) { - client.gitdata.createBlob( - { - user: "mikedeboertest", - repo: "node_chat", - content: "test", - encoding: "utf-8" - }, - function(err, res) { - Assert.equal(err, null); - Assert.equal(typeof res.sha, "string"); - var sha = res.sha; - - client.gitdata.getBlob( - { - user: "mikedeboertest", - repo: "node_chat", - sha: sha - }, - function(err, res) { - Assert.equal(err, null); - Assert.equal(res.sha, sha); - Assert.equal(res.size, 4); - Assert.equal(res.encoding, "base64"); - - next(); - } - ); - } - ); - }); - - it("should successfully execute GET /repos/:user/:repo/git/commits/:sha (getCommit)", function(next) { - client.gitdata.getCommit( - { - user: "mikedeboertest", - repo: "node_chat", - sha: "17e0734295ffd8174f91f04ba8e8f8e51954b793" - }, - function(err, res) { - Assert.equal(err, null); - Assert.equal(res.author.date, "2012-10-05T08:05:31-07:00"); - Assert.equal(res.author.name, "Mike de Boer"); - Assert.equal(res.parents[0].sha, "221140b288a3c64949594c58420cb4ab289b0756"); - Assert.equal(res.parents[1].sha, "d2836429f4ff7de033c8bc0d16d22d55f2ea39c3"); - next(); - } - ); - }); - - it("should successfully execute POST /repos/:user/:repo/git/commits (createCommit)", function(next) { - // got valid tree reference by executing - // git cat-file -p HEAD - client.gitdata.createCommit( - { - user: "mikedeboertest", - repo: "node_chat", - message: "test", - tree: "8ce4393a319b60bc6179509e0c46dee83c179f9f", - parents: [], - author: { - name: "test-chef", - email: "test-chef@pasta-nirvana.it", - date: "2008-07-09T16:13:30+12:00" - }, - committer: { - name: "test-minion", - email: "test-minion@pasta-nirvana.it", - date: "2008-07-09T16:13:30+12:00" - } - }, - function(err, res) { - Assert.equal(err, null); - Assert.equal(res.author.name, "test-chef"); - Assert.equal(res.author.email, "test-chef@pasta-nirvana.it"); - Assert.equal(res.committer.name, "test-minion"); - Assert.equal(res.committer.email, "test-minion@pasta-nirvana.it"); - Assert.equal(res.message, "test"); - next(); - } - ); - }); - - it("should successfully execute GET /repos/:user/:repo/git/refs/:ref (getReference)", function(next) { - client.gitdata.getReference( - { - user: "mikedeboertest", - repo: "node_chat", - ref: "heads/master" - }, - function(err, res) { - Assert.equal(err, null); - Assert.equal(res.ref, "refs/heads/master"); - Assert.equal(res.object.type, "commit"); - Assert.equal(res.object.sha, "17e0734295ffd8174f91f04ba8e8f8e51954b793"); - next(); - } - ); - }); - - it("should successfully execute GET /repos/:user/:repo/git/refs (getAllReferences)", function(next) { - client.gitdata.getAllReferences( - { - user: "mikedeboertest", - repo: "node_chat" - }, - function(err, res) { - Assert.equal(err, null); - var ref = res[0]; - Assert.equal(ref.ref, "refs/heads/master"); - Assert.equal(ref.object.type, "commit"); - Assert.equal(ref.object.sha, "17e0734295ffd8174f91f04ba8e8f8e51954b793"); - next(); - } - ); - }); -/* -DISABLED temporarily due to Internal Server Error from Github! - - it("should successfully execute POST /repos/:user/:repo/git/refs (createReference)", function(next) { - client.gitdata.createReference( - { - user: "mikedeboertest", - repo: "node_chat", - ref: "heads/tagliatelle", - sha: "17e0734295ffd8174f91f04ba8e8f8e51954b793" - }, - function(err, res) { - Assert.equal(err, null); - console.log(res); - - // other assertions go here - client.gitdata.deleteReference( - { - user: "mikedeboertest", - repo: "node_chat", - ref: "heads/tagliatelle" - }, - function(err, res) { - Assert.equal(err, null); - // other assertions go here - next(); - } - ); - } - ); - });*/ - - it("should successfully execute PATCH /repos/:user/:repo/git/refs/:ref (updateReference)", function(next) { - client.gitdata.getReference( - { - user: "mikedeboertest", - repo: "node_chat", - ref: "heads/master" - }, - function(err, res) { - Assert.equal(err, null); - var sha = res.object.sha; - - // do `force=true` because we go backward in history, which yields a warning - // that it's not a reference that can be fast-forwarded to. - client.gitdata.updateReference( - { - user: "mikedeboertest", - repo: "node_chat", - ref: "heads/master", - sha: "221140b288a3c64949594c58420cb4ab289b0756", - force: true - }, - function(err, res) { - Assert.equal(err, null); - Assert.equal(res.ref, "refs/heads/master"); - Assert.equal(res.object.type, "commit"); - Assert.equal(res.object.sha, "221140b288a3c64949594c58420cb4ab289b0756"); - - client.gitdata.updateReference( - { - user: "mikedeboertest", - repo: "node_chat", - ref: "heads/master", - sha: sha, - force: false - }, - function(err, res) { - Assert.equal(err, null); - Assert.equal(res.ref, "refs/heads/master"); - Assert.equal(res.object.type, "commit"); - Assert.equal(res.object.sha, sha); - - next(); - } - ); - } - ); - } - ); - - }); -/* -DISABLED temporarily due to Internal Server Error from Github! - - it("should successfully execute DELETE /repos/:user/:repo/git/refs/:ref (deleteReference)", function(next) { - client.gitdata.createReference( - { - user: "mikedeboertest", - repo: "node_chat", - ref: "heads/tagliatelle", - sha: "17e0734295ffd8174f91f04ba8e8f8e51954b793" - }, - function(err, res) { - Assert.equal(err, null); - console.log(res); - - // other assertions go here - client.gitdata.deleteReference( - { - user: "mikedeboertest", - repo: "node_chat", - ref: "heads/tagliatelle" - }, - function(err, res) { - Assert.equal(err, null); - // other assertions go here - next(); - } - ); - } - ); - });*/ - - it("should successfully execute GET /repos/:user/:repo/git/tags/:sha (getTag)", function(next) { - client.gitdata.createTag( - { - user: "mikedeboertest", - repo: "node_chat", - tag: "test-pasta", - message: "Grandma's secret sauce", - object: "17e0734295ffd8174f91f04ba8e8f8e51954b793", - type: "commit", - tagger: { - name: "test-chef", - email: "test-chef@pasta-nirvana.it", - date: "2008-07-09T16:13:30+12:00" - } - }, - function(err, res) { - Assert.equal(err, null); - var sha = res.sha; - - client.gitdata.getTag( - { - user: "mikedeboertest", - repo: "node_chat", - sha: sha - }, - function(err, res) { - Assert.equal(err, null); - Assert.equal(res.tag, "test-pasta"); - Assert.equal(res.message, "Grandma's secret sauce"); - Assert.equal(res.sha, sha); - Assert.equal(res.tagger.name, "test-chef"); - Assert.equal(res.tagger.email, "test-chef@pasta-nirvana.it"); - - // other assertions go here - client.gitdata.deleteReference( - { - user: "mikedeboertest", - repo: "node_chat", - ref: "tags/" + sha - }, - function(err, res) { - //Assert.equal(err, null); - // NOTE: Github return 'Validation Failed' error codes back, which makes no sense to me. - // ask the guys what's up here... - Assert.equal(err.code, 422); - - next(); - } - ); - } - ); - } - ); - }); - - it("should successfully execute POST /repos/:user/:repo/git/tags (createTag)", function(next) { - client.gitdata.createTag( - { - user: "mikedeboertest", - repo: "node_chat", - tag: "test-pasta", - message: "Grandma's secret sauce", - object: "17e0734295ffd8174f91f04ba8e8f8e51954b793", - type: "commit", - tagger: { - name: "test-chef", - email: "test-chef@pasta-nirvana.it", - date: "2008-07-09T16:13:30+12:00" - } - }, - function(err, res) { - Assert.equal(err, null); - var sha = res.sha; - - client.gitdata.getTag( - { - user: "mikedeboertest", - repo: "node_chat", - sha: sha - }, - function(err, res) { - Assert.equal(err, null); - Assert.equal(res.tag, "test-pasta"); - Assert.equal(res.message, "Grandma's secret sauce"); - Assert.equal(res.sha, sha); - Assert.equal(res.tagger.name, "test-chef"); - Assert.equal(res.tagger.email, "test-chef@pasta-nirvana.it"); - - // other assertions go here - client.gitdata.deleteReference( - { - user: "mikedeboertest", - repo: "node_chat", - ref: "tags/" + sha - }, - function(err, res) { - //Assert.equal(err, null); - // NOTE: Github return 'Validation Failed' error codes back, which makes no sense to me. - // ask the guys what's up here... - Assert.equal(err.code, 422); - - next(); - } - ); - } - ); - } - ); - }); - - it("should successfully execute GET /repos/:user/:repo/git/trees/:sha (getTree)", function(next) { - client.gitdata.getTree( - { - user: "mikedeboertest", - repo: "node_chat", - sha: "8ce4393a319b60bc6179509e0c46dee83c179f9f", - recursive: false - }, - function(err, res) { - Assert.equal(err, null); - Assert.equal(res.tree[0].type, "blob"); - Assert.equal(res.tree[0].path, "LICENSE-MIT"); - Assert.equal(res.tree[0].sha, "f30a31de94635399f42fd05f91f6ed3ff2f013d6"); - Assert.equal(res.tree[0].mode, "100644"); - Assert.equal(res.tree[0].size, 1075); - - client.gitdata.getTree( - { - user: "mikedeboertest", - repo: "node_chat", - sha: "8ce4393a319b60bc6179509e0c46dee83c179f9f", - recursive: true - }, - function(err, res) { - Assert.equal(err, null); - Assert.equal(res.tree[0].type, "blob"); - Assert.equal(res.tree[0].path, "LICENSE-MIT"); - Assert.equal(res.tree[0].sha, "f30a31de94635399f42fd05f91f6ed3ff2f013d6"); - Assert.equal(res.tree[0].mode, "100644"); - Assert.equal(res.tree[0].size, 1075); - - next(); - } - ); - } - ); - }); - - it("should successfully execute POST /repos/:user/:repo/git/trees (createTree)", function(next) { - client.gitdata.getTree( - { - user: "mikedeboertest", - repo: "node_chat", - sha: "8ce4393a319b60bc6179509e0c46dee83c179f9f", - recursive: false - }, - function(err, res) { - Assert.equal(err, null); - var file = res.tree[0]; - - client.gitdata.createTree( - { - base_tree: "8ce4393a319b60bc6179509e0c46dee83c179f9f", - user: "mikedeboertest", - repo: "node_chat", - tree: [ - { - path: file.path, - mode: "100755", - type: file.type, - sha: file.sha - } - ] - }, - function(err, res) { - Assert.equal(err, null); - var sha = res.sha; - - client.gitdata.getTree( - { - user: "mikedeboertest", - repo: "node_chat", - sha: sha, - recursive: true - }, - function(err, res) { - Assert.equal(err, null); - Assert.equal(res.tree[0].type, "blob"); - Assert.equal(res.tree[0].path, "LICENSE-MIT"); - Assert.equal(res.tree[0].sha, "f30a31de94635399f42fd05f91f6ed3ff2f013d6"); - Assert.equal(res.tree[0].mode, "100755"); - Assert.equal(res.tree[0].size, 1075); - - next(); - } - ); - } - ); - } - ); - }); -}); diff --git a/api/v3.0.0/gitignore.js b/api/v3.0.0/gitignore.js deleted file mode 100644 index b60b86b6fe..0000000000 --- a/api/v3.0.0/gitignore.js +++ /dev/null @@ -1,102 +0,0 @@ -/** - * mixin gitignore - * - * Copyright 2012 Cloud9 IDE, Inc. - * - * This product includes software developed by - * Cloud9 IDE, Inc (http://c9.io). - * - * Author: Mike de Boer - **/ - -"use strict"; - -var error = require("./../../error"); -var Util = require("./../../util"); - -var gitignore = module.exports = { - gitignore: {} -}; - -(function() { - /** section: github - * gitignore#templates(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * No other params, simply pass an empty Object literal `{}` - **/ - this.templates = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * gitignore#template(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - name (String): Required. The name of the .gitignore template to get - **/ - this.template = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - -}).call(gitignore.gitignore); diff --git a/api/v3.0.0/gitignoreTest.js b/api/v3.0.0/gitignoreTest.js deleted file mode 100644 index e533eb4c88..0000000000 --- a/api/v3.0.0/gitignoreTest.js +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright 2012 Cloud9 IDE, Inc. - * - * This product includes software developed by - * Cloud9 IDE, Inc (http://c9.io). - * - * Author: Mike de Boer - */ - -"use strict"; - -var Assert = require("assert"); -var Client = require("./../../index"); - -describe("[gitignore]", function() { - var client; - - beforeEach(function() { - client = new Client({ - version: "3.0.0" - }); - }); - - it("should successfully execute GET /gitignore/templates (templates)", function(next) { - client.gitignore.templates( - {}, - function(err, res) { - Assert.equal(err, null); - // other assertions go here - Assert.ifError(err); - Assert(Array.isArray(res)); - Assert(res.length > 10); - next(); - } - ); - }); - - it("should successfully execute GET /gitignore/templates/:name (template)", function(next) { - client.gitignore.template( - { - name: "C" - }, - function(err, res) { - Assert.equal(err, null); - // other assertions go here - Assert.ifError(err); - Assert('name' in res); - Assert('source' in res); - Assert(typeof res.source === 'string'); - next(); - } - ); - }); -}); diff --git a/api/v3.0.0/index.js b/api/v3.0.0/index.js deleted file mode 100644 index 5ce2480f28..0000000000 --- a/api/v3.0.0/index.js +++ /dev/null @@ -1,40 +0,0 @@ -/** - * class Github - * - * A Node.JS module, which provides an object oriented wrapper for the GitHub v3 API. - * - * Copyright 2012 Cloud9 IDE, Inc. - * - * This product includes software developed by - * Cloud9 IDE, Inc (http://c9.io). - * - * Author: Mike de Boer - **/ - -"use strict"; - -var Fs = require("fs"); -var Util = require("./../../util"); -var error = require("./../../error"); - -var GithubHandler = module.exports = function(client) { - this.client = client; - this.routes = JSON.parse(Fs.readFileSync(__dirname + "/routes.json", "utf8")); -}; - -var proto = { - sendError: function(err, block, msg, callback) { - if (this.client.debug) - Util.log(err, block, msg.user, "error"); - if (typeof err == "string") - err = new error.InternalServerError(err); - if (callback) - callback(err); - } -}; - -["gists", "gitdata", "issues", "authorization", "orgs", "statuses", "pullRequests", "repos", "user", "events", "releases", "search", "markdown", "gitignore", "misc"].forEach(function(api) { - Util.extend(proto, require("./" + api)); -}); - -GithubHandler.prototype = proto; diff --git a/api/v3.0.0/issues.js b/api/v3.0.0/issues.js deleted file mode 100644 index dfd44bc9b5..0000000000 --- a/api/v3.0.0/issues.js +++ /dev/null @@ -1,1120 +0,0 @@ -/** - * mixin issues - * - * Copyright 2012 Cloud9 IDE, Inc. - * - * This product includes software developed by - * Cloud9 IDE, Inc (http://c9.io). - * - * Author: Mike de Boer - **/ - -"use strict"; - -var error = require("./../../error"); -var Util = require("./../../util"); - -var issues = module.exports = { - issues: {} -}; - -(function() { - /** section: github - * issues#getAll(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - filter (String): Optional. Validation rule: ` ^(all|assigned|created|mentioned|subscribed)$ `. - * - state (String): Optional. open, closed, or all Validation rule: ` ^(open|closed|all)$ `. - * - labels (String): Optional. String list of comma separated Label names. Example: bug,ui,@high - * - sort (String): Optional. Validation rule: ` ^(created|updated|comments)$ `. - * - direction (String): Optional. Validation rule: ` ^(asc|desc)$ `. - * - since (Date): Optional. Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ - * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. - * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. - **/ - this.getAll = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * issues#repoIssues(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - milestone (String): Optional. Validation rule: ` ^([0-9]+|none|\*)$ `. - * - state (String): Optional. open, closed, or all Validation rule: ` ^(open|closed|all)$ `. - * - assignee (String): Optional. String User login, `none` for Issues with no assigned User. `*` for Issues with any assigned User. - * - mentioned (String): Optional. String User login. - * - labels (String): Optional. String list of comma separated Label names. Example: bug,ui,@high - * - sort (String): Optional. Validation rule: ` ^(created|updated|comments)$ `. - * - direction (String): Optional. Validation rule: ` ^(asc|desc)$ `. - * - since (Date): Optional. Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ - * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. - * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. - **/ - this.repoIssues = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * issues#getRepoIssue(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - number (Number): Required. Validation rule: ` ^[0-9]+$ `. - **/ - this.getRepoIssue = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * issues#create(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - title (String): Required. - * - body (String): Optional. - * - assignee (String): Optional. Login for the user that this issue should be assigned to. - * - milestone (Number): Optional. Milestone to associate this issue with. Validation rule: ` ^[0-9]+$ `. - * - labels (Json): Required. Array of strings - Labels to associate with this issue. - **/ - this.create = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * issues#edit(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - number (Number): Required. Validation rule: ` ^[0-9]+$ `. - * - title (String): Optional. - * - body (String): Optional. - * - assignee (String): Optional. Login for the user that this issue should be assigned to. - * - milestone (Number): Optional. Milestone to associate this issue with. Validation rule: ` ^[0-9]+$ `. - * - labels (Json): Optional. Array of strings - Labels to associate with this issue. - * - state (String): Optional. open or closed Validation rule: ` ^(open|closed)$ `. - **/ - this.edit = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * issues#repoComments(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - sort (String): Optional. Validation rule: ` ^(created|updated)$ `. - * - direction (String): Optional. Validation rule: ` ^(asc|desc)$ `. - * - since (Date): Optional. Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ - * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. - * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. - **/ - this.repoComments = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * issues#getComments(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - number (Number): Required. Validation rule: ` ^[0-9]+$ `. - * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. - * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. - **/ - this.getComments = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * issues#getComment(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - id (String): Required. - **/ - this.getComment = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * issues#createComment(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - number (Number): Required. Validation rule: ` ^[0-9]+$ `. - * - body (String): Required. - **/ - this.createComment = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * issues#editComment(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - id (String): Required. - * - body (String): Required. - **/ - this.editComment = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * issues#deleteComment(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - id (String): Required. - **/ - this.deleteComment = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * issues#getEvents(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - number (Number): Required. Validation rule: ` ^[0-9]+$ `. - * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. - * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. - **/ - this.getEvents = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * issues#getRepoEvents(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. - * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. - **/ - this.getRepoEvents = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * issues#getEvent(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - id (String): Required. - **/ - this.getEvent = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * issues#getLabels(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. - * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. - **/ - this.getLabels = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * issues#getLabel(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - name (String): Required. - **/ - this.getLabel = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * issues#createLabel(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - name (String): Required. - * - color (String): Required. 6 character hex code, without a leading #. - **/ - this.createLabel = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * issues#updateLabel(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - name (String): Required. - * - color (String): Required. 6 character hex code, without a leading #. - **/ - this.updateLabel = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * issues#deleteLabel(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - name (String): Required. - **/ - this.deleteLabel = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * issues#getIssueLabels(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - number (Number): Required. Validation rule: ` ^[0-9]+$ `. - **/ - this.getIssueLabels = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * issues#getAllMilestones(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - state (String): Optional. Validation rule: ` ^(open|closed)$ `. - * - sort (String): Optional. due_date, completeness, default: due_date Validation rule: ` ^(due_date|completeness)$ `. - * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. - * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. - **/ - this.getAllMilestones = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * issues#getMilestone(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - number (Number): Required. Validation rule: ` ^[0-9]+$ `. - **/ - this.getMilestone = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * issues#createMilestone(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - title (String): Required. - * - state (String): Optional. Validation rule: ` ^(open|closed)$ `. - * - description (String): Optional. - * - due_on (Date): Optional. Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ - **/ - this.createMilestone = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * issues#updateMilestone(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - number (Number): Required. Validation rule: ` ^[0-9]+$ `. - * - title (String): Required. - * - state (String): Optional. Validation rule: ` ^(open|closed)$ `. - * - description (String): Optional. - * - due_on (Date): Optional. Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ - **/ - this.updateMilestone = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * issues#deleteMilestone(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - number (Number): Required. Validation rule: ` ^[0-9]+$ `. - **/ - this.deleteMilestone = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - -}).call(issues.issues); diff --git a/api/v3.0.0/issuesTest.js b/api/v3.0.0/issuesTest.js deleted file mode 100644 index c9f217bff9..0000000000 --- a/api/v3.0.0/issuesTest.js +++ /dev/null @@ -1,423 +0,0 @@ -/* - * Copyright 2012 Cloud9 IDE, Inc. - * - * This product includes software developed by - * Cloud9 IDE, Inc (http://c9.io). - * - * Author: Mike de Boer - */ - -"use strict"; - -var Assert = require("assert"); -var Client = require("./../../index"); - -describe("[issues]", function() { - var client; - var token = "c286e38330e15246a640c2cf32a45ea45d93b2ba"; - - beforeEach(function() { - client = new Client({ - version: "3.0.0" - }); - client.authenticate({ - type: "oauth", - token: token - }); - }); - - it("should successfully execute GET /issues (getAll)", function(next) { - client.issues.getAll( - { - filter: "created", - state: "open", - labels: "", - sort: "updated", - direction: "asc" - }, - function(err, res) { - Assert.equal(err, null); - Assert.equal(res.length, 1); - var issue = res[0]; - Assert.equal(issue.title, "My First Issue"); - Assert.equal(issue.number, 2); - Assert.equal(issue.state, "open"); - Assert.equal(issue.body, "Willing to start a debate on the best recipe of macaroni."); - Assert.equal(issue.assignee.login, "mikedeboertest"); - - next(); - } - ); - }); - - it("should successfully execute GET /repos/:user/:repo/issues (repoIssues)", function(next) { - client.issues.repoIssues( - { - user: "mikedeboertest", - repo: "node_chat", - state: "open", - sort: "updated", - direction: "asc" - }, - function(err, res) { - Assert.equal(err, null); - Assert.equal(res.length, 1); - var issue = res[0]; - Assert.equal(issue.title, "My First Issue"); - Assert.equal(issue.number, 2); - Assert.equal(issue.state, "open"); - Assert.equal(issue.body, "Willing to start a debate on the best recipe of macaroni."); - Assert.equal(issue.assignee.login, "mikedeboertest"); - - next(); - } - ); - }); - - it("should successfully execute GET /repos/:user/:repo/issues/:number (getRepoIssue)", function(next) { - client.issues.getRepoIssue( - { - user: "mikedeboertest", - repo: "node_chat", - number: 2 - }, - function(err, res) { - Assert.equal(err, null); - Assert.equal(res.title, "My First Issue"); - Assert.equal(res.number, 2); - Assert.equal(res.state, "open"); - Assert.equal(res.body, "Willing to start a debate on the best recipe of macaroni."); - Assert.equal(res.assignee.login, "mikedeboertest"); - - next(); - } - ); - }); -/* - it("should successfully execute POST /repos/:user/:repo/issues (create)", function(next) { - client.issues.create( - { - user: "String", - repo: "String", - title: "String", - body: "String", - assignee: "String", - milestone: "Number", - labels: "Json" - }, - function(err, res) { - Assert.equal(err, null); - // other assertions go here - next(); - } - ); - }); - - it("should successfully execute PATCH /repos/:user/:repo/issues/:number (edit)", function(next) { - client.issues.edit( - { - user: "String", - repo: "String", - number: "Number", - title: "String", - body: "String", - assignee: "String", - milestone: "Number", - labels: "Json" - }, - function(err, res) { - Assert.equal(err, null); - // other assertions go here - next(); - } - ); - }); - - it("should successfully execute GET /repos/:user/:repo/issues/:number/comments (getComments)", function(next) { - client.issues.getComments( - { - user: "String", - repo: "String", - number: "Number", - page: "Number", - per_page: "Number" - }, - function(err, res) { - Assert.equal(err, null); - // other assertions go here - next(); - } - ); - }); - - it("should successfully execute GET /repos/:user/:repo/issues/comments/:id (getComment)", function(next) { - client.issues.getComment( - { - user: "String", - repo: "String", - id: "String" - }, - function(err, res) { - Assert.equal(err, null); - // other assertions go here - next(); - } - ); - }); - - it("should successfully execute POST /repos/:user/:repo/issues/:number/comments (createComment)", function(next) { - client.issues.createComment( - { - user: "String", - repo: "String", - number: "Number", - body: "String" - }, - function(err, res) { - Assert.equal(err, null); - // other assertions go here - next(); - } - ); - }); - - it("should successfully execute PATCH /repos/:user/:repo/issues/comments/:id (editComment)", function(next) { - client.issues.editComment( - { - user: "String", - repo: "String", - id: "String", - body: "String" - }, - function(err, res) { - Assert.equal(err, null); - // other assertions go here - next(); - } - ); - }); - - it("should successfully execute DELETE /repos/:user/:repo/issues/comments/:id (deleteComment)", function(next) { - client.issues.deleteComment( - { - user: "String", - repo: "String", - id: "String" - }, - function(err, res) { - Assert.equal(err, null); - // other assertions go here - next(); - } - ); - }); - - it("should successfully execute GET /repos/:user/:repo/issues/:number/events (getEvents)", function(next) { - client.issues.getEvents( - { - user: "String", - repo: "String", - number: "Number", - page: "Number", - per_page: "Number" - }, - function(err, res) { - Assert.equal(err, null); - // other assertions go here - next(); - } - ); - }); - - it("should successfully execute GET /repos/:user/:repo/issues/events (getRepoEvents)", function(next) { - client.issues.getRepoEvents( - { - user: "String", - repo: "String", - page: "Number", - per_page: "Number" - }, - function(err, res) { - Assert.equal(err, null); - // other assertions go here - next(); - } - ); - }); - - it("should successfully execute GET /repos/:user/:repo/issues/events/:id (getEvent)", function(next) { - client.issues.getEvent( - { - user: "String", - repo: "String", - id: "String" - }, - function(err, res) { - Assert.equal(err, null); - // other assertions go here - next(); - } - ); - }); - - it("should successfully execute GET /repos/:user/:repo/labels (getLabels)", function(next) { - client.issues.getLabels( - { - user: "String", - repo: "String" - }, - function(err, res) { - Assert.equal(err, null); - // other assertions go here - next(); - } - ); - }); - - it("should successfully execute GET /repos/:user/:repo/labels/:name (getLabel)", function(next) { - client.issues.getLabel( - { - user: "String", - repo: "String", - name: "String" - }, - function(err, res) { - Assert.equal(err, null); - // other assertions go here - next(); - } - ); - }); - - it("should successfully execute POST /repos/:user/:repo/labels (createLabel)", function(next) { - client.issues.createLabel( - { - user: "String", - repo: "String", - name: "String", - color: "String" - }, - function(err, res) { - Assert.equal(err, null); - // other assertions go here - next(); - } - ); - }); - - it("should successfully execute POST /repos/:user/:repo/labels/:name (updateLabel)", function(next) { - client.issues.updateLabel( - { - user: "String", - repo: "String", - name: "String", - color: "String" - }, - function(err, res) { - Assert.equal(err, null); - // other assertions go here - next(); - } - ); - }); - - it("should successfully execute DELETE /repos/:user/:repo/labels/:name (deleteLabel)", function(next) { - client.issues.deleteLabel( - { - user: "String", - repo: "String", - name: "String" - }, - function(err, res) { - Assert.equal(err, null); - // other assertions go here - next(); - } - ); - }); - - it("should successfully execute GET /repos/:user/:repo/milestones (getAllMilestones)", function(next) { - client.issues.getAllMilestones( - { - user: "String", - repo: "String", - state: "String", - sort: "String", - page: "Number", - per_page: "Number" - }, - function(err, res) { - Assert.equal(err, null); - // other assertions go here - next(); - } - ); - }); - - it("should successfully execute GET /repos/:user/:repo/milestones/:number (getMilestone)", function(next) { - client.issues.getMilestone( - { - user: "String", - repo: "String", - number: "Number" - }, - function(err, res) { - Assert.equal(err, null); - // other assertions go here - next(); - } - ); - }); - - it("should successfully execute POST /repos/:user/:repo/milestones (createMilestone)", function(next) { - client.issues.createMilestone( - { - user: "String", - repo: "String", - title: "String", - state: "String", - description: "String", - due_on: "Date" - }, - function(err, res) { - Assert.equal(err, null); - // other assertions go here - next(); - } - ); - }); - - it("should successfully execute PATCH /repos/:user/:repo/milestones/:number (updateMilestone)", function(next) { - client.issues.updateMilestone( - { - user: "String", - repo: "String", - number: "Number", - title: "String", - state: "String", - description: "String", - due_on: "Date" - }, - function(err, res) { - Assert.equal(err, null); - // other assertions go here - next(); - } - ); - }); - - it("should successfully execute DELETE /repos/:user/:repo/milestones/:number (deleteMilestone)", function(next) { - client.issues.deleteMilestone( - { - user: "String", - repo: "String", - number: "Number" - }, - function(err, res) { - Assert.equal(err, null); - // other assertions go here - next(); - } - ); - });*/ -}); diff --git a/api/v3.0.0/markdown.js b/api/v3.0.0/markdown.js deleted file mode 100644 index c5f7ba2231..0000000000 --- a/api/v3.0.0/markdown.js +++ /dev/null @@ -1,64 +0,0 @@ -/** - * mixin markdown - * - * Copyright 2012 Cloud9 IDE, Inc. - * - * This product includes software developed by - * Cloud9 IDE, Inc (http://c9.io). - * - * Author: Mike de Boer - **/ - -"use strict"; - -var error = require("./../../error"); -var Util = require("./../../util"); - -var markdown = module.exports = { - markdown: {} -}; - -(function() { - /** section: github - * markdown#render(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - text (String): Required. The Markdown text to render - * - mode (String): Optional. The rendering mode, `markdown` to render a document as plain Markdown, just like README files are rendered. `gfm` to render a document as user-content, e.g. like user comments or issues are rendered. In GFM mode, hard line breaks are always taken into account, and issue and user mentions are linked accordingly. Validation rule: ` ^(markdown|gfm)$ `. - * - context (String): Optional. The repository context, only taken into account when rendering as `gfm` - **/ - this.render = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - -}).call(markdown.markdown); diff --git a/api/v3.0.0/markdownTest.js b/api/v3.0.0/markdownTest.js deleted file mode 100644 index 19271af777..0000000000 --- a/api/v3.0.0/markdownTest.js +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright 2012 Cloud9 IDE, Inc. - * - * This product includes software developed by - * Cloud9 IDE, Inc (http://c9.io). - * - * Author: Mike de Boer - */ - -"use strict"; - -var Assert = require("assert"); -var Client = require("./../../index"); - -describe("[markdown]", function() { - var client; - var token = "c286e38330e15246a640c2cf32a45ea45d93b2ba"; - - beforeEach(function() { - client = new Client({ - version: "3.0.0" - }); - /*client.authenticate({ - type: "oauth", - token: token - });*/ - }); - - it("should successfully execute POST /markdown (render)", function(next) { - client.markdown.render( - { - text: "Hello world github/linguist#1 **cool**, and #1!", - mode: "gfm", - context: "github/gollem" - }, - function(err, res) { - Assert.equal(err, null); - console.log(res); - next(); - } - ); - }); -}); diff --git a/api/v3.0.0/misc.js b/api/v3.0.0/misc.js deleted file mode 100644 index b1dc00ba79..0000000000 --- a/api/v3.0.0/misc.js +++ /dev/null @@ -1,142 +0,0 @@ -/** - * mixin misc - * - * Copyright 2012 Cloud9 IDE, Inc. - * - * This product includes software developed by - * Cloud9 IDE, Inc (http://c9.io). - * - * Author: Mike de Boer - **/ - -"use strict"; - -var error = require("./../../error"); -var Util = require("./../../util"); - -var misc = module.exports = { - misc: {} -}; - -(function() { - /** section: github - * misc#emojis(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * No other params, simply pass an empty Object literal `{}` - **/ - this.emojis = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * misc#meta(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * No other params, simply pass an empty Object literal `{}` - **/ - this.meta = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * misc#rateLimit(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * No other params, simply pass an empty Object literal `{}` - **/ - this.rateLimit = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - -}).call(misc.misc); diff --git a/api/v3.0.0/miscTest.js b/api/v3.0.0/miscTest.js deleted file mode 100644 index 6cee44f2f7..0000000000 --- a/api/v3.0.0/miscTest.js +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright 2012 Cloud9 IDE, Inc. - * - * This product includes software developed by - * Cloud9 IDE, Inc (http://c9.io). - * - * Author: Mike de Boer - */ - -"use strict"; - -var Assert = require("assert"); -var Client = require("./../../index"); - -describe("[misc]", function() { - var client; - - beforeEach(function() { - client = new Client({ - version: "3.0.0" - }); - }); - - it("should successfully execute GET /emojis (emojis)", function(next) { - client.misc.emojis( - {}, - function(err, res) { - Assert.equal(err, null); - // other assertions go here - Assert.ifError(err); - // A common emoji on github - Assert('shipit' in res); - next(); - } - ); - }); - - it("should successfully execute GET /meta (meta)", function(next) { - client.misc.meta( - {}, - function(err, res) { - Assert.equal(err, null); - // other assertions go here - Assert('hooks' in res); - Assert('git' in res); - next(); - } - ); - }); - - it("should successfully execute GET /rate_limit (rateLimit)", function(next) { - client.misc.rateLimit( - {}, - function(err, res) { - Assert.equal(err, null); - Assert('resources' in res); - Assert('core' in res.resources); - Assert(typeof res.resources.core.limit === 'number'); - Assert(typeof res.resources.core.remaining === 'number'); - Assert(typeof res.resources.core.reset === 'number'); - Assert('search' in res.resources); - Assert(typeof res.resources.search.limit === 'number'); - Assert(typeof res.resources.search.remaining === 'number'); - Assert(typeof res.resources.search.reset === 'number'); - next(); - } - ); - }); -}); diff --git a/api/v3.0.0/orgs.js b/api/v3.0.0/orgs.js deleted file mode 100644 index 8fe1727975..0000000000 --- a/api/v3.0.0/orgs.js +++ /dev/null @@ -1,978 +0,0 @@ -/** - * mixin orgs - * - * Copyright 2012 Cloud9 IDE, Inc. - * - * This product includes software developed by - * Cloud9 IDE, Inc (http://c9.io). - * - * Author: Mike de Boer - **/ - -"use strict"; - -var error = require("./../../error"); -var Util = require("./../../util"); - -var orgs = module.exports = { - orgs: {} -}; - -(function() { - /** section: github - * orgs#getFromUser(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. - * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. - **/ - this.getFromUser = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * orgs#get(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - org (String): Required. - * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. - * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. - **/ - this.get = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * orgs#update(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - org (String): Required. - * - billing_email (String): Optional. Billing email address. This address is not publicized. - * - company (String): Optional. - * - email (String): Optional. Publicly visible email address. - * - location (String): Optional. - * - name (String): Optional. - **/ - this.update = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * orgs#getMembers(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - org (String): Required. - * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. - * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. - **/ - this.getMembers = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * orgs#getMember(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - org (String): Required. - * - user (String): Required. - **/ - this.getMember = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * orgs#removeMember(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - org (String): Required. - * - user (String): Required. - **/ - this.removeMember = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * orgs#getPublicMembers(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - org (String): Required. - **/ - this.getPublicMembers = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * orgs#getPublicMember(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - org (String): Required. - * - user (String): Required. - **/ - this.getPublicMember = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * orgs#publicizeMembership(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - org (String): Required. - * - user (String): Required. - **/ - this.publicizeMembership = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * orgs#concealMembership(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - org (String): Required. - * - user (String): Required. - **/ - this.concealMembership = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * orgs#getTeams(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - org (String): Required. - * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. - * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. - **/ - this.getTeams = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * orgs#getTeam(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - id (String): Required. - **/ - this.getTeam = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * orgs#createTeam(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - org (String): Required. - * - name (String): Required. - * - repo_names (Array): Optional. Array of strings - * - permission (String): Optional. `pull` - team members can pull, but not push or administer this repositories (Default), `push` - team members can pull and push, but not administer this repositores, `admin` - team members can pull, push and administer these repositories. Validation rule: ` ^(pull|push|admin)$ `. - **/ - this.createTeam = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * orgs#updateTeam(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - id (String): Required. - * - name (String): Required. - * - permission (String): Optional. `pull` - team members can pull, but not push or administer this repositories (Default), `push` - team members can pull and push, but not administer this repositores, `admin` - team members can pull, push and administer these repositories. Validation rule: ` ^(pull|push|admin)$ `. - **/ - this.updateTeam = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * orgs#deleteTeam(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - id (String): Required. - **/ - this.deleteTeam = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * orgs#getTeamMembers(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - id (String): Required. - * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. - * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. - **/ - this.getTeamMembers = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * orgs#getTeamMember(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - id (String): Required. - * - user (String): Required. - **/ - this.getTeamMember = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * orgs#addTeamMember(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - id (String): Required. - * - user (String): Required. - **/ - this.addTeamMember = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * orgs#deleteTeamMember(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - id (String): Required. - * - user (String): Required. - **/ - this.deleteTeamMember = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * orgs#getTeamRepos(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - id (String): Required. - * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. - * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. - **/ - this.getTeamRepos = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * orgs#getTeamRepo(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - id (String): Required. - * - user (String): Required. - * - repo (String): Required. - **/ - this.getTeamRepo = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * orgs#addTeamRepo(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - id (String): Required. - * - user (String): Required. - * - repo (String): Required. - **/ - this.addTeamRepo = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * orgs#deleteTeamRepo(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - id (String): Required. - * - user (String): Required. - * - repo (String): Required. - **/ - this.deleteTeamRepo = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - -}).call(orgs.orgs); diff --git a/api/v3.0.0/orgsTest.js b/api/v3.0.0/orgsTest.js deleted file mode 100644 index 44faeed898..0000000000 --- a/api/v3.0.0/orgsTest.js +++ /dev/null @@ -1,361 +0,0 @@ -/* - * Copyright 2012 Cloud9 IDE, Inc. - * - * This product includes software developed by - * Cloud9 IDE, Inc (http://c9.io). - * - * Author: Mike de Boer - */ - -"use strict"; - -var Assert = require("assert"); -var Client = require("./../../index"); - -describe("[orgs]", function() { - var client; - var token = "c286e38330e15246a640c2cf32a45ea45d93b2ba"; - - beforeEach(function() { - client = new Client({ - version: "3.0.0" - }); - client.authenticate({ - type: "oauth", - token: token - }); - }); - - it("should successfully execute GET /users/:user/orgs (getFromUser)", function(next) { - client.orgs.getFromUser( - { - user: "String", - page: "Number", - per_page: "Number" - }, - function(err, res) { - Assert.equal(err, null); - // other assertions go here - next(); - } - ); - }); - - it("should successfully execute GET /orgs/:org (get)", function(next) { - client.orgs.get( - { - org: "String", - page: "Number", - per_page: "Number" - }, - function(err, res) { - Assert.equal(err, null); - // other assertions go here - next(); - } - ); - }); - - it("should successfully execute PATCH /orgs/:org (update)", function(next) { - client.orgs.update( - { - org: "String", - billing_email: "String", - company: "String", - email: "String", - location: "String", - name: "String" - }, - function(err, res) { - Assert.equal(err, null); - // other assertions go here - next(); - } - ); - }); - - it("should successfully execute GET /orgs/:org/members (getMembers)", function(next) { - client.orgs.getMembers( - { - org: "String", - page: "Number", - per_page: "Number" - }, - function(err, res) { - Assert.equal(err, null); - // other assertions go here - next(); - } - ); - }); - - it("should successfully execute GET /orgs/:org/members/:user (getMember)", function(next) { - client.orgs.getMember( - { - org: "String", - user: "String" - }, - function(err, res) { - Assert.equal(err, null); - // other assertions go here - next(); - } - ); - }); - - it("should successfully execute DELETE /orgs/:org/members/:user (removeMember)", function(next) { - client.orgs.removeMember( - { - org: "String", - user: "String" - }, - function(err, res) { - Assert.equal(err, null); - // other assertions go here - next(); - } - ); - }); - - it("should successfully execute GET /orgs/:org/public_members (getPublicMembers)", function(next) { - client.orgs.getPublicMembers( - { - org: "String" - }, - function(err, res) { - Assert.equal(err, null); - // other assertions go here - next(); - } - ); - }); - - it("should successfully execute GET /orgs/:org/public_members/:user (getPublicMember)", function(next) { - client.orgs.getPublicMember( - { - org: "String", - user: "String" - }, - function(err, res) { - Assert.equal(err, null); - // other assertions go here - next(); - } - ); - }); - - it("should successfully execute PUT /orgs/:org/public_members/:user (publicizeMembership)", function(next) { - client.orgs.publicizeMembership( - { - org: "String", - user: "String" - }, - function(err, res) { - Assert.equal(err, null); - // other assertions go here - next(); - } - ); - }); - - it("should successfully execute DELETE /orgs/:org/public_members/:user (concealMembership)", function(next) { - client.orgs.concealMembership( - { - org: "String", - user: "String" - }, - function(err, res) { - Assert.equal(err, null); - // other assertions go here - next(); - } - ); - }); - - it("should successfully execute GET /orgs/:org/teams (getTeams)", function(next) { - client.orgs.getTeams( - { - org: "String" - }, - function(err, res) { - Assert.equal(err, null); - // other assertions go here - next(); - } - ); - }); - - it("should successfully execute GET /teams/:id (getTeam)", function(next) { - client.orgs.getTeam( - { - id: "String" - }, - function(err, res) { - Assert.equal(err, null); - // other assertions go here - next(); - } - ); - }); - - it("should successfully execute POST /orgs/:org/teams (createTeam)", function(next) { - client.orgs.createTeam( - { - org: "String", - name: "String", - repo_names: "Array", - permission: "String" - }, - function(err, res) { - Assert.equal(err, null); - // other assertions go here - next(); - } - ); - }); - - it("should successfully execute PATCH /teams/:id (updateTeam)", function(next) { - client.orgs.updateTeam( - { - id: "String", - name: "String", - permission: "String" - }, - function(err, res) { - Assert.equal(err, null); - // other assertions go here - next(); - } - ); - }); - - it("should successfully execute DELETE /teams/:id (deleteTeam)", function(next) { - client.orgs.deleteTeam( - { - id: "String" - }, - function(err, res) { - Assert.equal(err, null); - // other assertions go here - next(); - } - ); - }); - - it("should successfully execute GET /teams/:id/members (getTeamMembers)", function(next) { - client.orgs.getTeamMembers( - { - id: "String", - page: "Number", - per_page: "Number" - }, - function(err, res) { - Assert.equal(err, null); - // other assertions go here - next(); - } - ); - }); - - it("should successfully execute GET /teams/:id/members/:user (getTeamMember)", function(next) { - client.orgs.getTeamMember( - { - id: "String", - user: "String" - }, - function(err, res) { - Assert.equal(err, null); - // other assertions go here - next(); - } - ); - }); - - it("should successfully execute PUT /teams/:id/members/:user (addTeamMember)", function(next) { - client.orgs.addTeamMember( - { - id: "String", - user: "String" - }, - function(err, res) { - Assert.equal(err, null); - // other assertions go here - next(); - } - ); - }); - - it("should successfully execute DELETE /teams/:id/members/:user (deleteTeamMember)", function(next) { - client.orgs.deleteTeamMember( - { - id: "String", - user: "String" - }, - function(err, res) { - Assert.equal(err, null); - // other assertions go here - next(); - } - ); - }); - - it("should successfully execute GET /teams/:id/repos (getTeamRepos)", function(next) { - client.orgs.getTeamRepos( - { - id: "String", - page: "Number", - per_page: "Number" - }, - function(err, res) { - Assert.equal(err, null); - // other assertions go here - next(); - } - ); - }); - - it("should successfully execute GET /teams/:id/repos/:user/:repo (getTeamRepo)", function(next) { - client.orgs.getTeamRepo( - { - id: "String", - user: "String", - repo: "String" - }, - function(err, res) { - Assert.equal(err, null); - // other assertions go here - next(); - } - ); - }); - - it("should successfully execute PUT /teams/:id/repos/:user/:repo (addTeamRepo)", function(next) { - client.orgs.addTeamRepo( - { - id: "String", - user: "String", - repo: "String" - }, - function(err, res) { - Assert.equal(err, null); - // other assertions go here - next(); - } - ); - }); - - it("should successfully execute DELETE /teams/:id/repos/:user/:repo (deleteTeamRepo)", function(next) { - client.orgs.deleteTeamRepo( - { - id: "String", - user: "String", - repo: "String" - }, - function(err, res) { - Assert.equal(err, null); - // other assertions go here - next(); - } - ); - }); -}); diff --git a/api/v3.0.0/pullRequests.js b/api/v3.0.0/pullRequests.js deleted file mode 100644 index 67175b8214..0000000000 --- a/api/v3.0.0/pullRequests.js +++ /dev/null @@ -1,680 +0,0 @@ -/** - * mixin pullRequests - * - * Copyright 2012 Cloud9 IDE, Inc. - * - * This product includes software developed by - * Cloud9 IDE, Inc (http://c9.io). - * - * Author: Mike de Boer - **/ - -"use strict"; - -var error = require("./../../error"); -var Util = require("./../../util"); - -var pullRequests = module.exports = { - pullRequests: {} -}; - -(function() { - /** section: github - * pullRequests#getAll(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - state (String): Optional. open, closed, or all Validation rule: ` ^(open|closed|all)$ `. - * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. - * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. - * - sort (String): Optional. Possible values are: `created`, `updated`, `popularity`, `long-running`, Default: `created` Validation rule: ` ^(created|updated|popularity|long-running)$ `. - * - direction (String): Optional. Validation rule: ` ^(asc|desc)$ `. - **/ - this.getAll = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * pullRequests#get(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - number (Number): Required. Validation rule: ` ^[0-9]+$ `. - **/ - this.get = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * pullRequests#create(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - title (String): Required. - * - body (String): Optional. - * - base (String): Required. The branch (or git ref) you want your changes pulled into. This should be an existing branch on the current repository. You cannot submit a pull request to one repo that requests a merge to a base of another repo. - * - head (String): Required. The branch (or git ref) where your changes are implemented. - **/ - this.create = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * pullRequests#createFromIssue(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - issue (Number): Required. Validation rule: ` ^[0-9]+$ `. - * - base (String): Required. The branch (or git ref) you want your changes pulled into. This should be an existing branch on the current repository. You cannot submit a pull request to one repo that requests a merge to a base of another repo. - * - head (String): Required. The branch (or git ref) where your changes are implemented. - **/ - this.createFromIssue = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * pullRequests#update(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - number (Number): Required. Validation rule: ` ^[0-9]+$ `. - * - state (String): Optional. Validation rule: ` ^(open|closed)$ `. - * - title (String): Required. - * - body (String): Optional. - **/ - this.update = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * pullRequests#getCommits(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - number (Number): Required. Validation rule: ` ^[0-9]+$ `. - * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. - * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. - **/ - this.getCommits = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * pullRequests#getFiles(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - number (Number): Required. Validation rule: ` ^[0-9]+$ `. - * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. - * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. - **/ - this.getFiles = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * pullRequests#getMerged(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - number (Number): Required. Validation rule: ` ^[0-9]+$ `. - * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. - * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. - **/ - this.getMerged = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * pullRequests#merge(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - number (Number): Required. Validation rule: ` ^[0-9]+$ `. - * - commit_message (String): Optional. The message that will be used for the merge commit - **/ - this.merge = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * pullRequests#getComments(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - number (Number): Required. Validation rule: ` ^[0-9]+$ `. - * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. - * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. - **/ - this.getComments = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * pullRequests#getComment(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - number (Number): Required. Validation rule: ` ^[0-9]+$ `. - **/ - this.getComment = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * pullRequests#createComment(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - number (Number): Required. Validation rule: ` ^[0-9]+$ `. - * - body (String): Required. - * - commit_id (String): Required. Sha of the commit to comment on. - * - path (String): Required. Relative path of the file to comment on. - * - position (Number): Required. Column index in the diff to comment on. - **/ - this.createComment = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * pullRequests#createCommentReply(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - number (Number): Required. Validation rule: ` ^[0-9]+$ `. - * - body (String): Required. - * - in_reply_to (Number): Required. - **/ - this.createCommentReply = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * pullRequests#updateComment(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - number (Number): Required. Validation rule: ` ^[0-9]+$ `. - * - body (String): Required. - **/ - this.updateComment = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * pullRequests#deleteComment(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - number (Number): Required. Validation rule: ` ^[0-9]+$ `. - **/ - this.deleteComment = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - -}).call(pullRequests.pullRequests); diff --git a/api/v3.0.0/pullRequestsTest.js b/api/v3.0.0/pullRequestsTest.js deleted file mode 100644 index 6948680116..0000000000 --- a/api/v3.0.0/pullRequestsTest.js +++ /dev/null @@ -1,279 +0,0 @@ -/* - * Copyright 2012 Cloud9 IDE, Inc. - * - * This product includes software developed by - * Cloud9 IDE, Inc (http://c9.io). - * - * Author: Mike de Boer - */ - -"use strict"; - -var Assert = require("assert"); -var Client = require("./../../index"); - -describe("[pullRequests]", function() { - var client; - var token = "c286e38330e15246a640c2cf32a45ea45d93b2ba"; - - beforeEach(function() { - client = new Client({ - version: "3.0.0" - }); - client.authenticate({ - type: "oauth", - token: token - }); - }); - - it("should successfully execute GET /repos/:user/:repo/pulls (getAll)", function(next) { - client.pullRequests.getAll( - { - user: "String", - repo: "String", - state: "String", - page: "Number", - per_page: "Number" - }, - function(err, res) { - Assert.equal(err, null); - // other assertions go here - next(); - } - ); - }); - - it("should successfully execute GET /repos/:user/:repo/pulls/:number (get)", function(next) { - client.pullRequests.get( - { - user: "String", - repo: "String", - number: "Number" - }, - function(err, res) { - Assert.equal(err, null); - // other assertions go here - next(); - } - ); - }); - - it("should successfully execute POST /repos/:user/:repo/pulls (create)", function(next) { - client.pullRequests.create( - { - user: "String", - repo: "String", - title: "String", - body: "String", - base: "String", - head: "String" - }, - function(err, res) { - Assert.equal(err, null); - // other assertions go here - next(); - } - ); - }); - - it("should successfully execute POST /repos/:user/:repo/pulls (createFromIssue)", function(next) { - client.pullRequests.createFromIssue( - { - user: "String", - repo: "String", - issue: "Number", - base: "String", - head: "String" - }, - function(err, res) { - Assert.equal(err, null); - // other assertions go here - next(); - } - ); - }); - - it("should successfully execute PATCH /repos/:user/:repo/pulls/:number (update)", function(next) { - client.pullRequests.update( - { - user: "String", - repo: "String", - number: "Number", - state: "String", - title: "String", - body: "String" - }, - function(err, res) { - Assert.equal(err, null); - // other assertions go here - next(); - } - ); - }); - - it("should successfully execute GET /repos/:user/:repo/pulls/:number/commits (getCommits)", function(next) { - client.pullRequests.getCommits( - { - user: "String", - repo: "String", - number: "Number", - page: "Number", - per_page: "Number" - }, - function(err, res) { - Assert.equal(err, null); - // other assertions go here - next(); - } - ); - }); - - it("should successfully execute GET /repos/:user/:repo/pulls/:number/files (getFiles)", function(next) { - client.pullRequests.getFiles( - { - user: "String", - repo: "String", - number: "Number", - page: "Number", - per_page: "Number" - }, - function(err, res) { - Assert.equal(err, null); - // other assertions go here - next(); - } - ); - }); - - it("should successfully execute GET /repos/:user/:repo/pulls/:number/merge (getMerged)", function(next) { - client.pullRequests.getMerged( - { - user: "String", - repo: "String", - number: "Number", - page: "Number", - per_page: "Number" - }, - function(err, res) { - Assert.equal(err, null); - // other assertions go here - next(); - } - ); - }); - - it("should successfully execute PUT /repos/:user/:repo/pulls/:number/merge (merge)", function(next) { - client.pullRequests.merge( - { - user: "String", - repo: "String", - number: "Number", - commit_message: "String" - }, - function(err, res) { - Assert.equal(err, null); - // other assertions go here - next(); - } - ); - }); - - it("should successfully execute GET /repos/:user/:repo/pulls/:number/comments (getComments)", function(next) { - client.pullRequests.getComments( - { - user: "String", - repo: "String", - number: "Number", - page: "Number", - per_page: "Number" - }, - function(err, res) { - Assert.equal(err, null); - // other assertions go here - next(); - } - ); - }); - - it("should successfully execute GET /repos/:user/:repo/pulls/comments/:number (getComment)", function(next) { - client.pullRequests.getComment( - { - user: "String", - repo: "String", - number: "Number" - }, - function(err, res) { - Assert.equal(err, null); - // other assertions go here - next(); - } - ); - }); - - it("should successfully execute POST /repos/:user/:repo/pulls/:number/comments (createComment)", function(next) { - client.pullRequests.createComment( - { - user: "String", - repo: "String", - number: "Number", - body: "String", - commit_id: "String", - path: "String", - position: "Number" - }, - function(err, res) { - Assert.equal(err, null); - // other assertions go here - next(); - } - ); - }); - - it("should successfully execute POST /repos/:user/:repo/pulls/:number/comments (createCommentReply)", function(next) { - client.pullRequests.createCommentReply( - { - user: "String", - repo: "String", - number: "Number", - body: "String", - in_reply_to: "Number" - }, - function(err, res) { - Assert.equal(err, null); - // other assertions go here - next(); - } - ); - }); - - it("should successfully execute PATCH /repos/:user/:repo/pulls/comments/:number (updateComment)", function(next) { - client.pullRequests.updateComment( - { - user: "String", - repo: "String", - number: "Number", - body: "String" - }, - function(err, res) { - Assert.equal(err, null); - // other assertions go here - next(); - } - ); - }); - - it("should successfully execute DELETE /repos/:user/:repo/pulls/comments/:number (deleteComment)", function(next) { - client.pullRequests.deleteComment( - { - user: "String", - repo: "String", - number: "Number" - }, - function(err, res) { - Assert.equal(err, null); - // other assertions go here - next(); - } - ); - }); -}); diff --git a/api/v3.0.0/releases.js b/api/v3.0.0/releases.js deleted file mode 100644 index 424b8c6948..0000000000 --- a/api/v3.0.0/releases.js +++ /dev/null @@ -1,414 +0,0 @@ -/** - * mixin releases - * - * Copyright 2012 Cloud9 IDE, Inc. - * - * This product includes software developed by - * Cloud9 IDE, Inc (http://c9.io). - * - * Author: Mike de Boer - **/ - -"use strict"; - -var error = require("./../../error"); -var Util = require("./../../util"); - -var releases = module.exports = { - releases: {} -}; - -(function() { - /** section: github - * releases#listReleases(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - owner (String): Required. - * - repo (String): Required. - * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. - * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. - **/ - this.listReleases = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * releases#getRelease(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - owner (String): Required. - * - id (Number): Required. - * - repo (String): Required. - **/ - this.getRelease = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * releases#createRelease(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - owner (String): Required. - * - repo (String): Required. - * - tag_name (String): Required. String of the tag - * - target_commitish (String): Optional. Specifies the commitish value that determines where the Git tag is created from. Can be any branch or commit SHA. Unused if the Git tag already exists. Default: the repository's default branch (usually master). - * - name (String): Optional. - * - body (String): Optional. - * - draft (Boolean): Optional. true to create a draft (unpublished) release, false to create a published one. Default: false - * - prerelease (Boolean): Optional. true to identify the release as a prerelease. false to identify the release as a full release. Default: false - **/ - this.createRelease = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * releases#editRelease(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - owner (String): Required. - * - id (Number): Required. - * - repo (String): Required. - * - tag_name (String): Required. String of the tag - * - target_commitish (String): Optional. Specifies the commitish value that determines where the Git tag is created from. Can be any branch or commit SHA. Unused if the Git tag already exists. Default: the repository�s default branch (usually master). - * - name (String): Optional. - * - body (String): Optional. - * - draft (Boolean): Optional. true to create a draft (unpublished) release, false to create a published one. Default: false - * - prerelease (Boolean): Optional. true to identify the release as a prerelease. false to identify the release as a full release. Default: false - **/ - this.editRelease = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * releases#deleteRelease(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - owner (String): Required. - * - id (Number): Required. - * - repo (String): Required. - **/ - this.deleteRelease = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * releases#listAssets(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - owner (String): Required. - * - id (Number): Required. - * - repo (String): Required. - **/ - this.listAssets = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * releases#getAsset(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - owner (String): Required. - * - id (Number): Required. - * - repo (String): Required. - **/ - this.getAsset = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * releases#editAsset(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - owner (String): Required. - * - id (Number): Required. - * - repo (String): Required. - * - name (String): Required. - * - label (String): Optional. An alternate short description of the asset. Used in place of the filename. - **/ - this.editAsset = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * releases#deleteAsset(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - owner (String): Required. - * - id (Number): Required. - * - repo (String): Required. - **/ - this.deleteAsset = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - -}).call(releases.releases); diff --git a/api/v3.0.0/releasesTest.js b/api/v3.0.0/releasesTest.js deleted file mode 100644 index c8175d9b0f..0000000000 --- a/api/v3.0.0/releasesTest.js +++ /dev/null @@ -1,232 +0,0 @@ - /* - * Copyright 2012 Cloud9 IDE, Inc. - * - * This product includes software developed by - * Cloud9 IDE, Inc (http://c9.io). - * - * Author: Mike de Boer - */ - -"use strict"; - -var Assert = require("assert"); -var Client = require("./../../index"); - -describe("[releases]", function() { - var client; - var token = "c286e38330e15246a640c2cf32a45ea45d93b2ba"; - - var owner = "greggman"; - var repo = "test"; - var haveWriteAccess = true; // set to false if the authenticated person below does not have write access to the repo above - var releaseIdWithAsset = 393621; // Some release id from the repo above that has at least 1 asset. - - var releaseId; // release id found when listing releases. Used for get release - var newReleaseId; // release id created when creating release, used for edit and delete release - var assetId; // asset id found when listing assets. Used for get asset - var newAssetId; // asset id used when creating asset. Used for edit and delete asset - - beforeEach(function() { - client = new Client({ - version: "3.0.0" - }); - client.authenticate({ - type: "oauth", - token: token - }); - }); - - it("should successfully execute GET /repos/:owner/:repo/releases (listReleases)", function(next) { - client.releases.listReleases( - { - owner: owner, - repo: repo, - }, - function(err, res) { - Assert.equal(err, null); - Assert.ok(res instanceof Array); - if (res instanceof Array && res.length > 0) { - releaseId = res[0].id; - } - next(); - } - ); - }); - - it("should successfully execute GET /repos/:owner/:repo/releases/:id (getRelease)", function(next) { - if (!releaseId) { - next(); - return; - } - client.releases.getRelease( - { - owner: owner, - id: releaseId, - repo: repo - }, - function(err, res) { - Assert.equal(err, null); - Assert.equal(res.id, releaseId); - next(); - } - ); - }); - - it("should successfully execute POST /repos/:owner/:repo/releases (createRelease)", function(next) { - if (!haveWriteAccess) { - next(); - return; - } - client.releases.createRelease( - { - owner: owner, - repo: repo, - tag_name: "node-github-tag", - target_commitish: "master", - name: "node-github-name", - body: "node-github-body", - draft: false, - prerelease: true, - }, - function(err, res) { - Assert.equal(err, null); - Assert.equal(res.tag_name, "node-github-tag"); - Assert.equal(res.target_commitish, "master"); - Assert.equal(res.name, "node-github-name"); - Assert.equal(res.body, "node-github-body"); - Assert.equal(res.assets.length, 0); - Assert.ok(res.prerelease); - Assert.ok(!res.draft); - newReleaseId = res.id; - next(); - } - ); - }); - - it("should successfully execute PATCH /repos/:owner/:repo/releases/:id (editRelease)", function(next) { - if (!haveWriteAccess) { - next(); - return; - } - client.releases.editRelease( - { - owner: owner, - id: newReleaseId, - repo: repo, - tag_name: "node-github-new-tag", - target_commitish: "master", - name: "node-github-new-name", - body: "node-github-new-body", - draft: true, - prerelease: true, - }, - function(err, res) { - Assert.equal(err, null); - Assert.equal(res.id, newReleaseId); - Assert.equal(res.tag_name, "node-github-new-tag"); - Assert.equal(res.target_commitish, "master"); - Assert.equal(res.name, "node-github-new-name"); - Assert.equal(res.body, "node-github-new-body"); - Assert.equal(res.assets.length, 0); - Assert.ok(res.prerelease); - Assert.ok(res.draft); - next(); - } - ); - }); - - it("should successfully execute DELETE /repos/:owner/:repo/releases/:id (deleteRelease)", function(next) { - if (!haveWriteAccess) { - next(); - return; - } - client.releases.deleteRelease( - { - owner: owner, - repo: repo, - id: newReleaseId, - }, - function(err, res) { - Assert.equal(err, null); - next(); - } - ); - }); - - it("should successfully execute GET /repos/:owner/:repo/releases/:id/assets (listAssets)", function(next) { - client.releases.listAssets( - { - owner: owner, - id: releaseIdWithAsset, - repo: repo - }, - function(err, res) { - Assert.equal(err, null); - Assert.ok(res instanceof Array); - if (res instanceof Array && res.length > 0) { - assetId = res[0].id; - } - next(); - } - ); - }); - - it("should successfully execute GET /repos/:owner/:repo/releases/assets/:id (getAsset)", function(next) { - if (!assetId) { - next(); - return; - } - client.releases.getAsset( - { - owner: owner, - id: assetId, - repo: repo - }, - function(err, res) { - Assert.equal(err, null); - Assert.equal(res.id, assetId); - next(); - } - ); - }); - - it("should successfully execute PATCH /repos/:owner/:repo/releases/assets/:id (editAsset)", function(next) { - if (!newAssetId) { - next(); - return; - } - client.releases.editAsset( - { - owner: owner, - id: "Number", - repo: repo, - name: "String", - label: "String" - }, - function(err, res) { - Assert.equal(err, null); - // other assertions go here - next(); - } - ); - }); - - it("should successfully execute DELETE /repos/:owner/:repo/releases/assets/:id (deleteAsset)", function(next) { - if (!newAssetId) { - next(); - return; - } - client.releases.deleteAsset( - { - owner: owner, - id: "Number", - repo: repo - }, - function(err, res) { - Assert.equal(err, null); - // other assertions go here - next(); - } - ); - }); -}); diff --git a/api/v3.0.0/repos.js b/api/v3.0.0/repos.js deleted file mode 100644 index 21f97c6ad9..0000000000 --- a/api/v3.0.0/repos.js +++ /dev/null @@ -1,2756 +0,0 @@ -/** - * mixin repos - * - * Copyright 2012 Cloud9 IDE, Inc. - * - * This product includes software developed by - * Cloud9 IDE, Inc (http://c9.io). - * - * Author: Mike de Boer - **/ - -"use strict"; - -var error = require("./../../error"); -var Util = require("./../../util"); - -var repos = module.exports = { - repos: {} -}; - -(function() { - /** section: github - * repos#getAll(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - type (String): Optional. Possible values: `all`, `owner`, `public`, `private`, `member`. Default: `all`. Validation rule: ` ^(all|owner|public|private|member)$ `. - * - sort (String): Optional. Possible values: `created`, `updated`, `pushed`, `full_name`. Default: `full_name`. Validation rule: ` ^(created|updated|pushed|full_name)$ `. - * - direction (String): Optional. Validation rule: ` ^(asc|desc)$ `. - * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. - * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. - **/ - this.getAll = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * repos#getFromUser(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - type (String): Optional. Possible values: `all`, `owner`, `member`. Default: `public`. Validation rule: ` ^(all|owner|member)$ `. - * - sort (String): Optional. Possible values: `created`, `updated`, `pushed`, `full_name`. Default: `full_name`. Validation rule: ` ^(created|updated|pushed|full_name)$ `. - * - direction (String): Optional. Validation rule: ` ^(asc|desc)$ `. - * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. - * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. - **/ - this.getFromUser = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * repos#getFromOrg(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - org (String): Required. - * - type (String): Optional. Possible values: `all`, `public`, `member`. Default: `all`. Validation rule: ` ^(all|public|member)$ `. - * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. - * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. - **/ - this.getFromOrg = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * repos#create(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - name (String): Required. - * - description (String): Optional. - * - homepage (String): Optional. - * - private (Boolean): Optional. True to create a private repository, false to create a public one. Creating private repositories requires a paid GitHub account. Default is false. - * - has_issues (Boolean): Optional. True to enable issues for this repository, false to disable them. Default is true. - * - has_wiki (Boolean): Optional. True to enable the wiki for this repository, false to disable it. Default is true. - * - has_downloads (Boolean): Optional. True to enable downloads for this repository, false to disable them. Default is true. - * - auto_init (Boolean): Optional. True to create an initial commit with empty README. Default is false - * - gitignore_template (String): Optional. Desired language or platform .gitignore template to apply. Ignored if auto_init parameter is not provided. - **/ - this.create = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * repos#createFromOrg(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - org (String): Required. - * - name (String): Required. - * - description (String): Optional. - * - homepage (String): Optional. - * - private (Boolean): Optional. True to create a private repository, false to create a public one. Creating private repositories requires a paid GitHub account. Default is false. - * - has_issues (Boolean): Optional. True to enable issues for this repository, false to disable them. Default is true. - * - has_wiki (Boolean): Optional. True to enable the wiki for this repository, false to disable it. Default is true. - * - has_downloads (Boolean): Optional. True to enable downloads for this repository, false to disable them. Default is true. - * - auto_init (Boolean): Optional. True to create an initial commit with empty README. Default is false - * - gitignore_template (String): Optional. Desired language or platform .gitignore template to apply. Ignored if auto_init parameter is not provided. - * - team_id (Number): Optional. The id of the team that will be granted access to this repository. This is only valid when creating a repo in an organization. Validation rule: ` ^[0-9]+$ `. - **/ - this.createFromOrg = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * repos#get(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - **/ - this.get = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * repos#update(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - name (String): Required. - * - description (String): Optional. - * - homepage (String): Optional. - * - private (Boolean): Optional. True to create a private repository, false to create a public one. Creating private repositories requires a paid GitHub account. Default is false. - * - has_issues (Boolean): Optional. True to enable issues for this repository, false to disable them. Default is true. - * - has_wiki (Boolean): Optional. True to enable the wiki for this repository, false to disable it. Default is true. - * - has_downloads (Boolean): Optional. True to enable downloads for this repository, false to disable them. Default is true. - * - default_branch (String): Optional. Updates the default branch for this repository. - **/ - this.update = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * repos#delete(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - **/ - this.delete = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * repos#merge(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - base (String): Required. The branch (or git ref) you want your changes pulled into. This should be an existing branch on the current repository. You cannot submit a pull request to one repo that requests a merge to a base of another repo. - * - head (String): Required. The branch (or git ref) where your changes are implemented. - * - commit_message (String): Optional. Commit message to use for the merge commit. If omitted, a default message will be used. - **/ - this.merge = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * repos#getContributors(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - anon (Boolean): Optional. Set to 1 or true to include anonymous contributors in results. - * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. - * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. - **/ - this.getContributors = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * repos#getLanguages(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. - * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. - **/ - this.getLanguages = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * repos#getTeams(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. - * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. - **/ - this.getTeams = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * repos#getTags(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. - * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. - **/ - this.getTags = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * repos#getBranches(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. - * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. - **/ - this.getBranches = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * repos#getBranch(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - branch (String): Required. - * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. - * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. - **/ - this.getBranch = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * repos#getCollaborators(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. - * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. - **/ - this.getCollaborators = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * repos#getCollaborator(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - collabuser (String): Required. - **/ - this.getCollaborator = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * repos#addCollaborator(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - collabuser (String): Required. - **/ - this.addCollaborator = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * repos#removeCollaborator(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - collabuser (String): Required. - **/ - this.removeCollaborator = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * repos#getCommits(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - sha (String): Optional. Sha or branch to start listing commits from. - * - path (String): Optional. Only commits containing this file path will be returned. - * - author (String): Optional. GitHub login or email address by which to filter by commit author. - * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. - * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. - * - since (Date): Optional. Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ - * - until (Date): Optional. Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ - **/ - this.getCommits = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * repos#getCommit(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - sha (String): Required. - **/ - this.getCommit = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * repos#getAllCommitComments(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. - * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. - **/ - this.getAllCommitComments = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * repos#getCommitComments(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - sha (String): Required. - * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. - * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. - **/ - this.getCommitComments = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * repos#createCommitComment(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - sha (String): Required. - * - body (String): Required. - * - commit_id (String): Required. Sha of the commit to comment on. - * - path (String): Optional. Relative path of the file to comment on. - * - position (Number): Optional. Line index in the diff to comment on. - * - line (Number): Optional. Line number in the file to comment on. Defaults to 1. - **/ - this.createCommitComment = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * repos#getCommitComment(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - id (String): Required. - **/ - this.getCommitComment = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * repos#updateCommitComment(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - id (String): Required. - * - body (String): Required. - **/ - this.updateCommitComment = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * repos#compareCommits(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - base (String): Required. The branch (or git ref) you want your changes pulled into. This should be an existing branch on the current repository. You cannot submit a pull request to one repo that requests a merge to a base of another repo. - * - head (String): Required. The branch (or git ref) where your changes are implemented. - **/ - this.compareCommits = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * repos#deleteCommitComment(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - id (String): Required. - **/ - this.deleteCommitComment = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * repos#getReadme(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - ref (String): Optional. The String name of the Commit/Branch/Tag. Defaults to master. - **/ - this.getReadme = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * repos#getContent(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - path (String): Optional. The content path. - * - ref (String): Optional. The String name of the Commit/Branch/Tag. Defaults to master. - **/ - this.getContent = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * repos#createContent(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - content (String): Optional. - * - message (String): Optional. - * - path (String): Optional. The content path. - * - ref (String): Optional. The String name of the Commit/Branch/Tag. Defaults to master. - **/ - this.createContent = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * repos#createFile(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - path (String): Required. The content path. - * - message (String): Required. The commit message. - * - content (String): Required. The new file content, Base64 encoded. - * - branch (String): Optional. The branch name. If not provided, uses the repository’s default branch (usually master). - * - author (Json): Optional. - * - committer (Json): Optional. - **/ - this.createFile = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * repos#updateFile(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - path (String): Required. The content path. - * - message (String): Required. The commit message. - * - content (String): Required. The updated file content, Base64 encoded. - * - sha (String): Required. The blob SHA of the file being replaced. - * - branch (String): Optional. The branch name. If not provided, uses the repository’s default branch (usually master). - * - author (Json): Optional. - * - committer (Json): Optional. - **/ - this.updateFile = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * repos#deleteFile(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - path (String): Required. The content path. - * - message (String): Required. The commit message. - * - sha (String): Required. The blob SHA of the file being removed. - * - branch (String): Optional. The branch name. If not provided, uses the repository’s default branch (usually master). - * - author (Json): Optional. - * - committer (Json): Optional. - **/ - this.deleteFile = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * repos#getArchiveLink(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - ref (String): Optional. String of the name of the fully qualified reference (ie: heads/master). If it doesn’t have at least one slash, it will be rejected. - * - archive_format (String): Required. Either tarball or zipball Validation rule: ` ^(tarball|zipball)$ `. - **/ - this.getArchiveLink = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * repos#getDownloads(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. - * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. - **/ - this.getDownloads = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * repos#getDownload(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - id (String): Required. - **/ - this.getDownload = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * repos#deleteDownload(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - id (String): Required. - **/ - this.deleteDownload = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * repos#getForks(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - sort (String): Optional. Possible values: `newest`, `oldest`, `watchers`, default: `newest`. Validation rule: ` ^(newest|oldest|watchers)$ `. - * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. - * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. - **/ - this.getForks = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * repos#fork(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - organization (String): Optional. Organization login. The repository will be forked into this organization. - **/ - this.fork = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * repos#getKeys(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. - * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. - **/ - this.getKeys = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * repos#getKey(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - id (String): Required. - **/ - this.getKey = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * repos#createKey(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - title (String): Required. - * - key (String): Required. - **/ - this.createKey = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * repos#updateKey(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - id (String): Required. - * - title (String): Required. - * - key (String): Required. - **/ - this.updateKey = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * repos#deleteKey(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - id (String): Required. - **/ - this.deleteKey = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * repos#getStargazers(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. - * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. - **/ - this.getStargazers = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * repos#getStarred(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. - * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. - **/ - this.getStarred = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * repos#getStarredFromUser(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. - * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. - **/ - this.getStarredFromUser = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * repos#getStarring(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. - * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. - **/ - this.getStarring = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * repos#star(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - **/ - this.star = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * repos#unStar(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - **/ - this.unStar = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * repos#getWatchers(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. - * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. - **/ - this.getWatchers = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * repos#getWatched(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. - * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. - **/ - this.getWatched = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * repos#getWatchedFromUser(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. - * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. - **/ - this.getWatchedFromUser = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * repos#getWatching(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. - * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. - **/ - this.getWatching = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * repos#watch(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - **/ - this.watch = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * repos#unWatch(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - **/ - this.unWatch = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * repos#getHooks(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. - * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. - **/ - this.getHooks = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * repos#getHook(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - id (String): Required. - **/ - this.getHook = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * repos#createHook(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - name (String): Required. - * - config (Json): Required. A Hash containing key/value pairs to provide settings for this hook. These settings vary between the services and are defined in the github-services repo. Booleans are stored internally as `1` for true, and `0` for false. Any JSON true/false values will be converted automatically. - * - events (Array): Optional. Determines what events the hook is triggered for. Default: `['push']`. - * - active (Boolean): Optional. Determines whether the hook is actually triggered on pushes. - **/ - this.createHook = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * repos#updateHook(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - id (String): Required. - * - name (String): Required. - * - config (Json): Required. A Hash containing key/value pairs to provide settings for this hook. Modifying this will replace the entire config object. These settings vary between the services and are defined in the github-services repo. Booleans are stored internally as `1` for true, and `0` for false. Any JSON true/false values will be converted automatically. - * - events (Array): Optional. Determines what events the hook is triggered for. This replaces the entire array of events. Default: `['push']`. - * - add_events (Array): Optional. Determines a list of events to be added to the list of events that the Hook triggers for. - * - remove_events (Array): Optional. Determines a list of events to be removed from the list of events that the Hook triggers for. - * - active (Boolean): Optional. Determines whether the hook is actually triggered on pushes. - **/ - this.updateHook = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * repos#testHook(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - id (String): Required. - **/ - this.testHook = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * repos#deleteHook(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - id (String): Required. - **/ - this.deleteHook = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - -}).call(repos.repos); diff --git a/api/v3.0.0/reposTest.js b/api/v3.0.0/reposTest.js deleted file mode 100644 index 1b5c5b2f98..0000000000 --- a/api/v3.0.0/reposTest.js +++ /dev/null @@ -1,1056 +0,0 @@ -/* - * Copyright 2012 Cloud9 IDE, Inc. - * - * This product includes software developed by - * Cloud9 IDE, Inc (http://c9.io). - * - * Author: Mike de Boer - */ - -"use strict"; - -var Assert = require("assert"); -var Client = require("./../../index"); - -describe("[repos]", function() { - var client; - var token = "c286e38330e15246a640c2cf32a45ea45d93b2ba"; - - beforeEach(function() { - client = new Client({ - version: "3.0.0" - }); - client.authenticate({ - type: "oauth", - token: token - }); - }); - - it("should successfully execute GET /user/repos (getAll)", function(next) { - client.repos.getAll( - { - type: "String", - sort: "String", - direction: "String", - page: "Number", - per_page: "Number" - }, - function(err, res) { - Assert.equal(err, null); - // other assertions go here - next(); - } - ); - }); - - it("should successfully execute GET /users/:user/repos (getFromUser)", function(next) { - client.repos.getFromUser( - { - user: "String", - type: "String", - sort: "String", - direction: "String", - page: "Number", - per_page: "Number" - }, - function(err, res) { - Assert.equal(err, null); - // other assertions go here - next(); - } - ); - }); - - it("should successfully execute GET /orgs/:org/repos (getFromOrg)", function(next) { - client.repos.getFromOrg( - { - org: "String", - type: "String", - page: "Number", - per_page: "Number" - }, - function(err, res) { - Assert.equal(err, null); - // other assertions go here - next(); - } - ); - }); - - it("should successfully execute POST /user/repos (create)", function(next) { - client.repos.create( - { - name: "String", - description: "String", - homepage: "String", - private: "Boolean", - has_issues: "Boolean", - has_wiki: "Boolean", - has_downloads: "Boolean", - auto_init: "Boolean", - gitignore_template: "String" - }, - function(err, res) { - Assert.equal(err, null); - // other assertions go here - next(); - } - ); - }); - - it("should successfully execute POST /orgs/:org/repos (createFromOrg)", function(next) { - client.repos.createFromOrg( - { - org: "String", - name: "String", - description: "String", - homepage: "String", - private: "Boolean", - has_issues: "Boolean", - has_wiki: "Boolean", - has_downloads: "Boolean", - auto_init: "Boolean", - gitignore_template: "String", - team_id: "Number" - }, - function(err, res) { - Assert.equal(err, null); - // other assertions go here - next(); - } - ); - }); - - it("should successfully execute GET /repos/:user/:repo (get)", function(next) { - client.repos.get( - { - user: "String", - repo: "String" - }, - function(err, res) { - Assert.equal(err, null); - // other assertions go here - next(); - } - ); - }); - - it("should successfully execute PATCH /repos/:user/:repo (update)", function(next) { - client.repos.update( - { - user: "String", - repo: "String", - name: "String", - description: "String", - homepage: "String", - private: "Boolean", - has_issues: "Boolean", - has_wiki: "Boolean", - has_downloads: "Boolean" - }, - function(err, res) { - Assert.equal(err, null); - // other assertions go here - next(); - } - ); - }); - - it("should successfully execute DELETE /repos/:user/:repo (delete)", function(next) { - client.repos.delete( - { - user: "String", - repo: "String" - }, - function(err, res) { - Assert.equal(err, null); - // other assertions go here - next(); - } - ); - }); - - it("should successfully execute POST /repos/:user/:repo/merges (merge)", function(next) { - client.repos.merge( - { - user: "String", - repo: "String", - base: "String", - head: "String", - commit_message: "String" - }, - function(err, res) { - Assert.equal(err, null); - // other assertions go here - next(); - } - ); - }); - - it("should successfully execute GET /repos/:user/:repo/contributors (getContributors)", function(next) { - client.repos.getContributors( - { - user: "String", - repo: "String", - anon: "Boolean", - page: "Number", - per_page: "Number" - }, - function(err, res) { - Assert.equal(err, null); - // other assertions go here - next(); - } - ); - }); - - it("should successfully execute GET /repos/:user/:repo/languages (getLanguages)", function(next) { - client.repos.getLanguages( - { - user: "String", - repo: "String", - page: "Number", - per_page: "Number" - }, - function(err, res) { - Assert.equal(err, null); - // other assertions go here - next(); - } - ); - }); - - it("should successfully execute GET /repos/:user/:repo/teams (getTeams)", function(next) { - client.repos.getTeams( - { - user: "String", - repo: "String", - page: "Number", - per_page: "Number" - }, - function(err, res) { - Assert.equal(err, null); - // other assertions go here - next(); - } - ); - }); - - it("should successfully execute GET /repos/:user/:repo/tags (getTags)", function(next) { - client.repos.getTags( - { - user: "String", - repo: "String", - page: "Number", - per_page: "Number" - }, - function(err, res) { - Assert.equal(err, null); - // other assertions go here - next(); - } - ); - }); - - it("should successfully execute GET /repos/:user/:repo/branches (getBranches)", function(next) { - client.repos.getBranches( - { - user: "String", - repo: "String", - page: "Number", - per_page: "Number" - }, - function(err, res) { - Assert.equal(err, null); - // other assertions go here - next(); - } - ); - }); - - it("should successfully execute GET /repos/:user/:repo/branches/:branch (getBranch)", function(next) { - client.repos.getBranches( - { - user: "String", - repo: "String", - branch: "String", - page: "Number", - per_page: "Number" - }, - function(err, res) { - Assert.equal(err, null); - // other assertions go here - next(); - } - ); - }); - - it("should successfully execute GET /repos/:user/:repo/collaborators (getCollaborators)", function(next) { - client.repos.getCollaborators( - { - user: "String", - repo: "String", - page: "Number", - per_page: "Number" - }, - function(err, res) { - Assert.equal(err, null); - // other assertions go here - next(); - } - ); - }); - - it("should successfully execute GET /repos/:user/:repo/collaborators/:collabuser (getCollaborator)", function(next) { - client.repos.getCollaborator( - { - user: "String", - repo: "String", - collabuser: "String" - }, - function(err, res) { - Assert.equal(err, null); - // other assertions go here - next(); - } - ); - }); - - it("should successfully execute PUT /repos/:user/:repo/collaborators/:collabuser (addCollaborator)", function(next) { - client.repos.addCollaborator( - { - user: "String", - repo: "String", - collabuser: "String" - }, - function(err, res) { - Assert.equal(err, null); - // other assertions go here - next(); - } - ); - }); - - it("should successfully execute DELETE /repos/:user/:repo/collaborators/:collabuser (removeCollaborator)", function(next) { - client.repos.removeCollaborator( - { - user: "String", - repo: "String", - collabuser: "String" - }, - function(err, res) { - Assert.equal(err, null); - // other assertions go here - next(); - } - ); - }); - - it("should successfully execute GET /repos/:user/:repo/commits (getCommits)", function(next) { - client.repos.getCommits( - { - user: "String", - repo: "String", - sha: "String", - path: "String", - page: "Number", - per_page: "Number", - author: "String" - }, - function(err, res) { - Assert.equal(err, null); - // other assertions go here - next(); - } - ); - }); - - it("should successfully execute GET /repos/:user/:repo/commits/:sha (getCommit)", function(next) { - client.repos.getCommit( - { - user: "String", - repo: "String", - sha: "String" - }, - function(err, res) { - Assert.equal(err, null); - // other assertions go here - next(); - } - ); - }); - - it("should successfully execute GET /repos/:user/:repo/comments (getAllCommitComments)", function(next) { - client.repos.getAllCommitComments( - { - user: "String", - repo: "String", - page: "Number", - per_page: "Number" - }, - function(err, res) { - Assert.equal(err, null); - // other assertions go here - next(); - } - ); - }); - - it("should successfully execute GET /repos/:user/:repo/commits/:sha/comments (getCommitComments)", function(next) { - client.repos.getCommitComments( - { - user: "String", - repo: "String", - sha: "String", - page: "Number", - per_page: "Number" - }, - function(err, res) { - Assert.equal(err, null); - // other assertions go here - next(); - } - ); - }); - - it("should successfully execute POST /repos/:user/:repo/commits/:sha/comments (createCommitComment)", function(next) { - client.repos.createCommitComment( - { - user: "String", - repo: "String", - sha: "String", - body: "String", - commit_id: "String", - path: "String", - position: "Number", - line: "Number" - }, - function(err, res) { - Assert.equal(err, null); - // other assertions go here - next(); - } - ); - }); - - it("should successfully execute GET /repos/:user/:repo/comments/:id (getCommitComment)", function(next) { - client.repos.getCommitComment( - { - user: "String", - repo: "String", - id: "String" - }, - function(err, res) { - Assert.equal(err, null); - // other assertions go here - next(); - } - ); - }); - - it("should successfully execute PATCH /repos/:user/:repo/comments/:id (updateCommitComment)", function(next) { - client.repos.updateCommitComment( - { - user: "String", - repo: "String", - id: "String", - body: "String" - }, - function(err, res) { - Assert.equal(err, null); - // other assertions go here - next(); - } - ); - }); - - it("should successfully execute GET /repos/:user/:repo/compare/:base...:head (compareCommits)", function(next) { - client.repos.compareCommits( - { - user: "String", - repo: "String", - base: "String", - head: "String" - }, - function(err, res) { - Assert.equal(err, null); - // other assertions go here - next(); - } - ); - }); - - it("should successfully execute DELETE /repos/:user/:repo/comments/:id (deleteCommitComment)", function(next) { - client.repos.deleteCommitComment( - { - user: "String", - repo: "String", - id: "String" - }, - function(err, res) { - Assert.equal(err, null); - // other assertions go here - next(); - } - ); - }); - - it("should successfully execute GET /repos/:user/:repo/readme (getReadme)", function(next) { - client.repos.getReadme( - { - user: "String", - repo: "String", - ref: "String" - }, - function(err, res) { - Assert.equal(err, null); - // other assertions go here - next(); - } - ); - }); - - it("should successfully execute GET /repos/:user/:repo/contents/:path (getContent)", function(next) { - client.repos.getContent( - { - user: "String", - repo: "String", - path: "String", - ref: "String" - }, - function(err, res) { - Assert.equal(err, null); - // other assertions go here - next(); - } - ); - }); - it("should successfully execute GET /repos/:user/:repo/contents/:path (createContent)", function(next) { - client.repos.getContent( - { - user: "String", - repo: "String", - path: "String", - ref: "String", - content:"String", - message:"String" - }, - function(err, res) { - Assert.equal(err, null); - // other assertions go here - next(); - } - ); - }); - - it("should successfully execute PUT /repos/:user/:repo/contents/:path (createFile)", function(next) { - client.repos.createFile( - { - user: "String", - repo: "String", - path: "String", - message: "String", - content: "String", - branch: "String", - author: "Json", - committer: "Json" - }, - function(err, res) { - Assert.equal(err, null); - // other assertions go here - next(); - } - ); - }); - - it("should successfully execute PUT /repos/:user/:repo/contents/:path (updateFile)", function(next) { - client.repos.updateFile( - { - user: "String", - repo: "String", - path: "String", - message: "String", - content: "String", - sha: "String", - branch: "String", - author: "Json", - committer: "Json" - }, - function(err, res) { - Assert.equal(err, null); - // other assertions go here - next(); - } - ); - }); - - it("should successfully execute DELETE /repos/:user/:repo/contents/:path (deleteFile)", function(next) { - client.repos.deleteFile( - { - user: "String", - repo: "String", - path: "String", - message: "String", - sha: "String", - branch: "String", - author: "Json", - committer: "Json" - }, - function(err, res) { - Assert.equal(err, null); - // other assertions go here - next(); - } - ); - }); - - it("should successfully execute GET /repos/:user/:repo/:archive_format/:ref (getArchiveLink)", function(next) { - client.repos.getArchiveLink( - { - user: "String", - repo: "String", - archive_format: "String" - }, - function(err, res) { - Assert.equal(err, null); - // other assertions go here - next(); - } - ); - }); - - it("should successfully execute GET /repos/:user/:repo/downloads (getDownloads)", function(next) { - client.repos.getDownloads( - { - user: "String", - repo: "String", - page: "Number", - per_page: "Number" - }, - function(err, res) { - Assert.equal(err, null); - // other assertions go here - next(); - } - ); - }); - - it("should successfully execute GET /repos/:user/:repo/downloads/:id (getDownload)", function(next) { - client.repos.getDownload( - { - user: "String", - repo: "String", - id: "String" - }, - function(err, res) { - Assert.equal(err, null); - // other assertions go here - next(); - } - ); - }); - - it("should successfully execute DELETE /repos/:user/:repo/downloads/:id (deleteDownload)", function(next) { - client.repos.deleteDownload( - { - user: "String", - repo: "String", - id: "String" - }, - function(err, res) { - Assert.equal(err, null); - // other assertions go here - next(); - } - ); - }); - - it("should successfully execute GET /repos/:user/:repo/forks (getForks)", function(next) { - client.repos.getForks( - { - user: "String", - repo: "String", - sort: "String", - page: "Number", - per_page: "Number" - }, - function(err, res) { - Assert.equal(err, null); - // other assertions go here - next(); - } - ); - }); - - it("should successfully execute POST /repos/:user/:repo/forks (fork)", function(next) { - client.repos.fork( - { - user: "String", - repo: "String", - organization: "String" - }, - function(err, res) { - Assert.equal(err, null); - // other assertions go here - next(); - } - ); - }); - - it("should successfully execute GET /repos/:user/:repo/keys (getKeys)", function(next) { - client.repos.getKeys( - { - user: "String", - repo: "String", - page: "Number", - per_page: "Number" - }, - function(err, res) { - Assert.equal(err, null); - // other assertions go here - next(); - } - ); - }); - - it("should successfully execute GET /repos/:user/:repo/keys/:id (getKey)", function(next) { - client.repos.getKey( - { - user: "String", - repo: "String", - id: "String" - }, - function(err, res) { - Assert.equal(err, null); - // other assertions go here - next(); - } - ); - }); - - it("should successfully execute POST /repos/:user/:repo/keys (createKey)", function(next) { - client.repos.createKey( - { - user: "String", - repo: "String", - title: "String", - key: "String" - }, - function(err, res) { - Assert.equal(err, null); - // other assertions go here - next(); - } - ); - }); - - it("should successfully execute PUT /repos/:user/:repo/keys/:id (updateKey)", function(next) { - client.repos.updateKey( - { - user: "String", - repo: "String", - id: "String", - title: "String", - key: "String" - }, - function(err, res) { - Assert.equal(err, null); - // other assertions go here - next(); - } - ); - }); - - it("should successfully execute DELETE /repos/:user/:repo/keys/:id (deleteKey)", function(next) { - client.repos.deleteKey( - { - user: "String", - repo: "String", - id: "String" - }, - function(err, res) { - Assert.equal(err, null); - // other assertions go here - next(); - } - ); - }); - - it("should successfully execute GET /repos/:user/:repo/stargazers (getStargazers)", function(next) { - client.repos.getStargazers( - { - user: "String", - repo: "String", - page: "Number", - per_page: "Number" - }, - function(err, res) { - Assert.equal(err, null); - // other assertions go here - next(); - } - ); - }); - - it("should successfully execute GET /user/starred (getStarred)", function(next) { - client.repos.getStarred( - { - page: "Number", - per_page: "Number" - }, - function(err, res) { - Assert.equal(err, null); - // other assertions go here - next(); - } - ); - }); - - it("should successfully execute GET /users/:user/starred (getStarredFromUser)", function(next) { - client.repos.getStarredFromUser( - { - user: "String", - page: "Number", - per_page: "Number" - }, - function(err, res) { - Assert.equal(err, null); - // other assertions go here - next(); - } - ); - }); - - it("should successfully execute GET /user/starred/:user/:repo (getStarring)", function(next) { - client.repos.getStarring( - { - user: "String", - repo: "String", - page: "Number", - per_page: "Number" - }, - function(err, res) { - Assert.equal(err, null); - // other assertions go here - next(); - } - ); - }); - - it("should successfully execute PUT /user/starred/:user/:repo (watch)", function(next) { - client.repos.watch( - { - user: "String", - repo: "String" - }, - function(err, res) { - Assert.equal(err, null); - // other assertions go here - next(); - } - ); - }); - - it("should successfully execute DELETE /user/starred/:user/:repo (unWatch)", function(next) { - client.repos.unWatch( - { - user: "String", - repo: "String" - }, - function(err, res) { - Assert.equal(err, null); - // other assertions go here - next(); - } - ); - }); - - it("should successfully execute GET /repos/:user/:repo/watchers (getWatchers)", function(next) { - client.repos.getWatchers( - { - user: "String", - repo: "String", - page: "Number", - per_page: "Number" - }, - function(err, res) { - Assert.equal(err, null); - // other assertions go here - next(); - } - ); - }); - - it("should successfully execute GET /user/watched (getWatched)", function(next) { - client.repos.getWatched( - { - page: "Number", - per_page: "Number" - }, - function(err, res) { - Assert.equal(err, null); - // other assertions go here - next(); - } - ); - }); - - it("should successfully execute GET /users/:user/watched (getWatchedFromUser)", function(next) { - client.repos.getWatchedFromUser( - { - user: "String", - page: "Number", - per_page: "Number" - }, - function(err, res) { - Assert.equal(err, null); - // other assertions go here - next(); - } - ); - }); - - it("should successfully execute GET /user/watched/:user/:repo (getWatching)", function(next) { - client.repos.getWatching( - { - user: "String", - repo: "String", - page: "Number", - per_page: "Number" - }, - function(err, res) { - Assert.equal(err, null); - // other assertions go here - next(); - } - ); - }); - - it("should successfully execute PUT /user/watched/:user/:repo (watch)", function(next) { - client.repos.watch( - { - user: "String", - repo: "String" - }, - function(err, res) { - Assert.equal(err, null); - // other assertions go here - next(); - } - ); - }); - - it("should successfully execute DELETE /user/watched/:user/:repo (unWatch)", function(next) { - client.repos.unWatch( - { - user: "String", - repo: "String" - }, - function(err, res) { - Assert.equal(err, null); - // other assertions go here - next(); - } - ); - }); - - it("should successfully execute GET /repos/:user/:repo/hooks (getHooks)", function(next) { - client.repos.getHooks( - { - user: "String", - repo: "String", - page: "Number", - per_page: "Number" - }, - function(err, res) { - Assert.equal(err, null); - // other assertions go here - next(); - } - ); - }); - - it("should successfully execute GET /repos/:user/:repo/hooks/:id (getHook)", function(next) { - client.repos.getHook( - { - user: "String", - repo: "String", - id: "String" - }, - function(err, res) { - Assert.equal(err, null); - // other assertions go here - next(); - } - ); - }); - - it("should successfully execute POST /repos/:user/:repo/hooks (createHook)", function(next) { - client.repos.createHook( - { - user: "String", - repo: "String", - name: "String", - config: "Json", - events: "Array", - active: "Boolean" - }, - function(err, res) { - Assert.equal(err, null); - // other assertions go here - next(); - } - ); - }); - - it("should successfully execute PATCH /repos/:user/:repo/hooks/:id (updateHook)", function(next) { - client.repos.updateHook( - { - user: "String", - repo: "String", - id: "String", - name: "String", - config: "Json", - events: "Array", - add_events: "Array", - remove_events: "Array", - active: "Boolean" - }, - function(err, res) { - Assert.equal(err, null); - // other assertions go here - next(); - } - ); - }); - - it("should successfully execute POST /repos/:user/:repo/hooks/:id/test (testHook)", function(next) { - client.repos.testHook( - { - user: "String", - repo: "String", - id: "String" - }, - function(err, res) { - Assert.equal(err, null); - // other assertions go here - next(); - } - ); - }); - - it("should successfully execute DELETE /repos/:user/:repo/hooks/:id (deleteHook)", function(next) { - client.repos.deleteHook( - { - user: "String", - repo: "String", - id: "String" - }, - function(err, res) { - Assert.equal(err, null); - // other assertions go here - next(); - } - ); - }); -}); diff --git a/api/v3.0.0/routes.json b/api/v3.0.0/routes.json deleted file mode 100644 index 1440a08186..0000000000 --- a/api/v3.0.0/routes.json +++ /dev/null @@ -1,3568 +0,0 @@ -{ - "defines": { - "constants": { - "name": "Github", - "description": "A Node.JS module, which provides an object oriented wrapper for the GitHub v3 API.", - "protocol": "https", - "host": "api.github.com", - "port": 443, - "dateFormat": "YYYY-MM-DDTHH:MM:SSZ", - "requestFormat": "json", - "requestMedia": "application/vnd.github.beta+json" - }, - "response-headers": [ - "X-RateLimit-Limit", - "X-RateLimit-Remaining", - "X-RateLimit-Reset", - "X-Oauth-Scopes", - "Link", - "Location", - "Last-Modified", - "Etag", - "Status" - ], - "request-headers": [ - "If-Modified-Since", - "If-None-Match", - "Cookie", - "User-Agent", - "Accept", - "X-GitHub-OTP" - ], - "params": { - "files": { - "type": "Json", - "required": true, - "validation": "", - "invalidmsg": "", - "description": "Files that make up this gist. The key of which should be a required string filename and the value another required hash with parameters: 'content'" - }, - "user": { - "type": "String", - "required": true, - "validation": "", - "invalidmsg": "", - "description": "" - }, - "org": { - "type": "String", - "required": true, - "validation": "", - "invalidmsg": "", - "description": "" - }, - "repo": { - "type": "String", - "required": true, - "validation": "", - "invalidmsg": "", - "description": "" - }, - "branch": { - "type": "String", - "required": true, - "validation": "", - "invalidmsg": "", - "description": "" - }, - "sha": { - "type": "String", - "required": true, - "validation": "", - "invalidmsg": "", - "description": "" - }, - "description": { - "type": "String", - "required": false, - "validation": "", - "invalidmsg": "", - "description": "" - }, - "id": { - "type": "String", - "required": true, - "validation": "", - "invalidmsg": "", - "description": "" - }, - "gist_id": { - "type": "String", - "required": true, - "validation": "", - "invalidmsg": "", - "description": "Id (SHA1 hash) of the gist." - }, - "ref": { - "type": "String", - "required": true, - "validation": "", - "invalidmsg": "", - "description": "String of the name of the fully qualified reference (ie: heads/master). If it doesn’t have at least one slash, it will be rejected." - }, - "number": { - "type": "Number", - "required": true, - "validation": "^[0-9]+$", - "invalidmsg": "", - "description": "" - }, - "name": { - "type": "String", - "required": true, - "validation": "", - "invalidmsg": "", - "description": "" - }, - "direction": { - "type": "String", - "required": false, - "validation": "^(asc|desc)$", - "invalidmsg": "asc or desc, default: desc.", - "description": "" - }, - "since": { - "type": "Date", - "required": false, - "validation": "", - "invalidmsg": "", - "description": "Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ" - }, - "until": { - "type": "Date", - "required": false, - "validation": "", - "invalidmsg": "", - "description": "Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ" - }, - "state": { - "type": "String", - "required": false, - "validation": "^(open|closed)$", - "invalidmsg": "open, closed, default: open", - "description": "" - }, - "color": { - "type": "String", - "required": true, - "validation": "", - "invalidmsg": "6 character hex code, without a leading #.", - "description": "6 character hex code, without a leading #." - }, - "permission": { - "type": "String", - "required": false, - "validation": "^(pull|push|admin)$", - "invalidmsg": "", - "description": "`pull` - team members can pull, but not push or administer this repositories (Default), `push` - team members can pull and push, but not administer this repositores, `admin` - team members can pull, push and administer these repositories." - }, - "base": { - "type": "String", - "required": true, - "validation": "", - "invalidmsg": "", - "description": "The branch (or git ref) you want your changes pulled into. This should be an existing branch on the current repository. You cannot submit a pull request to one repo that requests a merge to a base of another repo." - }, - "head": { - "type": "String", - "required": true, - "validation": "", - "invalidmsg": "", - "description": "The branch (or git ref) where your changes are implemented." - }, - "commit_id": { - "type": "String", - "required": true, - "validation": "", - "invalidmsg": "Sha of the commit to comment on.", - "description": "Sha of the commit to comment on." - }, - "line": { - "type": "Number", - "required": true, - "validation": "", - "invalidmsg": "Line index in the diff to comment on.", - "description": "Line index in the diff to comment on." - }, - "path": { - "type": "String", - "required": true, - "validation": "", - "invalidmsg": "Relative path of the file to comment on.", - "description": "Relative path of the file to comment on." - }, - "position": { - "type": "Number", - "required": true, - "validation": "", - "invalidmsg": "Column index in the diff to comment on.", - "description": "Column index in the diff to comment on." - }, - "body": { - "type": "String", - "required": true, - "validation": "", - "invalidmsg": "", - "description": "" - }, - "homepage": { - "type": "String", - "required": false, - "validation": "", - "invalidmsg": "", - "description": "" - }, - "private": { - "type": "Boolean", - "required": false, - "validation": "", - "invalidmsg": "", - "description": "True to create a private repository, false to create a public one. Creating private repositories requires a paid GitHub account. Default is false." - }, - "has_issues": { - "type": "Boolean", - "required": false, - "validation": "", - "invalidmsg": "", - "description": "True to enable issues for this repository, false to disable them. Default is true." - }, - "has_wiki": { - "type": "Boolean", - "required": false, - "validation": "", - "invalidmsg": "", - "description": "True to enable the wiki for this repository, false to disable it. Default is true." - }, - "has_downloads": { - "type": "Boolean", - "required": false, - "validation": "", - "invalidmsg": "", - "description": "True to enable downloads for this repository, false to disable them. Default is true." - }, - "default_branch": { - "type": "String", - "required": false, - "validation": "", - "invalidmsg": "", - "description": "Updates the default branch for this repository." - }, - "collabuser": { - "type": "String", - "required": true, - "validation": "", - "invalidmsg": "", - "description": "" - }, - "title": { - "type": "String", - "required": true, - "validation": "", - "invalidmsg": "", - "description": "" - }, - "key": { - "type": "String", - "required": true, - "validation": "", - "invalidmsg": "", - "description": "" - }, - "page": { - "type": "Number", - "required": false, - "validation": "^[0-9]+$", - "invalidmsg": "", - "description": "Page number of the results to fetch." - }, - "per_page": { - "type": "Number", - "required": false, - "validation": "^[0-9]+$", - "invalidmsg": "", - "description": "A custom page size up to 100. Default is 30." - }, - "scopes": { - "type": "Array", - "required": false, - "validation": "", - "invalidmsg": "", - "description": "A list of scopes that this authorization is in." - }, - "note": { - "type": "String", - "required": false, - "validation": "", - "invalidmsg": "", - "description": "A note to remind you what the OAuth token is for." - }, - "note_url": { - "type": "String", - "required": false, - "validation": "", - "invalidmsg": "", - "description": "A URL to remind you what app the OAuth token is for." - }, - "auto_init": { - "type": "Boolean", - "required": false, - "validation": "", - "invalidmsg": "", - "description": "True to create an initial commit with empty README. Default is false" - }, - "gitignore_template": { - "type": "String", - "required": false, - "validation": "", - "invalidmsg": "", - "description": "Desired language or platform .gitignore template to apply. Ignored if auto_init parameter is not provided." - }, - "content": { - "type": "String", - "required": false, - "validation": "", - "invalidmsg": "", - "description": "" - }, - "message": { - "type": "String", - "required": false, - "validation": "", - "invalidmsg": "", - "description": "" - }, - "order": { - "type": "String", - "required": false, - "validation": "^(asc|desc)$", - "invalidmsg": "The sort order if sort parameter is provided. One of asc or desc. Default: desc", - "description": "asc or desc" - }, - "q": { - "type": "String", - "required": true, - "validation": "", - "invalidmsg": "", - "description": "Search Term", - "combined": true - } - } - }, - - "gists": { - "get-all": { - "url": "/gists", - "method": "GET", - "params": { - "$page": null, - "$per_page": null, - "$since": null - } - }, - - "get-from-user": { - "url": "/users/:user/gists", - "method": "GET", - "params": { - "$user": null, - "$page": null, - "$per_page": null, - "$since": null - } - }, - - "create": { - "url": "/gists", - "method": "POST", - "params": { - "$description": null, - "public": { - "type": "Boolean", - "required": true, - "validation": "", - "invalidmsg": "", - "description": "" - }, - "$files": null - } - }, - - "edit": { - "url": "/gists/:id", - "method": "PATCH", - "params": { - "$id": null, - "$description": null, - "$files": null - } - }, - - "public": { - "url": "/gists/public", - "method": "GET", - "params": { - "$since": null - } - }, - - "starred": { - "url": "/gists/starred", - "method": "GET", - "params": { - "$since": null - } - }, - - "get": { - "url": "/gists/:id", - "method": "GET", - "params": { - "$id": null - } - }, - - "star": { - "url": "/gists/:id/star", - "method": "PUT", - "params": { - "$id": null - } - }, - - "delete-star": { - "url": "/gists/:id/star", - "method": "DELETE", - "params": { - "$id": null - } - }, - - "check-star": { - "url": "/gists/:id/star", - "method": "GET", - "params": { - "$id": null - } - }, - - "fork": { - "url": "/gists/:id/fork", - "method": "POST", - "params": { - "$id": null - } - }, - - "delete": { - "url": "/gists/:id", - "method": "DELETE", - "params": { - "$id": null - } - }, - - "get-comments": { - "url": "/gists/:gist_id/comments", - "method": "GET", - "params": { - "$gist_id": null - } - }, - - "get-comment": { - "url": "/gists/:gist_id/comments/:id", - "method": "GET", - "params": { - "$gist_id": null, - "$id": null - } - }, - - "create-comment": { - "url": "/gists/:gist_id/comments", - "method": "POST", - "params": { - "$gist_id": null, - "$body": null - } - }, - - "edit-comment": { - "url": "/gists/:gist_id/comments/:id", - "method": "PATCH", - "params": { - "$gist_id": null, - "$id": null, - "$body": null - } - }, - - "delete-comment": { - "url": "/gists/:gist_id/comments/:id", - "method": "DELETE", - "params": { - "$gist_id": null, - "$id": null - } - } - }, - - "gitdata": { - "get-blob": { - "url": "/repos/:user/:repo/git/blobs/:sha", - "method": "GET", - "params": { - "$user": null, - "$repo": null, - "$sha": null, - "$page": null, - "$per_page": null - } - }, - - "create-blob": { - "url": "/repos/:user/:repo/git/blobs", - "method": "POST", - "params": { - "$user": null, - "$repo": null, - "content": { - "type": "String", - "required": true, - "validation": "", - "invalidmsg": "", - "description": "" - }, - "encoding": { - "type": "String", - "required": true, - "validation": "", - "invalidmsg": "", - "description": "" - } - } - }, - - "get-commit": { - "url": "/repos/:user/:repo/git/commits/:sha", - "method": "GET", - "params": { - "$user": null, - "$repo": null, - "$sha": null - } - }, - - "create-commit": { - "url": "/repos/:user/:repo/git/commits", - "method": "POST", - "params": { - "$user": null, - "$repo": null, - "message": { - "type": "String", - "required": true, - "validation": "", - "invalidmsg": "", - "description": "String of the commit message" - }, - "tree": { - "type": "String", - "required": true, - "validation": "", - "invalidmsg": "", - "description": "String of the SHA of the tree object this commit points to" - }, - "parents": { - "type": "Array", - "required": true, - "validation": "", - "invalidmsg": "", - "description": "Array of the SHAs of the commits that were the parents of this commit. If omitted or empty, the commit will be written as a root commit. For a single parent, an array of one SHA should be provided, for a merge commit, an array of more than one should be provided." - }, - "author": { - "type": "Json", - "required": false, - "validation": "", - "invalidmsg": "", - "description": "" - }, - "committer": { - "type": "Json", - "required": false, - "validation": "", - "invalidmsg": "", - "description": "" - } - } - }, - - "get-reference": { - "url": "/repos/:user/:repo/git/refs/:ref", - "method": "GET", - "params": { - "$user": null, - "$repo": null, - "$ref": null - } - }, - - "get-all-references": { - "url": "/repos/:user/:repo/git/refs", - "method": "GET", - "params": { - "$user": null, - "$repo": null, - "$page": null, - "$per_page": null - } - }, - - "create-reference": { - "url": "/repos/:user/:repo/git/refs", - "method": "POST", - "params": { - "$user": null, - "$repo": null, - "$ref": null, - "$sha": null - } - }, - - "update-reference": { - "url": "/repos/:user/:repo/git/refs/:ref", - "method": "PATCH", - "params": { - "$user": null, - "$repo": null, - "$ref": null, - "$sha": null, - "force": { - "type": "Boolean", - "required": false, - "validation": "", - "invalidmsg": "", - "description": "Boolean indicating whether to force the update or to make sure the update is a fast-forward update. The default is false, so leaving this out or setting it to false will make sure you’re not overwriting work." - } - } - }, - - "delete-reference": { - "url": "/repos/:user/:repo/git/refs/:ref", - "method": "DELETE", - "params": { - "$user": null, - "$repo": null, - "$ref": null - } - }, - - "get-tag": { - "url": "/repos/:user/:repo/git/tags/:sha", - "method": "GET", - "params": { - "$user": null, - "$repo": null, - "$sha": null - } - }, - - "create-tag": { - "url": "/repos/:user/:repo/git/tags", - "method": "POST", - "params": { - "$user": null, - "$repo": null, - "tag": { - "type": "String", - "required": true, - "validation": "", - "invalidmsg": "", - "description": "String of the tag" - }, - "message": { - "type": "String", - "required": true, - "validation": "", - "invalidmsg": "", - "description": "String of the tag message" - }, - "object": { - "type": "String", - "required": true, - "validation": "", - "invalidmsg": "", - "description": "String of the SHA of the git object this is tagging" - }, - "type": { - "type": "String", - "required": true, - "validation": "", - "invalidmsg": "", - "description": "String of the type of the object we’re tagging. Normally this is a commit but it can also be a tree or a blob." - }, - "tagger": { - "type": "Json", - "required": true, - "validation": "", - "invalidmsg": "", - "description": "JSON object that contains the following keys: `name` - String of the name of the author of the tag, `email` - String of the email of the author of the tag, `date` - Timestamp of when this object was tagged" - } - } - }, - - "get-tree": { - "url": "/repos/:user/:repo/git/trees/:sha", - "method": "GET", - "params": { - "$user": null, - "$repo": null, - "$sha": null, - "recursive": { - "type": "Boolean", - "required": false, - "validation": "", - "invalidmsg": "", - "description": "" - } - } - }, - - "create-tree": { - "url": "/repos/:user/:repo/git/trees", - "method": "POST", - "params": { - "$user": null, - "$repo": null, - "tree": { - "type": "Json", - "required": true, - "validation": "", - "invalidmsg": "", - "description": "Array of Hash objects (of path, mode, type and sha) specifying a tree structure" - }, - "base_tree": { - "type": "String", - "required": false, - "validation": "", - "invalidmsg": "", - "description": "String of the SHA1 of the tree you want to update with new data" - } - } - } - }, - - "issues": { - "get-all": { - "url": "/issues", - "method": "GET", - "params": { - "filter": { - "type": "String", - "required": false, - "validation": "^(all|assigned|created|mentioned|subscribed)$", - "invalidmsg": "", - "description": "" - }, - "state": { - "type": "String", - "required": false, - "validation": "^(open|closed|all)$", - "invalidmsg": "open, closed, all, default: open", - "description": "open, closed, or all" - }, - "labels": { - "type": "String", - "required": false, - "validation": "", - "invalidmsg": "", - "description": "String list of comma separated Label names. Example: bug,ui,@high" - }, - "sort": { - "type": "String", - "required": false, - "validation": "^(created|updated|comments)$", - "invalidmsg": "created, updated, comments, default: created.", - "description": "" - }, - "$direction": null, - "$since": null, - "$page": null, - "$per_page": null - } - }, - - "repo-issues": { - "url": "/repos/:user/:repo/issues", - "method": "GET", - "params": { - "$user": null, - "$repo": null, - "milestone": { - "type": "String", - "required": false, - "validation": "^([0-9]+|none|\\*)$", - "invalidmsg": "", - "description": "" - }, - "state": { - "type": "String", - "required": false, - "validation": "^(open|closed|all)$", - "invalidmsg": "open, closed, all, default: open", - "description": "open, closed, or all" - }, - "assignee": { - "type": "String", - "required": false, - "validation": "", - "invalidmsg": "String User login, `none` for Issues with no assigned User. `*` for Issues with any assigned User.", - "description": "String User login, `none` for Issues with no assigned User. `*` for Issues with any assigned User." - }, - "mentioned": { - "type": "String", - "required": false, - "validation": "", - "invalidmsg": "", - "description": "String User login." - }, - "labels": { - "type": "String", - "required": false, - "validation": "", - "invalidmsg": "", - "description": "String list of comma separated Label names. Example: bug,ui,@high" - }, - "sort": { - "type": "String", - "required": false, - "validation": "^(created|updated|comments)$", - "invalidmsg": "created, updated, comments, default: created.", - "description": "" - }, - "$direction": null, - "$since": null, - "$page": null, - "$per_page": null - } - }, - - "get-repo-issue": { - "url": "/repos/:user/:repo/issues/:number", - "method": "GET", - "params": { - "$user": null, - "$repo": null, - "$number": null - } - }, - - "create": { - "url": "/repos/:user/:repo/issues", - "method": "POST", - "params": { - "$user": null, - "$repo": null, - "title": { - "type": "String", - "required": true, - "validation": "", - "invalidmsg": "", - "description": "" - }, - "body": { - "type": "String", - "required": false, - "validation": "", - "invalidmsg": "", - "description": "" - }, - "assignee": { - "type": "String", - "required": false, - "validation": "", - "invalidmsg": "", - "description": "Login for the user that this issue should be assigned to." - }, - "milestone": { - "type": "Number", - "required": false, - "validation": "^[0-9]+$", - "invalidmsg": "", - "description": "Milestone to associate this issue with." - }, - "labels": { - "type": "Json", - "required": true, - "validation": "", - "invalidmsg": "", - "description": "Array of strings - Labels to associate with this issue." - } - } - }, - - "edit": { - "url": "/repos/:user/:repo/issues/:number", - "method": "PATCH", - "params": { - "$user": null, - "$repo": null, - "$number": null, - "title": { - "type": "String", - "required": false, - "validation": "", - "invalidmsg": "", - "description": "" - }, - "body": { - "type": "String", - "required": false, - "validation": "", - "invalidmsg": "", - "description": "" - }, - "assignee": { - "type": "String", - "required": false, - "validation": "", - "invalidmsg": "", - "description": "Login for the user that this issue should be assigned to." - }, - "milestone": { - "type": "Number", - "required": false, - "validation": "^[0-9]+$", - "invalidmsg": "", - "description": "Milestone to associate this issue with." - }, - "labels": { - "type": "Json", - "required": false, - "validation": "", - "invalidmsg": "", - "description": "Array of strings - Labels to associate with this issue." - }, - "state": { - "type": "String", - "required": false, - "validation": "^(open|closed)$", - "invalidmsg": "open, closed, default: open", - "description": "open or closed" - } - } - }, - - "repo-comments": { - "url": "/repos/:user/:repo/issues/comments", - "method": "GET", - "params": { - "$user": null, - "$repo": null, - "sort": { - "type": "String", - "required": false, - "validation": "^(created|updated)$", - "invalidmsg": "created, updated, default: created.", - "description": "" - }, - "$direction": null, - "$since": null, - "$page": null, - "$per_page": null - } - }, - - "get-comments": { - "url": "/repos/:user/:repo/issues/:number/comments", - "method": "GET", - "params": { - "$user": null, - "$repo": null, - "$number": null, - "$page": null, - "$per_page": null - } - }, - - "get-comment": { - "url": "/repos/:user/:repo/issues/comments/:id", - "method": "GET", - "params": { - "$user": null, - "$repo": null, - "$id": null - } - }, - - "create-comment": { - "url": "/repos/:user/:repo/issues/:number/comments", - "method": "POST", - "params": { - "$user": null, - "$repo": null, - "$number": null, - "body": { - "type": "String", - "required": true, - "validation": "", - "invalidmsg": "", - "description": "" - } - } - }, - - "edit-comment": { - "url": "/repos/:user/:repo/issues/comments/:id", - "method": "PATCH", - "params": { - "$user": null, - "$repo": null, - "$id": null, - "body": { - "type": "String", - "required": true, - "validation": "", - "invalidmsg": "", - "description": "" - } - } - }, - - "delete-comment": { - "url": "/repos/:user/:repo/issues/comments/:id", - "method": "DELETE", - "params": { - "$user": null, - "$repo": null, - "$id": null - } - }, - - "get-events": { - "url": "/repos/:user/:repo/issues/:number/events", - "method": "GET", - "params": { - "$user": null, - "$repo": null, - "$number": null, - "$page": null, - "$per_page": null - } - }, - - "get-repo-events": { - "url": "/repos/:user/:repo/issues/events", - "method": "GET", - "params": { - "$user": null, - "$repo": null, - "$page": null, - "$per_page": null - } - }, - - "get-event": { - "url": "/repos/:user/:repo/issues/events/:id", - "method": "GET", - "params": { - "$user": null, - "$repo": null, - "$id": null - } - }, - - "get-labels": { - "url": "/repos/:user/:repo/labels", - "method": "GET", - "params": { - "$user": null, - "$repo": null, - "$page": null, - "$per_page": null - } - }, - - "get-label": { - "url": "/repos/:user/:repo/labels/:name", - "method": "GET", - "params": { - "$user": null, - "$repo": null, - "$name": null - } - }, - - "create-label": { - "url": "/repos/:user/:repo/labels", - "method": "POST", - "params": { - "$user": null, - "$repo": null, - "$name": null, - "$color": null - } - }, - - "update-label": { - "url": "/repos/:user/:repo/labels/:name", - "method": "POST", - "params": { - "$user": null, - "$repo": null, - "$name": null, - "$color": null - } - }, - - "delete-label": { - "url": "/repos/:user/:repo/labels/:name", - "method": "DELETE", - "params": { - "$user": null, - "$repo": null, - "$name": null - } - }, - - "get-issue-labels": { - "url": "/repos/:user/:repo/issues/:number/labels", - "method": "GET", - "params": { - "$user": null, - "$repo": null, - "$number": null - } - }, - - "get-all-milestones": { - "url": "/repos/:user/:repo/milestones", - "method": "GET", - "params": { - "$user": null, - "$repo": null, - "$state": null, - "sort": { - "type": "String", - "required": false, - "validation": "^(due_date|completeness)$", - "invalidmsg": "due_date, completeness, default: due_date", - "description": "due_date, completeness, default: due_date" - }, - "$page": null, - "$per_page": null - } - }, - - "get-milestone": { - "url": "/repos/:user/:repo/milestones/:number", - "method": "GET", - "params": { - "$user": null, - "$repo": null, - "$number": null - } - }, - - "create-milestone": { - "url": "/repos/:user/:repo/milestones", - "method": "POST", - "params": { - "$user": null, - "$repo": null, - "title": { - "type": "String", - "required": true, - "validation": "", - "invalidmsg": "", - "description": "" - }, - "$state": null, - "$description": null, - "due_on": { - "type": "Date", - "required": false, - "validation": "", - "invalidmsg": "Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ", - "description": "Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ" - } - } - }, - - "update-milestone": { - "url": "/repos/:user/:repo/milestones/:number", - "method": "PATCH", - "params": { - "$user": null, - "$repo": null, - "$number": null, - "title": { - "type": "String", - "required": true, - "validation": "", - "invalidmsg": "", - "description": "" - }, - "$state": null, - "$description": null, - "due_on": { - "type": "Date", - "required": false, - "validation": "", - "invalidmsg": "Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ", - "description": "Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ" - } - } - }, - - "delete-milestone": { - "url": "/repos/:user/:repo/milestones/:number", - "method": "DELETE", - "params": { - "$user": null, - "$repo": null, - "$number": null - } - } - }, - - "authorization": { - "get-all": { - "url": "/authorizations", - "method": "GET", - "params": { - "$page": null, - "$per_page": null - } - }, - "get": { - "url": "/authorizations/:id", - "method": "GET", - "params": { - "$id": null - } - }, - "create": { - "url": "/authorizations", - "method": "POST", - "params": { - "$scopes": null, - "$note": null, - "$note_url": null - } - }, - "update": { - "url": "/authorizations/:id", - "method": "PATCH", - "params": { - "$id": null, - "$scopes": null, - "add_scopes": { - "type": "Array", - "required": false, - "validation": "", - "invalidmsg": "", - "description": "A list of scopes to add to this authorization." - }, - "remove_scopes": { - "type": "Array", - "required": false, - "validation": "", - "invalidmsg": "", - "description": "A list of scopes to remove from this authorization." - }, - "$note": null, - "$note_url": null - } - }, - "delete": { - "url": "/authorizations/:id", - "method": "DELETE", - "params": { - "$id": null - } - } - }, - - "orgs": { - "get-from-user": { - "url": "/users/:user/orgs", - "method": "GET", - "params": { - "$user": null, - "$page": null, - "$per_page": null - } - }, - - "get": { - "url": "/orgs/:org", - "method": "GET", - "params": { - "$org": null, - "$page": null, - "$per_page": null - } - }, - - "update": { - "url": "/orgs/:org", - "method": "PATCH", - "params": { - "$org": null, - "billing_email": { - "type": "String", - "required": false, - "validation": "", - "invalidmsg": "", - "description": "Billing email address. This address is not publicized." - }, - "company": { - "type": "String", - "required": false, - "validation": "", - "invalidmsg": "", - "description": "" - }, - "email": { - "type": "String", - "required": false, - "validation": "", - "invalidmsg": "", - "description": "Publicly visible email address." - }, - "location": { - "type": "String", - "required": false, - "validation": "", - "invalidmsg": "", - "description": "" - }, - "name": { - "type": "String", - "required": false, - "validation": "", - "invalidmsg": "", - "description": "" - } - } - }, - - "get-members": { - "url": "/orgs/:org/members", - "method": "GET", - "params": { - "$org": null, - "$page": null, - "$per_page": null - } - }, - - "get-member": { - "url": "/orgs/:org/members/:user", - "method": "GET", - "params": { - "$org": null, - "$user": null - } - }, - - "remove-member": { - "url": "/orgs/:org/members/:user", - "method": "DELETE", - "params": { - "$org": null, - "$user": null - } - }, - - "get-public-members": { - "url": "/orgs/:org/public_members", - "method": "GET", - "params": { - "$org": null - } - }, - - "get-public-member": { - "url": "/orgs/:org/public_members/:user", - "method": "GET", - "params": { - "$org": null, - "$user": null - } - }, - - "publicize-membership": { - "url": "/orgs/:org/public_members/:user", - "method": "PUT", - "params": { - "$org": null, - "$user": null - } - }, - - "conceal-membership": { - "url": "/orgs/:org/public_members/:user", - "method": "DELETE", - "params": { - "$org": null, - "$user": null - } - }, - - "get-teams": { - "url": "/orgs/:org/teams", - "method": "GET", - "params": { - "$org": null, - "$page": null, - "$per_page": null - } - }, - - "get-team": { - "url": "/teams/:id", - "method": "GET", - "params": { - "$id": null - } - }, - - "create-team": { - "url": "/orgs/:org/teams", - "method": "POST", - "params": { - "$org": null, - "$name": null, - "repo_names": { - "type": "Array", - "required": false, - "validation": "", - "invalidmsg": "", - "description": "Array of strings" - }, - "$permission": null - } - }, - - "update-team": { - "url": "/teams/:id", - "method": "PATCH", - "params": { - "$id": null, - "$name": null, - "$permission": null - } - }, - - "delete-team": { - "url": "/teams/:id", - "method": "DELETE", - "params": { - "$id": null - } - }, - - "get-team-members": { - "url": "/teams/:id/members", - "method": "GET", - "params": { - "$id": null, - "$page": null, - "$per_page": null - } - }, - - "get-team-member": { - "url": "/teams/:id/members/:user", - "method": "GET", - "params": { - "$id": null, - "$user": null - } - }, - - "add-team-member": { - "url": "/teams/:id/members/:user", - "method": "PUT", - "params": { - "$id": null, - "$user": null - } - }, - - "delete-team-member": { - "url": "/teams/:id/members/:user", - "method": "DELETE", - "params": { - "$id": null, - "$user": null - } - }, - - "get-team-repos": { - "url": "/teams/:id/repos", - "method": "GET", - "params": { - "$id": null, - "$page": null, - "$per_page": null - } - }, - - "get-team-repo": { - "url": "/teams/:id/repos/:user/:repo", - "method": "GET", - "params": { - "$id": null, - "$user": null, - "$repo": null - } - }, - - "add-team-repo": { - "url": "/teams/:id/repos/:user/:repo", - "method": "PUT", - "params": { - "$id": null, - "$user": null, - "$repo": null - } - }, - - "delete-team-repo": { - "url": "/teams/:id/repos/:user/:repo", - "method": "DELETE", - "params": { - "$id": null, - "$user": null, - "$repo": null - } - } - }, - - "statuses": { - "get": { - "url": "/repos/:user/:repo/statuses/:sha", - "method": "GET", - "params": { - "$user": null, - "$repo": null, - "$sha": null - } - }, - - "create": { - "url": "/repos/:user/:repo/statuses/:sha", - "method": "POST", - "params": { - "$user": null, - "$repo": null, - "$sha": null, - "state": { - "type": "String", - "required": true, - "validation": "^(pending|success|error|failure)$", - "invalidmsg": "", - "description": "State of the status - can be one of pending, success, error, or failure." - }, - "target_url": { - "type": "String", - "required": false, - "validation": "", - "invalidmsg": "", - "description": "Target url to associate with this status. This URL will be linked from the GitHub UI to allow users to easily see the ‘source’ of the Status." - }, - "description": { - "type": "String", - "required": false, - "validation": "", - "invalidmsg": "", - "description": "Short description of the status." - } - } - } - }, - - "pull-requests": { - "get-all": { - "url": "/repos/:user/:repo/pulls", - "method": "GET", - "params": { - "$user": null, - "$repo": null, - "state": { - "type": "String", - "required": false, - "validation": "^(open|closed|all)$", - "invalidmsg": "open, closed, all, default: open", - "description": "open, closed, or all" - }, - "$page": null, - "$per_page": null, - "sort": { - "type": "String", - "required": false, - "validation": "^(created|updated|popularity|long-running)$", - "invalidmsg": "Possible values are: `created`, `updated`, `popularity`, `long-running`, Default: `created`", - "description": "Possible values are: `created`, `updated`, `popularity`, `long-running`, Default: `created`" - }, - "$direction": null - } - }, - - "get": { - "url": "/repos/:user/:repo/pulls/:number", - "method": "GET", - "params": { - "$user": null, - "$repo": null, - "$number": null - } - }, - - "create": { - "url": "/repos/:user/:repo/pulls", - "method": "POST", - "params": { - "$user": null, - "$repo": null, - "title": { - "type": "String", - "required": true, - "validation": "", - "invalidmsg": "", - "description": "" - }, - "body": { - "type": "String", - "required": false, - "validation": "", - "invalidmsg": "", - "description": "" - }, - "$base": null, - "$head": null - } - }, - - "create-from-issue": { - "url": "/repos/:user/:repo/pulls", - "method": "POST", - "params": { - "$user": null, - "$repo": null, - "issue": { - "type": "Number", - "required": true, - "validation": "^[0-9]+$", - "invalidmsg": "", - "description": "" - }, - "$base": null, - "$head": null - } - }, - - "update": { - "url": "/repos/:user/:repo/pulls/:number", - "method": "PATCH", - "params": { - "$user": null, - "$repo": null, - "$number": null, - "$state": null, - "title": { - "type": "String", - "required": true, - "validation": "", - "invalidmsg": "", - "description": "" - }, - "body": { - "type": "String", - "required": false, - "validation": "", - "invalidmsg": "", - "description": "" - } - } - }, - - "get-commits": { - "url": "/repos/:user/:repo/pulls/:number/commits", - "method": "GET", - "params": { - "$user": null, - "$repo": null, - "$number": null, - "$page": null, - "$per_page": null - } - }, - - "get-files": { - "url": "/repos/:user/:repo/pulls/:number/files", - "method": "GET", - "params": { - "$user": null, - "$repo": null, - "$number": null, - "$page": null, - "$per_page": null - } - }, - - "get-merged": { - "url": "/repos/:user/:repo/pulls/:number/merge", - "method": "GET", - "params": { - "$user": null, - "$repo": null, - "$number": null, - "$page": null, - "$per_page": null - } - }, - - "merge": { - "url": "/repos/:user/:repo/pulls/:number/merge", - "method": "PUT", - "params": { - "$user": null, - "$repo": null, - "$number": null, - "commit_message": { - "type": "String", - "required": false, - "validation": "", - "invalidmsg": "", - "description": "The message that will be used for the merge commit" - } - } - }, - - "get-comments": { - "url": "/repos/:user/:repo/pulls/:number/comments", - "method": "GET", - "params": { - "$user": null, - "$repo": null, - "$number": null, - "$page": null, - "$per_page": null - } - }, - - "get-comment": { - "url": "/repos/:user/:repo/pulls/comments/:number", - "method": "GET", - "params": { - "$user": null, - "$repo": null, - "$number": null - } - }, - - "create-comment": { - "url": "/repos/:user/:repo/pulls/:number/comments", - "method": "POST", - "params": { - "$user": null, - "$repo": null, - "$number": null, - "$body": null, - "$commit_id": null, - "$path": null, - "$position": null - } - }, - - "create-comment-reply": { - "url": "/repos/:user/:repo/pulls/:number/comments", - "method": "POST", - "params": { - "$user": null, - "$repo": null, - "$number": null, - "$body": null, - "in_reply_to": { - "type": "Number", - "required": true, - "validation": "", - "invalidmsg": "", - "description": "" - } - } - }, - - "update-comment": { - "url": "/repos/:user/:repo/pulls/comments/:number", - "method": "PATCH", - "params": { - "$user": null, - "$repo": null, - "$number": null, - "$body": null - } - }, - - "delete-comment": { - "url": "/repos/:user/:repo/pulls/comments/:number", - "method": "DELETE", - "params": { - "$user": null, - "$repo": null, - "$number": null - } - } - }, - - "repos": { - "get-all": { - "url": "/user/repos", - "method": "GET", - "params": { - "type": { - "type": "String", - "required": false, - "validation": "^(all|owner|public|private|member)$", - "invalidmsg": "Possible values: `all`, `owner`, `public`, `private`, `member`. Default: `all`.", - "description": "Possible values: `all`, `owner`, `public`, `private`, `member`. Default: `all`." - }, - "sort": { - "type": "String", - "required": false, - "validation": "^(created|updated|pushed|full_name)$", - "invalidmsg": "Possible values: `created`, `updated`, `pushed`, `full_name`. Default: `full_name`.", - "description": "Possible values: `created`, `updated`, `pushed`, `full_name`. Default: `full_name`." - }, - "$direction": null, - "$page": null, - "$per_page": null - } - }, - - "get-from-user": { - "url": "/users/:user/repos", - "method": "GET", - "params": { - "$user": null, - "type": { - "type": "String", - "required": false, - "validation": "^(all|owner|member)$", - "invalidmsg": "Possible values: `all`, `owner`, `member`. Default: `public`.", - "description": "Possible values: `all`, `owner`, `member`. Default: `public`." - }, - "sort": { - "type": "String", - "required": false, - "validation": "^(created|updated|pushed|full_name)$", - "invalidmsg": "Possible values: `created`, `updated`, `pushed`, `full_name`. Default: `full_name`.", - "description": "Possible values: `created`, `updated`, `pushed`, `full_name`. Default: `full_name`." - }, - "$direction": null, - "$page": null, - "$per_page": null - } - }, - - "get-from-org": { - "url": "/orgs/:org/repos", - "method": "GET", - "params": { - "$org": null, - "type": { - "type": "String", - "required": false, - "validation": "^(all|public|member)$", - "invalidmsg": "Possible values: `all`, `public`, `member`. Default: `all`.", - "description": "Possible values: `all`, `public`, `member`. Default: `all`." - }, - "$page": null, - "$per_page": null - } - }, - - "create": { - "url": "/user/repos", - "method": "POST", - "params": { - "$name": null, - "$description": null, - "$homepage": null, - "$private": null, - "$has_issues": null, - "$has_wiki": null, - "$has_downloads": null, - "$auto_init": null, - "$gitignore_template": null - } - }, - - "create-from-org": { - "url": "/orgs/:org/repos", - "method": "POST", - "params": { - "$org": null, - "$name": null, - "$description": null, - "$homepage": null, - "$private": null, - "$has_issues": null, - "$has_wiki": null, - "$has_downloads": null, - "$auto_init": null, - "$gitignore_template": null, - "team_id": { - "type": "Number", - "required": false, - "validation": "^[0-9]+$", - "invalidmsg": "", - "description": "The id of the team that will be granted access to this repository. This is only valid when creating a repo in an organization." - } - } - }, - - "get": { - "url": "/repos/:user/:repo", - "method": "GET", - "params": { - "$user": null, - "$repo": null - } - }, - - "update": { - "url": "/repos/:user/:repo", - "method": "PATCH", - "params": { - "$user": null, - "$repo": null, - "$name": null, - "$description": null, - "$homepage": null, - "$private": null, - "$has_issues": null, - "$has_wiki": null, - "$has_downloads": null, - "$default_branch": null - } - }, - - "delete": { - "url": "/repos/:user/:repo", - "method": "DELETE", - "params": { - "$user": null, - "$repo": null - } - }, - - "merge": { - "url": "/repos/:user/:repo/merges", - "method": "POST", - "params": { - "$user": null, - "$repo": null, - "$base": null, - "$head": null, - "commit_message": { - "type": "String", - "required": false, - "validation": "", - "invalidmsg": "", - "description": "Commit message to use for the merge commit. If omitted, a default message will be used." - } - } - }, - - "get-contributors": { - "url": "/repos/:user/:repo/contributors", - "method": "GET", - "params": { - "$user": null, - "$repo": null, - "anon": { - "type": "Boolean", - "required": false, - "validation": "", - "invalidmsg": "", - "description": "Set to 1 or true to include anonymous contributors in results." - }, - "$page": null, - "$per_page": null - } - }, - - "get-languages": { - "url": "/repos/:user/:repo/languages", - "method": "GET", - "params": { - "$user": null, - "$repo": null, - "$page": null, - "$per_page": null - } - }, - - "get-teams": { - "url": "/repos/:user/:repo/teams", - "method": "GET", - "params": { - "$user": null, - "$repo": null, - "$page": null, - "$per_page": null - } - }, - - "get-tags": { - "url": "/repos/:user/:repo/tags", - "method": "GET", - "params": { - "$user": null, - "$repo": null, - "$page": null, - "$per_page": null - } - }, - - "get-branches": { - "url": "/repos/:user/:repo/branches", - "method": "GET", - "params": { - "$user": null, - "$repo": null, - "$page": null, - "$per_page": null - } - }, - - "get-branch": { - "url": "/repos/:user/:repo/branches/:branch", - "method": "GET", - "params": { - "$user": null, - "$repo": null, - "$branch": null, - "$page": null, - "$per_page": null - } - }, - - "get-collaborators": { - "url": "/repos/:user/:repo/collaborators", - "method": "GET", - "params": { - "$user": null, - "$repo": null, - "$page": null, - "$per_page": null - } - }, - - "get-collaborator": { - "url": "/repos/:user/:repo/collaborators/:collabuser", - "method": "GET", - "params": { - "$user": null, - "$repo": null, - "$collabuser": null - } - }, - - "add-collaborator": { - "url": "/repos/:user/:repo/collaborators/:collabuser", - "method": "PUT", - "params": { - "$user": null, - "$repo": null, - "$collabuser": null - } - }, - - "remove-collaborator": { - "url": "/repos/:user/:repo/collaborators/:collabuser", - "method": "DELETE", - "params": { - "$user": null, - "$repo": null, - "$collabuser": null - } - }, - - "get-commits": { - "url": "/repos/:user/:repo/commits", - "method": "GET", - "params": { - "$user": null, - "$repo": null, - "sha": { - "type": "String", - "required": false, - "validation": "", - "invalidmsg": "", - "description": "Sha or branch to start listing commits from." - }, - "path": { - "type": "String", - "required": false, - "validation": "", - "invalidmsg": "", - "description": "Only commits containing this file path will be returned." - }, - "author": { - "type": "String", - "required": false, - "validation": "", - "invalidmsg": "", - "description": "GitHub login or email address by which to filter by commit author." - }, - "$page": null, - "$per_page": null, - "$since": null, - "$until": null - } - }, - - "get-commit": { - "url": "/repos/:user/:repo/commits/:sha", - "method": "GET", - "params": { - "$user": null, - "$repo": null, - "$sha": null - } - }, - - "get-all-commit-comments": { - "url": "/repos/:user/:repo/comments", - "method": "GET", - "params": { - "$user": null, - "$repo": null, - "$page": null, - "$per_page": null - } - }, - - "get-commit-comments": { - "url": "/repos/:user/:repo/commits/:sha/comments", - "method": "GET", - "params": { - "$user": null, - "$repo": null, - "$sha": null, - "$page": null, - "$per_page": null - } - }, - - "create-commit-comment": { - "url": "/repos/:user/:repo/commits/:sha/comments", - "method": "POST", - "params": { - "$user": null, - "$repo": null, - "$sha": null, - "$body": null, - "$commit_id": null, - "path": { - "type": "String", - "required": false, - "validation": "", - "invalidmsg": "", - "description": "Relative path of the file to comment on." - }, - "position": { - "type": "Number", - "required": false, - "validation": "", - "invalidmsg": "", - "description": "Line index in the diff to comment on." - }, - "line": { - "type": "Number", - "required": false, - "validation": "", - "invalidmsg": "", - "description": "Line number in the file to comment on. Defaults to 1." - } - } - }, - - "get-commit-comment": { - "url": "/repos/:user/:repo/comments/:id", - "method": "GET", - "params": { - "$user": null, - "$repo": null, - "$id": null - } - }, - - "update-commit-comment": { - "url": "/repos/:user/:repo/comments/:id", - "method": "PATCH", - "params": { - "$user": null, - "$repo": null, - "$id": null, - "$body": null - } - }, - - "compare-commits": { - "url": "/repos/:user/:repo/compare/:base...:head", - "method": "GET", - "params": { - "$user": null, - "$repo": null, - "$base": null, - "$head": null - } - }, - - "delete-commit-comment": { - "url": "/repos/:user/:repo/comments/:id", - "method": "DELETE", - "params": { - "$user": null, - "$repo": null, - "$id": null - } - }, - - "get-readme": { - "url": "/repos/:user/:repo/readme", - "method": "GET", - "params": { - "$user": null, - "$repo": null, - "ref": { - "type": "String", - "required": false, - "validation": "", - "invalidmsg": "", - "description": "The String name of the Commit/Branch/Tag. Defaults to master." - } - } - }, - - "get-content": { - "url": "/repos/:user/:repo/contents/:path", - "method": "GET", - "params": { - "$user": null, - "$repo": null, - "path": { - "type": "String", - "required": false, - "validation": "", - "invalidmsg": "", - "description": "The content path." - }, - "ref": { - "type": "String", - "required": false, - "validation": "", - "invalidmsg": "", - "description": "The String name of the Commit/Branch/Tag. Defaults to master." - } - } - }, - "create-content": { - "url": "/repos/:user/:repo/contents/:path", - "method": "PUT", - "params": { - "$user": null, - "$repo": null, - "$content":null, - "$message":null, - "path": { - "type": "String", - "required": false, - "validation": "", - "invalidmsg": "", - "description": "The content path." - }, - "ref": { - "type": "String", - "required": false, - "validation": "", - "invalidmsg": "", - "description": "The String name of the Commit/Branch/Tag. Defaults to master." - } - } - }, - - "create-file": { - "url": "/repos/:user/:repo/contents/:path", - "method": "PUT", - "params": { - "$user": null, - "$repo": null, - "path": { - "type": "String", - "required": true, - "validation": "", - "invalidmsg": "", - "description": "The content path." - }, - "message": { - "type": "String", - "required": true, - "validation": "", - "invalidmsg": "", - "description": "The commit message." - }, - "content": { - "type": "String", - "required": true, - "validation": "", - "invalidmsg": "", - "description": "The new file content, Base64 encoded." - }, - "branch": { - "type": "String", - "required": false, - "validation": "", - "invalidmsg": "", - "description": "The branch name. If not provided, uses the repository’s default branch (usually master)." - }, - "author": { - "type": "Json", - "required": false, - "validation": "", - "invalidmsg": "", - "description": "" - }, - "committer": { - "type": "Json", - "required": false, - "validation": "", - "invalidmsg": "", - "description": "" - } - } - }, - - "update-file": { - "url": "/repos/:user/:repo/contents/:path", - "method": "PUT", - "params": { - "$user": null, - "$repo": null, - "path": { - "type": "String", - "required": true, - "validation": "", - "invalidmsg": "", - "description": "The content path." - }, - "message": { - "type": "String", - "required": true, - "validation": "", - "invalidmsg": "", - "description": "The commit message." - }, - "content": { - "type": "String", - "required": true, - "validation": "", - "invalidmsg": "", - "description": "The updated file content, Base64 encoded." - }, - "sha": { - "type": "String", - "required": true, - "validation": "", - "invalidmsg": "", - "description": "The blob SHA of the file being replaced." - }, - "branch": { - "type": "String", - "required": false, - "validation": "", - "invalidmsg": "", - "description": "The branch name. If not provided, uses the repository’s default branch (usually master)." - }, - "author": { - "type": "Json", - "required": false, - "validation": "", - "invalidmsg": "", - "description": "" - }, - "committer": { - "type": "Json", - "required": false, - "validation": "", - "invalidmsg": "", - "description": "" - } - } - }, - - "delete-file": { - "url": "/repos/:user/:repo/contents/:path", - "method": "DELETE", - "params": { - "$user": null, - "$repo": null, - "path": { - "type": "String", - "required": true, - "validation": "", - "invalidmsg": "", - "description": "The content path." - }, - "message": { - "type": "String", - "required": true, - "validation": "", - "invalidmsg": "", - "description": "The commit message." - }, - "sha": { - "type": "String", - "required": true, - "validation": "", - "invalidmsg": "", - "description": "The blob SHA of the file being removed." - }, - "branch": { - "type": "String", - "required": false, - "validation": "", - "invalidmsg": "", - "description": "The branch name. If not provided, uses the repository’s default branch (usually master)." - }, - "author": { - "type": "Json", - "required": false, - "validation": "", - "invalidmsg": "", - "description": "" - }, - "committer": { - "type": "Json", - "required": false, - "validation": "", - "invalidmsg": "", - "description": "" - } - } - }, - - "get-archive-link": { - "url": "/repos/:user/:repo/:archive_format/:ref", - "method": "GET", - "params": { - "$user": null, - "$repo": null, - "ref": { - "type": "String", - "required": false, - "validation": "", - "invalidmsg": "", - "description": "String of the name of the fully qualified reference (ie: heads/master). If it doesn’t have at least one slash, it will be rejected." - }, - "archive_format": { - "type": "String", - "required": true, - "validation": "^(tarball|zipball)$", - "invalidmsg": "Either tarball or zipball", - "description": "Either tarball or zipball" - } - } - }, - - "get-downloads": { - "url": "/repos/:user/:repo/downloads", - "method": "GET", - "params": { - "$user": null, - "$repo": null, - "$page": null, - "$per_page": null - } - }, - - "get-download": { - "url": "/repos/:user/:repo/downloads/:id", - "method": "GET", - "params": { - "$user": null, - "$repo": null, - "$id": null - } - }, - - "delete-download": { - "url": "/repos/:user/:repo/downloads/:id", - "method": "DELETE", - "params": { - "$user": null, - "$repo": null, - "$id": null - } - }, - - "get-forks": { - "url": "/repos/:user/:repo/forks", - "method": "GET", - "params": { - "$user": null, - "$repo": null, - "sort": { - "type": "String", - "required": false, - "validation": "^(newest|oldest|watchers)$", - "invalidmsg": "Possible values: `newest`, `oldest`, `watchers`, default: `newest`.", - "description": "Possible values: `newest`, `oldest`, `watchers`, default: `newest`." - }, - "$page": null, - "$per_page": null - } - }, - - "fork": { - "url": "/repos/:user/:repo/forks", - "method": "POST", - "params": { - "$user": null, - "$repo": null, - "organization": { - "type": "String", - "required": false, - "validation": "", - "invalidmsg": "", - "description": "Organization login. The repository will be forked into this organization." - } - } - }, - - "get-keys": { - "url": "/repos/:user/:repo/keys", - "method": "GET", - "params": { - "$user": null, - "$repo": null, - "$page": null, - "$per_page": null - } - }, - - "get-key": { - "url": "/repos/:user/:repo/keys/:id", - "method": "GET", - "params": { - "$user": null, - "$repo": null, - "$id": null - } - }, - - "create-key": { - "url": "/repos/:user/:repo/keys", - "method": "POST", - "params": { - "$user": null, - "$repo": null, - "$title": null, - "$key": null - } - }, - - "update-key": { - "url": "/repos/:user/:repo/keys/:id", - "method": "PUT", - "params": { - "$user": null, - "$repo": null, - "$id": null, - "$title": null, - "$key": null - } - }, - - "delete-key": { - "url": "/repos/:user/:repo/keys/:id", - "method": "DELETE", - "params": { - "$user": null, - "$repo": null, - "$id": null - } - }, - - "get-stargazers": { - "url": "/repos/:user/:repo/stargazers", - "method": "GET", - "params": { - "$user": null, - "$repo": null, - "$page": null, - "$per_page": null - } - }, - - "get-starred": { - "url": "/user/starred", - "method": "GET", - "params": { - "$page": null, - "$per_page": null - } - }, - - "get-starred-from-user": { - "url": "/users/:user/starred", - "method": "GET", - "params": { - "$user": null, - "$page": null, - "$per_page": null - } - }, - - "get-starring": { - "url": "/user/starred/:user/:repo", - "method": "GET", - "params": { - "$user": null, - "$repo": null, - "$page": null, - "$per_page": null - } - }, - - "star": { - "url": "/user/starred/:user/:repo", - "method": "PUT", - "params": { - "$user": null, - "$repo": null - } - }, - - "un-star": { - "url": "/user/starred/:user/:repo", - "method": "DELETE", - "params": { - "$user": null, - "$repo": null - } - }, - - "get-watchers": { - "url": "/repos/:user/:repo/watchers", - "method": "GET", - "params": { - "$user": null, - "$repo": null, - "$page": null, - "$per_page": null - } - }, - - "get-watched": { - "url": "/user/watched", - "method": "GET", - "params": { - "$page": null, - "$per_page": null - } - }, - - "get-watched-from-user": { - "url": "/users/:user/watched", - "method": "GET", - "params": { - "$user": null, - "$page": null, - "$per_page": null - } - }, - - "get-watching": { - "url": "/user/watched/:user/:repo", - "method": "GET", - "params": { - "$user": null, - "$repo": null, - "$page": null, - "$per_page": null - } - }, - - "watch": { - "url": "/user/watched/:user/:repo", - "method": "PUT", - "params": { - "$user": null, - "$repo": null - } - }, - - "un-watch": { - "url": "/user/watched/:user/:repo", - "method": "DELETE", - "params": { - "$user": null, - "$repo": null - } - }, - - "get-hooks": { - "url": "/repos/:user/:repo/hooks", - "method": "GET", - "params": { - "$user": null, - "$repo": null, - "$page": null, - "$per_page": null - } - }, - - "get-hook": { - "url": "/repos/:user/:repo/hooks/:id", - "method": "GET", - "params": { - "$user": null, - "$repo": null, - "$id": null - } - }, - - "create-hook": { - "url": "/repos/:user/:repo/hooks", - "method": "POST", - "params": { - "$user": null, - "$repo": null, - "$name": null, - "config": { - "type": "Json", - "required": true, - "validation": "", - "invalidmsg": "", - "description": "A Hash containing key/value pairs to provide settings for this hook. These settings vary between the services and are defined in the github-services repo. Booleans are stored internally as `1` for true, and `0` for false. Any JSON true/false values will be converted automatically." - }, - "events": { - "type": "Array", - "required": false, - "validation": "", - "invalidmsg": "", - "description": "Determines what events the hook is triggered for. Default: `['push']`." - }, - "active": { - "type": "Boolean", - "required": false, - "validation": "", - "invalidmsg": "", - "description": "Determines whether the hook is actually triggered on pushes." - } - } - }, - - "update-hook": { - "url": "/repos/:user/:repo/hooks/:id", - "method": "PATCH", - "params": { - "$user": null, - "$repo": null, - "$id": null, - "$name": null, - "config": { - "type": "Json", - "required": true, - "validation": "", - "invalidmsg": "", - "description": "A Hash containing key/value pairs to provide settings for this hook. Modifying this will replace the entire config object. These settings vary between the services and are defined in the github-services repo. Booleans are stored internally as `1` for true, and `0` for false. Any JSON true/false values will be converted automatically." - }, - "events": { - "type": "Array", - "required": false, - "validation": "", - "invalidmsg": "", - "description": "Determines what events the hook is triggered for. This replaces the entire array of events. Default: `['push']`." - }, - "add_events": { - "type": "Array", - "required": false, - "validation": "", - "invalidmsg": "", - "description": "Determines a list of events to be added to the list of events that the Hook triggers for." - }, - "remove_events": { - "type": "Array", - "required": false, - "validation": "", - "invalidmsg": "", - "description": "Determines a list of events to be removed from the list of events that the Hook triggers for." - }, - "active": { - "type": "Boolean", - "required": false, - "validation": "", - "invalidmsg": "", - "description": "Determines whether the hook is actually triggered on pushes." - } - } - }, - - "test-hook": { - "url": "/repos/:user/:repo/hooks/:id/test", - "method": "POST", - "params": { - "$user": null, - "$repo": null, - "$id": null - } - }, - - "delete-hook": { - "url": "/repos/:user/:repo/hooks/:id", - "method": "DELETE", - "params": { - "$user": null, - "$repo": null, - "$id": null - } - } - }, - - "user": { - "get-from": { - "url": "/users/:user", - "method": "GET", - "params": { - "$user": null - } - }, - - "get": { - "url": "/user", - "method": "GET", - "params": {} - }, - - "update": { - "url": "/user", - "method": "PATCH", - "params": { - "name": { - "type": "String", - "required": false, - "validation": "", - "invalidmsg": "", - "description": "" - }, - "email": { - "type": "String", - "required": false, - "validation": "", - "invalidmsg": "", - "description": "" - }, - "blog": { - "type": "String", - "required": false, - "validation": "", - "invalidmsg": "", - "description": "" - }, - "company": { - "type": "String", - "required": false, - "validation": "", - "invalidmsg": "", - "description": "" - }, - "location": { - "type": "String", - "required": false, - "validation": "", - "invalidmsg": "", - "description": "" - }, - "hireable": { - "type": "Boolean", - "required": false, - "validation": "", - "invalidmsg": "", - "description": "" - }, - "bio": { - "type": "String", - "required": false, - "validation": "", - "invalidmsg": "", - "description": "" - } - } - }, - - "get-orgs": { - "url": "/user/orgs", - "method": "GET", - "params": { - "$page": null, - "$per_page": null - } - }, - - "get-teams": { - "url": "/user/teams", - "method": "GET", - "params": { - "$page": null, - "$per_page": null - } - }, - - "get-emails": { - "url": "/user/emails", - "method": "GET", - "params": { - "$page": null, - "$per_page": null - } - }, - - "add-emails": { - "url": "/user/emails", - "method": "POST", - "params": {} - }, - - "delete-emails": { - "url": "/user/emails", - "method": "DELETE", - "params": {} - }, - - "get-followers": { - "url": "/users/:user/followers", - "method": "GET", - "params": { - "$user": null, - "$page": null, - "$per_page": null - } - }, - - "get-following-from-user": { - "url": "/users/:user/following", - "method": "GET", - "params": { - "$user": null, - "$page": null, - "$per_page": null - } - }, - - "get-following": { - "url": "/user/following", - "method": "GET", - "params": { - "$page": null, - "$per_page": null - } - }, - - "get-follow-user": { - "url": "/user/following/:user", - "method": "GET", - "params": { - "$user": null, - "$page": null, - "$per_page": null - } - }, - - "follow-user": { - "url": "/user/following/:user", - "method": "PUT", - "params": { - "$user": null - } - }, - - "un-follow-user": { - "url": "/user/following/:user", - "method": "DELETE", - "params": { - "$user": null - } - }, - - "get-keys": { - "url": "/user/keys", - "method": "GET", - "params": { - "$page": null, - "$per_page": null - } - }, - - "get-keys-from-user": { - "url": "/users/:user/keys", - "method": "GET", - "params": { - "$user": null, - "$page": null, - "$per_page": null - } - }, - - "get-key": { - "url": "/user/keys/:id", - "method": "GET", - "params": { - "$id": null - } - }, - - "create-key": { - "url": "/user/keys", - "method": "POST", - "params": { - "$title": null, - "$key": null - } - }, - - "update-key": { - "url": "/user/keys/:id", - "method": "PATCH", - "params": { - "$id": null, - "$title": null, - "$key": null - } - }, - - "delete-key": { - "url": "/user/keys/:id", - "method": "DELETE", - "params": { - "$id": null - } - } - }, - - "events": { - "get": { - "url": "/events", - "method": "GET", - "params": { - "$page": null, - "$per_page": null - } - }, - - "get-from-repo": { - "url": "/repos/:user/:repo/events", - "method": "GET", - "params": { - "$user": null, - "$repo": null, - "$page": null, - "$per_page": null - } - }, - - "get-from-repo-issues": { - "url": "/repos/:user/:repo/issues/events", - "method": "GET", - "params": { - "$user": null, - "$repo": null, - "$page": null, - "$per_page": null - } - }, - - "get-from-repo-network": { - "url": "/networks/:user/:repo/events", - "method": "GET", - "params": { - "$user": null, - "$repo": null, - "$page": null, - "$per_page": null - } - }, - - "get-from-org": { - "url": "/orgs/:org/events", - "method": "GET", - "params": { - "$org": null, - "$page": null, - "$per_page": null - } - }, - - "get-received": { - "url": "/users/:user/received_events", - "method": "GET", - "params": { - "$user": null, - "$page": null, - "$per_page": null - } - }, - - "get-received-public": { - "url": "/users/:user/received_events/public", - "method": "GET", - "params": { - "$user": null, - "$page": null, - "$per_page": null - } - }, - - "get-from-user": { - "url": "/users/:user/events", - "method": "GET", - "params": { - "$user": null, - "$page": null, - "$per_page": null - } - }, - - "get-from-user-public": { - "url": "/users/:user/events/public", - "method": "GET", - "params": { - "$user": null, - "$page": null, - "$per_page": null - } - }, - - "get-from-user-org": { - "url": "/users/:user/events/orgs/:org", - "method": "GET", - "params": { - "$user": null, - "$org": null, - "$page": null, - "$per_page": null - } - } - }, - - "releases": { - "list-releases": { - "url": "/repos/:owner/:repo/releases", - "method": "GET", - "params": { - "owner": { - "type": "String", - "required": true, - "validation": "", - "invalidmsg": "", - "description": "" - }, - "$repo": null, - "$page": null, - "$per_page": null - } - }, - "get-release": { - "url": "/repos/:owner/:repo/releases/:id", - "method": "GET", - "params": { - "owner": { - "type": "String", - "required": true, - "validation": "", - "invalidmsg": "", - "description": "" - }, - "id": { - "type": "Number", - "required": true, - "validation": "", - "invalidmsg": "", - "description": "" - }, - "$repo": null - } - }, - "create-release": { - "url": "/repos/:owner/:repo/releases", - "method": "POST", - "params": { - "owner": { - "type": "String", - "required": true, - "validation": "", - "invalidmsg": "", - "description": "" - }, - "$repo": null, - "tag_name": { - "type": "String", - "required": true, - "validation": "", - "invalidmsg": "", - "description": "String of the tag" - }, - "target_commitish": { - "type": "String", - "required": false, - "validation": "", - "invalidmsg": "", - "description": "Specifies the commitish value that determines where the Git tag is created from. Can be any branch or commit SHA. Unused if the Git tag already exists. Default: the repository's default branch (usually master)." - }, - "name": { - "type": "String", - "required": false, - "validation": "", - "invalidmsg": "", - "description": "" - }, - "body": { - "type": "String", - "required": false, - "validation": "", - "invalidmsg": "", - "description": "" - }, - "draft": { - "type": "Boolean", - "validation": "", - "invalidmsg": "", - "description": "true to create a draft (unpublished) release, false to create a published one. Default: false" - }, - "prerelease": { - "type": "Boolean", - "validation": "", - "invalidmsg": "", - "description": "true to identify the release as a prerelease. false to identify the release as a full release. Default: false" - } - } - }, - "edit-release": { - "url": "/repos/:owner/:repo/releases/:id", - "method": "PATCH", - "params": { - "owner": { - "type": "String", - "required": true, - "validation": "", - "invalidmsg": "", - "description": "" - }, - "id": { - "type": "Number", - "required": true, - "validation": "", - "invalidmsg": "", - "description": "" - }, - "$repo": null, - "tag_name": { - "type": "String", - "required": true, - "validation": "", - "invalidmsg": "", - "description": "String of the tag" - }, - "target_commitish": { - "type": "String", - "required": false, - "validation": "", - "invalidmsg": "", - "description": "Specifies the commitish value that determines where the Git tag is created from. Can be any branch or commit SHA. Unused if the Git tag already exists. Default: the repositoryÕs default branch (usually master)." - }, - "name": { - "type": "String", - "required": false, - "validation": "", - "invalidmsg": "", - "description": "" - }, - "body": { - "type": "String", - "required": false, - "validation": "", - "invalidmsg": "", - "description": "" - }, - "draft": { - "type": "Boolean", - "required": false, - "validation": "", - "invalidmsg": "", - "description": "true to create a draft (unpublished) release, false to create a published one. Default: false" - }, - "prerelease": { - "type": "Boolean", - "required": false, - "validation": "", - "invalidmsg": "", - "description": "true to identify the release as a prerelease. false to identify the release as a full release. Default: false" - } - } - }, - "delete-release": { - "url": "/repos/:owner/:repo/releases/:id", - "method": "DELETE", - "params": { - "owner": { - "type": "String", - "required": true, - "validation": "", - "invalidmsg": "", - "description": "" - }, - "id": { - "type": "Number", - "required": true, - "validation": "", - "invalidmsg": "", - "description": "" - }, - "$repo": null - } - }, - "list-assets": { - "url": "/repos/:owner/:repo/releases/:id/assets", - "method": "GET", - "params": { - "owner": { - "type": "String", - "required": true, - "validation": "", - "invalidmsg": "", - "description": "" - }, - "id": { - "type": "Number", - "required": true, - "validation": "", - "invalidmsg": "", - "description": "" - }, - "$repo": null - } - }, - "get-asset": { - "url": "/repos/:owner/:repo/releases/assets/:id", - "method": "GET", - "params": { - "owner": { - "type": "String", - "required": true, - "validation": "", - "invalidmsg": "", - "description": "" - }, - "id": { - "type": "Number", - "required": true, - "validation": "", - "invalidmsg": "", - "description": "" - }, - "$repo": null - } - }, - "edit-asset": { - "url": "/repos/:owner/:repo/releases/assets/:id", - "method": "PATCH", - "params": { - "owner": { - "type": "String", - "required": true, - "validation": "", - "invalidmsg": "", - "description": "" - }, - "id": { - "type": "Number", - "required": true, - "validation": "", - "invalidmsg": "", - "description": "" - }, - "$repo": null, - "$name": null, - "label": { - "type": "String", - "required": false, - "validation": "", - "invalidmsg": "", - "description": "An alternate short description of the asset. Used in place of the filename." - } - } - }, - "delete-asset": { - "url": "/repos/:owner/:repo/releases/assets/:id", - "method": "DELETE", - "params": { - "owner": { - "type": "String", - "required": true, - "validation": "", - "invalidmsg": "", - "description": "" - }, - "id": { - "type": "Number", - "required": true, - "validation": "", - "invalidmsg": "", - "description": "" - }, - "$repo": null - } - } - }, - - "search": { - "issues": { - "url": "/search/issues", - "method": "GET", - "params": { - "$q": null, - "sort": { - "type": "String", - "required": false, - "validation": "^(comments|created|updated)$", - "invalidmsg": "comments, created, or updated", - "description": "comments, created, or updated" - }, - "$order": null - } - }, - - "repos": { - "url": "/search/repositories", - "method": "GET", - "params": { - "$q": null, - "sort": { - "type": "String", - "required": false, - "validation": "^(stars|forks|updated)$", - "invalidmsg": "One of stars, forks, or updated. Default: results are sorted by best match.", - "description": "stars, forks, or updated" - }, - "$order": null - } - }, - - "users": { - "url": "/search/users", - "method": "GET", - "params": { - "$q": null, - "sort": { - "type": "String", - "required": false, - "validation": "^(followers|repositories|joined)$", - "invalidmsg": "Can be followers, repositories, or joined. Default: results are sorted by best match.", - "description": "followers, repositories, or joined" - }, - "$order": null - } - }, - - "email": { - "url": "/legacy/user/email/:email", - "method": "GET", - "params": { - "email": { - "type": "String", - "required": true, - "validation": "", - "invalidmsg": "", - "description": "Email address" - } - } - } - }, - - "markdown": { - "render": { - "url": "/markdown", - "method": "POST", - "params": { - "text": { - "type": "String", - "required": true, - "validation": "", - "invalidmsg": "", - "description": "The Markdown text to render" - }, - "mode": { - "type": "String", - "required": false, - "validation": "^(markdown|gfm)$", - "invalidmsg": "", - "description": "The rendering mode, `markdown` to render a document as plain Markdown, just like README files are rendered. `gfm` to render a document as user-content, e.g. like user comments or issues are rendered. In GFM mode, hard line breaks are always taken into account, and issue and user mentions are linked accordingly." - }, - "context": { - "type": "String", - "required": false, - "validation": "", - "invalidmsg": "", - "description": "The repository context, only taken into account when rendering as `gfm`" - } - } - } - }, - - "gitignore": { - "templates": { - "url": "/gitignore/templates", - "method": "GET", - "params": { } - }, - "template": { - "url": "/gitignore/templates/:name", - "method": "GET", - "params": { - "name": { - "type": "String", - "required": true, - "validation": "", - "invalidmsg": "", - "description": "The name of the .gitignore template to get" - } - } - } - }, - - "misc": { - "emojis": { - "url": "/emojis", - "method": "GET", - "params": { } - }, - "meta": { - "url": "/meta", - "method": "GET", - "params": { } - }, - "rate-limit": { - "url": "/rate_limit", - "method": "GET", - "params": { } - } - } -} diff --git a/api/v3.0.0/search.js b/api/v3.0.0/search.js deleted file mode 100644 index edbf67d1ad..0000000000 --- a/api/v3.0.0/search.js +++ /dev/null @@ -1,188 +0,0 @@ -/** - * mixin search - * - * Copyright 2012 Cloud9 IDE, Inc. - * - * This product includes software developed by - * Cloud9 IDE, Inc (http://c9.io). - * - * Author: Mike de Boer - **/ - -"use strict"; - -var error = require("./../../error"); -var Util = require("./../../util"); - -var search = module.exports = { - search: {} -}; - -(function() { - /** section: github - * search#issues(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - q (String): Required. Search Term - * - sort (String): Optional. comments, created, or updated Validation rule: ` ^(comments|created|updated)$ `. - * - order (String): Optional. asc or desc Validation rule: ` ^(asc|desc)$ `. - **/ - this.issues = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * search#repos(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - q (String): Required. Search Term - * - sort (String): Optional. stars, forks, or updated Validation rule: ` ^(stars|forks|updated)$ `. - * - order (String): Optional. asc or desc Validation rule: ` ^(asc|desc)$ `. - **/ - this.repos = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * search#users(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - q (String): Required. Search Term - * - sort (String): Optional. followers, repositories, or joined Validation rule: ` ^(followers|repositories|joined)$ `. - * - order (String): Optional. asc or desc Validation rule: ` ^(asc|desc)$ `. - **/ - this.users = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * search#email(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - email (String): Required. Email address - **/ - this.email = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - -}).call(search.search); diff --git a/api/v3.0.0/searchTest.js b/api/v3.0.0/searchTest.js deleted file mode 100644 index 68fefa65c9..0000000000 --- a/api/v3.0.0/searchTest.js +++ /dev/null @@ -1,103 +0,0 @@ -/* - * Copyright 2012 Cloud9 IDE, Inc. - * - * This product includes software developed by - * Cloud9 IDE, Inc (http://c9.io). - * - * Author: Mike de Boer - */ - -"use strict"; - -var Assert = require("assert"); -var Client = require("./../../index"); - -describe("[search]", function() { - var client; - var token = "c286e38330e15246a640c2cf32a45ea45d93b2ba"; - - beforeEach(function() { - client = new Client({ - version: "3.0.0" - }); - /*client.authenticate({ - type: "oauth", - token: token - });*/ - }); - - it("should successfully execute GET /search/issues/:q (issues)", function(next) { - client.search.issues( - { - q: ['macaroni', 'repo:mikedeboertest/node_chat', 'state:open'].join('+') - }, - function(err, res) { - Assert.equal(err, null); - Assert.equal(res.items.length, 1); - var issue = res.items[0]; - Assert.equal(issue.title, "My First Issue"); - Assert.equal(issue.state, "open"); - - next(); - } - ); - }); - - it("should successfully execute GET /search/repositories/:q (repos)", function(next) { - client.search.repos( - { - q: ['pasta', 'language:JavaScript'].join('+') - }, - function(err, res) { - Assert.equal(err, null); - Assert.ok(res.items.length > 0); - Assert.equal(res.items[0].language, "JavaScript"); - - next(); - } - ); - }); - - it("should successfully execute GET /search/users/:q (users)", function(next) { - client.search.users( - { - q: "mikedeboer" - }, - function(err, res) { - Assert.equal(err, null); - Assert.equal(res.items.length, 2); - var user = res.items[0]; - Assert.equal(user.login, "mikedeboer"); - - client.search.users( - { - q: "location:Jyväskylä" - }, - function(err, res) { - Assert.equal(err, null); - //XXX: this is likely to change often. I added this for - // issue #159. - Assert.equal(res.items.length, 30); - var user = res.items[0]; - Assert.equal(user.login, "bebraw"); - - next(); - } - ); - } - ); - }); - - /*it("should successfully execute GET /search/user/email/:email (email)", function(next) { - client.search.email( - { - email: "String" - }, - function(err, res) { - Assert.equal(err, null); - // other assertions go here - next(); - } - ); - });*/ -}); diff --git a/api/v3.0.0/statuses.js b/api/v3.0.0/statuses.js deleted file mode 100644 index c924334e18..0000000000 --- a/api/v3.0.0/statuses.js +++ /dev/null @@ -1,109 +0,0 @@ -/** - * mixin statuses - * - * Copyright 2012 Cloud9 IDE, Inc. - * - * This product includes software developed by - * Cloud9 IDE, Inc (http://c9.io). - * - * Author: Mike de Boer - **/ - -"use strict"; - -var error = require("./../../error"); -var Util = require("./../../util"); - -var statuses = module.exports = { - statuses: {} -}; - -(function() { - /** section: github - * statuses#get(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - sha (String): Required. - **/ - this.get = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * statuses#create(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - repo (String): Required. - * - sha (String): Required. - * - state (String): Required. State of the status - can be one of pending, success, error, or failure. Validation rule: ` ^(pending|success|error|failure)$ `. - * - target_url (String): Optional. Target url to associate with this status. This URL will be linked from the GitHub UI to allow users to easily see the ‘source’ of the Status. - * - description (String): Optional. Short description of the status. - **/ - this.create = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - -}).call(statuses.statuses); diff --git a/api/v3.0.0/statusesTest.js b/api/v3.0.0/statusesTest.js deleted file mode 100644 index b00d6f6f38..0000000000 --- a/api/v3.0.0/statusesTest.js +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright 2012 Cloud9 IDE, Inc. - * - * This product includes software developed by - * Cloud9 IDE, Inc (http://c9.io). - * - * Author: Mike de Boer - */ - -"use strict"; - -var Assert = require("assert"); -var Client = require("./../../index"); - -describe("[statuses]", function() { - var client; - var token = "c286e38330e15246a640c2cf32a45ea45d93b2ba"; - - beforeEach(function() { - client = new Client({ - version: "3.0.0" - }); - client.authenticate({ - type: "oauth", - token: token - }); - }); - - it("should successfully execute GET /repos/:user/:repo/statuses/:sha (get)", function(next) { - client.statuses.get( - { - user: "mikedeboer", - repo: "node-github", - sha: "30d607d8fd8002427b61273f25d442c233cbf631" - }, - function(err, res) { - Assert.equal(err, null); - // other assertions go here - next(); - } - ); - }); - - it("should successfully execute POST /repos/:user/:repo/statuses/:sha (create)", function(next) { - client.statuses.create( - { - user: "String", - repo: "String", - sha: "String", - state: "String", - target_url: "String", - description: "String" - }, - function(err, res) { - Assert.equal(err, null); - // other assertions go here - next(); - } - ); - }); -}); diff --git a/api/v3.0.0/user.js b/api/v3.0.0/user.js deleted file mode 100644 index 21a21ba688..0000000000 --- a/api/v3.0.0/user.js +++ /dev/null @@ -1,844 +0,0 @@ -/** - * mixin user - * - * Copyright 2012 Cloud9 IDE, Inc. - * - * This product includes software developed by - * Cloud9 IDE, Inc (http://c9.io). - * - * Author: Mike de Boer - **/ - -"use strict"; - -var error = require("./../../error"); -var Util = require("./../../util"); - -var user = module.exports = { - user: {} -}; - -(function() { - /** section: github - * user#getFrom(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - **/ - this.getFrom = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * user#get(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * No other params, simply pass an empty Object literal `{}` - **/ - this.get = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * user#update(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - name (String): Optional. - * - email (String): Optional. - * - blog (String): Optional. - * - company (String): Optional. - * - location (String): Optional. - * - hireable (Boolean): Optional. - * - bio (String): Optional. - **/ - this.update = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * user#getOrgs(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. - * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. - **/ - this.getOrgs = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * user#getTeams(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. - * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. - **/ - this.getTeams = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * user#getEmails(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. - * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. - **/ - this.getEmails = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * user#addEmails(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * No other params, simply pass an empty Object literal `{}` - **/ - this.addEmails = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * user#deleteEmails(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * No other params, simply pass an empty Object literal `{}` - **/ - this.deleteEmails = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * user#getFollowers(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. - * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. - **/ - this.getFollowers = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * user#getFollowingFromUser(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. - * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. - **/ - this.getFollowingFromUser = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * user#getFollowing(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. - * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. - **/ - this.getFollowing = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * user#getFollowUser(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. - * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. - **/ - this.getFollowUser = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * user#followUser(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - **/ - this.followUser = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * user#unFollowUser(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - **/ - this.unFollowUser = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * user#getKeys(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. - * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. - **/ - this.getKeys = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * user#getKeysFromUser(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - user (String): Required. - * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. - * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. - **/ - this.getKeysFromUser = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * user#getKey(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - id (String): Required. - **/ - this.getKey = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * user#createKey(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - title (String): Required. - * - key (String): Required. - **/ - this.createKey = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * user#updateKey(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - id (String): Required. - * - title (String): Required. - * - key (String): Required. - **/ - this.updateKey = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - - /** section: github - * user#deleteKey(msg, callback) -> null - * - msg (Object): Object that contains the parameters and their values to be sent to the server. - * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. - * - * ##### Params on the `msg` object: - * - * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. - * - id (String): Required. - **/ - this.deleteKey = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); - }; - -}).call(user.user); diff --git a/doc/apidoc.js b/doc/apidoc.js new file mode 100644 index 0000000000..be964bf599 --- /dev/null +++ b/doc/apidoc.js @@ -0,0 +1,28714 @@ +/** + * @api {get} /notifications/threads/:id/subscription checkNotificationThreadSubscription + * @apiVersion 5.0.0 + * @apiName checkNotificationThreadSubscription + * @apiDescription Check to see if the current user is subscribed to a thread. + * @apiGroup activity + * + * @apiParam {String} id + * @apiExample {js} ex: +github.activity.checkNotificationThreadSubscription({ ... }); + */ + +/** + * @api {get} /user/starred/:owner/:repo checkStarringRepo + * @apiVersion 5.0.0 + * @apiName checkStarringRepo + * @apiDescription Check if you are starring a repository + * @apiGroup activity + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.activity.checkStarringRepo({ ... }); + */ + +/** + * @api {delete} /notifications/threads/:id/subscription deleteNotificationThreadSubscription + * @apiVersion 5.0.0 + * @apiName deleteNotificationThreadSubscription + * @apiDescription Delete a notification thread subscription. + * @apiGroup activity + * + * @apiParam {String} id + * @apiExample {js} ex: +github.activity.deleteNotificationThreadSubscription({ ... }); + */ + +/** + * @api {get} /events getEvents + * @apiVersion 5.0.0 + * @apiName getEvents + * @apiDescription List public events + * @apiGroup activity + * + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.activity.getEvents({ ... }); + */ + +/** + * @api {get} /orgs/:org/events getEventsForOrg + * @apiVersion 5.0.0 + * @apiName getEventsForOrg + * @apiDescription List public events for an organization + * @apiGroup activity + * + * @apiParam {String} org + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.activity.getEventsForOrg({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/events getEventsForRepo + * @apiVersion 5.0.0 + * @apiName getEventsForRepo + * @apiDescription List repository events + * @apiGroup activity + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.activity.getEventsForRepo({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/issues/events getEventsForRepoIssues + * @apiVersion 5.0.0 + * @apiName getEventsForRepoIssues + * @apiDescription List issue events for a repository + * @apiGroup activity + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.activity.getEventsForRepoIssues({ ... }); + */ + +/** + * @api {get} /networks/:owner/:repo/events getEventsForRepoNetwork + * @apiVersion 5.0.0 + * @apiName getEventsForRepoNetwork + * @apiDescription List public events for a network of repositories + * @apiGroup activity + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.activity.getEventsForRepoNetwork({ ... }); + */ + +/** + * @api {get} /users/:owner/events getEventsForUser + * @apiVersion 5.0.0 + * @apiName getEventsForUser + * @apiDescription List events performed by a user + * @apiGroup activity + * + * @apiParam {String} owner + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.activity.getEventsForUser({ ... }); + */ + +/** + * @api {get} /users/:owner/events/orgs/:org getEventsForUserOrg + * @apiVersion 5.0.0 + * @apiName getEventsForUserOrg + * @apiDescription List events for a user's organization + * @apiGroup activity + * + * @apiParam {String} owner + * @apiParam {String} org + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.activity.getEventsForUserOrg({ ... }); + */ + +/** + * @api {get} /users/:owner/events/public getEventsForUserPublic + * @apiVersion 5.0.0 + * @apiName getEventsForUserPublic + * @apiDescription List public events performed by a user + * @apiGroup activity + * + * @apiParam {String} owner + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.activity.getEventsForUserPublic({ ... }); + */ + +/** + * @api {get} /users/:owner/received_events getEventsReceived + * @apiVersion 5.0.0 + * @apiName getEventsReceived + * @apiDescription List events that a user has received + * @apiGroup activity + * + * @apiParam {String} owner + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.activity.getEventsReceived({ ... }); + */ + +/** + * @api {get} /users/:owner/received_events/public getEventsReceivedPublic + * @apiVersion 5.0.0 + * @apiName getEventsReceivedPublic + * @apiDescription List public events that a user has received + * @apiGroup activity + * + * @apiParam {String} owner + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.activity.getEventsReceivedPublic({ ... }); + */ + +/** + * @api {get} /feeds getFeeds + * @apiVersion 5.0.0 + * @apiName getFeeds + * @apiDescription Get all feeds available for the authenticated user. + * @apiGroup activity + * + * @apiExample {js} ex: +github.activity.getFeeds({ ... }); + */ + +/** + * @api {get} /notifications/threads/:id getNotificationThread + * @apiVersion 5.0.0 + * @apiName getNotificationThread + * @apiDescription View a single notification thread. + * @apiGroup activity + * + * @apiParam {String} id + * @apiExample {js} ex: +github.activity.getNotificationThread({ ... }); + */ + +/** + * @api {get} /notifications getNotifications + * @apiVersion 5.0.0 + * @apiName getNotifications + * @apiDescription Get all notifications for the current user, grouped by repository. + * @apiGroup activity + * + * @apiParam {Boolean} [all=false] If true, show notifications marked as read. Default: false + * @apiParam {Boolean} [participating=false] If true, only shows notifications in which the user is directly participating or mentioned. Default: false + * @apiParam {Date} [since] Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ + * @apiParam {String} [before] Only show notifications updated before the given time. This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ. + * @apiExample {js} ex: +github.activity.getNotifications({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/notifications getNotificationsForUser + * @apiVersion 5.0.0 + * @apiName getNotificationsForUser + * @apiDescription Get all notifications for the given user. + * @apiGroup activity + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Boolean} [all=false] If true, show notifications marked as read. Default: false + * @apiParam {Boolean} [participating=false] If true, only shows notifications in which the user is directly participating or mentioned. Default: false + * @apiParam {Date} [since] Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ + * @apiParam {String} [before] Only show notifications updated before the given time. This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ. + * @apiExample {js} ex: +github.activity.getNotificationsForUser({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/subscription getRepoSubscription + * @apiVersion 5.0.0 + * @apiName getRepoSubscription + * @apiDescription Get a Repository Subscription. + * @apiGroup activity + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.activity.getRepoSubscription({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/stargazers getStargazersForRepo + * @apiVersion 5.0.0 + * @apiName getStargazersForRepo + * @apiDescription List Stargazers + * @apiGroup activity + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.activity.getStargazersForRepo({ ... }); + */ + +/** + * @api {get} /user/starred getStarredRepos + * @apiVersion 5.0.0 + * @apiName getStarredRepos + * @apiDescription List repositories being starred by the authenticated user + * @apiGroup activity + * + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.activity.getStarredRepos({ ... }); + */ + +/** + * @api {get} /users/:owner/starred getStarredReposForUser + * @apiVersion 5.0.0 + * @apiName getStarredReposForUser + * @apiDescription List repositories being starred by a user + * @apiGroup activity + * + * @apiParam {String} owner + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.activity.getStarredReposForUser({ ... }); + */ + +/** + * @api {get} /user/subscriptions getWatchedRepos + * @apiVersion 5.0.0 + * @apiName getWatchedRepos + * @apiDescription List repositories being watched by the authenticated user. + * @apiGroup activity + * + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.activity.getWatchedRepos({ ... }); + */ + +/** + * @api {get} /users/:owner/subscriptions getWatchedReposForUser + * @apiVersion 5.0.0 + * @apiName getWatchedReposForUser + * @apiDescription List repositories being watched by a user. + * @apiGroup activity + * + * @apiParam {String} owner + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.activity.getWatchedReposForUser({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/subscribers getWatchersForRepo + * @apiVersion 5.0.0 + * @apiName getWatchersForRepo + * @apiDescription Get watchers for repository. + * @apiGroup activity + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.activity.getWatchersForRepo({ ... }); + */ + +/** + * @api {patch} /notifications/threads/:id markNotificationThreadAsRead + * @apiVersion 5.0.0 + * @apiName markNotificationThreadAsRead + * @apiDescription Mark a notification thread as read. + * @apiGroup activity + * + * @apiParam {String} id + * @apiExample {js} ex: +github.activity.markNotificationThreadAsRead({ ... }); + */ + +/** + * @api {put} /notifications markNotificationsAsRead + * @apiVersion 5.0.0 + * @apiName markNotificationsAsRead + * @apiDescription Mark notifications as read for authenticated user. + * @apiGroup activity + * + * @apiParam {String} [last_read_at=Time.now] Describes the last point that notifications were checked. Anything updated since this time will not be updated. This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ. Default: Time.now + * @apiExample {js} ex: +github.activity.markNotificationsAsRead({ ... }); + */ + +/** + * @api {put} /repos/:owner/:repo/notifications markNotificationsAsReadForRepo + * @apiVersion 5.0.0 + * @apiName markNotificationsAsReadForRepo + * @apiDescription Mark notifications in a repo as read. + * @apiGroup activity + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} [last_read_at=Time.now] Describes the last point that notifications were checked. Anything updated since this time will not be updated. This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ. Default: Time.now + * @apiExample {js} ex: +github.activity.markNotificationsAsReadForRepo({ ... }); + */ + +/** + * @api {put} /notifications/threads/:id/subscription setNotificationThreadSubscription + * @apiVersion 5.0.0 + * @apiName setNotificationThreadSubscription + * @apiDescription This lets you subscribe or unsubscribe from a conversation. Unsubscribing from a conversation mutes all future notifications (until you comment or get @mentioned once more). + * @apiGroup activity + * + * @apiParam {String} id + * @apiParam {Boolean} [subscribed] Determines if notifications should be received from this thread + * @apiParam {Boolean} [ignored] Determines if all notifications should be blocked from this thread + * @apiExample {js} ex: +github.activity.setNotificationThreadSubscription({ ... }); + */ + +/** + * @api {put} /repos/:owner/:repo/subscription setRepoSubscription + * @apiVersion 5.0.0 + * @apiName setRepoSubscription + * @apiDescription Set a Repository Subscription + * @apiGroup activity + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Boolean} [subscribed] Determines if notifications should be received from this repository. + * @apiParam {Boolean} [ignored] Determines if all notifications should be blocked from this repository. + * @apiExample {js} ex: +github.activity.setRepoSubscription({ ... }); + */ + +/** + * @api {put} /user/starred/:owner/:repo starRepo + * @apiVersion 5.0.0 + * @apiName starRepo + * @apiDescription Star a repository + * @apiGroup activity + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiExample {js} ex: +github.activity.starRepo({ ... }); + */ + +/** + * @api {delete} /user/starred/:owner/:repo unstarRepo + * @apiVersion 5.0.0 + * @apiName unstarRepo + * @apiDescription Unstar a repository + * @apiGroup activity + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiExample {js} ex: +github.activity.unstarRepo({ ... }); + */ + +/** + * @api {delete} /repos/:owner/:repo/subscription unwatchRepo + * @apiVersion 5.0.0 + * @apiName unwatchRepo + * @apiDescription Unwatch a repository. + * @apiGroup activity + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiExample {js} ex: +github.activity.unwatchRepo({ ... }); + */ + +/** + * @api {get} /applications/:client_id/tokens/:access_token check + * @apiVersion 5.0.0 + * @apiName check + * @apiDescription Check an authorization + * @apiGroup authorization + * + * @apiParam {String} access_token OAuth token + * @apiParam {String} [client_id] The 20 character OAuth app client key for which to create the token. + * @apiExample {js} ex: +github.authorization.check({ ... }); + */ + +/** + * @api {post} /authorizations create + * @apiVersion 5.0.0 + * @apiName create + * @apiDescription Create a new authorization + * @apiGroup authorization + * + * @apiParam {Array} [scopes] A list of scopes that this authorization is in. + * @apiParam {String} [note] A note to remind you what the OAuth token is for. + * @apiParam {String} [note_url] A URL to remind you what app the OAuth token is for. + * @apiParam {String} [client_id] The 20 character OAuth app client key for which to create the token. + * @apiParam {String} [client_secret] The 40 character OAuth app client secret for which to create the token. + * @apiParam {String} [fingerprint] A unique string to distinguish an authorization from others created for the same client ID and user. + * @apiExample {js} ex: +github.authorization.create({ ... }); + */ + +/** + * @api {delete} /authorizations/:id delete + * @apiVersion 5.0.0 + * @apiName delete + * @apiDescription Delete an authorization + * @apiGroup authorization + * + * @apiParam {String} id + * @apiExample {js} ex: +github.authorization.delete({ ... }); + */ + +/** + * @api {delete} /applications/grants/:id deleteGrant + * @apiVersion 5.0.0 + * @apiName deleteGrant + * @apiDescription Delete a grant. (In preview period. See README.) + * @apiGroup authorization + * + * @apiParam {String} id + * @apiExample {js} ex: +github.authorization.deleteGrant({ ... }); + */ + +/** + * @api {get} /authorizations/:id get + * @apiVersion 5.0.0 + * @apiName get + * @apiDescription Get a single authorization + * @apiGroup authorization + * + * @apiParam {String} id + * @apiExample {js} ex: +github.authorization.get({ ... }); + */ + +/** + * @api {get} /authorizations getAll + * @apiVersion 5.0.0 + * @apiName getAll + * @apiDescription List your authorizations + * @apiGroup authorization + * + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.authorization.getAll({ ... }); + */ + +/** + * @api {get} /applications/grants/:id getGrant + * @apiVersion 5.0.0 + * @apiName getGrant + * @apiDescription Get a single grant. (In preview period. See README.) + * @apiGroup authorization + * + * @apiParam {String} id + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.authorization.getGrant({ ... }); + */ + +/** + * @api {get} /applications/grants getGrants + * @apiVersion 5.0.0 + * @apiName getGrants + * @apiDescription List your grants. (In preview period. See README.) + * @apiGroup authorization + * + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.authorization.getGrants({ ... }); + */ + +/** + * @api {put} /authorizations/clients/:client_id getOrCreateAuthorizationForApp + * @apiVersion 5.0.0 + * @apiName getOrCreateAuthorizationForApp + * @apiDescription Get or create an authorization for a specific app + * @apiGroup authorization + * + * @apiParam {String} client_secret The 40 character OAuth app client secret associated with the client ID specified in the URL. + * @apiParam {String} [client_id] The 20 character OAuth app client key for which to create the token. + * @apiParam {Array} [scopes] A list of scopes that this authorization is in. + * @apiParam {String} [note] A note to remind you what the OAuth token is for. + * @apiParam {String} [note_url] A URL to remind you what app the OAuth token is for. + * @apiParam {String} [fingerprint] A unique string to distinguish an authorization from others created for the same client ID and user. + * @apiExample {js} ex: +github.authorization.getOrCreateAuthorizationForApp({ ... }); + */ + +/** + * @api {put} /authorizations/clients/:client_id/:fingerprint getOrCreateAuthorizationForAppAndFingerprint + * @apiVersion 5.0.0 + * @apiName getOrCreateAuthorizationForAppAndFingerprint + * @apiDescription Get or create an authorization for a specific app and fingerprint + * @apiGroup authorization + * + * @apiParam {String} client_secret The 40 character OAuth app client secret associated with the client ID specified in the URL. + * @apiParam {String} [client_id] The 20 character OAuth app client key for which to create the token. + * @apiParam {String} [fingerprint] A unique string to distinguish an authorization from others created for the same client ID and user. + * @apiParam {Array} [scopes] A list of scopes that this authorization is in. + * @apiParam {String} [note] A note to remind you what the OAuth token is for. + * @apiParam {String} [note_url] A URL to remind you what app the OAuth token is for. + * @apiExample {js} ex: +github.authorization.getOrCreateAuthorizationForAppAndFingerprint({ ... }); + */ + +/** + * @api {post} /applications/:client_id/tokens/:access_token reset + * @apiVersion 5.0.0 + * @apiName reset + * @apiDescription Reset an authorization + * @apiGroup authorization + * + * @apiParam {String} access_token OAuth token + * @apiParam {String} [client_id] The 20 character OAuth app client key for which to create the token. + * @apiExample {js} ex: +github.authorization.reset({ ... }); + */ + +/** + * @api {delete} /applications/:client_id/tokens/:access_token revoke + * @apiVersion 5.0.0 + * @apiName revoke + * @apiDescription Revoke an authorization for an application + * @apiGroup authorization + * + * @apiParam {String} access_token OAuth token + * @apiParam {String} [client_id] The 20 character OAuth app client key for which to create the token. + * @apiExample {js} ex: +github.authorization.revoke({ ... }); + */ + +/** + * @api {patch} /authorizations/:id update + * @apiVersion 5.0.0 + * @apiName update + * @apiDescription Update an existing authorization + * @apiGroup authorization + * + * @apiParam {String} id + * @apiParam {Array} [scopes] A list of scopes that this authorization is in. + * @apiParam {Array} [add_scopes] A list of scopes to add to this authorization. + * @apiParam {Array} [remove_scopes] A list of scopes to remove from this authorization. + * @apiParam {String} [note] A note to remind you what the OAuth token is for. + * @apiParam {String} [note_url] A URL to remind you what app the OAuth token is for. + * @apiExample {js} ex: +github.authorization.update({ ... }); + */ + +/** + * @api {post} /admin/organizations createOrg + * @apiVersion 5.0.0 + * @apiName createOrg + * @apiDescription Create an organization + * @apiGroup enterprise + * + * @apiParam {String} login The organization's username. + * @apiParam {String} admin The login of the user who will manage this organization. + * @apiParam {String} [profile_name] The organization's display name. + * @apiExample {js} ex: +github.enterprise.createOrg({ ... }); + */ + +/** + * @api {get} /enterprise/settings/license getLicense + * @apiVersion 5.0.0 + * @apiName getLicense + * @apiDescription Get license information + * @apiGroup enterprise + * + * @apiExample {js} ex: +github.enterprise.getLicense({ ... }); + */ + +/** + * @api {post} /staff/indexing_jobs queueIndexingJob + * @apiVersion 5.0.0 + * @apiName queueIndexingJob + * @apiDescription Queue an indexing job + * @apiGroup enterprise + * + * @apiParam {String} target A string representing the item to index. + * @apiExample {js} ex: +github.enterprise.queueIndexingJob({ ... }); + */ + +/** + * @api {get} /enterprise/stats/:type stats + * @apiVersion 5.0.0 + * @apiName stats + * @apiDescription Get statistics. + * @apiGroup enterprise + * + * @apiParam {String} type Possible values: issues, hooks, milestones, orgs, comments, pages, users, gists, pulls, repos, all. + * @apiExample {js} ex: +github.enterprise.stats({ ... }); + */ + +/** + * @api {post} /admin/ldap/teams/:team_id/sync syncLdapForTeam + * @apiVersion 5.0.0 + * @apiName syncLdapForTeam + * @apiDescription Sync LDAP mapping for a team. + * @apiGroup enterprise + * + * @apiParam {Number} [team_id] + * @apiExample {js} ex: +github.enterprise.syncLdapForTeam({ ... }); + */ + +/** + * @api {post} /admin/ldap/users/:user/sync syncLdapForUser + * @apiVersion 5.0.0 + * @apiName syncLdapForUser + * @apiDescription Sync LDAP mapping for a user. + * @apiGroup enterprise + * + * @apiParam {String} user + * @apiExample {js} ex: +github.enterprise.syncLdapForUser({ ... }); + */ + +/** + * @api {patch} /admin/ldap/teams/:team_id/mapping updateLdapForTeam + * @apiVersion 5.0.0 + * @apiName updateLdapForTeam + * @apiDescription Update LDAP mapping for a team. + * @apiGroup enterprise + * + * @apiParam {Number} [team_id] + * @apiExample {js} ex: +github.enterprise.updateLdapForTeam({ ... }); + */ + +/** + * @api {patch} /admin/ldap/users/:user/mapping updateLdapForUser + * @apiVersion 5.0.0 + * @apiName updateLdapForUser + * @apiDescription Update LDAP mapping for a user. + * @apiGroup enterprise + * + * @apiParam {String} user + * @apiExample {js} ex: +github.enterprise.updateLdapForUser({ ... }); + */ + +/** + * @api {get} /gists/:id/star checkStar + * @apiVersion 5.0.0 + * @apiName checkStar + * @apiDescription Check if a gist is starred + * @apiGroup gists + * + * @apiParam {String} id + * @apiExample {js} ex: +github.gists.checkStar({ ... }); + */ + +/** + * @api {post} /gists create + * @apiVersion 5.0.0 + * @apiName create + * @apiDescription Create a gist + * @apiGroup gists + * + * @apiParam {Json} files Files that make up this gist. The key of which should be a required string filename and the value another required hash with parameters: 'content' + * @apiParam {Boolean} public + * @apiParam {String} [description] + * @apiExample {js} ex: +github.gists.create({ ... }); + */ + +/** + * @api {post} /gists/:gist_id/comments createComment + * @apiVersion 5.0.0 + * @apiName createComment + * @apiDescription Create a comment + * @apiGroup gists + * + * @apiParam {String} gist_id Id (SHA1 hash) of the gist. + * @apiParam {String} body + * @apiExample {js} ex: +github.gists.createComment({ ... }); + */ + +/** + * @api {delete} /gists/:id delete + * @apiVersion 5.0.0 + * @apiName delete + * @apiDescription Delete a gist + * @apiGroup gists + * + * @apiParam {String} id + * @apiExample {js} ex: +github.gists.delete({ ... }); + */ + +/** + * @api {delete} /gists/:gist_id/comments/:id deleteComment + * @apiVersion 5.0.0 + * @apiName deleteComment + * @apiDescription Delete a comment + * @apiGroup gists + * + * @apiParam {String} gist_id Id (SHA1 hash) of the gist. + * @apiParam {String} id + * @apiExample {js} ex: +github.gists.deleteComment({ ... }); + */ + +/** + * @api {patch} /gists/:id edit + * @apiVersion 5.0.0 + * @apiName edit + * @apiDescription Edit a gist + * @apiGroup gists + * + * @apiParam {String} id + * @apiParam {Json} files Files that make up this gist. The key of which should be a required string filename and the value another required hash with parameters: 'content' + * @apiParam {String} [description] + * @apiExample {js} ex: +github.gists.edit({ ... }); + */ + +/** + * @api {patch} /gists/:gist_id/comments/:id editComment + * @apiVersion 5.0.0 + * @apiName editComment + * @apiDescription Edit a comment + * @apiGroup gists + * + * @apiParam {String} gist_id Id (SHA1 hash) of the gist. + * @apiParam {String} id + * @apiParam {String} body + * @apiExample {js} ex: +github.gists.editComment({ ... }); + */ + +/** + * @api {post} /gists/:id/forks fork + * @apiVersion 5.0.0 + * @apiName fork + * @apiDescription Fork a gist + * @apiGroup gists + * + * @apiParam {String} id + * @apiExample {js} ex: +github.gists.fork({ ... }); + */ + +/** + * @api {get} /gists/:id get + * @apiVersion 5.0.0 + * @apiName get + * @apiDescription Get a single gist + * @apiGroup gists + * + * @apiParam {String} id + * @apiExample {js} ex: +github.gists.get({ ... }); + */ + +/** + * @api {get} /gists getAll + * @apiVersion 5.0.0 + * @apiName getAll + * @apiDescription List the authenticated user's gists or if called anonymously, this will return all public gists + * @apiGroup gists + * + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiParam {Date} [since] Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ + * @apiExample {js} ex: +github.gists.getAll({ ... }); + */ + +/** + * @api {get} /gists/:gist_id/comments/:id getComment + * @apiVersion 5.0.0 + * @apiName getComment + * @apiDescription Get a single comment + * @apiGroup gists + * + * @apiParam {String} gist_id Id (SHA1 hash) of the gist. + * @apiParam {String} id + * @apiExample {js} ex: +github.gists.getComment({ ... }); + */ + +/** + * @api {get} /gists/:gist_id/comments getComments + * @apiVersion 5.0.0 + * @apiName getComments + * @apiDescription List comments on a gist + * @apiGroup gists + * + * @apiParam {String} gist_id Id (SHA1 hash) of the gist. + * @apiExample {js} ex: +github.gists.getComments({ ... }); + */ + +/** + * @api {get} /gists/:id/commits getCommits + * @apiVersion 5.0.0 + * @apiName getCommits + * @apiDescription List gist commits + * @apiGroup gists + * + * @apiParam {String} id + * @apiExample {js} ex: +github.gists.getCommits({ ... }); + */ + +/** + * @api {get} /users/:owner/gists getForUser + * @apiVersion 5.0.0 + * @apiName getForUser + * @apiDescription List a user's gists + * @apiGroup gists + * + * @apiParam {String} owner + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiParam {Date} [since] Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ + * @apiExample {js} ex: +github.gists.getForUser({ ... }); + */ + +/** + * @api {get} /gists/:id/forks getForks + * @apiVersion 5.0.0 + * @apiName getForks + * @apiDescription List gist forks + * @apiGroup gists + * + * @apiParam {String} id + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.gists.getForks({ ... }); + */ + +/** + * @api {get} /gists/public getPublic + * @apiVersion 5.0.0 + * @apiName getPublic + * @apiDescription List all public gists + * @apiGroup gists + * + * @apiParam {Date} [since] Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ + * @apiExample {js} ex: +github.gists.getPublic({ ... }); + */ + +/** + * @api {get} /gists/:id/:sha getRevision + * @apiVersion 5.0.0 + * @apiName getRevision + * @apiDescription Get a specific revision of a gist + * @apiGroup gists + * + * @apiParam {String} id + * @apiParam {String} sha + * @apiExample {js} ex: +github.gists.getRevision({ ... }); + */ + +/** + * @api {get} /gists/starred getStarred + * @apiVersion 5.0.0 + * @apiName getStarred + * @apiDescription List the authenticated user's starred gists + * @apiGroup gists + * + * @apiParam {Date} [since] Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ + * @apiExample {js} ex: +github.gists.getStarred({ ... }); + */ + +/** + * @api {put} /gists/:id/star star + * @apiVersion 5.0.0 + * @apiName star + * @apiDescription Star a gist + * @apiGroup gists + * + * @apiParam {String} id + * @apiExample {js} ex: +github.gists.star({ ... }); + */ + +/** + * @api {delete} /gists/:id/star unstar + * @apiVersion 5.0.0 + * @apiName unstar + * @apiDescription Unstar a gist + * @apiGroup gists + * + * @apiParam {String} id + * @apiExample {js} ex: +github.gists.unstar({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/git/blobs createBlob + * @apiVersion 5.0.0 + * @apiName createBlob + * @apiDescription Create a Blob + * @apiGroup gitdata + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} content + * @apiParam {String} encoding + * @apiExample {js} ex: +github.gitdata.createBlob({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/git/commits createCommit + * @apiVersion 5.0.0 + * @apiName createCommit + * @apiDescription Create a Commit + * @apiGroup gitdata + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} message String of the commit message + * @apiParam {String} tree String of the SHA of the tree object this commit points to + * @apiParam {Array} parents Array of the SHAs of the commits that were the parents of this commit. If omitted or empty, the commit will be written as a root commit. For a single parent, an array of one SHA should be provided, for a merge commit, an array of more than one should be provided. + * @apiParam {Json} [author] + * @apiParam {Json} [committer] + * @apiExample {js} ex: +github.gitdata.createCommit({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/git/refs createReference + * @apiVersion 5.0.0 + * @apiName createReference + * @apiDescription Create a Reference + * @apiGroup gitdata + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} ref String of the name of the fully qualified reference (ie: heads/master). If it doesn’t have at least one slash, it will be rejected. + * @apiParam {String} sha + * @apiExample {js} ex: +github.gitdata.createReference({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/git/tags createTag + * @apiVersion 5.0.0 + * @apiName createTag + * @apiDescription Create a Tag Object + * @apiGroup gitdata + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} tag String of the tag + * @apiParam {String} message String of the tag message + * @apiParam {String} object String of the SHA of the git object this is tagging + * @apiParam {String} type String of the type of the object we’re tagging. Normally this is a commit but it can also be a tree or a blob. + * @apiParam {Json} tagger JSON object that contains the following keys: `name` - String of the name of the author of the tag, `email` - String of the email of the author of the tag, `date` - Timestamp of when this object was tagged + * @apiExample {js} ex: +github.gitdata.createTag({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/git/trees createTree + * @apiVersion 5.0.0 + * @apiName createTree + * @apiDescription Create a Tree + * @apiGroup gitdata + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Json} tree Array of Hash objects (of path, mode, type and sha) specifying a tree structure + * @apiParam {String} [base_tree] String of the SHA1 of the tree you want to update with new data + * @apiExample {js} ex: +github.gitdata.createTree({ ... }); + */ + +/** + * @api {delete} /repos/:owner/:repo/git/refs/:ref deleteReference + * @apiVersion 5.0.0 + * @apiName deleteReference + * @apiDescription Delete a Reference + * @apiGroup gitdata + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} ref String of the name of the fully qualified reference (ie: heads/master). If it doesn’t have at least one slash, it will be rejected. + * @apiExample {js} ex: +github.gitdata.deleteReference({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/git/blobs/:sha getBlob + * @apiVersion 5.0.0 + * @apiName getBlob + * @apiDescription Get a Blob + * @apiGroup gitdata + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} sha + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.gitdata.getBlob({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/git/commits/:sha getCommit + * @apiVersion 5.0.0 + * @apiName getCommit + * @apiDescription Get a Commit + * @apiGroup gitdata + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} sha + * @apiExample {js} ex: +github.gitdata.getCommit({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/git/commits/:sha getCommitSignatureVerification + * @apiVersion 5.0.0 + * @apiName getCommitSignatureVerification + * @apiDescription Get a Commit Signature Verification. (In preview period. See README.) + * @apiGroup gitdata + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} sha + * @apiExample {js} ex: +github.gitdata.getCommitSignatureVerification({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/git/refs/:ref getReference + * @apiVersion 5.0.0 + * @apiName getReference + * @apiDescription Get a Reference + * @apiGroup gitdata + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} ref String of the name of the fully qualified reference (ie: heads/master). If it doesn’t have at least one slash, it will be rejected. + * @apiExample {js} ex: +github.gitdata.getReference({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/git/refs getReferences + * @apiVersion 5.0.0 + * @apiName getReferences + * @apiDescription Get all References + * @apiGroup gitdata + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.gitdata.getReferences({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/git/tags/:sha getTag + * @apiVersion 5.0.0 + * @apiName getTag + * @apiDescription Get a Tag + * @apiGroup gitdata + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} sha + * @apiExample {js} ex: +github.gitdata.getTag({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/git/tags/:sha getTagSignatureVerification + * @apiVersion 5.0.0 + * @apiName getTagSignatureVerification + * @apiDescription Get a Tag Signature Verification. (In preview period. See README.) + * @apiGroup gitdata + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} sha + * @apiExample {js} ex: +github.gitdata.getTagSignatureVerification({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/git/refs/tags getTags + * @apiVersion 5.0.0 + * @apiName getTags + * @apiDescription Get all tag References + * @apiGroup gitdata + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.gitdata.getTags({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/git/trees/:sha getTree + * @apiVersion 5.0.0 + * @apiName getTree + * @apiDescription Get a Tree + * @apiGroup gitdata + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} sha + * @apiParam {Boolean} [recursive] + * @apiExample {js} ex: +github.gitdata.getTree({ ... }); + */ + +/** + * @api {patch} /repos/:owner/:repo/git/refs/:ref updateReference + * @apiVersion 5.0.0 + * @apiName updateReference + * @apiDescription Update a Reference + * @apiGroup gitdata + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} ref String of the name of the fully qualified reference (ie: heads/master). If it doesn’t have at least one slash, it will be rejected. + * @apiParam {String} sha + * @apiParam {Boolean} [force=false] Boolean indicating whether to force the update or to make sure the update is a fast-forward update. The default is false, so leaving this out or setting it to false will make sure you’re not overwriting work. + * @apiExample {js} ex: +github.gitdata.updateReference({ ... }); + */ + +/** + * @api {post} /installations/:installation_id/access_tokens createInstallationToken + * @apiVersion 5.0.0 + * @apiName createInstallationToken + * @apiDescription Create a new installation token. (In preview period. See README.) + * @apiGroup integrations + * + * @apiParam {Number} installation_id The id of the installation for this integration. + * @apiParam {Number} [user_id] The id of the user for whom the integration is acting on behalf of. + * @apiExample {js} ex: +github.integrations.createInstallationToken({ ... }); + */ + +/** + * @api {get} /integration/installations getInstallations + * @apiVersion 5.0.0 + * @apiName getInstallations + * @apiDescription List the integration's installations. (In preview period. See README.) + * @apiGroup integrations + * + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.integrations.getInstallations({ ... }); + */ + +/** + * @api {post} /integration/identity/user getUserIdentity + * @apiVersion 5.0.0 + * @apiName getUserIdentity + * @apiDescription Request identity of user. (In preview period. See README.) + * @apiGroup integrations + * + * @apiParam {String} [nonce] + * @apiExample {js} ex: +github.integrations.getUserIdentity({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/issues/:number/assignees addAssigneesToIssue + * @apiVersion 5.0.0 + * @apiName addAssigneesToIssue + * @apiDescription Add assignees to an issue. + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiParam {Array} assignees Logins for the users that should be added to the issue. + * @apiExample {js} ex: +github.issues.addAssigneesToIssue({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/issues/:number/labels addLabels + * @apiVersion 5.0.0 + * @apiName addLabels + * @apiDescription Add labels to an issue + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiParam {Array} body + * @apiExample {js} ex: +github.issues.addLabels({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/assignees/:assignee checkAssignee + * @apiVersion 5.0.0 + * @apiName checkAssignee + * @apiDescription Check assignee + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} assignee Login for the user that this issue should be assigned to. + * @apiExample {js} ex: +github.issues.checkAssignee({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/issues create + * @apiVersion 5.0.0 + * @apiName create + * @apiDescription Create an issue + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} title + * @apiParam {String} [body] + * @apiParam {String} [assignee] Login for the user that this issue should be assigned to. + * @apiParam {Number} [milestone] Milestone to associate this issue with. + * @apiParam {Json} [labels] Array of strings - Labels to associate with this issue. + * @apiParam {Array} [assignees] Logins for Users to assign to this issue. NOTE: Only users with push access can set assignees for new issues. Assignees are silently dropped otherwise. + * @apiExample {js} ex: +github.issues.create({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/issues/:number/comments createComment + * @apiVersion 5.0.0 + * @apiName createComment + * @apiDescription Create a comment + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiParam {String} body + * @apiExample {js} ex: +github.issues.createComment({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/labels createLabel + * @apiVersion 5.0.0 + * @apiName createLabel + * @apiDescription Create a label + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} name + * @apiParam {String} color 6 character hex code, without a leading #. + * @apiExample {js} ex: +github.issues.createLabel({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/milestones createMilestone + * @apiVersion 5.0.0 + * @apiName createMilestone + * @apiDescription Create a milestone + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} title + * @apiParam {String} [state=open] + * @apiParam {String} [description] + * @apiParam {Date} [due_on] Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ + * @apiExample {js} ex: +github.issues.createMilestone({ ... }); + */ + +/** + * @api {delete} /repos/:owner/:repo/issues/comments/:id deleteComment + * @apiVersion 5.0.0 + * @apiName deleteComment + * @apiDescription Delete a comment + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiExample {js} ex: +github.issues.deleteComment({ ... }); + */ + +/** + * @api {delete} /repos/:owner/:repo/labels/:name deleteLabel + * @apiVersion 5.0.0 + * @apiName deleteLabel + * @apiDescription Delete a label + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} name + * @apiExample {js} ex: +github.issues.deleteLabel({ ... }); + */ + +/** + * @api {delete} /repos/:owner/:repo/milestones/:number deleteMilestone + * @apiVersion 5.0.0 + * @apiName deleteMilestone + * @apiDescription Delete a milestone + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiExample {js} ex: +github.issues.deleteMilestone({ ... }); + */ + +/** + * @api {patch} /repos/:owner/:repo/issues/:number edit + * @apiVersion 5.0.0 + * @apiName edit + * @apiDescription Edit an issue + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiParam {String} [title] + * @apiParam {String} [body] + * @apiParam {String} [assignee] Login for the user that this issue should be assigned to. + * @apiParam {String} [state=open] open or closed + * @apiParam {Number} [milestone] Milestone to associate this issue with. + * @apiParam {Json} [labels] Array of strings - Labels to associate with this issue. + * @apiParam {Array} [assignees] Logins for Users to assign to this issue. Pass one or more user logins to replace the set of assignees on this Issue. .Send an empty array ([]) to clear all assignees from the Issue. NOTE: Only users with push access can set assignees for new issues. Assignees are silently dropped otherwise. + * @apiExample {js} ex: +github.issues.edit({ ... }); + */ + +/** + * @api {patch} /repos/:owner/:repo/issues/comments/:id editComment + * @apiVersion 5.0.0 + * @apiName editComment + * @apiDescription Edit a comment + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiParam {String} body + * @apiExample {js} ex: +github.issues.editComment({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/issues/:number get + * @apiVersion 5.0.0 + * @apiName get + * @apiDescription Get a single issue + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiExample {js} ex: +github.issues.get({ ... }); + */ + +/** + * @api {get} /issues getAll + * @apiVersion 5.0.0 + * @apiName getAll + * @apiDescription List all issues across all the authenticated user's visible repositories including owned repositories, member repositories, and organization repositories + * @apiGroup issues + * + * @apiParam {String} [filter] + * @apiParam {String} [state=open] open, closed, or all + * @apiParam {String} [labels] String list of comma separated Label names. Example: bug,ui,@high + * @apiParam {String} [sort=created] + * @apiParam {String} [direction=desc] + * @apiParam {Date} [since] Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.issues.getAll({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/assignees getAssignees + * @apiVersion 5.0.0 + * @apiName getAssignees + * @apiDescription List assignees + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiExample {js} ex: +github.issues.getAssignees({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/issues/comments/:id getComment + * @apiVersion 5.0.0 + * @apiName getComment + * @apiDescription Get a single comment + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiExample {js} ex: +github.issues.getComment({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/issues/:number/comments getComments + * @apiVersion 5.0.0 + * @apiName getComments + * @apiDescription List comments on an issue + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.issues.getComments({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/issues/comments getCommentsForRepo + * @apiVersion 5.0.0 + * @apiName getCommentsForRepo + * @apiDescription List comments in a repository + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} [sort=created] + * @apiParam {String} [direction=desc] + * @apiParam {Date} [since] Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.issues.getCommentsForRepo({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/issues/events/:id getEvent + * @apiVersion 5.0.0 + * @apiName getEvent + * @apiDescription Get a single event + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiExample {js} ex: +github.issues.getEvent({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/issues/:number/events getEvents + * @apiVersion 5.0.0 + * @apiName getEvents + * @apiDescription List events for an issue + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.issues.getEvents({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/issues/events getEventsForRepo + * @apiVersion 5.0.0 + * @apiName getEventsForRepo + * @apiDescription List events for a repository + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.issues.getEventsForRepo({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/issues/:number/timeline getEventsTimeline + * @apiVersion 5.0.0 + * @apiName getEventsTimeline + * @apiDescription List events for an issue. (In preview period. See README.) + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.issues.getEventsTimeline({ ... }); + */ + +/** + * @api {get} /orgs/:org/issues getForOrg + * @apiVersion 5.0.0 + * @apiName getForOrg + * @apiDescription List all issues for a given organization for the authenticated user + * @apiGroup issues + * + * @apiParam {String} org + * @apiParam {String} [filter] + * @apiParam {String} [state=open] open, closed, or all + * @apiParam {String} [labels] String list of comma separated Label names. Example: bug,ui,@high + * @apiParam {String} [sort=created] + * @apiParam {String} [direction=desc] + * @apiParam {Date} [since] Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.issues.getForOrg({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/issues getForRepo + * @apiVersion 5.0.0 + * @apiName getForRepo + * @apiDescription List issues for a repository + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} [milestone] + * @apiParam {String} [state=open] open, closed, or all + * @apiParam {String} [assignee] String User login, `none` for Issues with no assigned User. `*` for Issues with any assigned User. + * @apiParam {String} [creator] The user that created the issue. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiParam {String} [labels] String list of comma separated Label names. Example: bug,ui,@high + * @apiParam {String} [sort=created] + * @apiParam {String} [direction=desc] + * @apiParam {Date} [since] Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {String} [mentioned] String User login. + * @apiExample {js} ex: +github.issues.getForRepo({ ... }); + */ + +/** + * @api {get} /user/issues getForUser + * @apiVersion 5.0.0 + * @apiName getForUser + * @apiDescription List all issues across owned and member repositories for the authenticated user + * @apiGroup issues + * + * @apiParam {String} [filter] + * @apiParam {String} [state=open] open, closed, or all + * @apiParam {String} [labels] String list of comma separated Label names. Example: bug,ui,@high + * @apiParam {String} [sort=created] + * @apiParam {String} [direction=desc] + * @apiParam {Date} [since] Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.issues.getForUser({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/issues/:number/labels getIssueLabels + * @apiVersion 5.0.0 + * @apiName getIssueLabels + * @apiDescription List labels on an issue + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiExample {js} ex: +github.issues.getIssueLabels({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/labels/:name getLabel + * @apiVersion 5.0.0 + * @apiName getLabel + * @apiDescription Get a single label + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} name + * @apiExample {js} ex: +github.issues.getLabel({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/labels getLabels + * @apiVersion 5.0.0 + * @apiName getLabels + * @apiDescription List all labels for this repository + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.issues.getLabels({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/milestones/:number getMilestone + * @apiVersion 5.0.0 + * @apiName getMilestone + * @apiDescription Get a single milestone + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiExample {js} ex: +github.issues.getMilestone({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/milestones/:number/labels getMilestoneLabels + * @apiVersion 5.0.0 + * @apiName getMilestoneLabels + * @apiDescription Get labels for every issue in a milestone + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiExample {js} ex: +github.issues.getMilestoneLabels({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/milestones getMilestones + * @apiVersion 5.0.0 + * @apiName getMilestones + * @apiDescription List milestones for a repository + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} [state=open] + * @apiParam {String} [sort=due_on] due_on, completeness, default: due_on + * @apiParam {String} [direction=asc] + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.issues.getMilestones({ ... }); + */ + +/** + * @api {put} /repos/:owner/:repo/issues/:number/lock lock + * @apiVersion 5.0.0 + * @apiName lock + * @apiDescription Users with push access can lock an issue's conversation. + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiExample {js} ex: +github.issues.lock({ ... }); + */ + +/** + * @api {delete} /repos/:owner/:repo/issues/:number/labels removeAllLabels + * @apiVersion 5.0.0 + * @apiName removeAllLabels + * @apiDescription Remove all labels from an issue + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiExample {js} ex: +github.issues.removeAllLabels({ ... }); + */ + +/** + * @api {delete} /repos/:owner/:repo/issues/:number/assignees removeAssigneesFromIssue + * @apiVersion 5.0.0 + * @apiName removeAssigneesFromIssue + * @apiDescription Remove assignees from an issue. + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiParam {Json} body JSON object that contains assignees array of logins for the users that should be removed from the issue. + * @apiExample {js} ex: +github.issues.removeAssigneesFromIssue({ ... }); + */ + +/** + * @api {delete} /repos/:owner/:repo/issues/:number/labels/:name removeLabel + * @apiVersion 5.0.0 + * @apiName removeLabel + * @apiDescription Remove a label from an issue + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiParam {String} name + * @apiExample {js} ex: +github.issues.removeLabel({ ... }); + */ + +/** + * @api {put} /repos/:owner/:repo/issues/:number/labels replaceAllLabels + * @apiVersion 5.0.0 + * @apiName replaceAllLabels + * @apiDescription Replace all labels for an issue + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiParam {Array} body Sending an empty array ([]) will remove all Labels from the Issue. + * @apiExample {js} ex: +github.issues.replaceAllLabels({ ... }); + */ + +/** + * @api {delete} /repos/:owner/:repo/issues/:number/lock unlock + * @apiVersion 5.0.0 + * @apiName unlock + * @apiDescription Users with push access can unlock an issue's conversation. + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiExample {js} ex: +github.issues.unlock({ ... }); + */ + +/** + * @api {patch} /repos/:owner/:repo/labels/:oldname updateLabel + * @apiVersion 5.0.0 + * @apiName updateLabel + * @apiDescription Update a label + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} oldname The old name of the label. + * @apiParam {String} name The new name of the label. + * @apiParam {String} color 6 character hex code, without a leading #. + * @apiExample {js} ex: +github.issues.updateLabel({ ... }); + */ + +/** + * @api {patch} /repos/:owner/:repo/milestones/:number updateMilestone + * @apiVersion 5.0.0 + * @apiName updateMilestone + * @apiDescription Update a milestone + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiParam {String} title + * @apiParam {String} [state=open] + * @apiParam {String} [description] + * @apiParam {Date} [due_on] Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ + * @apiExample {js} ex: +github.issues.updateMilestone({ ... }); + */ + +/** + * @api {delete} /repos/:owner/:repo/import cancelImport + * @apiVersion 5.0.0 + * @apiName cancelImport + * @apiDescription Cancel an import. (In preview period. See README.) + * @apiGroup migrations + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiExample {js} ex: +github.migrations.cancelImport({ ... }); + */ + +/** + * @api {delete} /orgs/:org/migrations/:id/archive deleteMigrationArchive + * @apiVersion 5.0.0 + * @apiName deleteMigrationArchive + * @apiDescription Delete a migration archive + * @apiGroup migrations + * + * @apiParam {String} org + * @apiParam {String} id + * @apiExample {js} ex: +github.migrations.deleteMigrationArchive({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/import/authors getImportCommitAuthors + * @apiVersion 5.0.0 + * @apiName getImportCommitAuthors + * @apiDescription Get import commit authors. (In preview period. See README.) + * @apiGroup migrations + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} [since] Only authors found after this id are returned. Provide the highest author ID you've seen so far. New authors may be added to the list at any point while the importer is performing the raw step. + * @apiExample {js} ex: +github.migrations.getImportCommitAuthors({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/import getImportProgress + * @apiVersion 5.0.0 + * @apiName getImportProgress + * @apiDescription Get import progress. (In preview period. See README.) + * @apiGroup migrations + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiExample {js} ex: +github.migrations.getImportProgress({ ... }); + */ + +/** + * @api {get} /:owner/:name/import/large_files getLargeImportFiles + * @apiVersion 5.0.0 + * @apiName getLargeImportFiles + * @apiDescription List files larger than 100MB found during the import. (In preview period. See README.) + * @apiGroup migrations + * + * @apiParam {String} owner + * @apiParam {String} name + * @apiExample {js} ex: +github.migrations.getLargeImportFiles({ ... }); + */ + +/** + * @api {get} /orgs/:org/migrations/:id/archive getMigrationArchiveLink + * @apiVersion 5.0.0 + * @apiName getMigrationArchiveLink + * @apiDescription Get the URL to a migration archive. + * @apiGroup migrations + * + * @apiParam {String} org + * @apiParam {String} id + * @apiExample {js} ex: +github.migrations.getMigrationArchiveLink({ ... }); + */ + +/** + * @api {get} /orgs/:org/migrations/:id getMigrationStatus + * @apiVersion 5.0.0 + * @apiName getMigrationStatus + * @apiDescription Get the status of a migration + * @apiGroup migrations + * + * @apiParam {String} org + * @apiParam {String} id + * @apiExample {js} ex: +github.migrations.getMigrationStatus({ ... }); + */ + +/** + * @api {get} /orgs/:org/migrations getMigrations + * @apiVersion 5.0.0 + * @apiName getMigrations + * @apiDescription Get a list of migrations + * @apiGroup migrations + * + * @apiParam {String} org + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.migrations.getMigrations({ ... }); + */ + +/** + * @api {patch} /repos/:owner/:repo/import/authors/:author_id mapImportCommitAuthor + * @apiVersion 5.0.0 + * @apiName mapImportCommitAuthor + * @apiDescription Map a commit author. (In preview period. See README.) + * @apiGroup migrations + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} author_id The commit author id. + * @apiParam {String} [email] The new Git author email. + * @apiParam {String} [name] The new Git author name. + * @apiExample {js} ex: +github.migrations.mapImportCommitAuthor({ ... }); + */ + +/** + * @api {patch} /:owner/:name/import/lfs setImportLfsPreference + * @apiVersion 5.0.0 + * @apiName setImportLfsPreference + * @apiDescription Set import LFS preference. (In preview period. See README.) + * @apiGroup migrations + * + * @apiParam {String} owner + * @apiParam {String} name + * @apiExample {js} ex: +github.migrations.setImportLfsPreference({ ... }); + */ + +/** + * @api {put} /repos/:owner/:repo/import startImport + * @apiVersion 5.0.0 + * @apiName startImport + * @apiDescription Start an import. (In preview period. See README.) + * @apiGroup migrations + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} vcs_url The URL of the originating repository. + * @apiParam {String} [vcs] The originating VCS type. Please be aware that without this parameter, the import job will take additional time to detect the VCS type before beginning the import. This detection step will be reflected in the response. + * @apiParam {String} [vcs_username] If authentication is required, the username to provide to vcs_url. + * @apiParam {String} [vcs_password] If authentication is required, the password to provide to vcs_url. + * @apiParam {String} [tfvc_project] For a tfvc import, the name of the project that is being imported. + * @apiExample {js} ex: +github.migrations.startImport({ ... }); + */ + +/** + * @api {post} /orgs/:org/migrations startMigration + * @apiVersion 5.0.0 + * @apiName startMigration + * @apiDescription Start a migration. + * @apiGroup migrations + * + * @apiParam {String} org + * @apiParam {Array} repositories A list of arrays indicating which repositories should be migrated. + * @apiParam {Boolean} [lock_repositories=false] Indicates whether repositories should be locked (to prevent manipulation) while migrating data. Default: false. + * @apiParam {Boolean} [exclude_attachments=false] Indicates whether attachments should be excluded from the migration (to reduce migration archive file size). Default: false. + * @apiExample {js} ex: +github.migrations.startMigration({ ... }); + */ + +/** + * @api {delete} /orgs/:org/migrations/:id/repos/:repo/lock unlockRepoLockedForMigration + * @apiVersion 5.0.0 + * @apiName unlockRepoLockedForMigration + * @apiDescription Unlock a repository that was locked for migration. + * @apiGroup migrations + * + * @apiParam {String} org + * @apiParam {String} id + * @apiParam {String} repo + * @apiExample {js} ex: +github.migrations.unlockRepoLockedForMigration({ ... }); + */ + +/** + * @api {patch} /repos/:owner/:repo/import updateImport + * @apiVersion 5.0.0 + * @apiName updateImport + * @apiDescription Update existing import. (In preview period. See README.) + * @apiGroup migrations + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiExample {js} ex: +github.migrations.updateImport({ ... }); + */ + +/** + * @api {get} /emojis getEmojis + * @apiVersion 5.0.0 + * @apiName getEmojis + * @apiDescription Lists all the emojis available to use on GitHub. + * @apiGroup misc + * + * @apiExample {js} ex: +github.misc.getEmojis({ ... }); + */ + +/** + * @api {get} /gitignore/templates/:name getGitignoreTemplate + * @apiVersion 5.0.0 + * @apiName getGitignoreTemplate + * @apiDescription Get a single gitignore template + * @apiGroup misc + * + * @apiParam {String} name The name of the .gitignore template to get e.g. 'C' + * @apiExample {js} ex: +github.misc.getGitignoreTemplate({ ... }); + */ + +/** + * @api {get} /gitignore/templates getGitignoreTemplates + * @apiVersion 5.0.0 + * @apiName getGitignoreTemplates + * @apiDescription Lists available gitignore templates + * @apiGroup misc + * + * @apiExample {js} ex: +github.misc.getGitignoreTemplates({ ... }); + */ + +/** + * @api {get} /licenses/:license getLicense + * @apiVersion 5.0.0 + * @apiName getLicense + * @apiDescription Get an individual license. (In preview period. See README.) + * @apiGroup misc + * + * @apiParam {String} license Ex: /licenses/mit + * @apiExample {js} ex: +github.misc.getLicense({ ... }); + */ + +/** + * @api {get} /licenses getLicenses + * @apiVersion 5.0.0 + * @apiName getLicenses + * @apiDescription List all licenses. (In preview period. See README.) + * @apiGroup misc + * + * @apiExample {js} ex: +github.misc.getLicenses({ ... }); + */ + +/** + * @api {get} /meta getMeta + * @apiVersion 5.0.0 + * @apiName getMeta + * @apiDescription This endpoint provides information about GitHub.com, the service. Or, if you access this endpoint on your organization's GitHub Enterprise installation, this endpoint provides information about that installation. + * @apiGroup misc + * + * @apiExample {js} ex: +github.misc.getMeta({ ... }); + */ + +/** + * @api {get} /rate_limit getRateLimit + * @apiVersion 5.0.0 + * @apiName getRateLimit + * @apiDescription Get your current rate limit status + * @apiGroup misc + * + * @apiExample {js} ex: +github.misc.getRateLimit({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/license getRepoLicense + * @apiVersion 5.0.0 + * @apiName getRepoLicense + * @apiDescription Get the contents of a repository's license. (In preview period. See README.) + * @apiGroup misc + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiExample {js} ex: +github.misc.getRepoLicense({ ... }); + */ + +/** + * @api {post} /markdown renderMarkdown + * @apiVersion 5.0.0 + * @apiName renderMarkdown + * @apiDescription Render an arbitrary Markdown document + * @apiGroup misc + * + * @apiParam {String} text The Markdown text to render + * @apiParam {String} [mode=markdown] The rendering mode, `markdown` to render a document as plain Markdown, just like README files are rendered. `gfm` to render a document as user-content, e.g. like user comments or issues are rendered. In GFM mode, hard line breaks are always taken into account, and issue and user mentions are linked accordingly. + * @apiParam {String} [context] The repository context. Only taken into account when rendering as `gfm` + * @apiExample {js} ex: +github.misc.renderMarkdown({ ... }); + */ + +/** + * @api {post} /markdown/raw renderMarkdownRaw + * @apiVersion 5.0.0 + * @apiName renderMarkdownRaw + * @apiDescription Render a Markdown document in raw mode + * @apiGroup misc + * + * @apiParam {String} data Raw data to send as the body of the request + * @apiExample {js} ex: +github.misc.renderMarkdownRaw({ ... }); + */ + +/** + * @api {put} /orgs/:org/memberships/:user addOrganizationMembership + * @apiVersion 5.0.0 + * @apiName addOrganizationMembership + * @apiDescription Add or update organization membership + * @apiGroup orgs + * + * @apiParam {String} org + * @apiParam {String} user + * @apiParam {String} role The role to give the user in the organization. + * @apiExample {js} ex: +github.orgs.addOrganizationMembership({ ... }); + */ + +/** + * @api {put} /teams/:id/memberships/:user addTeamMembership + * @apiVersion 5.0.0 + * @apiName addTeamMembership + * @apiDescription Add team membership + * @apiGroup orgs + * + * @apiParam {String} id + * @apiParam {String} user + * @apiParam {String} [role=member] The role that this user should have in the team. + * @apiExample {js} ex: +github.orgs.addTeamMembership({ ... }); + */ + +/** + * @api {put} /teams/:id/repos/:org/:repo addTeamRepo + * @apiVersion 5.0.0 + * @apiName addTeamRepo + * @apiDescription Add team repository + * @apiGroup orgs + * + * @apiParam {String} id + * @apiParam {String} org + * @apiParam {String} repo + * @apiParam {String} [permission] `pull` - team members can pull, but not push or administer this repository, `push` - team members can pull and push, but not administer this repository, `admin` - team members can pull, push and administer this repository. + * @apiExample {js} ex: +github.orgs.addTeamRepo({ ... }); + */ + +/** + * @api {get} /orgs/:org/members/:owner checkMembership + * @apiVersion 5.0.0 + * @apiName checkMembership + * @apiDescription Check membership + * @apiGroup orgs + * + * @apiParam {String} org + * @apiParam {String} owner + * @apiExample {js} ex: +github.orgs.checkMembership({ ... }); + */ + +/** + * @api {get} /orgs/:org/public_members/:user checkPublicMembership + * @apiVersion 5.0.0 + * @apiName checkPublicMembership + * @apiDescription Check public membership + * @apiGroup orgs + * + * @apiParam {String} org + * @apiParam {String} user + * @apiExample {js} ex: +github.orgs.checkPublicMembership({ ... }); + */ + +/** + * @api {get} /teams/:id/repos/:owner/:repo checkTeamRepo + * @apiVersion 5.0.0 + * @apiName checkTeamRepo + * @apiDescription Check if a team manages a repository + * @apiGroup orgs + * + * @apiParam {String} id + * @apiParam {String} owner + * @apiParam {String} repo + * @apiExample {js} ex: +github.orgs.checkTeamRepo({ ... }); + */ + +/** + * @api {delete} /orgs/:org/public_members/:user concealMembership + * @apiVersion 5.0.0 + * @apiName concealMembership + * @apiDescription Conceal a user's membership + * @apiGroup orgs + * + * @apiParam {String} org + * @apiParam {String} user + * @apiExample {js} ex: +github.orgs.concealMembership({ ... }); + */ + +/** + * @api {post} /orgs/:org/hooks createHook + * @apiVersion 5.0.0 + * @apiName createHook + * @apiDescription Create a hook + * @apiGroup orgs + * + * @apiParam {String} org + * @apiParam {String} name Must be passed as "web". + * @apiParam {Json} config Key/value pairs to provide settings for this webhook + * @apiParam {Array} [events=["push"]] Determines what events the hook is triggered for. Default: ["push"]. + * @apiParam {Boolean} [active] Determines whether the hook is actually triggered on pushes. + * @apiExample {js} ex: +github.orgs.createHook({ ... }); + */ + +/** + * @api {post} /orgs/:org/teams createTeam + * @apiVersion 5.0.0 + * @apiName createTeam + * @apiDescription Create team + * @apiGroup orgs + * + * @apiParam {String} org + * @apiParam {String} name + * @apiParam {String} [description] The description of the team. + * @apiParam {Array} [repo_names] The full name (e.g., "organization-name/repository-name") of repositories to add the team to. + * @apiParam {String} [privacy=secret] The level of privacy this team should have. + * @apiExample {js} ex: +github.orgs.createTeam({ ... }); + */ + +/** + * @api {delete} /orgs/:org/hooks/:id deleteHook + * @apiVersion 5.0.0 + * @apiName deleteHook + * @apiDescription Delete a hook + * @apiGroup orgs + * + * @apiParam {String} org + * @apiParam {String} id + * @apiExample {js} ex: +github.orgs.deleteHook({ ... }); + */ + +/** + * @api {delete} /teams/:id deleteTeam + * @apiVersion 5.0.0 + * @apiName deleteTeam + * @apiDescription undefined + * @apiGroup orgs + * + * @apiParam {String} id + * @apiExample {js} ex: +github.orgs.deleteTeam({ ... }); + */ + +/** + * @api {delete} /teams/:id/repos/:owner/:repo deleteTeamRepo + * @apiVersion 5.0.0 + * @apiName deleteTeamRepo + * @apiDescription Remove team repository + * @apiGroup orgs + * + * @apiParam {String} id + * @apiParam {String} owner + * @apiParam {String} repo + * @apiExample {js} ex: +github.orgs.deleteTeamRepo({ ... }); + */ + +/** + * @api {patch} /orgs/:org/hooks/:id editHook + * @apiVersion 5.0.0 + * @apiName editHook + * @apiDescription Edit a hook + * @apiGroup orgs + * + * @apiParam {String} org + * @apiParam {String} id + * @apiParam {Json} config Key/value pairs to provide settings for this webhook + * @apiParam {Array} [events=["push"]] Determines what events the hook is triggered for. Default: ["push"]. + * @apiParam {Boolean} [active] Determines whether the hook is actually triggered on pushes. + * @apiExample {js} ex: +github.orgs.editHook({ ... }); + */ + +/** + * @api {patch} /teams/:id editTeam + * @apiVersion 5.0.0 + * @apiName editTeam + * @apiDescription Edit team + * @apiGroup orgs + * + * @apiParam {String} id + * @apiParam {String} name + * @apiParam {String} [description] The description of the team. + * @apiParam {String} [privacy=secret] The level of privacy this team should have. + * @apiExample {js} ex: +github.orgs.editTeam({ ... }); + */ + +/** + * @api {get} /orgs/:org get + * @apiVersion 5.0.0 + * @apiName get + * @apiDescription Get an organization + * @apiGroup orgs + * + * @apiParam {String} org + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.orgs.get({ ... }); + */ + +/** + * @api {get} /organizations getAll + * @apiVersion 5.0.0 + * @apiName getAll + * @apiDescription List all organizations + * @apiGroup orgs + * + * @apiParam {String} [since] The integer ID of the last Organization that you've seen. + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.orgs.getAll({ ... }); + */ + +/** + * @api {get} /users/:owner/orgs getForUser + * @apiVersion 5.0.0 + * @apiName getForUser + * @apiDescription List public organization memberships for the specified user. + * @apiGroup orgs + * + * @apiParam {String} owner + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.orgs.getForUser({ ... }); + */ + +/** + * @api {get} /orgs/:org/hooks/:id getHook + * @apiVersion 5.0.0 + * @apiName getHook + * @apiDescription Get single hook + * @apiGroup orgs + * + * @apiParam {String} org + * @apiParam {String} id + * @apiExample {js} ex: +github.orgs.getHook({ ... }); + */ + +/** + * @api {get} /orgs/:org/hooks getHooks + * @apiVersion 5.0.0 + * @apiName getHooks + * @apiDescription List hooks + * @apiGroup orgs + * + * @apiParam {String} org + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.orgs.getHooks({ ... }); + */ + +/** + * @api {get} /orgs/:org/members getMembers + * @apiVersion 5.0.0 + * @apiName getMembers + * @apiDescription Members list + * @apiGroup orgs + * + * @apiParam {String} org + * @apiParam {String} [filter=all] Filter members returned in the list. + * @apiParam {String} [role=all] Filter members returned by their role. + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.orgs.getMembers({ ... }); + */ + +/** + * @api {get} /orgs/:org/memberships/:user getOrganizationMembership + * @apiVersion 5.0.0 + * @apiName getOrganizationMembership + * @apiDescription Get organization membership + * @apiGroup orgs + * + * @apiParam {String} org + * @apiParam {String} user + * @apiExample {js} ex: +github.orgs.getOrganizationMembership({ ... }); + */ + +/** + * @api {get} /user/memberships/orgs getOrganizationMemberships + * @apiVersion 5.0.0 + * @apiName getOrganizationMemberships + * @apiDescription List your organization memberships + * @apiGroup orgs + * + * @apiParam {String} [state] Indicates the state of the memberships to return. Can be either active or pending. If not specified, both active and pending memberships are returned. + * @apiExample {js} ex: +github.orgs.getOrganizationMemberships({ ... }); + */ + +/** + * @api {get} /orgs/:org/public_members getPublicMembers + * @apiVersion 5.0.0 + * @apiName getPublicMembers + * @apiDescription Public members list + * @apiGroup orgs + * + * @apiParam {String} org + * @apiExample {js} ex: +github.orgs.getPublicMembers({ ... }); + */ + +/** + * @api {get} /teams/:id getTeam + * @apiVersion 5.0.0 + * @apiName getTeam + * @apiDescription Get team + * @apiGroup orgs + * + * @apiParam {String} id + * @apiExample {js} ex: +github.orgs.getTeam({ ... }); + */ + +/** + * @api {get} /teams/:id/members getTeamMembers + * @apiVersion 5.0.0 + * @apiName getTeamMembers + * @apiDescription undefined + * @apiGroup orgs + * + * @apiParam {String} id + * @apiParam {String} [role=all] Filters members returned by their role in the team. + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.orgs.getTeamMembers({ ... }); + */ + +/** + * @api {get} /teams/:id/memberships/:user getTeamMembership + * @apiVersion 5.0.0 + * @apiName getTeamMembership + * @apiDescription Get team membership + * @apiGroup orgs + * + * @apiParam {String} id + * @apiParam {String} user + * @apiExample {js} ex: +github.orgs.getTeamMembership({ ... }); + */ + +/** + * @api {get} /teams/:id/repos getTeamRepos + * @apiVersion 5.0.0 + * @apiName getTeamRepos + * @apiDescription Get team repos + * @apiGroup orgs + * + * @apiParam {String} id + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.orgs.getTeamRepos({ ... }); + */ + +/** + * @api {get} /orgs/:org/teams getTeams + * @apiVersion 5.0.0 + * @apiName getTeams + * @apiDescription List teams + * @apiGroup orgs + * + * @apiParam {String} org + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.orgs.getTeams({ ... }); + */ + +/** + * @api {post} /orgs/:org/hooks/:id/pings pingHook + * @apiVersion 5.0.0 + * @apiName pingHook + * @apiDescription Ping a hook + * @apiGroup orgs + * + * @apiParam {String} org + * @apiParam {String} id + * @apiExample {js} ex: +github.orgs.pingHook({ ... }); + */ + +/** + * @api {put} /orgs/:org/public_members/:user publicizeMembership + * @apiVersion 5.0.0 + * @apiName publicizeMembership + * @apiDescription Publicize a user's membership + * @apiGroup orgs + * + * @apiParam {String} org + * @apiParam {String} user + * @apiExample {js} ex: +github.orgs.publicizeMembership({ ... }); + */ + +/** + * @api {delete} /orgs/:org/members/:user removeMember + * @apiVersion 5.0.0 + * @apiName removeMember + * @apiDescription Remove a member + * @apiGroup orgs + * + * @apiParam {String} org + * @apiParam {String} user + * @apiExample {js} ex: +github.orgs.removeMember({ ... }); + */ + +/** + * @api {delete} /orgs/:org/memberships/:user removeOrganizationMembership + * @apiVersion 5.0.0 + * @apiName removeOrganizationMembership + * @apiDescription Remove organization membership + * @apiGroup orgs + * + * @apiParam {String} org + * @apiParam {String} user + * @apiExample {js} ex: +github.orgs.removeOrganizationMembership({ ... }); + */ + +/** + * @api {delete} /teams/:id/memberships/:user removeTeamMembership + * @apiVersion 5.0.0 + * @apiName removeTeamMembership + * @apiDescription Remove team membership + * @apiGroup orgs + * + * @apiParam {String} id + * @apiParam {String} user + * @apiExample {js} ex: +github.orgs.removeTeamMembership({ ... }); + */ + +/** + * @api {patch} /orgs/:org update + * @apiVersion 5.0.0 + * @apiName update + * @apiDescription Edit an organization + * @apiGroup orgs + * + * @apiParam {String} org + * @apiParam {String} [billing_email] Billing email address. This address is not publicized. + * @apiParam {String} [company] The company name. + * @apiParam {String} [email] The publicly visible email address. + * @apiParam {String} [location] The location. + * @apiParam {String} [name] The shorthand name of the company. + * @apiParam {String} [description] The description of the company. + * @apiExample {js} ex: +github.orgs.update({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/pulls/:number/merge checkMerged + * @apiVersion 5.0.0 + * @apiName checkMerged + * @apiDescription Get if a pull request has been merged + * @apiGroup pullRequests + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.pullRequests.checkMerged({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/pulls create + * @apiVersion 5.0.0 + * @apiName create + * @apiDescription Create a pull request + * @apiGroup pullRequests + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} title The title of the pull request. + * @apiParam {String} head The branch (or git ref) where your changes are implemented. + * @apiParam {String} base The branch (or git ref) you want your changes pulled into. This should be an existing branch on the current repository. You cannot submit a pull request to one repo that requests a merge to a base of another repo. + * @apiParam {String} [body] The contents of the pull request. + * @apiExample {js} ex: +github.pullRequests.create({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/pulls/:number/comments createComment + * @apiVersion 5.0.0 + * @apiName createComment + * @apiDescription Create a comment + * @apiGroup pullRequests + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiParam {String} body + * @apiParam {String} commit_id Sha of the commit to comment on. + * @apiParam {String} path Relative path of the file to comment on. + * @apiParam {Number} position Column index in the diff to comment on. + * @apiExample {js} ex: +github.pullRequests.createComment({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/pulls/:number/comments createCommentReply + * @apiVersion 5.0.0 + * @apiName createCommentReply + * @apiDescription Reply to existing pull request comment + * @apiGroup pullRequests + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiParam {String} body + * @apiParam {Number} in_reply_to The comment id to reply to. + * @apiExample {js} ex: +github.pullRequests.createCommentReply({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/pulls createFromIssue + * @apiVersion 5.0.0 + * @apiName createFromIssue + * @apiDescription Create a pull request from an existing issue + * @apiGroup pullRequests + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} issue The issue number in this repository to turn into a Pull Request. + * @apiParam {String} head The branch (or git ref) where your changes are implemented. + * @apiParam {String} base The branch (or git ref) you want your changes pulled into. This should be an existing branch on the current repository. You cannot submit a pull request to one repo that requests a merge to a base of another repo. + * @apiExample {js} ex: +github.pullRequests.createFromIssue({ ... }); + */ + +/** + * @api {delete} /repos/:owner/:repo/pulls/comments/:number deleteComment + * @apiVersion 5.0.0 + * @apiName deleteComment + * @apiDescription Delete a comment + * @apiGroup pullRequests + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiExample {js} ex: +github.pullRequests.deleteComment({ ... }); + */ + +/** + * @api {patch} /repos/:owner/:repo/pulls/comments/:number editComment + * @apiVersion 5.0.0 + * @apiName editComment + * @apiDescription Edit a comment + * @apiGroup pullRequests + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiParam {String} body + * @apiExample {js} ex: +github.pullRequests.editComment({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/pulls/:number get + * @apiVersion 5.0.0 + * @apiName get + * @apiDescription Get a single pull request + * @apiGroup pullRequests + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiExample {js} ex: +github.pullRequests.get({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/pulls getAll + * @apiVersion 5.0.0 + * @apiName getAll + * @apiDescription List pull requests + * @apiGroup pullRequests + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} [state=open] open, closed, or all + * @apiParam {String} [head] Filter pulls by head user and branch name in the format of user:ref-name. Example: github:new-script-format. + * @apiParam {String} [base] Filter pulls by base branch name. Example: gh-pages. + * @apiParam {String} [sort=created] Possible values are: `created`, `updated`, `popularity`, `long-running`, Default: `created` + * @apiParam {String} [direction=desc] + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.pullRequests.getAll({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/pulls/comments/:number getComment + * @apiVersion 5.0.0 + * @apiName getComment + * @apiDescription Get a single comment + * @apiGroup pullRequests + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiExample {js} ex: +github.pullRequests.getComment({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/pulls/:number/comments getComments + * @apiVersion 5.0.0 + * @apiName getComments + * @apiDescription List comments on a pull request + * @apiGroup pullRequests + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.pullRequests.getComments({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/pulls/comments getCommentsForRepo + * @apiVersion 5.0.0 + * @apiName getCommentsForRepo + * @apiDescription List comments in a repository + * @apiGroup pullRequests + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} [sort=created] Possible values are: `created`, `updated`, Default: `created` + * @apiParam {String} [direction=desc] + * @apiParam {Date} [since] Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.pullRequests.getCommentsForRepo({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/pulls/:number/commits getCommits + * @apiVersion 5.0.0 + * @apiName getCommits + * @apiDescription List commits on a pull request + * @apiGroup pullRequests + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.pullRequests.getCommits({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/pulls/:number/files getFiles + * @apiVersion 5.0.0 + * @apiName getFiles + * @apiDescription List pull requests files + * @apiGroup pullRequests + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.pullRequests.getFiles({ ... }); + */ + +/** + * @api {put} /repos/:owner/:repo/pulls/:number/merge merge + * @apiVersion 5.0.0 + * @apiName merge + * @apiDescription Merge a pull request (Merge Button) + * @apiGroup pullRequests + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiParam {String} [commit_title] Title for the automatic commit message. (In preview period. See README.) + * @apiParam {String} [commit_message] Extra detail to append to automatic commit message. + * @apiParam {String} [sha] SHA that pull request head must match to allow merge + * @apiParam {String} [merge_method=merge] Merge method to use. Possible values are `merge`, `squash`, or `rebase`. (In preview period. See README.) + * @apiExample {js} ex: +github.pullRequests.merge({ ... }); + */ + +/** + * @api {patch} /repos/:owner/:repo/pulls/:number update + * @apiVersion 5.0.0 + * @apiName update + * @apiDescription Update a pull request + * @apiGroup pullRequests + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiParam {String} [title] The title of the pull request. + * @apiParam {String} [body] The contents of the pull request. + * @apiParam {String} [state=open] + * @apiExample {js} ex: +github.pullRequests.update({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/comments/:id/reactions createForCommitComment + * @apiVersion 5.0.0 + * @apiName createForCommitComment + * @apiDescription Create reaction for a commit comment. (In preview period. See README.) + * @apiGroup reactions + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiParam {String} content The reaction type. + * @apiExample {js} ex: +github.reactions.createForCommitComment({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/issues/:number/reactions createForIssue + * @apiVersion 5.0.0 + * @apiName createForIssue + * @apiDescription Create reaction for an issue. (In preview period. See README.) + * @apiGroup reactions + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiParam {String} content The reaction type. + * @apiExample {js} ex: +github.reactions.createForIssue({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/issues/comments/:id/reactions createForIssueComment + * @apiVersion 5.0.0 + * @apiName createForIssueComment + * @apiDescription Create reaction for an issue comment. (In preview period. See README.) + * @apiGroup reactions + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiParam {String} content The reaction type. + * @apiExample {js} ex: +github.reactions.createForIssueComment({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/pulls/comments/:id/reactions createForPullRequestReviewComment + * @apiVersion 5.0.0 + * @apiName createForPullRequestReviewComment + * @apiDescription Create reaction for a pull request review comment. (In preview period. See README.) + * @apiGroup reactions + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiParam {String} content The reaction type. + * @apiExample {js} ex: +github.reactions.createForPullRequestReviewComment({ ... }); + */ + +/** + * @api {delete} /reactions/:id delete + * @apiVersion 5.0.0 + * @apiName delete + * @apiDescription Delete a reaction. (In preview period. See README.) + * @apiGroup reactions + * + * @apiParam {String} id + * @apiExample {js} ex: +github.reactions.delete({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/comments/:id/reactions getForCommitComment + * @apiVersion 5.0.0 + * @apiName getForCommitComment + * @apiDescription List reactions for a commit comment. (In preview period. See README.) + * @apiGroup reactions + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiParam {String} [content] Indicates which type of reaction to return. + * @apiExample {js} ex: +github.reactions.getForCommitComment({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/issues/:number/reactions getForIssue + * @apiVersion 5.0.0 + * @apiName getForIssue + * @apiDescription List reactions for an issue. (In preview period. See README.) + * @apiGroup reactions + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiParam {String} [content] Indicates which type of reaction to return. + * @apiExample {js} ex: +github.reactions.getForIssue({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/issues/comments/:id/reactions getForIssueComment + * @apiVersion 5.0.0 + * @apiName getForIssueComment + * @apiDescription List reactions for an issue comment. (In preview period. See README.) + * @apiGroup reactions + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiParam {String} [content] Indicates which type of reaction to return. + * @apiExample {js} ex: +github.reactions.getForIssueComment({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/pulls/comments/:id/reactions getForPullRequestReviewComment + * @apiVersion 5.0.0 + * @apiName getForPullRequestReviewComment + * @apiDescription List reactions for a pull request review comment. (In preview period. See README.) + * @apiGroup reactions + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiParam {String} [content] Indicates which type of reaction to return. + * @apiExample {js} ex: +github.reactions.getForPullRequestReviewComment({ ... }); + */ + +/** + * @api {put} /repos/:owner/:repo/collaborators/:collabuser addCollaborator + * @apiVersion 5.0.0 + * @apiName addCollaborator + * @apiDescription Add user as a collaborator + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} collabuser + * @apiParam {String} [permission=push] `pull` - can pull, but not push to or administer this repository, `push` - can pull and push, but not administer this repository, `admin` - can pull, push and administer this repository. + * @apiExample {js} ex: +github.repos.addCollaborator({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/branches/:branch/protection/required_status_checks/contexts addProtectedBranchRequiredStatusChecksContexts + * @apiVersion 5.0.0 + * @apiName addProtectedBranchRequiredStatusChecksContexts + * @apiDescription Add required status checks contexts of protected branch. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} branch + * @apiParam {Array} body An array of protected branch required status checks contexts (e.g. continuous-integration/jenkins). + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.addProtectedBranchRequiredStatusChecksContexts({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/branches/:branch/protection/restrictions/teams addProtectedBranchTeamRestrictions + * @apiVersion 5.0.0 + * @apiName addProtectedBranchTeamRestrictions + * @apiDescription Add team restrictions of protected branch. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} branch + * @apiParam {Array} body An array of team slugs (e.g. justice-league). + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.addProtectedBranchTeamRestrictions({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/branches/:branch/protection/restrictions/users addProtectedBranchUserRestrictions + * @apiVersion 5.0.0 + * @apiName addProtectedBranchUserRestrictions + * @apiDescription Add user restrictions of protected branch. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} branch + * @apiParam {Array} body An array of team slugs (e.g. justice-league). + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.addProtectedBranchUserRestrictions({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/collaborators/:collabuser checkCollaborator + * @apiVersion 5.0.0 + * @apiName checkCollaborator + * @apiDescription Check if user is a collaborator. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} collabuser + * @apiExample {js} ex: +github.repos.checkCollaborator({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/compare/:base...:head compareCommits + * @apiVersion 5.0.0 + * @apiName compareCommits + * @apiDescription Compare two commits. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} base The branch (or git ref) you want your changes pulled into. This should be an existing branch on the current repository. You cannot submit a pull request to one repo that requests a merge to a base of another repo. + * @apiParam {String} head The branch (or git ref) where your changes are implemented. + * @apiExample {js} ex: +github.repos.compareCommits({ ... }); + */ + +/** + * @api {post} /user/repos create + * @apiVersion 5.0.0 + * @apiName create + * @apiDescription Create a new repository for the authenticated user. + * @apiGroup repos + * + * @apiParam {String} name + * @apiParam {Boolean} [allow_rebase_merge=true] Either true to allow rebase-merging pull requests, or false to prevent rebase-merging. Default: true. (In preview period. See README.) + * @apiParam {String} [homepage] + * @apiParam {Boolean} [private=false] True to create a private repository, false to create a public one. Creating private repositories requires a paid GitHub account. Default is false. + * @apiParam {Boolean} [has_issues=true] True to enable issues for this repository, false to disable them. Default is true. + * @apiParam {Boolean} [has_wiki=true] True to enable the wiki for this repository, false to disable it. Default is true. + * @apiParam {String} [description] + * @apiParam {Boolean} [auto_init=false] True to create an initial commit with empty README. Default is false + * @apiParam {String} [gitignore_template] Desired language or platform .gitignore template to apply. Ignored if auto_init parameter is not provided. + * @apiParam {String} [license_template] Desired LICENSE template to apply. Use the name of the template without the extension. For example, "mit" or "mozilla". + * @apiParam {Boolean} [allow_squash_merge=true] Either true to allow squash-merging pull requests, or false to prevent squash-merging. Default: true. (In preview period. See README.) + * @apiParam {Boolean} [allow_merge_commit=true] Either true to allow merging pull requests with a merge commit, or false to prevent merging pull requests with merge commits. Default: true. (In preview period. See README.) + * @apiParam {Boolean} [has_downloads=true] True to enable downloads for this repository, false to disable them. Default is true. + * @apiExample {js} ex: +github.repos.create({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/commits/:sha/comments createCommitComment + * @apiVersion 5.0.0 + * @apiName createCommitComment + * @apiDescription Create a commit comment. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} sha + * @apiParam {String} body + * @apiParam {String} [path] Relative path of the file to comment on. + * @apiParam {Number} [position] Line index in the diff to comment on. + * @apiParam {Number} [line] Deprecated. Use position parameter instead. Line number in the file to comment on. + * @apiExample {js} ex: +github.repos.createCommitComment({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/deployments createDeployment + * @apiVersion 5.0.0 + * @apiName createDeployment + * @apiDescription Create a deployment. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} ref The ref to deploy. This can be a branch, tag, or sha. + * @apiParam {String} repo + * @apiParam {String} [task=deploy] The named task to execute. e.g. deploy or deploy:migrations. Default: deploy + * @apiParam {Boolean} [auto_merge=true] Optional parameter to merge the default branch into the requested ref if it is behind the default branch. Default: true + * @apiParam {Boolean} [production_environment] Specifies if the given environment is a one that end-users directly interact with. Default: true when environment is `production` and false otherwise. (In preview period. See README.) + * @apiParam {String} [payload=""] Optional JSON payload with extra information about the deployment. Default: "" + * @apiParam {String} [environment=none] The name of the environment that was deployed to. e.g. staging or production. Default: none. + * @apiParam {String} [description=""] Optional short description. Default: "" + * @apiParam {Boolean} [transient_environment=false] Specifies if the given environment is specific to the deployment and will no longer exist at some point in the future. Default: false. (In preview period. See README.) + * @apiParam {Array} [required_contexts] Optional array of status contexts verified against commit status checks. If this parameter is omitted from the parameters then all unique contexts will be verified before a deployment is created. To bypass checking entirely pass an empty array. Defaults to all unique contexts. + * @apiExample {js} ex: +github.repos.createDeployment({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/deployments/:id/statuses createDeploymentStatus + * @apiVersion 5.0.0 + * @apiName createDeploymentStatus + * @apiDescription Create a deployment status. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiParam {String} [state] The state of the status. Can be one of pending, success, error, or failure. + * @apiParam {String} [target_url=""] The target URL to associate with this status. This URL should contain output to keep the user updated while the task is running or serve as historical information for what happened in the deployment. Default: "" + * @apiParam {String} [log_url=""] Functionally equivalent to target_url. Default: "". (In preview period. See README.) + * @apiParam {String} [description=""] A short description of the status. Default: "" + * @apiParam {String} [environment_url=""] URL for accessing the deployment environment. Default: "". (In preview period. See README.) + * @apiParam {Boolean} [auto_inactive=true] When true the new `inactive` status is added to all other non-transient, non-production environment deployments with the same repository and environment name as the created status's deployment. Default: true. (In preview period. See README.) + * @apiExample {js} ex: +github.repos.createDeploymentStatus({ ... }); + */ + +/** + * @api {put} /repos/:owner/:repo/contents/:path createFile + * @apiVersion 5.0.0 + * @apiName createFile + * @apiDescription Create a new file in the given repository. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} path The content path. + * @apiParam {String} message The commit message. + * @apiParam {String} content The new file content, Base64 encoded. + * @apiParam {String} [branch] The branch name. If not provided, uses the repository’s default branch (usually master). + * @apiParam {Json} [committer] + * @apiExample {js} ex: +github.repos.createFile({ ... }); + */ + +/** + * @api {post} /orgs/:org/repos createForOrg + * @apiVersion 5.0.0 + * @apiName createForOrg + * @apiDescription Create a new repository for an organization. + * @apiGroup repos + * + * @apiParam {String} org + * @apiParam {String} name + * @apiParam {String} [description] + * @apiParam {String} [homepage] + * @apiParam {Boolean} [private=false] True to create a private repository, false to create a public one. Creating private repositories requires a paid GitHub account. Default is false. + * @apiParam {Boolean} [has_issues=true] True to enable issues for this repository, false to disable them. Default is true. + * @apiParam {Boolean} [has_wiki=true] True to enable the wiki for this repository, false to disable it. Default is true. + * @apiParam {Boolean} [allow_rebase_merge=true] Either true to allow rebase-merging pull requests, or false to prevent rebase-merging. Default: true. (In preview period. See README.) + * @apiParam {Number} [team_id] The id of the team that will be granted access to this repository. This is only valid when creating a repo in an organization. + * @apiParam {Boolean} [auto_init=false] True to create an initial commit with empty README. Default is false + * @apiParam {String} [gitignore_template] Desired language or platform .gitignore template to apply. Ignored if auto_init parameter is not provided. + * @apiParam {String} [license_template] Desired LICENSE template to apply. Use the name of the template without the extension. For example, "mit" or "mozilla". + * @apiParam {Boolean} [allow_squash_merge=true] Either true to allow squash-merging pull requests, or false to prevent squash-merging. Default: true. (In preview period. See README.) + * @apiParam {Boolean} [allow_merge_commit=true] Either true to allow merging pull requests with a merge commit, or false to prevent merging pull requests with merge commits. Default: true. (In preview period. See README.) + * @apiParam {Boolean} [has_downloads=true] True to enable downloads for this repository, false to disable them. Default is true. + * @apiExample {js} ex: +github.repos.createForOrg({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/hooks createHook + * @apiVersion 5.0.0 + * @apiName createHook + * @apiDescription Create a hook. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} name + * @apiParam {Json} config A Hash containing key/value pairs to provide settings for this hook. These settings vary between the services and are defined in the github-services repo. Booleans are stored internally as `1` for true, and `0` for false. Any JSON true/false values will be converted automatically. + * @apiParam {Array} [events=["push"]] Determines what events the hook is triggered for. Default: `['push']`. + * @apiParam {Boolean} [active] Determines whether the hook is actually triggered on pushes. + * @apiExample {js} ex: +github.repos.createHook({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/keys createKey + * @apiVersion 5.0.0 + * @apiName createKey + * @apiDescription Add a new deploy key. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} title + * @apiParam {String} key + * @apiParam {Boolean} [read_only] If true, the key will only be able to read repository contents. Otherwise, the key will be able to read and write. + * @apiExample {js} ex: +github.repos.createKey({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/projects createProject + * @apiVersion 5.0.0 + * @apiName createProject + * @apiDescription Create a project. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} name + * @apiParam {String} body + * @apiExample {js} ex: +github.repos.createProject({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/projects/columns/:id/cards createProjectCard + * @apiVersion 5.0.0 + * @apiName createProjectCard + * @apiDescription Create a project card. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiParam {String} [note] The note of the card. + * @apiParam {String} [content_id] The id of the Issue or Pull Request to associate with this card. + * @apiParam {String} [content_type] The type of content to associate with this card. Can be either 'Issue' or 'PullRequest'. + * @apiExample {js} ex: +github.repos.createProjectCard({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/projects/:number/columns createProjectColumn + * @apiVersion 5.0.0 + * @apiName createProjectColumn + * @apiDescription Create a project column. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiParam {String} name + * @apiExample {js} ex: +github.repos.createProjectColumn({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/releases createRelease + * @apiVersion 5.0.0 + * @apiName createRelease + * @apiDescription Create a release. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} tag_name String of the tag + * @apiParam {String} [target_commitish] Specifies the commitish value that determines where the Git tag is created from. Can be any branch or commit SHA. Unused if the Git tag already exists. Default: the repository's default branch (usually master). + * @apiParam {String} [name] + * @apiParam {String} [body] + * @apiParam {Boolean} [draft=false] true to create a draft (unpublished) release, false to create a published one. Default: false + * @apiParam {Boolean} [prerelease=false] true to identify the release as a prerelease. false to identify the release as a full release. Default: false + * @apiExample {js} ex: +github.repos.createRelease({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/statuses/:sha createStatus + * @apiVersion 5.0.0 + * @apiName createStatus + * @apiDescription Create a status. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} sha + * @apiParam {String} state State of the status - can be one of pending, success, error, or failure. + * @apiParam {String} [target_url] Target url to associate with this status. This URL will be linked from the GitHub UI to allow users to easily see the ‘source’ of the Status. + * @apiParam {String} [description] Short description of the status. + * @apiParam {String} [context] A string label to differentiate this status from the status of other systems. + * @apiExample {js} ex: +github.repos.createStatus({ ... }); + */ + +/** + * @api {delete} /repos/:owner/:repo delete + * @apiVersion 5.0.0 + * @apiName delete + * @apiDescription Delete a repository. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiExample {js} ex: +github.repos.delete({ ... }); + */ + +/** + * @api {delete} /repos/:owner/:repo/releases/assets/:id deleteAsset + * @apiVersion 5.0.0 + * @apiName deleteAsset + * @apiDescription Delete a release asset. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiExample {js} ex: +github.repos.deleteAsset({ ... }); + */ + +/** + * @api {delete} /repos/:owner/:repo/comments/:id deleteCommitComment + * @apiVersion 5.0.0 + * @apiName deleteCommitComment + * @apiDescription Delete a commit comment. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiExample {js} ex: +github.repos.deleteCommitComment({ ... }); + */ + +/** + * @api {delete} /repos/:owner/:repo/downloads/:id deleteDownload + * @apiVersion 5.0.0 + * @apiName deleteDownload + * @apiDescription Delete a download. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiExample {js} ex: +github.repos.deleteDownload({ ... }); + */ + +/** + * @api {delete} /repos/:owner/:repo/contents/:path deleteFile + * @apiVersion 5.0.0 + * @apiName deleteFile + * @apiDescription Delete a file. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} path The content path. + * @apiParam {String} message The commit message. + * @apiParam {String} sha The blob SHA of the file being removed. + * @apiParam {String} [branch] The branch name. If not provided, uses the repository’s default branch (usually master). + * @apiParam {Json} [committer] + * @apiExample {js} ex: +github.repos.deleteFile({ ... }); + */ + +/** + * @api {delete} /repos/:owner/:repo/hooks/:id deleteHook + * @apiVersion 5.0.0 + * @apiName deleteHook + * @apiDescription Deleate a hook. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiExample {js} ex: +github.repos.deleteHook({ ... }); + */ + +/** + * @api {delete} /repositories/:repo/invitations/:id deleteInvite + * @apiVersion 5.0.0 + * @apiName deleteInvite + * @apiDescription Delete a repository invitation. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} repo + * @apiParam {String} id + * @apiExample {js} ex: +github.repos.deleteInvite({ ... }); + */ + +/** + * @api {delete} /repos/:owner/:repo/keys/:id deleteKey + * @apiVersion 5.0.0 + * @apiName deleteKey + * @apiDescription Remove a deploy key. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiExample {js} ex: +github.repos.deleteKey({ ... }); + */ + +/** + * @api {delete} /repos/:owner/:repo/projects/:number deleteProject + * @apiVersion 5.0.0 + * @apiName deleteProject + * @apiDescription Delete a project. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiExample {js} ex: +github.repos.deleteProject({ ... }); + */ + +/** + * @api {delete} /repos/:owner/:repo/projects/columns/cards/:id deleteProjectCard + * @apiVersion 5.0.0 + * @apiName deleteProjectCard + * @apiDescription Delete a project card. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiExample {js} ex: +github.repos.deleteProjectCard({ ... }); + */ + +/** + * @api {delete} /repos/:owner/:repo/projects/columns/:id deleteProjectColumn + * @apiVersion 5.0.0 + * @apiName deleteProjectColumn + * @apiDescription Delete a project column. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiExample {js} ex: +github.repos.deleteProjectColumn({ ... }); + */ + +/** + * @api {delete} /repos/:owner/:repo/releases/:id deleteRelease + * @apiVersion 5.0.0 + * @apiName deleteRelease + * @apiDescription Delete a release + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiExample {js} ex: +github.repos.deleteRelease({ ... }); + */ + +/** + * @api {patch} /repos/:owner/:repo edit + * @apiVersion 5.0.0 + * @apiName edit + * @apiDescription Update a repo. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} name + * @apiParam {String} repo + * @apiParam {String} [description] + * @apiParam {String} [homepage] + * @apiParam {Boolean} [private=false] True to create a private repository, false to create a public one. Creating private repositories requires a paid GitHub account. Default is false. + * @apiParam {Boolean} [allow_rebase_merge=true] Either true to allow rebase-merging pull requests, or false to prevent rebase-merging. Default: true. (In preview period. See README.) + * @apiParam {Boolean} [has_wiki=true] True to enable the wiki for this repository, false to disable it. Default is true. + * @apiParam {Boolean} [has_downloads=true] True to enable downloads for this repository, false to disable them. Default is true. + * @apiParam {String} [default_branch] Updates the default branch for this repository. + * @apiParam {Boolean} [allow_squash_merge=true] Either true to allow squash-merging pull requests, or false to prevent squash-merging. Default: true. (In preview period. See README.) + * @apiParam {Boolean} [allow_merge_commit=true] Either true to allow merging pull requests with a merge commit, or false to prevent merging pull requests with merge commits. Default: true. (In preview period. See README.) + * @apiParam {Boolean} [has_issues=true] True to enable issues for this repository, false to disable them. Default is true. + * @apiExample {js} ex: +github.repos.edit({ ... }); + */ + +/** + * @api {patch} /repos/:owner/:repo/releases/assets/:id editAsset + * @apiVersion 5.0.0 + * @apiName editAsset + * @apiDescription Edit a release asset. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiParam {String} name + * @apiParam {String} [label] An alternate short description of the asset. Used in place of the filename. + * @apiExample {js} ex: +github.repos.editAsset({ ... }); + */ + +/** + * @api {patch} /repos/:owner/:repo/hooks/:id editHook + * @apiVersion 5.0.0 + * @apiName editHook + * @apiDescription Edit a hook. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiParam {String} name + * @apiParam {Json} config A Hash containing key/value pairs to provide settings for this hook. Modifying this will replace the entire config object. These settings vary between the services and are defined in the github-services repo. Booleans are stored internally as `1` for true, and `0` for false. Any JSON true/false values will be converted automatically. + * @apiParam {Array} [events=["push"]] Determines what events the hook is triggered for. This replaces the entire array of events. Default: `['push']`. + * @apiParam {Array} [add_events] Determines a list of events to be added to the list of events that the Hook triggers for. + * @apiParam {Array} [remove_events] Determines a list of events to be removed from the list of events that the Hook triggers for. + * @apiParam {Boolean} [active] Determines whether the hook is actually triggered on pushes. + * @apiExample {js} ex: +github.repos.editHook({ ... }); + */ + +/** + * @api {patch} /repos/:owner/:repo/releases/:id editRelease + * @apiVersion 5.0.0 + * @apiName editRelease + * @apiDescription Edit a release. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiParam {String} tag_name String of the tag + * @apiParam {String} [target_commitish] Specifies the commitish value that determines where the Git tag is created from. Can be any branch or commit SHA. Unused if the Git tag already exists. Default: the repository's default branch (usually master). + * @apiParam {String} [name] + * @apiParam {String} [body] + * @apiParam {Boolean} [draft=false] true to create a draft (unpublished) release, false to create a published one. Default: false + * @apiParam {Boolean} [prerelease=false] true to identify the release as a prerelease. false to identify the release as a full release. Default: false + * @apiExample {js} ex: +github.repos.editRelease({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/forks fork + * @apiVersion 5.0.0 + * @apiName fork + * @apiDescription Create a fork. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} [organization] Optional parameter to specify the organization name if forking into an organization. + * @apiExample {js} ex: +github.repos.fork({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo get + * @apiVersion 5.0.0 + * @apiName get + * @apiDescription Get a repo for a user. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiExample {js} ex: +github.repos.get({ ... }); + */ + +/** + * @api {get} /user/repos getAll + * @apiVersion 5.0.0 + * @apiName getAll + * @apiDescription List your repositories + * @apiGroup repos + * + * @apiParam {String} [visibility=all] Can be one of `all`, `public`, or `private`. Default: `all`. + * @apiParam {String} [affiliation=owner,collaborator,organization_member] Comma-separated list of values. Can include: `owner`, `collaborator`, `organization_member`. + * @apiParam {String} [type=all] Possible values: `all`, `owner`, `public`, `private`, `member`. Default: `all`. + * @apiParam {String} [sort=full_name] Possible values: `created`, `updated`, `pushed`, `full_name`. Default: `full_name`. + * @apiParam {String} [direction=desc] + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.getAll({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/comments getAllCommitComments + * @apiVersion 5.0.0 + * @apiName getAllCommitComments + * @apiDescription List commit comments for a repository. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.getAllCommitComments({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/:archive_format/:ref getArchiveLink + * @apiVersion 5.0.0 + * @apiName getArchiveLink + * @apiDescription Get archive link. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} archive_format=tarball Either tarball or zipball, Deafult: tarball. + * @apiParam {String} [ref] String of the name of the fully qualified reference (ie: heads/master). If it doesn’t have at least one slash, it will be rejected. + * @apiExample {js} ex: +github.repos.getArchiveLink({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/releases/assets/:id getAsset + * @apiVersion 5.0.0 + * @apiName getAsset + * @apiDescription Get a single release asset. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiExample {js} ex: +github.repos.getAsset({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/branches/:branch getBranch + * @apiVersion 5.0.0 + * @apiName getBranch + * @apiDescription Get branch. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} branch + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.getBranch({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/branches/:branch/protection getBranchProtection + * @apiVersion 5.0.0 + * @apiName getBranchProtection + * @apiDescription Get branch protection. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} branch + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.getBranchProtection({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/branches getBranches + * @apiVersion 5.0.0 + * @apiName getBranches + * @apiDescription List branches. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Boolean} [protected] Set to true to only return protected branches + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.getBranches({ ... }); + */ + +/** + * @api {get} /repositories/:id getById + * @apiVersion 5.0.0 + * @apiName getById + * @apiDescription Get a single repo by id. + * @apiGroup repos + * + * @apiParam {String} id + * @apiExample {js} ex: +github.repos.getById({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/traffic/clones getClones + * @apiVersion 5.0.0 + * @apiName getClones + * @apiDescription Get the total number of clones and breakdown per day or week for the last 14 days. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.getClones({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/collaborators getCollaborators + * @apiVersion 5.0.0 + * @apiName getCollaborators + * @apiDescription List collaborators + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.getCollaborators({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/commits/:sha/status getCombinedStatus + * @apiVersion 5.0.0 + * @apiName getCombinedStatus + * @apiDescription Get the combined status for a specific ref. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} sha + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.getCombinedStatus({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/commits/:sha getCommit + * @apiVersion 5.0.0 + * @apiName getCommit + * @apiDescription Get a single commit. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} sha + * @apiExample {js} ex: +github.repos.getCommit({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/comments/:id getCommitComment + * @apiVersion 5.0.0 + * @apiName getCommitComment + * @apiDescription Get a single commit comment. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiExample {js} ex: +github.repos.getCommitComment({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/commits/:sha/comments getCommitComments + * @apiVersion 5.0.0 + * @apiName getCommitComments + * @apiDescription List comments for a single commit. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} sha + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.getCommitComments({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/commits getCommits + * @apiVersion 5.0.0 + * @apiName getCommits + * @apiDescription List commits on a repository. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} [sha] Sha or branch to start listing commits from. + * @apiParam {String} [path] Only commits containing this file path will be returned. + * @apiParam {String} [author] GitHub login or email address by which to filter by commit author. + * @apiParam {Date} [since] Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ + * @apiParam {Date} [until] Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.getCommits({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/contents/:path getContent + * @apiVersion 5.0.0 + * @apiName getContent + * @apiDescription Get the contents of a file or directory in a repository. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} path The content path. + * @apiParam {String} [ref] The String name of the Commit/Branch/Tag. Defaults to master. + * @apiExample {js} ex: +github.repos.getContent({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/contributors getContributors + * @apiVersion 5.0.0 + * @apiName getContributors + * @apiDescription Get contributors for the specified repository. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Boolean} [anon] Set to 1 or true to include anonymous contributors in results. + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.getContributors({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/deployments/:id/statuses getDeploymentStatuses + * @apiVersion 5.0.0 + * @apiName getDeploymentStatuses + * @apiDescription List deployment statuses. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiExample {js} ex: +github.repos.getDeploymentStatuses({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/deployments getDeployments + * @apiVersion 5.0.0 + * @apiName getDeployments + * @apiDescription List deployments. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} [sha=none] The short or long sha that was recorded at creation time. Default: none. + * @apiParam {String} [ref=none] The name of the ref. This can be a branch, tag, or sha. Default: none. + * @apiParam {String} [task=none] The name of the task for the deployment. e.g. deploy or deploy:migrations. Default: none. + * @apiParam {String} [environment=none] The name of the environment that was deployed to. e.g. staging or production. Default: none. + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.getDeployments({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/downloads/:id getDownload + * @apiVersion 5.0.0 + * @apiName getDownload + * @apiDescription Get a single download. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiExample {js} ex: +github.repos.getDownload({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/downloads getDownloads + * @apiVersion 5.0.0 + * @apiName getDownloads + * @apiDescription List downloads for repository. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.getDownloads({ ... }); + */ + +/** + * @api {get} /orgs/:org/repos getForOrg + * @apiVersion 5.0.0 + * @apiName getForOrg + * @apiDescription List repositories for the specified org. + * @apiGroup repos + * + * @apiParam {String} org + * @apiParam {String} [type=all] Possible values: `all`, `public`, `private`, `forks`, `sources`, `member`. Default: `all`. + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.getForOrg({ ... }); + */ + +/** + * @api {get} /users/:user/repos getForUser + * @apiVersion 5.0.0 + * @apiName getForUser + * @apiDescription List public repositories for the specified user. + * @apiGroup repos + * + * @apiParam {String} user + * @apiParam {String} [type=owner] Possible values: `all`, `owner`, `member`. Default: `owner`. + * @apiParam {String} [sort=full_name] Possible values: `created`, `updated`, `pushed`, `full_name`. Default: `full_name`. + * @apiParam {String} [direction=desc] + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.getForUser({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/forks getForks + * @apiVersion 5.0.0 + * @apiName getForks + * @apiDescription List forks. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} [sort=newest] Possible values: `newest`, `oldest`, `stargazers`, default: `newest`. + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.getForks({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/hooks/:id getHook + * @apiVersion 5.0.0 + * @apiName getHook + * @apiDescription Get single hook. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiExample {js} ex: +github.repos.getHook({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/hooks getHooks + * @apiVersion 5.0.0 + * @apiName getHooks + * @apiDescription List hooks. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.getHooks({ ... }); + */ + +/** + * @api {get} /repositories/:repo/invitations getInvites + * @apiVersion 5.0.0 + * @apiName getInvites + * @apiDescription List invitations for a repository. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} repo + * @apiExample {js} ex: +github.repos.getInvites({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/keys/:id getKey + * @apiVersion 5.0.0 + * @apiName getKey + * @apiDescription Get a deploy key. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiExample {js} ex: +github.repos.getKey({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/keys getKeys + * @apiVersion 5.0.0 + * @apiName getKeys + * @apiDescription List deploy keys. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.getKeys({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/languages getLanguages + * @apiVersion 5.0.0 + * @apiName getLanguages + * @apiDescription Get languages for the specified repository. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.getLanguages({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/pages/builds/latest getLatestPagesBuild + * @apiVersion 5.0.0 + * @apiName getLatestPagesBuild + * @apiDescription Get latest Pages build + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiExample {js} ex: +github.repos.getLatestPagesBuild({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/releases/latest getLatestRelease + * @apiVersion 5.0.0 + * @apiName getLatestRelease + * @apiDescription Get the latest release. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiExample {js} ex: +github.repos.getLatestRelease({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/pages getPages + * @apiVersion 5.0.0 + * @apiName getPages + * @apiDescription Get information about a Pages site. (Use preview header to include additional info.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.getPages({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/pages/builds/:id getPagesBuild + * @apiVersion 5.0.0 + * @apiName getPagesBuild + * @apiDescription Get a specific Pages build + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiExample {js} ex: +github.repos.getPagesBuild({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/pages/builds getPagesBuilds + * @apiVersion 5.0.0 + * @apiName getPagesBuilds + * @apiDescription List Pages builds + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.getPagesBuilds({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/traffic/popular/paths getPaths + * @apiVersion 5.0.0 + * @apiName getPaths + * @apiDescription Get the top 10 popular contents over the last 14 days. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.getPaths({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/projects/:number getProject + * @apiVersion 5.0.0 + * @apiName getProject + * @apiDescription List a project. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiExample {js} ex: +github.repos.getProject({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/projects/columns/cards/:id getProjectCard + * @apiVersion 5.0.0 + * @apiName getProjectCard + * @apiDescription Get project card. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiExample {js} ex: +github.repos.getProjectCard({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/projects/columns/:id/cards getProjectCards + * @apiVersion 5.0.0 + * @apiName getProjectCards + * @apiDescription List project cards. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiExample {js} ex: +github.repos.getProjectCards({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/projects/columns/:id getProjectColumn + * @apiVersion 5.0.0 + * @apiName getProjectColumn + * @apiDescription Get a project column. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiExample {js} ex: +github.repos.getProjectColumn({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/projects/:number/columns getProjectColumns + * @apiVersion 5.0.0 + * @apiName getProjectColumns + * @apiDescription List a project's columns. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiExample {js} ex: +github.repos.getProjectColumns({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/projects getProjects + * @apiVersion 5.0.0 + * @apiName getProjects + * @apiDescription List projects. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiExample {js} ex: +github.repos.getProjects({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/branches/:branch/protection/required_status_checks getProtectedBranchRequiredStatusChecks + * @apiVersion 5.0.0 + * @apiName getProtectedBranchRequiredStatusChecks + * @apiDescription Get required status checks of protected branch. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} branch + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.getProtectedBranchRequiredStatusChecks({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/branches/:branch/protection/required_status_checks/contexts getProtectedBranchRequiredStatusChecksContexts + * @apiVersion 5.0.0 + * @apiName getProtectedBranchRequiredStatusChecksContexts + * @apiDescription List required status checks contexts of protected branch. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} branch + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.getProtectedBranchRequiredStatusChecksContexts({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/branches/:branch/protection/restrictions getProtectedBranchRestrictions + * @apiVersion 5.0.0 + * @apiName getProtectedBranchRestrictions + * @apiDescription Get restrictions of protected branch. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} branch + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.getProtectedBranchRestrictions({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/branches/:branch/protection/restrictions/teams getProtectedBranchTeamRestrictions + * @apiVersion 5.0.0 + * @apiName getProtectedBranchTeamRestrictions + * @apiDescription List team restrictions of protected branch. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} branch + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.getProtectedBranchTeamRestrictions({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/branches/:branch/protection/restrictions/users getProtectedBranchUserRestrictions + * @apiVersion 5.0.0 + * @apiName getProtectedBranchUserRestrictions + * @apiDescription List user restrictions of protected branch. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} branch + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.getProtectedBranchUserRestrictions({ ... }); + */ + +/** + * @api {get} /repositories getPublic + * @apiVersion 5.0.0 + * @apiName getPublic + * @apiDescription List all public repositories + * @apiGroup repos + * + * @apiParam {String} [since] The integer ID of the last Repository that you've seen. + * @apiExample {js} ex: +github.repos.getPublic({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/readme getReadme + * @apiVersion 5.0.0 + * @apiName getReadme + * @apiDescription Get the README for the given repository. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} [ref] The name of the commit/branch/tag. Default: the repository’s default branch (usually master) + * @apiExample {js} ex: +github.repos.getReadme({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/traffic/popular/referrers getReferrers + * @apiVersion 5.0.0 + * @apiName getReferrers + * @apiDescription Get the top 10 referrers over the last 14 days. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.getReferrers({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/releases/:id getRelease + * @apiVersion 5.0.0 + * @apiName getRelease + * @apiDescription Get a single release. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiExample {js} ex: +github.repos.getRelease({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/releases/tags/:tag getReleaseByTag + * @apiVersion 5.0.0 + * @apiName getReleaseByTag + * @apiDescription Get a release by tag name. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} tag String of the tag + * @apiExample {js} ex: +github.repos.getReleaseByTag({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/releases getReleases + * @apiVersion 5.0.0 + * @apiName getReleases + * @apiDescription List releases for a repository. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.getReleases({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/commits/:ref getShaOfCommitRef + * @apiVersion 5.0.0 + * @apiName getShaOfCommitRef + * @apiDescription Get the SHA-1 of a commit reference. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} ref String of the name of the fully qualified reference (ie: heads/master). If it doesn’t have at least one slash, it will be rejected. + * @apiExample {js} ex: +github.repos.getShaOfCommitRef({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/stats/code_frequency getStatsCodeFrequency + * @apiVersion 5.0.0 + * @apiName getStatsCodeFrequency + * @apiDescription Get the number of additions and deletions per week. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiExample {js} ex: +github.repos.getStatsCodeFrequency({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/stats/commit_activity getStatsCommitActivity + * @apiVersion 5.0.0 + * @apiName getStatsCommitActivity + * @apiDescription Get the last year of commit activity data. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiExample {js} ex: +github.repos.getStatsCommitActivity({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/stats/contributors getStatsContributors + * @apiVersion 5.0.0 + * @apiName getStatsContributors + * @apiDescription Get contributors list with additions, deletions, and commit counts. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiExample {js} ex: +github.repos.getStatsContributors({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/stats/participation getStatsParticipation + * @apiVersion 5.0.0 + * @apiName getStatsParticipation + * @apiDescription Get the weekly commit count for the repository owner and everyone else. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiExample {js} ex: +github.repos.getStatsParticipation({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/stats/punch_card getStatsPunchCard + * @apiVersion 5.0.0 + * @apiName getStatsPunchCard + * @apiDescription Get the number of commits per hour in each day. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiExample {js} ex: +github.repos.getStatsPunchCard({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/commits/:sha/statuses getStatuses + * @apiVersion 5.0.0 + * @apiName getStatuses + * @apiDescription Get status for a specfic ref. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} sha + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.getStatuses({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/tags getTags + * @apiVersion 5.0.0 + * @apiName getTags + * @apiDescription Get tags for the specified repository. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.getTags({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/teams getTeams + * @apiVersion 5.0.0 + * @apiName getTeams + * @apiDescription Get teams for the specified repository. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.getTeams({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/traffic/views getViews + * @apiVersion 5.0.0 + * @apiName getViews + * @apiDescription Get the total number of views and breakdown per day or week for the last 14 days. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.getViews({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/releases/:id/assets listAssets + * @apiVersion 5.0.0 + * @apiName listAssets + * @apiDescription List assets for a release. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiExample {js} ex: +github.repos.listAssets({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/merges merge + * @apiVersion 5.0.0 + * @apiName merge + * @apiDescription Perform a merge. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} base The branch (or git ref) you want your changes pulled into. This should be an existing branch on the current repository. You cannot submit a pull request to one repo that requests a merge to a base of another repo. + * @apiParam {String} head The branch (or git ref) where your changes are implemented. + * @apiParam {String} [commit_message] Commit message to use for the merge commit. If omitted, a default message will be used. + * @apiExample {js} ex: +github.repos.merge({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/projects/columns/cards/:id/moves moveProjectCard + * @apiVersion 5.0.0 + * @apiName moveProjectCard + * @apiDescription Move a project card. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiParam {String} position Can be one of first, last, or after:, where is the id value of a column in the same project. + * @apiParam {String} [column_id] The id value of a column in the same project. + * @apiExample {js} ex: +github.repos.moveProjectCard({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/projects/columns/:id/moves moveProjectColumn + * @apiVersion 5.0.0 + * @apiName moveProjectColumn + * @apiDescription Move a project column. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiParam {String} position Can be one of first, last, or after:, where is the id value of a column in the same project. + * @apiExample {js} ex: +github.repos.moveProjectColumn({ ... }); + */ + +/** + * @api {get} /repositories/:id one + * @apiVersion 5.0.0 + * @apiName one + * @apiDescription Get a specific repo. + * @apiGroup repos + * + * @apiParam {String} id + * @apiExample {js} ex: +github.repos.one({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/hooks/:id/pings pingHook + * @apiVersion 5.0.0 + * @apiName pingHook + * @apiDescription Ping a hook. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiExample {js} ex: +github.repos.pingHook({ ... }); + */ + +/** + * @api {delete} /repos/:owner/:repo/branches/:branch/protection removeBranchProtection + * @apiVersion 5.0.0 + * @apiName removeBranchProtection + * @apiDescription Remove branch protection. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} branch + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.removeBranchProtection({ ... }); + */ + +/** + * @api {delete} /repos/:owner/:repo/collaborators/:collabuser removeCollaborator + * @apiVersion 5.0.0 + * @apiName removeCollaborator + * @apiDescription Remove user as a collaborator. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} collabuser + * @apiExample {js} ex: +github.repos.removeCollaborator({ ... }); + */ + +/** + * @api {delete} /repos/:owner/:repo/branches/:branch/protection/required_status_checks removeProtectedBranchRequiredStatusChecks + * @apiVersion 5.0.0 + * @apiName removeProtectedBranchRequiredStatusChecks + * @apiDescription Remove required status checks of protected branch. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} branch + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.removeProtectedBranchRequiredStatusChecks({ ... }); + */ + +/** + * @api {delete} /repos/:owner/:repo/branches/:branch/protection/required_status_checks/contexts removeProtectedBranchRequiredStatusChecksContexts + * @apiVersion 5.0.0 + * @apiName removeProtectedBranchRequiredStatusChecksContexts + * @apiDescription Remove required status checks contexts of protected branch. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} branch + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.removeProtectedBranchRequiredStatusChecksContexts({ ... }); + */ + +/** + * @api {delete} /repos/:owner/:repo/branches/:branch/protection/restrictions removeProtectedBranchRestrictions + * @apiVersion 5.0.0 + * @apiName removeProtectedBranchRestrictions + * @apiDescription Remove restrictions of protected branch. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} branch + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.removeProtectedBranchRestrictions({ ... }); + */ + +/** + * @api {delete} /repos/:owner/:repo/branches/:branch/protection/restrictions/teams removeProtectedBranchTeamRestrictions + * @apiVersion 5.0.0 + * @apiName removeProtectedBranchTeamRestrictions + * @apiDescription Remove team restrictions of protected branch. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} branch + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.removeProtectedBranchTeamRestrictions({ ... }); + */ + +/** + * @api {delete} /repos/:owner/:repo/branches/:branch/protection/restrictions/users removeProtectedBranchUserRestrictions + * @apiVersion 5.0.0 + * @apiName removeProtectedBranchUserRestrictions + * @apiDescription Remove user restrictions of protected branch. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} branch + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.removeProtectedBranchUserRestrictions({ ... }); + */ + +/** + * @api {put} /repos/:owner/:repo/branches/:branch/protection/required_status_checks/contexts replaceProtectedBranchRequiredStatusChecksContexts + * @apiVersion 5.0.0 + * @apiName replaceProtectedBranchRequiredStatusChecksContexts + * @apiDescription Replace required status checks contexts of protected branch. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} branch + * @apiParam {Array} body An array of protected branch required status checks contexts (e.g. continuous-integration/jenkins). + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.replaceProtectedBranchRequiredStatusChecksContexts({ ... }); + */ + +/** + * @api {put} /repos/:owner/:repo/branches/:branch/protection/restrictions/teams replaceProtectedBranchTeamRestrictions + * @apiVersion 5.0.0 + * @apiName replaceProtectedBranchTeamRestrictions + * @apiDescription Replace team restrictions of protected branch. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} branch + * @apiParam {Array} body An array of team slugs (e.g. justice-league). + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.replaceProtectedBranchTeamRestrictions({ ... }); + */ + +/** + * @api {put} /repos/:owner/:repo/branches/:branch/protection/restrictions/users replaceProtectedBranchUserRestrictions + * @apiVersion 5.0.0 + * @apiName replaceProtectedBranchUserRestrictions + * @apiDescription Replace user restrictions of protected branch. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} branch + * @apiParam {Array} body An array of team slugs (e.g. justice-league). + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.replaceProtectedBranchUserRestrictions({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/pages/builds requestPageBuild + * @apiVersion 5.0.0 + * @apiName requestPageBuild + * @apiDescription Request a page build. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiExample {js} ex: +github.repos.requestPageBuild({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/hooks/:id/test testHook + * @apiVersion 5.0.0 + * @apiName testHook + * @apiDescription Test a [push] hook. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiExample {js} ex: +github.repos.testHook({ ... }); + */ + +/** + * @api {put} /repos/:owner/:repo/branches/:branch/protection updateBranchProtection + * @apiVersion 5.0.0 + * @apiName updateBranchProtection + * @apiDescription Update branch protection. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} branch + * @apiParam {Json} required_status_checks JSON object that contains the following keys: `include_admins` - Enforce required status checks for repository administrators, `strict` - Require branches to be up to date before merging, `contexts` - The list of status checks to require in order to merge into this branch. This object can have the value of `null` for disabled. + * @apiParam {Json} restrictions JSON object that contains the following keys: `users` - The list of user logins with push access, `teams` - The list of team slugs with push access. This object can have the value of `null` for disabled. + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.updateBranchProtection({ ... }); + */ + +/** + * @api {patch} /repos/:owner/:repo/comments/:id updateCommitComment + * @apiVersion 5.0.0 + * @apiName updateCommitComment + * @apiDescription Update a commit comment. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiParam {String} body + * @apiExample {js} ex: +github.repos.updateCommitComment({ ... }); + */ + +/** + * @api {put} /repos/:owner/:repo/contents/:path updateFile + * @apiVersion 5.0.0 + * @apiName updateFile + * @apiDescription Update a file. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} path The content path. + * @apiParam {String} message The commit message. + * @apiParam {String} content The updated file content, Base64 encoded. + * @apiParam {String} sha The blob SHA of the file being replaced. + * @apiParam {String} [branch] The branch name. If not provided, uses the repository’s default branch (usually master). + * @apiParam {Json} [committer] + * @apiExample {js} ex: +github.repos.updateFile({ ... }); + */ + +/** + * @api {patch} /repositories/:repo/invitations/:id updateInvite + * @apiVersion 5.0.0 + * @apiName updateInvite + * @apiDescription Update a repository invitation. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} repo + * @apiParam {String} id + * @apiParam {String} [permission] The permissions that the associated user will have on the repository. + * @apiExample {js} ex: +github.repos.updateInvite({ ... }); + */ + +/** + * @api {patch} /repos/:owner/:repo/projects/:number updateProject + * @apiVersion 5.0.0 + * @apiName updateProject + * @apiDescription Update a project. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiParam {String} name + * @apiParam {String} body + * @apiExample {js} ex: +github.repos.updateProject({ ... }); + */ + +/** + * @api {patch} /repos/:owner/:repo/projects/columns/cards/:id updateProjectCard + * @apiVersion 5.0.0 + * @apiName updateProjectCard + * @apiDescription Update a project card. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiParam {String} [note] The note of the card. + * @apiExample {js} ex: +github.repos.updateProjectCard({ ... }); + */ + +/** + * @api {patch} /repos/:owner/:repo/projects/columns/:id updateProjectColumn + * @apiVersion 5.0.0 + * @apiName updateProjectColumn + * @apiDescription Update a project column. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiParam {String} name + * @apiExample {js} ex: +github.repos.updateProjectColumn({ ... }); + */ + +/** + * @api {patch} /repos/:owner/:repo/branches/:branch/protection/required_status_checks updateProtectedBranchRequiredStatusChecks + * @apiVersion 5.0.0 + * @apiName updateProtectedBranchRequiredStatusChecks + * @apiDescription Update required status checks of protected branch. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} branch + * @apiParam {Json} body JSON object that contains the following keys: `include_admins` - Enforce required status checks for repository administrators, `strict` - Require branches to be up to date before merging, `contexts` - The list of status checks to require in order to merge into this branch. + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.updateProtectedBranchRequiredStatusChecks({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/releases/:id/assets uploadAsset + * @apiVersion 5.0.0 + * @apiName uploadAsset + * @apiDescription Upload a release asset. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiParam {String} filePath The file path of the asset. + * @apiParam {String} name The file name of the asset. This should be set in a URI query parameter. + * @apiParam {String} [label] An alternate short description of the asset. Used in place of the filename. This should be set in a URI query parameter. + * @apiExample {js} ex: +github.repos.uploadAsset({ ... }); + */ + +/** + * @api {get} /search/code code + * @apiVersion 5.0.0 + * @apiName code + * @apiDescription Search code. + * @apiGroup search + * + * @apiParam {String} q Search Term + * @apiParam {String} [sort] The sort field. Can only be indexed, which indicates how recently a file has been indexed by the GitHub search infrastructure. Default: results are sorted by best match. + * @apiParam {String} [order=desc] asc or desc + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.search.code({ ... }); + */ + +/** + * @api {get} /legacy/user/email/:email email + * @apiVersion 5.0.0 + * @apiName email + * @apiDescription Search against public email addresses. + * @apiGroup search + * + * @apiParam {String} email The email address + * @apiExample {js} ex: +github.search.email({ ... }); + */ + +/** + * @api {get} /search/issues issues + * @apiVersion 5.0.0 + * @apiName issues + * @apiDescription Search issues. + * @apiGroup search + * + * @apiParam {String} q Search Term + * @apiParam {String} [sort] The sort field. Can be comments, created, or updated. Default: results are sorted by best match. + * @apiParam {String} [order=desc] asc or desc + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.search.issues({ ... }); + */ + +/** + * @api {get} /search/repositories repos + * @apiVersion 5.0.0 + * @apiName repos + * @apiDescription Search repositories. + * @apiGroup search + * + * @apiParam {String} q Search Term + * @apiParam {String} [sort] stars, forks, or updated + * @apiParam {String} [order=desc] asc or desc + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.search.repos({ ... }); + */ + +/** + * @api {get} /search/users users + * @apiVersion 5.0.0 + * @apiName users + * @apiDescription Search users. + * @apiGroup search + * + * @apiParam {String} q Search Term + * @apiParam {String} [sort] The sort field. Can be followers, repositories, or joined. Default: results are sorted by best match. + * @apiParam {String} [order=desc] asc or desc + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.search.users({ ... }); + */ + +/** + * @api {patch} /user/repository_invitations/:id acceptRepoInvite + * @apiVersion 5.0.0 + * @apiName acceptRepoInvite + * @apiDescription Accept a repository invitation. (In preview period. See README.) + * @apiGroup users + * + * @apiParam {String} id + * @apiExample {js} ex: +github.users.acceptRepoInvite({ ... }); + */ + +/** + * @api {post} /user/emails addEmails + * @apiVersion 5.0.0 + * @apiName addEmails + * @apiDescription Add email address(es) + * @apiGroup users + * + * @apiParam {Array} body You can post a single email address or an array of addresses. + * @apiExample {js} ex: +github.users.addEmails({ ... }); + */ + +/** + * @api {get} /user/following/:user checkFollowing + * @apiVersion 5.0.0 + * @apiName checkFollowing + * @apiDescription Check if you are following a user + * @apiGroup users + * + * @apiParam {String} user + * @apiExample {js} ex: +github.users.checkFollowing({ ... }); + */ + +/** + * @api {get} /users/:user/following/:other_user checkIfOneFollowersOther + * @apiVersion 5.0.0 + * @apiName checkIfOneFollowersOther + * @apiDescription Check if one user follows another + * @apiGroup users + * + * @apiParam {String} user + * @apiParam {String} other_user Other user + * @apiExample {js} ex: +github.users.checkIfOneFollowersOther({ ... }); + */ + +/** + * @api {post} /user/gpg_keys createGpgKey + * @apiVersion 5.0.0 + * @apiName createGpgKey + * @apiDescription Create a GPG key. (In preview period. See README.) + * @apiGroup users + * + * @apiParam {String} armored_public_key GPG key contents + * @apiExample {js} ex: +github.users.createGpgKey({ ... }); + */ + +/** + * @api {post} /user/keys createKey + * @apiVersion 5.0.0 + * @apiName createKey + * @apiDescription Create a public key + * @apiGroup users + * + * @apiParam {String} title + * @apiParam {String} key + * @apiExample {js} ex: +github.users.createKey({ ... }); + */ + +/** + * @api {delete} /user/repository_invitations/:id declineRepoInvite + * @apiVersion 5.0.0 + * @apiName declineRepoInvite + * @apiDescription Decline a repository invitation. (In preview period. See README.) + * @apiGroup users + * + * @apiParam {String} id + * @apiExample {js} ex: +github.users.declineRepoInvite({ ... }); + */ + +/** + * @api {delete} /user/emails deleteEmails + * @apiVersion 5.0.0 + * @apiName deleteEmails + * @apiDescription Delete email address(es) + * @apiGroup users + * + * @apiParam {Array} body You can post a single email address or an array of addresses. + * @apiExample {js} ex: +github.users.deleteEmails({ ... }); + */ + +/** + * @api {delete} /user/gpg_keys/:id deleteGpgKey + * @apiVersion 5.0.0 + * @apiName deleteGpgKey + * @apiDescription Delete a GPG key. (In preview period. See README.) + * @apiGroup users + * + * @apiParam {String} id + * @apiExample {js} ex: +github.users.deleteGpgKey({ ... }); + */ + +/** + * @api {delete} /user/keys/:id deleteKey + * @apiVersion 5.0.0 + * @apiName deleteKey + * @apiDescription Delete a public key + * @apiGroup users + * + * @apiParam {String} id + * @apiExample {js} ex: +github.users.deleteKey({ ... }); + */ + +/** + * @api {delete} /users/:user/site_admin demote + * @apiVersion 5.0.0 + * @apiName demote + * @apiDescription Demote a site administrator to an ordinary user + * @apiGroup users + * + * @apiParam {String} user + * @apiExample {js} ex: +github.users.demote({ ... }); + */ + +/** + * @api {patch} /user/memberships/orgs/:org editOrganizationMembership + * @apiVersion 5.0.0 + * @apiName editOrganizationMembership + * @apiDescription Edit your organization membership + * @apiGroup users + * + * @apiParam {String} org + * @apiParam {String} state The state that the membership should be in. Only "active" will be accepted. + * @apiExample {js} ex: +github.users.editOrganizationMembership({ ... }); + */ + +/** + * @api {put} /user/following/:user followUser + * @apiVersion 5.0.0 + * @apiName followUser + * @apiDescription Follow a user + * @apiGroup users + * + * @apiParam {String} user + * @apiExample {js} ex: +github.users.followUser({ ... }); + */ + +/** + * @api {get} /user get + * @apiVersion 5.0.0 + * @apiName get + * @apiDescription Get the authenticated user + * @apiGroup users + * + * @apiExample {js} ex: +github.users.get({ ... }); + */ + +/** + * @api {get} /users getAll + * @apiVersion 5.0.0 + * @apiName getAll + * @apiDescription Get all users + * @apiGroup users + * + * @apiParam {Number} [since] The integer ID of the last User that you’ve seen. + * @apiExample {js} ex: +github.users.getAll({ ... }); + */ + +/** + * @api {get} /user/:id getById + * @apiVersion 5.0.0 + * @apiName getById + * @apiDescription Get a single user by GitHub ID + * @apiGroup users + * + * @apiParam {String} id + * @apiExample {js} ex: +github.users.getById({ ... }); + */ + +/** + * @api {get} /user/emails getEmails + * @apiVersion 5.0.0 + * @apiName getEmails + * @apiDescription List email addresses for a user + * @apiGroup users + * + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.users.getEmails({ ... }); + */ + +/** + * @api {get} /users/followers getFollowers + * @apiVersion 5.0.0 + * @apiName getFollowers + * @apiDescription List the authenticated user's followers + * @apiGroup users + * + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.users.getFollowers({ ... }); + */ + +/** + * @api {get} /users/:user/followers getFollowersForUser + * @apiVersion 5.0.0 + * @apiName getFollowersForUser + * @apiDescription List a user's followers + * @apiGroup users + * + * @apiParam {String} user + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.users.getFollowersForUser({ ... }); + */ + +/** + * @api {get} /user/following getFollowing + * @apiVersion 5.0.0 + * @apiName getFollowing + * @apiDescription List who the authenticated user is following + * @apiGroup users + * + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.users.getFollowing({ ... }); + */ + +/** + * @api {get} /users/:user/following getFollowingForUser + * @apiVersion 5.0.0 + * @apiName getFollowingForUser + * @apiDescription List who a user is following + * @apiGroup users + * + * @apiParam {String} user + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.users.getFollowingForUser({ ... }); + */ + +/** + * @api {get} /users/:user getForUser + * @apiVersion 5.0.0 + * @apiName getForUser + * @apiDescription Get a single user + * @apiGroup users + * + * @apiParam {String} user + * @apiExample {js} ex: +github.users.getForUser({ ... }); + */ + +/** + * @api {get} /user/gpg_keys/:id getGpgKey + * @apiVersion 5.0.0 + * @apiName getGpgKey + * @apiDescription Get a single GPG key. (In preview period. See README.) + * @apiGroup users + * + * @apiParam {String} id + * @apiExample {js} ex: +github.users.getGpgKey({ ... }); + */ + +/** + * @api {get} /user/gpg_keys getGpgKeys + * @apiVersion 5.0.0 + * @apiName getGpgKeys + * @apiDescription List your GPG keys. (In preview period. See README.) + * @apiGroup users + * + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.users.getGpgKeys({ ... }); + */ + +/** + * @api {get} /user/keys/:id getKey + * @apiVersion 5.0.0 + * @apiName getKey + * @apiDescription Get a single public key + * @apiGroup users + * + * @apiParam {String} id + * @apiExample {js} ex: +github.users.getKey({ ... }); + */ + +/** + * @api {get} /user/keys getKeys + * @apiVersion 5.0.0 + * @apiName getKeys + * @apiDescription List your public keys + * @apiGroup users + * + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.users.getKeys({ ... }); + */ + +/** + * @api {get} /users/:user/keys getKeysForUser + * @apiVersion 5.0.0 + * @apiName getKeysForUser + * @apiDescription List public keys for a user + * @apiGroup users + * + * @apiParam {String} user + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.users.getKeysForUser({ ... }); + */ + +/** + * @api {get} /user/memberships/orgs/:org getOrganizationMembership + * @apiVersion 5.0.0 + * @apiName getOrganizationMembership + * @apiDescription Get your organization membership + * @apiGroup users + * + * @apiParam {String} org + * @apiExample {js} ex: +github.users.getOrganizationMembership({ ... }); + */ + +/** + * @api {get} /user/orgs getOrgs + * @apiVersion 5.0.0 + * @apiName getOrgs + * @apiDescription List organizations for the authenticated user. + * @apiGroup users + * + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.users.getOrgs({ ... }); + */ + +/** + * @api {get} /user/repository_invitations getRepoInvites + * @apiVersion 5.0.0 + * @apiName getRepoInvites + * @apiDescription List a user's repository invitations. (In preview period. See README.) + * @apiGroup users + * + * @apiExample {js} ex: +github.users.getRepoInvites({ ... }); + */ + +/** + * @api {get} /user/teams getTeams + * @apiVersion 5.0.0 + * @apiName getTeams + * @apiDescription Get your teams + * @apiGroup users + * + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.users.getTeams({ ... }); + */ + +/** + * @api {put} /users/:user/site_admin promote + * @apiVersion 5.0.0 + * @apiName promote + * @apiDescription Promote an ordinary user to a site administrator + * @apiGroup users + * + * @apiParam {String} user + * @apiExample {js} ex: +github.users.promote({ ... }); + */ + +/** + * @api {put} /users/:user/suspended suspend + * @apiVersion 5.0.0 + * @apiName suspend + * @apiDescription Suspend a user + * @apiGroup users + * + * @apiParam {String} user + * @apiExample {js} ex: +github.users.suspend({ ... }); + */ + +/** + * @api {delete} /user/following/:user unfollowUser + * @apiVersion 5.0.0 + * @apiName unfollowUser + * @apiDescription Unfollow a user + * @apiGroup users + * + * @apiParam {String} user + * @apiExample {js} ex: +github.users.unfollowUser({ ... }); + */ + +/** + * @api {delete} /users/:user/suspended unsuspend + * @apiVersion 5.0.0 + * @apiName unsuspend + * @apiDescription Unsuspend a user + * @apiGroup users + * + * @apiParam {String} user + * @apiExample {js} ex: +github.users.unsuspend({ ... }); + */ + +/** + * @api {patch} /user update + * @apiVersion 5.0.0 + * @apiName update + * @apiDescription Update the authenticated user + * @apiGroup users + * + * @apiParam {String} [name] The new name of the user + * @apiParam {String} [email] Publicly visible email address. + * @apiParam {String} [blog] The new blog URL of the user. + * @apiParam {String} [company] The new company of the user. + * @apiParam {String} [location] The new location of the user. + * @apiParam {Boolean} [hireable] The new hiring availability of the user. + * @apiParam {String} [bio] The new short biography of the user. + * @apiExample {js} ex: +github.users.update({ ... }); + */ + +/** + * @api {get} /notifications/threads/:id/subscription checkNotificationThreadSubscription + * @apiVersion 5.3.3 + * @apiName checkNotificationThreadSubscription + * @apiDescription Check to see if the current user is subscribed to a thread. + * @apiGroup activity + * + * @apiParam {String} id + * @apiExample {js} ex: +github.activity.checkNotificationThreadSubscription({ ... }); + */ + +/** + * @api {get} /user/starred/:owner/:repo checkStarringRepo + * @apiVersion 5.3.3 + * @apiName checkStarringRepo + * @apiDescription Check if you are starring a repository + * @apiGroup activity + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.activity.checkStarringRepo({ ... }); + */ + +/** + * @api {delete} /notifications/threads/:id/subscription deleteNotificationThreadSubscription + * @apiVersion 5.3.3 + * @apiName deleteNotificationThreadSubscription + * @apiDescription Delete a notification thread subscription. + * @apiGroup activity + * + * @apiParam {String} id + * @apiExample {js} ex: +github.activity.deleteNotificationThreadSubscription({ ... }); + */ + +/** + * @api {get} /events getEvents + * @apiVersion 5.3.3 + * @apiName getEvents + * @apiDescription List public events + * @apiGroup activity + * + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.activity.getEvents({ ... }); + */ + +/** + * @api {get} /orgs/:org/events getEventsForOrg + * @apiVersion 5.3.3 + * @apiName getEventsForOrg + * @apiDescription List public events for an organization + * @apiGroup activity + * + * @apiParam {String} org + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.activity.getEventsForOrg({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/events getEventsForRepo + * @apiVersion 5.3.3 + * @apiName getEventsForRepo + * @apiDescription List repository events + * @apiGroup activity + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.activity.getEventsForRepo({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/issues/events getEventsForRepoIssues + * @apiVersion 5.3.3 + * @apiName getEventsForRepoIssues + * @apiDescription List issue events for a repository + * @apiGroup activity + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.activity.getEventsForRepoIssues({ ... }); + */ + +/** + * @api {get} /networks/:owner/:repo/events getEventsForRepoNetwork + * @apiVersion 5.3.3 + * @apiName getEventsForRepoNetwork + * @apiDescription List public events for a network of repositories + * @apiGroup activity + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.activity.getEventsForRepoNetwork({ ... }); + */ + +/** + * @api {get} /users/:owner/events getEventsForUser + * @apiVersion 5.3.3 + * @apiName getEventsForUser + * @apiDescription List events performed by a user + * @apiGroup activity + * + * @apiParam {String} owner + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.activity.getEventsForUser({ ... }); + */ + +/** + * @api {get} /users/:owner/events/orgs/:org getEventsForUserOrg + * @apiVersion 5.3.3 + * @apiName getEventsForUserOrg + * @apiDescription List events for a user's organization + * @apiGroup activity + * + * @apiParam {String} owner + * @apiParam {String} org + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.activity.getEventsForUserOrg({ ... }); + */ + +/** + * @api {get} /users/:owner/events/public getEventsForUserPublic + * @apiVersion 5.3.3 + * @apiName getEventsForUserPublic + * @apiDescription List public events performed by a user + * @apiGroup activity + * + * @apiParam {String} owner + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.activity.getEventsForUserPublic({ ... }); + */ + +/** + * @api {get} /users/:owner/received_events getEventsReceived + * @apiVersion 5.3.3 + * @apiName getEventsReceived + * @apiDescription List events that a user has received + * @apiGroup activity + * + * @apiParam {String} owner + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.activity.getEventsReceived({ ... }); + */ + +/** + * @api {get} /users/:owner/received_events/public getEventsReceivedPublic + * @apiVersion 5.3.3 + * @apiName getEventsReceivedPublic + * @apiDescription List public events that a user has received + * @apiGroup activity + * + * @apiParam {String} owner + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.activity.getEventsReceivedPublic({ ... }); + */ + +/** + * @api {get} /feeds getFeeds + * @apiVersion 5.3.3 + * @apiName getFeeds + * @apiDescription Get all feeds available for the authenticated user. + * @apiGroup activity + * + * @apiExample {js} ex: +github.activity.getFeeds({ ... }); + */ + +/** + * @api {get} /notifications/threads/:id getNotificationThread + * @apiVersion 5.3.3 + * @apiName getNotificationThread + * @apiDescription View a single notification thread. + * @apiGroup activity + * + * @apiParam {String} id + * @apiExample {js} ex: +github.activity.getNotificationThread({ ... }); + */ + +/** + * @api {get} /notifications getNotifications + * @apiVersion 5.3.3 + * @apiName getNotifications + * @apiDescription Get all notifications for the current user, grouped by repository. + * @apiGroup activity + * + * @apiParam {Boolean} [all=false] If true, show notifications marked as read. Default: false + * @apiParam {Boolean} [participating=false] If true, only shows notifications in which the user is directly participating or mentioned. Default: false + * @apiParam {Date} [since] Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ + * @apiParam {String} [before] Only show notifications updated before the given time. This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ. + * @apiExample {js} ex: +github.activity.getNotifications({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/notifications getNotificationsForUser + * @apiVersion 5.3.3 + * @apiName getNotificationsForUser + * @apiDescription Get all notifications for the given user. + * @apiGroup activity + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Boolean} [all=false] If true, show notifications marked as read. Default: false + * @apiParam {Boolean} [participating=false] If true, only shows notifications in which the user is directly participating or mentioned. Default: false + * @apiParam {Date} [since] Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ + * @apiParam {String} [before] Only show notifications updated before the given time. This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ. + * @apiExample {js} ex: +github.activity.getNotificationsForUser({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/subscription getRepoSubscription + * @apiVersion 5.3.3 + * @apiName getRepoSubscription + * @apiDescription Get a Repository Subscription. + * @apiGroup activity + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.activity.getRepoSubscription({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/stargazers getStargazersForRepo + * @apiVersion 5.3.3 + * @apiName getStargazersForRepo + * @apiDescription List Stargazers + * @apiGroup activity + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.activity.getStargazersForRepo({ ... }); + */ + +/** + * @api {get} /user/starred getStarredRepos + * @apiVersion 5.3.3 + * @apiName getStarredRepos + * @apiDescription List repositories being starred by the authenticated user + * @apiGroup activity + * + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.activity.getStarredRepos({ ... }); + */ + +/** + * @api {get} /users/:owner/starred getStarredReposForUser + * @apiVersion 5.3.3 + * @apiName getStarredReposForUser + * @apiDescription List repositories being starred by a user + * @apiGroup activity + * + * @apiParam {String} owner + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.activity.getStarredReposForUser({ ... }); + */ + +/** + * @api {get} /user/subscriptions getWatchedRepos + * @apiVersion 5.3.3 + * @apiName getWatchedRepos + * @apiDescription List repositories being watched by the authenticated user. + * @apiGroup activity + * + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.activity.getWatchedRepos({ ... }); + */ + +/** + * @api {get} /users/:owner/subscriptions getWatchedReposForUser + * @apiVersion 5.3.3 + * @apiName getWatchedReposForUser + * @apiDescription List repositories being watched by a user. + * @apiGroup activity + * + * @apiParam {String} owner + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.activity.getWatchedReposForUser({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/subscribers getWatchersForRepo + * @apiVersion 5.3.3 + * @apiName getWatchersForRepo + * @apiDescription Get watchers for repository. + * @apiGroup activity + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.activity.getWatchersForRepo({ ... }); + */ + +/** + * @api {patch} /notifications/threads/:id markNotificationThreadAsRead + * @apiVersion 5.3.3 + * @apiName markNotificationThreadAsRead + * @apiDescription Mark a notification thread as read. + * @apiGroup activity + * + * @apiParam {String} id + * @apiExample {js} ex: +github.activity.markNotificationThreadAsRead({ ... }); + */ + +/** + * @api {put} /notifications markNotificationsAsRead + * @apiVersion 5.3.3 + * @apiName markNotificationsAsRead + * @apiDescription Mark notifications as read for authenticated user. + * @apiGroup activity + * + * @apiParam {String} [last_read_at=Time.now] Describes the last point that notifications were checked. Anything updated since this time will not be updated. This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ. Default: Time.now + * @apiExample {js} ex: +github.activity.markNotificationsAsRead({ ... }); + */ + +/** + * @api {put} /repos/:owner/:repo/notifications markNotificationsAsReadForRepo + * @apiVersion 5.3.3 + * @apiName markNotificationsAsReadForRepo + * @apiDescription Mark notifications in a repo as read. + * @apiGroup activity + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} [last_read_at=Time.now] Describes the last point that notifications were checked. Anything updated since this time will not be updated. This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ. Default: Time.now + * @apiExample {js} ex: +github.activity.markNotificationsAsReadForRepo({ ... }); + */ + +/** + * @api {put} /notifications/threads/:id/subscription setNotificationThreadSubscription + * @apiVersion 5.3.3 + * @apiName setNotificationThreadSubscription + * @apiDescription This lets you subscribe or unsubscribe from a conversation. Unsubscribing from a conversation mutes all future notifications (until you comment or get @mentioned once more). + * @apiGroup activity + * + * @apiParam {String} id + * @apiParam {Boolean} [subscribed] Determines if notifications should be received from this thread + * @apiParam {Boolean} [ignored] Determines if all notifications should be blocked from this thread + * @apiExample {js} ex: +github.activity.setNotificationThreadSubscription({ ... }); + */ + +/** + * @api {put} /repos/:owner/:repo/subscription setRepoSubscription + * @apiVersion 5.3.3 + * @apiName setRepoSubscription + * @apiDescription Set a Repository Subscription + * @apiGroup activity + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Boolean} [subscribed] Determines if notifications should be received from this repository. + * @apiParam {Boolean} [ignored] Determines if all notifications should be blocked from this repository. + * @apiExample {js} ex: +github.activity.setRepoSubscription({ ... }); + */ + +/** + * @api {put} /user/starred/:owner/:repo starRepo + * @apiVersion 5.3.3 + * @apiName starRepo + * @apiDescription Star a repository + * @apiGroup activity + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiExample {js} ex: +github.activity.starRepo({ ... }); + */ + +/** + * @api {delete} /user/starred/:owner/:repo unstarRepo + * @apiVersion 5.3.3 + * @apiName unstarRepo + * @apiDescription Unstar a repository + * @apiGroup activity + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiExample {js} ex: +github.activity.unstarRepo({ ... }); + */ + +/** + * @api {delete} /repos/:owner/:repo/subscription unwatchRepo + * @apiVersion 5.3.3 + * @apiName unwatchRepo + * @apiDescription Unwatch a repository. + * @apiGroup activity + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiExample {js} ex: +github.activity.unwatchRepo({ ... }); + */ + +/** + * @api {get} /applications/:client_id/tokens/:access_token check + * @apiVersion 5.3.3 + * @apiName check + * @apiDescription Check an authorization + * @apiGroup authorization + * + * @apiParam {String} access_token OAuth token + * @apiParam {String} [client_id] The 20 character OAuth app client key for which to create the token. + * @apiExample {js} ex: +github.authorization.check({ ... }); + */ + +/** + * @api {post} /authorizations create + * @apiVersion 5.3.3 + * @apiName create + * @apiDescription Create a new authorization. + * @apiGroup authorization + * + * @apiParam {Array} [scopes] A list of scopes that this authorization is in. + * @apiParam {String} [note] A note to remind you what the OAuth token is for. + * @apiParam {String} [note_url] A URL to remind you what app the OAuth token is for. + * @apiParam {String} [client_id] The 20 character OAuth app client key for which to create the token. + * @apiParam {String} [client_secret] The 40 character OAuth app client secret for which to create the token. + * @apiParam {String} [fingerprint] A unique string to distinguish an authorization from others created for the same client ID and user. + * @apiExample {js} ex: +github.authorization.create({ ... }); + */ + +/** + * @api {delete} /authorizations/:id delete + * @apiVersion 5.3.3 + * @apiName delete + * @apiDescription Delete an authorization. + * @apiGroup authorization + * + * @apiParam {String} id + * @apiExample {js} ex: +github.authorization.delete({ ... }); + */ + +/** + * @api {delete} /applications/grants/:id deleteGrant + * @apiVersion 5.3.3 + * @apiName deleteGrant + * @apiDescription Delete a grant. + * @apiGroup authorization + * + * @apiParam {String} id + * @apiExample {js} ex: +github.authorization.deleteGrant({ ... }); + */ + +/** + * @api {get} /authorizations/:id get + * @apiVersion 5.3.3 + * @apiName get + * @apiDescription Get a single authorization. + * @apiGroup authorization + * + * @apiParam {String} id + * @apiExample {js} ex: +github.authorization.get({ ... }); + */ + +/** + * @api {get} /authorizations getAll + * @apiVersion 5.3.3 + * @apiName getAll + * @apiDescription List your authorizations. + * @apiGroup authorization + * + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.authorization.getAll({ ... }); + */ + +/** + * @api {get} /applications/grants/:id getGrant + * @apiVersion 5.3.3 + * @apiName getGrant + * @apiDescription Get a single grant. + * @apiGroup authorization + * + * @apiParam {String} id + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.authorization.getGrant({ ... }); + */ + +/** + * @api {get} /applications/grants getGrants + * @apiVersion 5.3.3 + * @apiName getGrants + * @apiDescription List your grants. + * @apiGroup authorization + * + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.authorization.getGrants({ ... }); + */ + +/** + * @api {put} /authorizations/clients/:client_id getOrCreateAuthorizationForApp + * @apiVersion 5.3.3 + * @apiName getOrCreateAuthorizationForApp + * @apiDescription Get or create an authorization for a specific app. + * @apiGroup authorization + * + * @apiParam {String} client_secret The 40 character OAuth app client secret associated with the client ID specified in the URL. + * @apiParam {String} [client_id] The 20 character OAuth app client key for which to create the token. + * @apiParam {Array} [scopes] A list of scopes that this authorization is in. + * @apiParam {String} [note] A note to remind you what the OAuth token is for. + * @apiParam {String} [note_url] A URL to remind you what app the OAuth token is for. + * @apiParam {String} [fingerprint] A unique string to distinguish an authorization from others created for the same client ID and user. + * @apiExample {js} ex: +github.authorization.getOrCreateAuthorizationForApp({ ... }); + */ + +/** + * @api {put} /authorizations/clients/:client_id/:fingerprint getOrCreateAuthorizationForAppAndFingerprint + * @apiVersion 5.3.3 + * @apiName getOrCreateAuthorizationForAppAndFingerprint + * @apiDescription Get or create an authorization for a specific app and fingerprint. + * @apiGroup authorization + * + * @apiParam {String} client_secret The 40 character OAuth app client secret associated with the client ID specified in the URL. + * @apiParam {String} [client_id] The 20 character OAuth app client key for which to create the token. + * @apiParam {String} [fingerprint] A unique string to distinguish an authorization from others created for the same client ID and user. + * @apiParam {Array} [scopes] A list of scopes that this authorization is in. + * @apiParam {String} [note] A note to remind you what the OAuth token is for. + * @apiParam {String} [note_url] A URL to remind you what app the OAuth token is for. + * @apiExample {js} ex: +github.authorization.getOrCreateAuthorizationForAppAndFingerprint({ ... }); + */ + +/** + * @api {post} /applications/:client_id/tokens/:access_token reset + * @apiVersion 5.3.3 + * @apiName reset + * @apiDescription Reset an authorization + * @apiGroup authorization + * + * @apiParam {String} access_token OAuth token + * @apiParam {String} [client_id] The 20 character OAuth app client key for which to create the token. + * @apiExample {js} ex: +github.authorization.reset({ ... }); + */ + +/** + * @api {delete} /applications/:client_id/tokens/:access_token revoke + * @apiVersion 5.3.3 + * @apiName revoke + * @apiDescription Revoke an authorization for an application + * @apiGroup authorization + * + * @apiParam {String} access_token OAuth token + * @apiParam {String} [client_id] The 20 character OAuth app client key for which to create the token. + * @apiExample {js} ex: +github.authorization.revoke({ ... }); + */ + +/** + * @api {patch} /authorizations/:id update + * @apiVersion 5.3.3 + * @apiName update + * @apiDescription Update an existing authorization. + * @apiGroup authorization + * + * @apiParam {String} id + * @apiParam {Array} [scopes] A list of scopes that this authorization is in. + * @apiParam {Array} [add_scopes] A list of scopes to add to this authorization. + * @apiParam {Array} [remove_scopes] A list of scopes to remove from this authorization. + * @apiParam {String} [note] A note to remind you what the OAuth token is for. + * @apiParam {String} [note_url] A URL to remind you what app the OAuth token is for. + * @apiExample {js} ex: +github.authorization.update({ ... }); + */ + +/** + * @api {post} /admin/organizations createOrg + * @apiVersion 5.3.3 + * @apiName createOrg + * @apiDescription Create an organization + * @apiGroup enterprise + * + * @apiParam {String} login The organization's username. + * @apiParam {String} admin The login of the user who will manage this organization. + * @apiParam {String} [profile_name] The organization's display name. + * @apiExample {js} ex: +github.enterprise.createOrg({ ... }); + */ + +/** + * @api {post} /admin/pre_receive_environments createPreReceiveEnvironment + * @apiVersion 5.3.3 + * @apiName createPreReceiveEnvironment + * @apiDescription Create a pre-receive environment. (In preview period. See README.) + * @apiGroup enterprise + * + * @apiParam {String} name The new pre-receive environment's name. + * @apiParam {String} image_url URL from which to download a tarball of this environment. + * @apiExample {js} ex: +github.enterprise.createPreReceiveEnvironment({ ... }); + */ + +/** + * @api {post} /admin/pre-receive-hooks createPreReceiveHook + * @apiVersion 5.3.3 + * @apiName createPreReceiveHook + * @apiDescription Create a pre-receive hook. (In preview period. See README.) + * @apiGroup enterprise + * + * @apiParam {String} name The name of the hook. + * @apiParam {String} script The script that the hook runs. + * @apiParam {Json} script_repository The GitHub repository where the script is kept. + * @apiParam {Json} environment The pre-receive environment where the script is executed. + * @apiParam {String} [enforcement=disabled] The state of enforcement for this hook. default: disabled + * @apiParam {Boolean} [allow_downstream_configuration=false] Whether enforcement can be overridden at the org or repo level. default: false + * @apiExample {js} ex: +github.enterprise.createPreReceiveHook({ ... }); + */ + +/** + * @api {delete} /admin/pre_receive_environments/:id deletePreReceiveEnvironment + * @apiVersion 5.3.3 + * @apiName deletePreReceiveEnvironment + * @apiDescription Delete a pre-receive environment. (In preview period. See README.) + * @apiGroup enterprise + * + * @apiParam {String} id + * @apiExample {js} ex: +github.enterprise.deletePreReceiveEnvironment({ ... }); + */ + +/** + * @api {delete} /admin/pre_receive_hooks/:id deletePreReceiveHook + * @apiVersion 5.3.3 + * @apiName deletePreReceiveHook + * @apiDescription Delete a pre-receive hook. (In preview period. See README.) + * @apiGroup enterprise + * + * @apiParam {String} id + * @apiExample {js} ex: +github.enterprise.deletePreReceiveHook({ ... }); + */ + +/** + * @api {patch} /admin/pre_receive_environments/:id editPreReceiveEnvironment + * @apiVersion 5.3.3 + * @apiName editPreReceiveEnvironment + * @apiDescription Create a pre-receive environment. (In preview period. See README.) + * @apiGroup enterprise + * + * @apiParam {String} id + * @apiParam {String} name This pre-receive environment's new name. + * @apiParam {String} image_url URL from which to download a tarball of this environment. + * @apiExample {js} ex: +github.enterprise.editPreReceiveEnvironment({ ... }); + */ + +/** + * @api {patch} /admin/pre_receive_hooks/:id editPreReceiveHook + * @apiVersion 5.3.3 + * @apiName editPreReceiveHook + * @apiDescription Edit a pre-receive hook. (In preview period. See README.) + * @apiGroup enterprise + * + * @apiParam {String} id + * @apiParam {Json} body JSON object that contains pre-receive hook info. + * @apiExample {js} ex: +github.enterprise.editPreReceiveHook({ ... }); + */ + +/** + * @api {get} /enterprise/settings/license getLicense + * @apiVersion 5.3.3 + * @apiName getLicense + * @apiDescription Get license information + * @apiGroup enterprise + * + * @apiExample {js} ex: +github.enterprise.getLicense({ ... }); + */ + +/** + * @api {get} /admin/pre-receive-environments/:id getPreReceiveEnvironment + * @apiVersion 5.3.3 + * @apiName getPreReceiveEnvironment + * @apiDescription Get a single pre-receive environment. (In preview period. See README.) + * @apiGroup enterprise + * + * @apiParam {String} id + * @apiExample {js} ex: +github.enterprise.getPreReceiveEnvironment({ ... }); + */ + +/** + * @api {get} /admin/pre-receive-environments/:id/downloads/latest getPreReceiveEnvironmentDownloadStatus + * @apiVersion 5.3.3 + * @apiName getPreReceiveEnvironmentDownloadStatus + * @apiDescription Get a pre-receive environment's download status. (In preview period. See README.) + * @apiGroup enterprise + * + * @apiParam {String} id + * @apiExample {js} ex: +github.enterprise.getPreReceiveEnvironmentDownloadStatus({ ... }); + */ + +/** + * @api {get} /admin/pre_receive_environments getPreReceiveEnvironments + * @apiVersion 5.3.3 + * @apiName getPreReceiveEnvironments + * @apiDescription List pre-receive environments. (In preview period. See README.) + * @apiGroup enterprise + * + * @apiExample {js} ex: +github.enterprise.getPreReceiveEnvironments({ ... }); + */ + +/** + * @api {get} /admin/pre-receive-hooks/:id getPreReceiveHook + * @apiVersion 5.3.3 + * @apiName getPreReceiveHook + * @apiDescription Get a single pre-receive hook. (In preview period. See README.) + * @apiGroup enterprise + * + * @apiParam {String} id + * @apiExample {js} ex: +github.enterprise.getPreReceiveHook({ ... }); + */ + +/** + * @api {get} /admin/pre-receive-hooks getPreReceiveHooks + * @apiVersion 5.3.3 + * @apiName getPreReceiveHooks + * @apiDescription List pre-receive hooks. (In preview period. See README.) + * @apiGroup enterprise + * + * @apiExample {js} ex: +github.enterprise.getPreReceiveHooks({ ... }); + */ + +/** + * @api {post} /staff/indexing_jobs queueIndexingJob + * @apiVersion 5.3.3 + * @apiName queueIndexingJob + * @apiDescription Queue an indexing job + * @apiGroup enterprise + * + * @apiParam {String} target A string representing the item to index. + * @apiExample {js} ex: +github.enterprise.queueIndexingJob({ ... }); + */ + +/** + * @api {get} /enterprise/stats/:type stats + * @apiVersion 5.3.3 + * @apiName stats + * @apiDescription Get statistics. + * @apiGroup enterprise + * + * @apiParam {String} type Possible values: issues, hooks, milestones, orgs, comments, pages, users, gists, pulls, repos, all. + * @apiExample {js} ex: +github.enterprise.stats({ ... }); + */ + +/** + * @api {post} /admin/ldap/teams/:team_id/sync syncLdapForTeam + * @apiVersion 5.3.3 + * @apiName syncLdapForTeam + * @apiDescription Sync LDAP mapping for a team. + * @apiGroup enterprise + * + * @apiParam {Number} team_id + * @apiExample {js} ex: +github.enterprise.syncLdapForTeam({ ... }); + */ + +/** + * @api {post} /admin/ldap/users/:user/sync syncLdapForUser + * @apiVersion 5.3.3 + * @apiName syncLdapForUser + * @apiDescription Sync LDAP mapping for a user. + * @apiGroup enterprise + * + * @apiParam {String} user + * @apiExample {js} ex: +github.enterprise.syncLdapForUser({ ... }); + */ + +/** + * @api {post} /admin/pre_receive_environments/:id/downloads triggerPreReceiveEnvironmentDownload + * @apiVersion 5.3.3 + * @apiName triggerPreReceiveEnvironmentDownload + * @apiDescription Trigger a pre-receive environment download. (In preview period. See README.) + * @apiGroup enterprise + * + * @apiParam {String} id + * @apiExample {js} ex: +github.enterprise.triggerPreReceiveEnvironmentDownload({ ... }); + */ + +/** + * @api {patch} /admin/ldap/teams/:team_id/mapping updateLdapForTeam + * @apiVersion 5.3.3 + * @apiName updateLdapForTeam + * @apiDescription Update LDAP mapping for a team. + * @apiGroup enterprise + * + * @apiParam {Number} team_id + * @apiParam {String} ldap_dn LDAP DN for user + * @apiExample {js} ex: +github.enterprise.updateLdapForTeam({ ... }); + */ + +/** + * @api {patch} /admin/ldap/users/:user/mapping updateLdapForUser + * @apiVersion 5.3.3 + * @apiName updateLdapForUser + * @apiDescription Update LDAP mapping for a user. + * @apiGroup enterprise + * + * @apiParam {String} user + * @apiParam {String} ldap_dn LDAP DN for user + * @apiExample {js} ex: +github.enterprise.updateLdapForUser({ ... }); + */ + +/** + * @api {get} /gists/:id/star checkStar + * @apiVersion 5.3.3 + * @apiName checkStar + * @apiDescription Check if a gist is starred + * @apiGroup gists + * + * @apiParam {String} id + * @apiExample {js} ex: +github.gists.checkStar({ ... }); + */ + +/** + * @api {post} /gists create + * @apiVersion 5.3.3 + * @apiName create + * @apiDescription Create a gist + * @apiGroup gists + * + * @apiParam {Json} files Files that make up this gist. The key of which should be a required string filename and the value another required hash with parameters: 'content' + * @apiParam {Boolean} public + * @apiParam {String} [description] + * @apiExample {js} ex: +github.gists.create({ ... }); + */ + +/** + * @api {post} /gists/:gist_id/comments createComment + * @apiVersion 5.3.3 + * @apiName createComment + * @apiDescription Create a comment + * @apiGroup gists + * + * @apiParam {String} gist_id Id (SHA1 hash) of the gist. + * @apiParam {String} body + * @apiExample {js} ex: +github.gists.createComment({ ... }); + */ + +/** + * @api {delete} /gists/:id delete + * @apiVersion 5.3.3 + * @apiName delete + * @apiDescription Delete a gist + * @apiGroup gists + * + * @apiParam {String} id + * @apiExample {js} ex: +github.gists.delete({ ... }); + */ + +/** + * @api {delete} /gists/:gist_id/comments/:id deleteComment + * @apiVersion 5.3.3 + * @apiName deleteComment + * @apiDescription Delete a comment + * @apiGroup gists + * + * @apiParam {String} gist_id Id (SHA1 hash) of the gist. + * @apiParam {String} id + * @apiExample {js} ex: +github.gists.deleteComment({ ... }); + */ + +/** + * @api {patch} /gists/:id edit + * @apiVersion 5.3.3 + * @apiName edit + * @apiDescription Edit a gist + * @apiGroup gists + * + * @apiParam {String} id + * @apiParam {Json} files Files that make up this gist. The key of which should be a required string filename and the value another required hash with parameters: 'content' + * @apiParam {String} [description] + * @apiParam {String} [content] Updated file contents. + * @apiParam {String} [filename] New name for this file. + * @apiExample {js} ex: +github.gists.edit({ ... }); + */ + +/** + * @api {patch} /gists/:gist_id/comments/:id editComment + * @apiVersion 5.3.3 + * @apiName editComment + * @apiDescription Edit a comment + * @apiGroup gists + * + * @apiParam {String} gist_id Id (SHA1 hash) of the gist. + * @apiParam {String} id + * @apiParam {String} body + * @apiExample {js} ex: +github.gists.editComment({ ... }); + */ + +/** + * @api {post} /gists/:id/forks fork + * @apiVersion 5.3.3 + * @apiName fork + * @apiDescription Fork a gist + * @apiGroup gists + * + * @apiParam {String} id + * @apiExample {js} ex: +github.gists.fork({ ... }); + */ + +/** + * @api {get} /gists/:id get + * @apiVersion 5.3.3 + * @apiName get + * @apiDescription Get a single gist + * @apiGroup gists + * + * @apiParam {String} id + * @apiExample {js} ex: +github.gists.get({ ... }); + */ + +/** + * @api {get} /gists getAll + * @apiVersion 5.3.3 + * @apiName getAll + * @apiDescription List the authenticated user's gists or if called anonymously, this will return all public gists + * @apiGroup gists + * + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiParam {Date} [since] Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ + * @apiExample {js} ex: +github.gists.getAll({ ... }); + */ + +/** + * @api {get} /gists/:gist_id/comments/:id getComment + * @apiVersion 5.3.3 + * @apiName getComment + * @apiDescription Get a single comment + * @apiGroup gists + * + * @apiParam {String} gist_id Id (SHA1 hash) of the gist. + * @apiParam {String} id + * @apiExample {js} ex: +github.gists.getComment({ ... }); + */ + +/** + * @api {get} /gists/:gist_id/comments getComments + * @apiVersion 5.3.3 + * @apiName getComments + * @apiDescription List comments on a gist + * @apiGroup gists + * + * @apiParam {String} gist_id Id (SHA1 hash) of the gist. + * @apiExample {js} ex: +github.gists.getComments({ ... }); + */ + +/** + * @api {get} /gists/:id/commits getCommits + * @apiVersion 5.3.3 + * @apiName getCommits + * @apiDescription List gist commits + * @apiGroup gists + * + * @apiParam {String} id + * @apiExample {js} ex: +github.gists.getCommits({ ... }); + */ + +/** + * @api {get} /users/:owner/gists getForUser + * @apiVersion 5.3.3 + * @apiName getForUser + * @apiDescription List a user's gists + * @apiGroup gists + * + * @apiParam {String} owner + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiParam {Date} [since] Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ + * @apiExample {js} ex: +github.gists.getForUser({ ... }); + */ + +/** + * @api {get} /gists/:id/forks getForks + * @apiVersion 5.3.3 + * @apiName getForks + * @apiDescription List gist forks + * @apiGroup gists + * + * @apiParam {String} id + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.gists.getForks({ ... }); + */ + +/** + * @api {get} /gists/public getPublic + * @apiVersion 5.3.3 + * @apiName getPublic + * @apiDescription List all public gists + * @apiGroup gists + * + * @apiParam {Date} [since] Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ + * @apiExample {js} ex: +github.gists.getPublic({ ... }); + */ + +/** + * @api {get} /gists/:id/:sha getRevision + * @apiVersion 5.3.3 + * @apiName getRevision + * @apiDescription Get a specific revision of a gist + * @apiGroup gists + * + * @apiParam {String} id + * @apiParam {String} sha + * @apiExample {js} ex: +github.gists.getRevision({ ... }); + */ + +/** + * @api {get} /gists/starred getStarred + * @apiVersion 5.3.3 + * @apiName getStarred + * @apiDescription List the authenticated user's starred gists + * @apiGroup gists + * + * @apiParam {Date} [since] Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ + * @apiExample {js} ex: +github.gists.getStarred({ ... }); + */ + +/** + * @api {put} /gists/:id/star star + * @apiVersion 5.3.3 + * @apiName star + * @apiDescription Star a gist + * @apiGroup gists + * + * @apiParam {String} id + * @apiExample {js} ex: +github.gists.star({ ... }); + */ + +/** + * @api {delete} /gists/:id/star unstar + * @apiVersion 5.3.3 + * @apiName unstar + * @apiDescription Unstar a gist + * @apiGroup gists + * + * @apiParam {String} id + * @apiExample {js} ex: +github.gists.unstar({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/git/blobs createBlob + * @apiVersion 5.3.3 + * @apiName createBlob + * @apiDescription Create a Blob + * @apiGroup gitdata + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} content + * @apiParam {String} encoding + * @apiExample {js} ex: +github.gitdata.createBlob({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/git/commits createCommit + * @apiVersion 5.3.3 + * @apiName createCommit + * @apiDescription Create a Commit + * @apiGroup gitdata + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} message String of the commit message + * @apiParam {String} tree String of the SHA of the tree object this commit points to + * @apiParam {Array} parents Array of the SHAs of the commits that were the parents of this commit. If omitted or empty, the commit will be written as a root commit. For a single parent, an array of one SHA should be provided, for a merge commit, an array of more than one should be provided. + * @apiParam {Json} [author] + * @apiParam {Json} [committer] + * @apiExample {js} ex: +github.gitdata.createCommit({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/git/refs createReference + * @apiVersion 5.3.3 + * @apiName createReference + * @apiDescription Create a Reference + * @apiGroup gitdata + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} ref String of the name of the fully qualified reference (ie: heads/master). If it doesn’t have at least one slash, it will be rejected. + * @apiParam {String} sha + * @apiExample {js} ex: +github.gitdata.createReference({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/git/tags createTag + * @apiVersion 5.3.3 + * @apiName createTag + * @apiDescription Create a Tag Object + * @apiGroup gitdata + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} tag String of the tag + * @apiParam {String} message String of the tag message + * @apiParam {String} object String of the SHA of the git object this is tagging + * @apiParam {String} type String of the type of the object we’re tagging. Normally this is a commit but it can also be a tree or a blob. + * @apiParam {Json} tagger JSON object that contains the following keys: `name` - String of the name of the author of the tag, `email` - String of the email of the author of the tag, `date` - Timestamp of when this object was tagged + * @apiExample {js} ex: +github.gitdata.createTag({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/git/trees createTree + * @apiVersion 5.3.3 + * @apiName createTree + * @apiDescription Create a Tree + * @apiGroup gitdata + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Json} tree Array of Hash objects (of path, mode, type and sha) specifying a tree structure + * @apiParam {String} [base_tree] String of the SHA1 of the tree you want to update with new data + * @apiExample {js} ex: +github.gitdata.createTree({ ... }); + */ + +/** + * @api {delete} /repos/:owner/:repo/git/refs/:ref deleteReference + * @apiVersion 5.3.3 + * @apiName deleteReference + * @apiDescription Delete a Reference + * @apiGroup gitdata + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} ref String of the name of the fully qualified reference (ie: heads/master). If it doesn’t have at least one slash, it will be rejected. + * @apiExample {js} ex: +github.gitdata.deleteReference({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/git/blobs/:sha getBlob + * @apiVersion 5.3.3 + * @apiName getBlob + * @apiDescription Get a Blob + * @apiGroup gitdata + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} sha + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.gitdata.getBlob({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/git/commits/:sha getCommit + * @apiVersion 5.3.3 + * @apiName getCommit + * @apiDescription Get a Commit + * @apiGroup gitdata + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} sha + * @apiExample {js} ex: +github.gitdata.getCommit({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/git/commits/:sha getCommitSignatureVerification + * @apiVersion 5.3.3 + * @apiName getCommitSignatureVerification + * @apiDescription Get a Commit Signature Verification. (In preview period. See README.) + * @apiGroup gitdata + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} sha + * @apiExample {js} ex: +github.gitdata.getCommitSignatureVerification({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/git/refs/:ref getReference + * @apiVersion 5.3.3 + * @apiName getReference + * @apiDescription Get a Reference + * @apiGroup gitdata + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} ref String of the name of the fully qualified reference (ie: heads/master). If it doesn’t have at least one slash, it will be rejected. + * @apiExample {js} ex: +github.gitdata.getReference({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/git/refs getReferences + * @apiVersion 5.3.3 + * @apiName getReferences + * @apiDescription Get all References + * @apiGroup gitdata + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.gitdata.getReferences({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/git/tags/:sha getTag + * @apiVersion 5.3.3 + * @apiName getTag + * @apiDescription Get a Tag + * @apiGroup gitdata + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} sha + * @apiExample {js} ex: +github.gitdata.getTag({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/git/tags/:sha getTagSignatureVerification + * @apiVersion 5.3.3 + * @apiName getTagSignatureVerification + * @apiDescription Get a Tag Signature Verification. (In preview period. See README.) + * @apiGroup gitdata + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} sha + * @apiExample {js} ex: +github.gitdata.getTagSignatureVerification({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/git/refs/tags getTags + * @apiVersion 5.3.3 + * @apiName getTags + * @apiDescription Get all tag References + * @apiGroup gitdata + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.gitdata.getTags({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/git/trees/:sha getTree + * @apiVersion 5.3.3 + * @apiName getTree + * @apiDescription Get a Tree + * @apiGroup gitdata + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} sha + * @apiParam {Boolean} [recursive] + * @apiExample {js} ex: +github.gitdata.getTree({ ... }); + */ + +/** + * @api {patch} /repos/:owner/:repo/git/refs/:ref updateReference + * @apiVersion 5.3.3 + * @apiName updateReference + * @apiDescription Update a Reference + * @apiGroup gitdata + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} ref String of the name of the fully qualified reference (ie: heads/master). If it doesn’t have at least one slash, it will be rejected. + * @apiParam {String} sha + * @apiParam {Boolean} [force=false] Boolean indicating whether to force the update or to make sure the update is a fast-forward update. The default is false, so leaving this out or setting it to false will make sure you’re not overwriting work. + * @apiExample {js} ex: +github.gitdata.updateReference({ ... }); + */ + +/** + * @api {post} /installations/:installation_id/access_tokens createInstallationToken + * @apiVersion 5.3.3 + * @apiName createInstallationToken + * @apiDescription Create a new installation token. (In preview period. See README.) + * @apiGroup integrations + * + * @apiParam {Number} installation_id The id of the installation for this integration. + * @apiParam {Number} [user_id] The id of the user for whom the integration is acting on behalf of. + * @apiExample {js} ex: +github.integrations.createInstallationToken({ ... }); + */ + +/** + * @api {get} /installation/repositories getInstallationRepositories + * @apiVersion 5.3.3 + * @apiName getInstallationRepositories + * @apiDescription List repositories that are accessible to the authenticated installation. + * @apiGroup integrations + * + * @apiParam {String} [user_id] The integer ID of a user, to filter results to repositories that are visible to both the installation and the given user. + * @apiExample {js} ex: +github.integrations.getInstallationRepositories({ ... }); + */ + +/** + * @api {get} /integration/installations getInstallations + * @apiVersion 5.3.3 + * @apiName getInstallations + * @apiDescription List the integration's installations. (In preview period. See README.) + * @apiGroup integrations + * + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.integrations.getInstallations({ ... }); + */ + +/** + * @api {post} /integration/identity/user getUserIdentity + * @apiVersion 5.3.3 + * @apiName getUserIdentity + * @apiDescription Request identity of user. (In preview period. See README.) + * @apiGroup integrations + * + * @apiParam {String} [nonce] + * @apiExample {js} ex: +github.integrations.getUserIdentity({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/issues/:number/assignees addAssigneesToIssue + * @apiVersion 5.3.3 + * @apiName addAssigneesToIssue + * @apiDescription Add assignees to an issue. + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiParam {Array} assignees Logins for the users that should be added to the issue. + * @apiExample {js} ex: +github.issues.addAssigneesToIssue({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/issues/:number/labels addLabels + * @apiVersion 5.3.3 + * @apiName addLabels + * @apiDescription Add labels to an issue + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiParam {Array} body + * @apiExample {js} ex: +github.issues.addLabels({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/assignees/:assignee checkAssignee + * @apiVersion 5.3.3 + * @apiName checkAssignee + * @apiDescription Check assignee + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} assignee Login for the user that this issue should be assigned to. + * @apiExample {js} ex: +github.issues.checkAssignee({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/issues create + * @apiVersion 5.3.3 + * @apiName create + * @apiDescription Create an issue + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} title + * @apiParam {String} [body] + * @apiParam {String} [assignee] Login for the user that this issue should be assigned to. + * @apiParam {Number} [milestone] Milestone to associate this issue with. + * @apiParam {Json} [labels] Array of strings - Labels to associate with this issue. + * @apiParam {Array} [assignees] Logins for Users to assign to this issue. NOTE: Only users with push access can set assignees for new issues. Assignees are silently dropped otherwise. + * @apiExample {js} ex: +github.issues.create({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/issues/:number/comments createComment + * @apiVersion 5.3.3 + * @apiName createComment + * @apiDescription Create a comment + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiParam {String} body + * @apiExample {js} ex: +github.issues.createComment({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/labels createLabel + * @apiVersion 5.3.3 + * @apiName createLabel + * @apiDescription Create a label + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} name + * @apiParam {String} color 6 character hex code, without a leading #. + * @apiExample {js} ex: +github.issues.createLabel({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/milestones createMilestone + * @apiVersion 5.3.3 + * @apiName createMilestone + * @apiDescription Create a milestone + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} title + * @apiParam {String} [state=open] + * @apiParam {String} [description] + * @apiParam {Date} [due_on] Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ + * @apiExample {js} ex: +github.issues.createMilestone({ ... }); + */ + +/** + * @api {delete} /repos/:owner/:repo/issues/comments/:id deleteComment + * @apiVersion 5.3.3 + * @apiName deleteComment + * @apiDescription Delete a comment + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiExample {js} ex: +github.issues.deleteComment({ ... }); + */ + +/** + * @api {delete} /repos/:owner/:repo/labels/:name deleteLabel + * @apiVersion 5.3.3 + * @apiName deleteLabel + * @apiDescription Delete a label + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} name + * @apiExample {js} ex: +github.issues.deleteLabel({ ... }); + */ + +/** + * @api {delete} /repos/:owner/:repo/milestones/:number deleteMilestone + * @apiVersion 5.3.3 + * @apiName deleteMilestone + * @apiDescription Delete a milestone + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiExample {js} ex: +github.issues.deleteMilestone({ ... }); + */ + +/** + * @api {patch} /repos/:owner/:repo/issues/:number edit + * @apiVersion 5.3.3 + * @apiName edit + * @apiDescription Edit an issue + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiParam {String} [title] + * @apiParam {String} [body] + * @apiParam {String} [assignee] Login for the user that this issue should be assigned to. + * @apiParam {String} [state=open] open or closed + * @apiParam {Number} [milestone] Milestone to associate this issue with. + * @apiParam {Json} [labels] Array of strings - Labels to associate with this issue. + * @apiParam {Array} [assignees] Logins for Users to assign to this issue. Pass one or more user logins to replace the set of assignees on this Issue. .Send an empty array ([]) to clear all assignees from the Issue. NOTE: Only users with push access can set assignees for new issues. Assignees are silently dropped otherwise. + * @apiExample {js} ex: +github.issues.edit({ ... }); + */ + +/** + * @api {patch} /repos/:owner/:repo/issues/comments/:id editComment + * @apiVersion 5.3.3 + * @apiName editComment + * @apiDescription Edit a comment + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiParam {String} body + * @apiExample {js} ex: +github.issues.editComment({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/issues/:number get + * @apiVersion 5.3.3 + * @apiName get + * @apiDescription Get a single issue + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiExample {js} ex: +github.issues.get({ ... }); + */ + +/** + * @api {get} /issues getAll + * @apiVersion 5.3.3 + * @apiName getAll + * @apiDescription List all issues across all the authenticated user's visible repositories including owned repositories, member repositories, and organization repositories + * @apiGroup issues + * + * @apiParam {String} [filter] + * @apiParam {String} [state=open] open, closed, or all + * @apiParam {String} [labels] String list of comma separated Label names. Example: bug,ui,@high + * @apiParam {String} [sort=created] + * @apiParam {String} [direction=desc] + * @apiParam {Date} [since] Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.issues.getAll({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/assignees getAssignees + * @apiVersion 5.3.3 + * @apiName getAssignees + * @apiDescription List assignees + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiExample {js} ex: +github.issues.getAssignees({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/issues/comments/:id getComment + * @apiVersion 5.3.3 + * @apiName getComment + * @apiDescription Get a single comment + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiExample {js} ex: +github.issues.getComment({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/issues/:number/comments getComments + * @apiVersion 5.3.3 + * @apiName getComments + * @apiDescription List comments on an issue + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.issues.getComments({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/issues/comments getCommentsForRepo + * @apiVersion 5.3.3 + * @apiName getCommentsForRepo + * @apiDescription List comments in a repository + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} [sort=created] + * @apiParam {String} [direction=desc] + * @apiParam {Date} [since] Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.issues.getCommentsForRepo({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/issues/events/:id getEvent + * @apiVersion 5.3.3 + * @apiName getEvent + * @apiDescription Get a single event + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiExample {js} ex: +github.issues.getEvent({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/issues/:number/events getEvents + * @apiVersion 5.3.3 + * @apiName getEvents + * @apiDescription List events for an issue + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.issues.getEvents({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/issues/events getEventsForRepo + * @apiVersion 5.3.3 + * @apiName getEventsForRepo + * @apiDescription List events for a repository + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.issues.getEventsForRepo({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/issues/:number/timeline getEventsTimeline + * @apiVersion 5.3.3 + * @apiName getEventsTimeline + * @apiDescription List events for an issue. (In preview period. See README.) + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.issues.getEventsTimeline({ ... }); + */ + +/** + * @api {get} /orgs/:org/issues getForOrg + * @apiVersion 5.3.3 + * @apiName getForOrg + * @apiDescription List all issues for a given organization for the authenticated user + * @apiGroup issues + * + * @apiParam {String} org + * @apiParam {String} [filter] + * @apiParam {String} [state=open] open, closed, or all + * @apiParam {String} [labels] String list of comma separated Label names. Example: bug,ui,@high + * @apiParam {String} [sort=created] + * @apiParam {String} [direction=desc] + * @apiParam {Date} [since] Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.issues.getForOrg({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/issues getForRepo + * @apiVersion 5.3.3 + * @apiName getForRepo + * @apiDescription List issues for a repository + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} [milestone] + * @apiParam {String} [state=open] open, closed, or all + * @apiParam {String} [assignee] String User login, `none` for Issues with no assigned User. `*` for Issues with any assigned User. + * @apiParam {String} [creator] The user that created the issue. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiParam {String} [labels] String list of comma separated Label names. Example: bug,ui,@high + * @apiParam {String} [sort=created] + * @apiParam {String} [direction=desc] + * @apiParam {Date} [since] Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {String} [mentioned] String User login. + * @apiExample {js} ex: +github.issues.getForRepo({ ... }); + */ + +/** + * @api {get} /user/issues getForUser + * @apiVersion 5.3.3 + * @apiName getForUser + * @apiDescription List all issues across owned and member repositories for the authenticated user + * @apiGroup issues + * + * @apiParam {String} [filter] + * @apiParam {String} [state=open] open, closed, or all + * @apiParam {String} [labels] String list of comma separated Label names. Example: bug,ui,@high + * @apiParam {String} [sort=created] + * @apiParam {String} [direction=desc] + * @apiParam {Date} [since] Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.issues.getForUser({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/issues/:number/labels getIssueLabels + * @apiVersion 5.3.3 + * @apiName getIssueLabels + * @apiDescription List labels on an issue + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiExample {js} ex: +github.issues.getIssueLabels({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/labels/:name getLabel + * @apiVersion 5.3.3 + * @apiName getLabel + * @apiDescription Get a single label + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} name + * @apiExample {js} ex: +github.issues.getLabel({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/labels getLabels + * @apiVersion 5.3.3 + * @apiName getLabels + * @apiDescription List all labels for this repository + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.issues.getLabels({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/milestones/:number getMilestone + * @apiVersion 5.3.3 + * @apiName getMilestone + * @apiDescription Get a single milestone + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiExample {js} ex: +github.issues.getMilestone({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/milestones/:number/labels getMilestoneLabels + * @apiVersion 5.3.3 + * @apiName getMilestoneLabels + * @apiDescription Get labels for every issue in a milestone + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiExample {js} ex: +github.issues.getMilestoneLabels({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/milestones getMilestones + * @apiVersion 5.3.3 + * @apiName getMilestones + * @apiDescription List milestones for a repository + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} [state=open] + * @apiParam {String} [sort=due_on] due_on, completeness, default: due_on + * @apiParam {String} [direction=asc] + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.issues.getMilestones({ ... }); + */ + +/** + * @api {put} /repos/:owner/:repo/issues/:number/lock lock + * @apiVersion 5.3.3 + * @apiName lock + * @apiDescription Users with push access can lock an issue's conversation. + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiExample {js} ex: +github.issues.lock({ ... }); + */ + +/** + * @api {delete} /repos/:owner/:repo/issues/:number/labels removeAllLabels + * @apiVersion 5.3.3 + * @apiName removeAllLabels + * @apiDescription Remove all labels from an issue + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiExample {js} ex: +github.issues.removeAllLabels({ ... }); + */ + +/** + * @api {delete} /repos/:owner/:repo/issues/:number/assignees removeAssigneesFromIssue + * @apiVersion 5.3.3 + * @apiName removeAssigneesFromIssue + * @apiDescription Remove assignees from an issue. + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiParam {Json} body JSON object that contains assignees array of logins for the users that should be removed from the issue. + * @apiExample {js} ex: +github.issues.removeAssigneesFromIssue({ ... }); + */ + +/** + * @api {delete} /repos/:owner/:repo/issues/:number/labels/:name removeLabel + * @apiVersion 5.3.3 + * @apiName removeLabel + * @apiDescription Remove a label from an issue + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiParam {String} name + * @apiExample {js} ex: +github.issues.removeLabel({ ... }); + */ + +/** + * @api {put} /repos/:owner/:repo/issues/:number/labels replaceAllLabels + * @apiVersion 5.3.3 + * @apiName replaceAllLabels + * @apiDescription Replace all labels for an issue + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiParam {Array} body Sending an empty array ([]) will remove all Labels from the Issue. + * @apiExample {js} ex: +github.issues.replaceAllLabels({ ... }); + */ + +/** + * @api {delete} /repos/:owner/:repo/issues/:number/lock unlock + * @apiVersion 5.3.3 + * @apiName unlock + * @apiDescription Users with push access can unlock an issue's conversation. + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiExample {js} ex: +github.issues.unlock({ ... }); + */ + +/** + * @api {patch} /repos/:owner/:repo/labels/:oldname updateLabel + * @apiVersion 5.3.3 + * @apiName updateLabel + * @apiDescription Update a label + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} oldname The old name of the label. + * @apiParam {String} name The new name of the label. + * @apiParam {String} color 6 character hex code, without a leading #. + * @apiExample {js} ex: +github.issues.updateLabel({ ... }); + */ + +/** + * @api {patch} /repos/:owner/:repo/milestones/:number updateMilestone + * @apiVersion 5.3.3 + * @apiName updateMilestone + * @apiDescription Update a milestone + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiParam {String} title + * @apiParam {String} [state=open] + * @apiParam {String} [description] + * @apiParam {Date} [due_on] Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ + * @apiExample {js} ex: +github.issues.updateMilestone({ ... }); + */ + +/** + * @api {delete} /repos/:owner/:repo/import cancelImport + * @apiVersion 5.3.3 + * @apiName cancelImport + * @apiDescription Cancel an import. (In preview period. See README.) + * @apiGroup migrations + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiExample {js} ex: +github.migrations.cancelImport({ ... }); + */ + +/** + * @api {delete} /orgs/:org/migrations/:id/archive deleteMigrationArchive + * @apiVersion 5.3.3 + * @apiName deleteMigrationArchive + * @apiDescription Delete a migration archive. (In preview period. See README.) + * @apiGroup migrations + * + * @apiParam {String} org + * @apiParam {String} id + * @apiExample {js} ex: +github.migrations.deleteMigrationArchive({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/import/authors getImportCommitAuthors + * @apiVersion 5.3.3 + * @apiName getImportCommitAuthors + * @apiDescription Get import commit authors. (In preview period. See README.) + * @apiGroup migrations + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} [since] Only authors found after this id are returned. Provide the highest author ID you've seen so far. New authors may be added to the list at any point while the importer is performing the raw step. + * @apiExample {js} ex: +github.migrations.getImportCommitAuthors({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/import getImportProgress + * @apiVersion 5.3.3 + * @apiName getImportProgress + * @apiDescription Get import progress. (In preview period. See README.) + * @apiGroup migrations + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiExample {js} ex: +github.migrations.getImportProgress({ ... }); + */ + +/** + * @api {get} /:owner/:name/import/large_files getLargeImportFiles + * @apiVersion 5.3.3 + * @apiName getLargeImportFiles + * @apiDescription List files larger than 100MB found during the import. (In preview period. See README.) + * @apiGroup migrations + * + * @apiParam {String} owner + * @apiParam {String} name + * @apiExample {js} ex: +github.migrations.getLargeImportFiles({ ... }); + */ + +/** + * @api {get} /orgs/:org/migrations/:id/archive getMigrationArchiveLink + * @apiVersion 5.3.3 + * @apiName getMigrationArchiveLink + * @apiDescription Get the URL to a migration archive. (In preview period. See README.) + * @apiGroup migrations + * + * @apiParam {String} org + * @apiParam {String} id + * @apiExample {js} ex: +github.migrations.getMigrationArchiveLink({ ... }); + */ + +/** + * @api {get} /orgs/:org/migrations/:id getMigrationStatus + * @apiVersion 5.3.3 + * @apiName getMigrationStatus + * @apiDescription Get the status of a migration. (In preview period. See README.) + * @apiGroup migrations + * + * @apiParam {String} org + * @apiParam {String} id + * @apiExample {js} ex: +github.migrations.getMigrationStatus({ ... }); + */ + +/** + * @api {get} /orgs/:org/migrations getMigrations + * @apiVersion 5.3.3 + * @apiName getMigrations + * @apiDescription Get a list of migrations. (In preview period. See README.) + * @apiGroup migrations + * + * @apiParam {String} org + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.migrations.getMigrations({ ... }); + */ + +/** + * @api {patch} /repos/:owner/:repo/import/authors/:author_id mapImportCommitAuthor + * @apiVersion 5.3.3 + * @apiName mapImportCommitAuthor + * @apiDescription Map a commit author. (In preview period. See README.) + * @apiGroup migrations + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} author_id The commit author id. + * @apiParam {String} [email] The new Git author email. + * @apiParam {String} [name] The new Git author name. + * @apiExample {js} ex: +github.migrations.mapImportCommitAuthor({ ... }); + */ + +/** + * @api {patch} /:owner/:name/import/lfs setImportLfsPreference + * @apiVersion 5.3.3 + * @apiName setImportLfsPreference + * @apiDescription Set import LFS preference. (In preview period. See README.) + * @apiGroup migrations + * + * @apiParam {String} owner + * @apiParam {String} name + * @apiExample {js} ex: +github.migrations.setImportLfsPreference({ ... }); + */ + +/** + * @api {put} /repos/:owner/:repo/import startImport + * @apiVersion 5.3.3 + * @apiName startImport + * @apiDescription Start an import. (In preview period. See README.) + * @apiGroup migrations + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} vcs_url The URL of the originating repository. + * @apiParam {String} [vcs] The originating VCS type. Please be aware that without this parameter, the import job will take additional time to detect the VCS type before beginning the import. This detection step will be reflected in the response. + * @apiParam {String} [vcs_username] If authentication is required, the username to provide to vcs_url. + * @apiParam {String} [vcs_password] If authentication is required, the password to provide to vcs_url. + * @apiParam {String} [tfvc_project] For a tfvc import, the name of the project that is being imported. + * @apiExample {js} ex: +github.migrations.startImport({ ... }); + */ + +/** + * @api {post} /orgs/:org/migrations startMigration + * @apiVersion 5.3.3 + * @apiName startMigration + * @apiDescription Start a migration. (In preview period. See README.) + * @apiGroup migrations + * + * @apiParam {String} org + * @apiParam {Array} repositories A list of arrays indicating which repositories should be migrated. + * @apiParam {Boolean} [lock_repositories=false] Indicates whether repositories should be locked (to prevent manipulation) while migrating data. Default: false. + * @apiParam {Boolean} [exclude_attachments=false] Indicates whether attachments should be excluded from the migration (to reduce migration archive file size). Default: false. + * @apiExample {js} ex: +github.migrations.startMigration({ ... }); + */ + +/** + * @api {delete} /orgs/:org/migrations/:id/repos/:repo/lock unlockRepoLockedForMigration + * @apiVersion 5.3.3 + * @apiName unlockRepoLockedForMigration + * @apiDescription Unlock a repository that was locked for migration. (In preview period. See README.) + * @apiGroup migrations + * + * @apiParam {String} org + * @apiParam {String} id + * @apiParam {String} repo + * @apiExample {js} ex: +github.migrations.unlockRepoLockedForMigration({ ... }); + */ + +/** + * @api {patch} /repos/:owner/:repo/import updateImport + * @apiVersion 5.3.3 + * @apiName updateImport + * @apiDescription Update existing import. (In preview period. See README.) + * @apiGroup migrations + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiExample {js} ex: +github.migrations.updateImport({ ... }); + */ + +/** + * @api {get} /emojis getEmojis + * @apiVersion 5.3.3 + * @apiName getEmojis + * @apiDescription Lists all the emojis available to use on GitHub. + * @apiGroup misc + * + * @apiExample {js} ex: +github.misc.getEmojis({ ... }); + */ + +/** + * @api {get} /gitignore/templates/:name getGitignoreTemplate + * @apiVersion 5.3.3 + * @apiName getGitignoreTemplate + * @apiDescription Get a single gitignore template + * @apiGroup misc + * + * @apiParam {String} name The name of the .gitignore template to get e.g. 'C' + * @apiExample {js} ex: +github.misc.getGitignoreTemplate({ ... }); + */ + +/** + * @api {get} /gitignore/templates getGitignoreTemplates + * @apiVersion 5.3.3 + * @apiName getGitignoreTemplates + * @apiDescription Lists available gitignore templates + * @apiGroup misc + * + * @apiExample {js} ex: +github.misc.getGitignoreTemplates({ ... }); + */ + +/** + * @api {get} /licenses/:license getLicense + * @apiVersion 5.3.3 + * @apiName getLicense + * @apiDescription Get an individual license. (In preview period. See README.) + * @apiGroup misc + * + * @apiParam {String} license Ex: /licenses/mit + * @apiExample {js} ex: +github.misc.getLicense({ ... }); + */ + +/** + * @api {get} /licenses getLicenses + * @apiVersion 5.3.3 + * @apiName getLicenses + * @apiDescription List all licenses. (In preview period. See README.) + * @apiGroup misc + * + * @apiExample {js} ex: +github.misc.getLicenses({ ... }); + */ + +/** + * @api {get} /meta getMeta + * @apiVersion 5.3.3 + * @apiName getMeta + * @apiDescription This endpoint provides information about GitHub.com, the service. Or, if you access this endpoint on your organization's GitHub Enterprise installation, this endpoint provides information about that installation. + * @apiGroup misc + * + * @apiExample {js} ex: +github.misc.getMeta({ ... }); + */ + +/** + * @api {get} /rate_limit getRateLimit + * @apiVersion 5.3.3 + * @apiName getRateLimit + * @apiDescription Get your current rate limit status + * @apiGroup misc + * + * @apiExample {js} ex: +github.misc.getRateLimit({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/license getRepoLicense + * @apiVersion 5.3.3 + * @apiName getRepoLicense + * @apiDescription Get the contents of a repository's license. (In preview period. See README.) + * @apiGroup misc + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiExample {js} ex: +github.misc.getRepoLicense({ ... }); + */ + +/** + * @api {post} /markdown renderMarkdown + * @apiVersion 5.3.3 + * @apiName renderMarkdown + * @apiDescription Render an arbitrary Markdown document + * @apiGroup misc + * + * @apiParam {String} text The Markdown text to render + * @apiParam {String} [mode=markdown] The rendering mode, `markdown` to render a document as plain Markdown, just like README files are rendered. `gfm` to render a document as user-content, e.g. like user comments or issues are rendered. In GFM mode, hard line breaks are always taken into account, and issue and user mentions are linked accordingly. + * @apiParam {String} [context] The repository context. Only taken into account when rendering as `gfm` + * @apiExample {js} ex: +github.misc.renderMarkdown({ ... }); + */ + +/** + * @api {post} /markdown/raw renderMarkdownRaw + * @apiVersion 5.3.3 + * @apiName renderMarkdownRaw + * @apiDescription Render a Markdown document in raw mode + * @apiGroup misc + * + * @apiParam {String} data Raw data to send as the body of the request + * @apiExample {js} ex: +github.misc.renderMarkdownRaw({ ... }); + */ + +/** + * @api {put} /orgs/:org/memberships/:user addOrganizationMembership + * @apiVersion 5.3.3 + * @apiName addOrganizationMembership + * @apiDescription Add or update organization membership + * @apiGroup orgs + * + * @apiParam {String} org + * @apiParam {String} user + * @apiParam {String} role The role to give the user in the organization. + * @apiExample {js} ex: +github.orgs.addOrganizationMembership({ ... }); + */ + +/** + * @api {put} /teams/:id/memberships/:user addTeamMembership + * @apiVersion 5.3.3 + * @apiName addTeamMembership + * @apiDescription Add team membership + * @apiGroup orgs + * + * @apiParam {String} id + * @apiParam {String} user + * @apiParam {String} [role=member] The role that this user should have in the team. + * @apiExample {js} ex: +github.orgs.addTeamMembership({ ... }); + */ + +/** + * @api {put} /teams/:id/repos/:org/:repo addTeamRepo + * @apiVersion 5.3.3 + * @apiName addTeamRepo + * @apiDescription Add team repository + * @apiGroup orgs + * + * @apiParam {String} id + * @apiParam {String} org + * @apiParam {String} repo + * @apiParam {String} [permission] `pull` - team members can pull, but not push or administer this repository, `push` - team members can pull and push, but not administer this repository, `admin` - team members can pull, push and administer this repository. + * @apiExample {js} ex: +github.orgs.addTeamRepo({ ... }); + */ + +/** + * @api {get} /orgs/:org/members/:owner checkMembership + * @apiVersion 5.3.3 + * @apiName checkMembership + * @apiDescription Check membership + * @apiGroup orgs + * + * @apiParam {String} org + * @apiParam {String} owner + * @apiExample {js} ex: +github.orgs.checkMembership({ ... }); + */ + +/** + * @api {get} /orgs/:org/public_members/:user checkPublicMembership + * @apiVersion 5.3.3 + * @apiName checkPublicMembership + * @apiDescription Check public membership + * @apiGroup orgs + * + * @apiParam {String} org + * @apiParam {String} user + * @apiExample {js} ex: +github.orgs.checkPublicMembership({ ... }); + */ + +/** + * @api {get} /teams/:id/repos/:owner/:repo checkTeamRepo + * @apiVersion 5.3.3 + * @apiName checkTeamRepo + * @apiDescription Check if a team manages a repository + * @apiGroup orgs + * + * @apiParam {String} id + * @apiParam {String} owner + * @apiParam {String} repo + * @apiExample {js} ex: +github.orgs.checkTeamRepo({ ... }); + */ + +/** + * @api {delete} /orgs/:org/public_members/:user concealMembership + * @apiVersion 5.3.3 + * @apiName concealMembership + * @apiDescription Conceal a user's membership + * @apiGroup orgs + * + * @apiParam {String} org + * @apiParam {String} user + * @apiExample {js} ex: +github.orgs.concealMembership({ ... }); + */ + +/** + * @api {post} /orgs/:org/hooks createHook + * @apiVersion 5.3.3 + * @apiName createHook + * @apiDescription Create a hook + * @apiGroup orgs + * + * @apiParam {String} org + * @apiParam {String} name Must be passed as "web". + * @apiParam {Json} config Key/value pairs to provide settings for this webhook + * @apiParam {Array} [events=["push"]] Determines what events the hook is triggered for. Default: ["push"]. + * @apiParam {Boolean} [active] Determines whether the hook is actually triggered on pushes. + * @apiExample {js} ex: +github.orgs.createHook({ ... }); + */ + +/** + * @api {post} /orgs/:org/teams createTeam + * @apiVersion 5.3.3 + * @apiName createTeam + * @apiDescription Create team + * @apiGroup orgs + * + * @apiParam {String} org + * @apiParam {String} name + * @apiParam {String} [description] The description of the team. + * @apiParam {Array} [repo_names] The full name (e.g., "organization-name/repository-name") of repositories to add the team to. + * @apiParam {String} [privacy=secret] The level of privacy this team should have. + * @apiExample {js} ex: +github.orgs.createTeam({ ... }); + */ + +/** + * @api {delete} /orgs/:org/hooks/:id deleteHook + * @apiVersion 5.3.3 + * @apiName deleteHook + * @apiDescription Delete a hook + * @apiGroup orgs + * + * @apiParam {String} org + * @apiParam {String} id + * @apiExample {js} ex: +github.orgs.deleteHook({ ... }); + */ + +/** + * @api {delete} /teams/:id deleteTeam + * @apiVersion 5.3.3 + * @apiName deleteTeam + * @apiDescription Delete team + * @apiGroup orgs + * + * @apiParam {String} id + * @apiExample {js} ex: +github.orgs.deleteTeam({ ... }); + */ + +/** + * @api {delete} /teams/:id/repos/:owner/:repo deleteTeamRepo + * @apiVersion 5.3.3 + * @apiName deleteTeamRepo + * @apiDescription Remove team repository + * @apiGroup orgs + * + * @apiParam {String} id + * @apiParam {String} owner + * @apiParam {String} repo + * @apiExample {js} ex: +github.orgs.deleteTeamRepo({ ... }); + */ + +/** + * @api {patch} /orgs/:org/hooks/:id editHook + * @apiVersion 5.3.3 + * @apiName editHook + * @apiDescription Edit a hook + * @apiGroup orgs + * + * @apiParam {String} org + * @apiParam {String} id + * @apiParam {Json} config Key/value pairs to provide settings for this webhook + * @apiParam {Array} [events=["push"]] Determines what events the hook is triggered for. Default: ["push"]. + * @apiParam {Boolean} [active] Determines whether the hook is actually triggered on pushes. + * @apiExample {js} ex: +github.orgs.editHook({ ... }); + */ + +/** + * @api {patch} /teams/:id editTeam + * @apiVersion 5.3.3 + * @apiName editTeam + * @apiDescription Edit team + * @apiGroup orgs + * + * @apiParam {String} id + * @apiParam {String} name + * @apiParam {String} [description] The description of the team. + * @apiParam {String} [privacy=secret] The level of privacy this team should have. + * @apiExample {js} ex: +github.orgs.editTeam({ ... }); + */ + +/** + * @api {get} /orgs/:org get + * @apiVersion 5.3.3 + * @apiName get + * @apiDescription Get an organization + * @apiGroup orgs + * + * @apiParam {String} org + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.orgs.get({ ... }); + */ + +/** + * @api {get} /organizations getAll + * @apiVersion 5.3.3 + * @apiName getAll + * @apiDescription List all organizations + * @apiGroup orgs + * + * @apiParam {String} [since] The integer ID of the last Organization that you've seen. + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.orgs.getAll({ ... }); + */ + +/** + * @api {get} /users/:owner/orgs getForUser + * @apiVersion 5.3.3 + * @apiName getForUser + * @apiDescription List public organization memberships for the specified user. + * @apiGroup orgs + * + * @apiParam {String} owner + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.orgs.getForUser({ ... }); + */ + +/** + * @api {get} /orgs/:org/hooks/:id getHook + * @apiVersion 5.3.3 + * @apiName getHook + * @apiDescription Get single hook + * @apiGroup orgs + * + * @apiParam {String} org + * @apiParam {String} id + * @apiExample {js} ex: +github.orgs.getHook({ ... }); + */ + +/** + * @api {get} /orgs/:org/hooks getHooks + * @apiVersion 5.3.3 + * @apiName getHooks + * @apiDescription List hooks + * @apiGroup orgs + * + * @apiParam {String} org + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.orgs.getHooks({ ... }); + */ + +/** + * @api {get} /orgs/:org/members getMembers + * @apiVersion 5.3.3 + * @apiName getMembers + * @apiDescription Members list + * @apiGroup orgs + * + * @apiParam {String} org + * @apiParam {String} [filter=all] Filter members returned in the list. + * @apiParam {String} [role=all] Filter members returned by their role. + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.orgs.getMembers({ ... }); + */ + +/** + * @api {get} /orgs/:org/memberships/:user getOrganizationMembership + * @apiVersion 5.3.3 + * @apiName getOrganizationMembership + * @apiDescription Get organization membership + * @apiGroup orgs + * + * @apiParam {String} org + * @apiParam {String} user + * @apiExample {js} ex: +github.orgs.getOrganizationMembership({ ... }); + */ + +/** + * @api {get} /user/memberships/orgs getOrganizationMemberships + * @apiVersion 5.3.3 + * @apiName getOrganizationMemberships + * @apiDescription List your organization memberships + * @apiGroup orgs + * + * @apiParam {String} [state] Indicates the state of the memberships to return. Can be either active or pending. If not specified, both active and pending memberships are returned. + * @apiExample {js} ex: +github.orgs.getOrganizationMemberships({ ... }); + */ + +/** + * @api {get} /orgs/:org/public_members getPublicMembers + * @apiVersion 5.3.3 + * @apiName getPublicMembers + * @apiDescription Public members list + * @apiGroup orgs + * + * @apiParam {String} org + * @apiExample {js} ex: +github.orgs.getPublicMembers({ ... }); + */ + +/** + * @api {get} /teams/:id getTeam + * @apiVersion 5.3.3 + * @apiName getTeam + * @apiDescription Get team + * @apiGroup orgs + * + * @apiParam {String} id + * @apiExample {js} ex: +github.orgs.getTeam({ ... }); + */ + +/** + * @api {get} /teams/:id/members getTeamMembers + * @apiVersion 5.3.3 + * @apiName getTeamMembers + * @apiDescription List team members + * @apiGroup orgs + * + * @apiParam {String} id + * @apiParam {String} [role=all] Filters members returned by their role in the team. + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.orgs.getTeamMembers({ ... }); + */ + +/** + * @api {get} /teams/:id/memberships/:user getTeamMembership + * @apiVersion 5.3.3 + * @apiName getTeamMembership + * @apiDescription Get team membership + * @apiGroup orgs + * + * @apiParam {String} id + * @apiParam {String} user + * @apiExample {js} ex: +github.orgs.getTeamMembership({ ... }); + */ + +/** + * @api {get} /teams/:id/repos getTeamRepos + * @apiVersion 5.3.3 + * @apiName getTeamRepos + * @apiDescription Get team repos + * @apiGroup orgs + * + * @apiParam {String} id + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.orgs.getTeamRepos({ ... }); + */ + +/** + * @api {get} /orgs/:org/teams getTeams + * @apiVersion 5.3.3 + * @apiName getTeams + * @apiDescription List teams + * @apiGroup orgs + * + * @apiParam {String} org + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.orgs.getTeams({ ... }); + */ + +/** + * @api {post} /orgs/:org/hooks/:id/pings pingHook + * @apiVersion 5.3.3 + * @apiName pingHook + * @apiDescription Ping a hook + * @apiGroup orgs + * + * @apiParam {String} org + * @apiParam {String} id + * @apiExample {js} ex: +github.orgs.pingHook({ ... }); + */ + +/** + * @api {put} /orgs/:org/public_members/:user publicizeMembership + * @apiVersion 5.3.3 + * @apiName publicizeMembership + * @apiDescription Publicize a user's membership + * @apiGroup orgs + * + * @apiParam {String} org + * @apiParam {String} user + * @apiExample {js} ex: +github.orgs.publicizeMembership({ ... }); + */ + +/** + * @api {delete} /orgs/:org/members/:user removeMember + * @apiVersion 5.3.3 + * @apiName removeMember + * @apiDescription Remove a member + * @apiGroup orgs + * + * @apiParam {String} org + * @apiParam {String} user + * @apiExample {js} ex: +github.orgs.removeMember({ ... }); + */ + +/** + * @api {delete} /orgs/:org/memberships/:user removeOrganizationMembership + * @apiVersion 5.3.3 + * @apiName removeOrganizationMembership + * @apiDescription Remove organization membership + * @apiGroup orgs + * + * @apiParam {String} org + * @apiParam {String} user + * @apiExample {js} ex: +github.orgs.removeOrganizationMembership({ ... }); + */ + +/** + * @api {delete} /teams/:id/memberships/:user removeTeamMembership + * @apiVersion 5.3.3 + * @apiName removeTeamMembership + * @apiDescription Remove team membership + * @apiGroup orgs + * + * @apiParam {String} id + * @apiParam {String} user + * @apiExample {js} ex: +github.orgs.removeTeamMembership({ ... }); + */ + +/** + * @api {patch} /orgs/:org update + * @apiVersion 5.3.3 + * @apiName update + * @apiDescription Edit an organization + * @apiGroup orgs + * + * @apiParam {String} org + * @apiParam {String} [billing_email] Billing email address. This address is not publicized. + * @apiParam {String} [company] The company name. + * @apiParam {String} [email] The publicly visible email address. + * @apiParam {String} [location] The location. + * @apiParam {String} [name] The shorthand name of the company. + * @apiParam {String} [description] The description of the company. + * @apiExample {js} ex: +github.orgs.update({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/pulls/:number/merge checkMerged + * @apiVersion 5.3.3 + * @apiName checkMerged + * @apiDescription Get if a pull request has been merged + * @apiGroup pullRequests + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.pullRequests.checkMerged({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/pulls create + * @apiVersion 5.3.3 + * @apiName create + * @apiDescription Create a pull request + * @apiGroup pullRequests + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} title The title of the pull request. + * @apiParam {String} head The branch (or git ref) where your changes are implemented. + * @apiParam {String} base The branch (or git ref) you want your changes pulled into. This should be an existing branch on the current repository. You cannot submit a pull request to one repo that requests a merge to a base of another repo. + * @apiParam {String} [body] The contents of the pull request. + * @apiExample {js} ex: +github.pullRequests.create({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/pulls/:number/comments createComment + * @apiVersion 5.3.3 + * @apiName createComment + * @apiDescription Create a comment + * @apiGroup pullRequests + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiParam {String} body + * @apiParam {String} commit_id Sha of the commit to comment on. + * @apiParam {String} path Relative path of the file to comment on. + * @apiParam {Number} position Column index in the diff to comment on. + * @apiExample {js} ex: +github.pullRequests.createComment({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/pulls/:number/comments createCommentReply + * @apiVersion 5.3.3 + * @apiName createCommentReply + * @apiDescription Reply to existing pull request comment + * @apiGroup pullRequests + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiParam {String} body + * @apiParam {Number} in_reply_to The comment id to reply to. + * @apiExample {js} ex: +github.pullRequests.createCommentReply({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/pulls createFromIssue + * @apiVersion 5.3.3 + * @apiName createFromIssue + * @apiDescription Create a pull request from an existing issue + * @apiGroup pullRequests + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} issue The issue number in this repository to turn into a Pull Request. + * @apiParam {String} head The branch (or git ref) where your changes are implemented. + * @apiParam {String} base The branch (or git ref) you want your changes pulled into. This should be an existing branch on the current repository. You cannot submit a pull request to one repo that requests a merge to a base of another repo. + * @apiExample {js} ex: +github.pullRequests.createFromIssue({ ... }); + */ + +/** + * @api {delete} /repos/:owner/:repo/pulls/comments/:number deleteComment + * @apiVersion 5.3.3 + * @apiName deleteComment + * @apiDescription Delete a comment + * @apiGroup pullRequests + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiExample {js} ex: +github.pullRequests.deleteComment({ ... }); + */ + +/** + * @api {patch} /repos/:owner/:repo/pulls/comments/:number editComment + * @apiVersion 5.3.3 + * @apiName editComment + * @apiDescription Edit a comment + * @apiGroup pullRequests + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiParam {String} body + * @apiExample {js} ex: +github.pullRequests.editComment({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/pulls/:number get + * @apiVersion 5.3.3 + * @apiName get + * @apiDescription Get a single pull request + * @apiGroup pullRequests + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiExample {js} ex: +github.pullRequests.get({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/pulls getAll + * @apiVersion 5.3.3 + * @apiName getAll + * @apiDescription List pull requests + * @apiGroup pullRequests + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} [state=open] open, closed, or all + * @apiParam {String} [head] Filter pulls by head user and branch name in the format of user:ref-name. Example: github:new-script-format. + * @apiParam {String} [base] Filter pulls by base branch name. Example: gh-pages. + * @apiParam {String} [sort=created] Possible values are: `created`, `updated`, `popularity`, `long-running`, Default: `created` + * @apiParam {String} [direction=desc] + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.pullRequests.getAll({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/pulls/comments/:number getComment + * @apiVersion 5.3.3 + * @apiName getComment + * @apiDescription Get a single comment + * @apiGroup pullRequests + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiExample {js} ex: +github.pullRequests.getComment({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/pulls/:number/comments getComments + * @apiVersion 5.3.3 + * @apiName getComments + * @apiDescription List comments on a pull request + * @apiGroup pullRequests + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.pullRequests.getComments({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/pulls/comments getCommentsForRepo + * @apiVersion 5.3.3 + * @apiName getCommentsForRepo + * @apiDescription List comments in a repository + * @apiGroup pullRequests + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} [sort=created] Possible values are: `created`, `updated`, Default: `created` + * @apiParam {String} [direction=desc] + * @apiParam {Date} [since] Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.pullRequests.getCommentsForRepo({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/pulls/:number/commits getCommits + * @apiVersion 5.3.3 + * @apiName getCommits + * @apiDescription List commits on a pull request + * @apiGroup pullRequests + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.pullRequests.getCommits({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/pulls/:number/files getFiles + * @apiVersion 5.3.3 + * @apiName getFiles + * @apiDescription List pull requests files + * @apiGroup pullRequests + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.pullRequests.getFiles({ ... }); + */ + +/** + * @api {put} /repos/:owner/:repo/pulls/:number/merge merge + * @apiVersion 5.3.3 + * @apiName merge + * @apiDescription Merge a pull request (Merge Button) + * @apiGroup pullRequests + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiParam {String} [commit_title] Title for the automatic commit message. (In preview period. See README.) + * @apiParam {String} [commit_message] Extra detail to append to automatic commit message. + * @apiParam {String} [sha] SHA that pull request head must match to allow merge + * @apiParam {String} [merge_method=merge] Merge method to use. Possible values are `merge`, `squash`, or `rebase`. (In preview period. See README.) + * @apiExample {js} ex: +github.pullRequests.merge({ ... }); + */ + +/** + * @api {patch} /repos/:owner/:repo/pulls/:number update + * @apiVersion 5.3.3 + * @apiName update + * @apiDescription Update a pull request + * @apiGroup pullRequests + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiParam {String} [title] The title of the pull request. + * @apiParam {String} [body] The contents of the pull request. + * @apiParam {String} [state=open] + * @apiExample {js} ex: +github.pullRequests.update({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/comments/:id/reactions createForCommitComment + * @apiVersion 5.3.3 + * @apiName createForCommitComment + * @apiDescription Create reaction for a commit comment. (In preview period. See README.) + * @apiGroup reactions + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiParam {String} content The reaction type. + * @apiExample {js} ex: +github.reactions.createForCommitComment({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/issues/:number/reactions createForIssue + * @apiVersion 5.3.3 + * @apiName createForIssue + * @apiDescription Create reaction for an issue. (In preview period. See README.) + * @apiGroup reactions + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiParam {String} content The reaction type. + * @apiExample {js} ex: +github.reactions.createForIssue({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/issues/comments/:id/reactions createForIssueComment + * @apiVersion 5.3.3 + * @apiName createForIssueComment + * @apiDescription Create reaction for an issue comment. (In preview period. See README.) + * @apiGroup reactions + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiParam {String} content The reaction type. + * @apiExample {js} ex: +github.reactions.createForIssueComment({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/pulls/comments/:id/reactions createForPullRequestReviewComment + * @apiVersion 5.3.3 + * @apiName createForPullRequestReviewComment + * @apiDescription Create reaction for a pull request review comment. (In preview period. See README.) + * @apiGroup reactions + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiParam {String} content The reaction type. + * @apiExample {js} ex: +github.reactions.createForPullRequestReviewComment({ ... }); + */ + +/** + * @api {delete} /reactions/:id delete + * @apiVersion 5.3.3 + * @apiName delete + * @apiDescription Delete a reaction. (In preview period. See README.) + * @apiGroup reactions + * + * @apiParam {String} id + * @apiExample {js} ex: +github.reactions.delete({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/comments/:id/reactions getForCommitComment + * @apiVersion 5.3.3 + * @apiName getForCommitComment + * @apiDescription List reactions for a commit comment. (In preview period. See README.) + * @apiGroup reactions + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiParam {String} [content] Indicates which type of reaction to return. + * @apiExample {js} ex: +github.reactions.getForCommitComment({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/issues/:number/reactions getForIssue + * @apiVersion 5.3.3 + * @apiName getForIssue + * @apiDescription List reactions for an issue. (In preview period. See README.) + * @apiGroup reactions + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiParam {String} [content] Indicates which type of reaction to return. + * @apiExample {js} ex: +github.reactions.getForIssue({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/issues/comments/:id/reactions getForIssueComment + * @apiVersion 5.3.3 + * @apiName getForIssueComment + * @apiDescription List reactions for an issue comment. (In preview period. See README.) + * @apiGroup reactions + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiParam {String} [content] Indicates which type of reaction to return. + * @apiExample {js} ex: +github.reactions.getForIssueComment({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/pulls/comments/:id/reactions getForPullRequestReviewComment + * @apiVersion 5.3.3 + * @apiName getForPullRequestReviewComment + * @apiDescription List reactions for a pull request review comment. (In preview period. See README.) + * @apiGroup reactions + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiParam {String} [content] Indicates which type of reaction to return. + * @apiExample {js} ex: +github.reactions.getForPullRequestReviewComment({ ... }); + */ + +/** + * @api {put} /repos/:owner/:repo/collaborators/:collabuser addCollaborator + * @apiVersion 5.3.3 + * @apiName addCollaborator + * @apiDescription Add user as a collaborator + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} collabuser + * @apiParam {String} [permission=push] `pull` - can pull, but not push to or administer this repository, `push` - can pull and push, but not administer this repository, `admin` - can pull, push and administer this repository. + * @apiExample {js} ex: +github.repos.addCollaborator({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/branches/:branch/protection/required_status_checks/contexts addProtectedBranchRequiredStatusChecksContexts + * @apiVersion 5.3.3 + * @apiName addProtectedBranchRequiredStatusChecksContexts + * @apiDescription Add required status checks contexts of protected branch. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} branch + * @apiParam {Array} body An array of protected branch required status checks contexts (e.g. continuous-integration/jenkins). + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.addProtectedBranchRequiredStatusChecksContexts({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/branches/:branch/protection/restrictions/teams addProtectedBranchTeamRestrictions + * @apiVersion 5.3.3 + * @apiName addProtectedBranchTeamRestrictions + * @apiDescription Add team restrictions of protected branch. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} branch + * @apiParam {Array} body An array of team slugs (e.g. justice-league). + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.addProtectedBranchTeamRestrictions({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/branches/:branch/protection/restrictions/users addProtectedBranchUserRestrictions + * @apiVersion 5.3.3 + * @apiName addProtectedBranchUserRestrictions + * @apiDescription Add user restrictions of protected branch. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} branch + * @apiParam {Array} body An array of team slugs (e.g. justice-league). + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.addProtectedBranchUserRestrictions({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/collaborators/:collabuser checkCollaborator + * @apiVersion 5.3.3 + * @apiName checkCollaborator + * @apiDescription Check if user is a collaborator. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} collabuser + * @apiExample {js} ex: +github.repos.checkCollaborator({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/compare/:base...:head compareCommits + * @apiVersion 5.3.3 + * @apiName compareCommits + * @apiDescription Compare two commits. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} base The branch (or git ref) you want your changes pulled into. This should be an existing branch on the current repository. You cannot submit a pull request to one repo that requests a merge to a base of another repo. + * @apiParam {String} head The branch (or git ref) where your changes are implemented. + * @apiExample {js} ex: +github.repos.compareCommits({ ... }); + */ + +/** + * @api {post} /user/repos create + * @apiVersion 5.3.3 + * @apiName create + * @apiDescription Create a new repository for the authenticated user. + * @apiGroup repos + * + * @apiParam {String} name + * @apiParam {Boolean} [allow_rebase_merge=true] Either true to allow rebase-merging pull requests, or false to prevent rebase-merging. Default: true. (In preview period. See README.) + * @apiParam {String} [homepage] + * @apiParam {Boolean} [private=false] True to create a private repository, false to create a public one. Creating private repositories requires a paid GitHub account. Default is false. + * @apiParam {Boolean} [has_issues=true] True to enable issues for this repository, false to disable them. Default is true. + * @apiParam {Boolean} [has_wiki=true] True to enable the wiki for this repository, false to disable it. Default is true. + * @apiParam {String} [description] + * @apiParam {Boolean} [auto_init=false] True to create an initial commit with empty README. Default is false + * @apiParam {String} [gitignore_template] Desired language or platform .gitignore template to apply. Ignored if auto_init parameter is not provided. + * @apiParam {String} [license_template] Desired LICENSE template to apply. Use the name of the template without the extension. For example, "mit" or "mozilla". + * @apiParam {Boolean} [allow_squash_merge=true] Either true to allow squash-merging pull requests, or false to prevent squash-merging. Default: true. (In preview period. See README.) + * @apiParam {Boolean} [allow_merge_commit=true] Either true to allow merging pull requests with a merge commit, or false to prevent merging pull requests with merge commits. Default: true. (In preview period. See README.) + * @apiParam {Boolean} [has_downloads=true] True to enable downloads for this repository, false to disable them. Default is true. + * @apiExample {js} ex: +github.repos.create({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/commits/:sha/comments createCommitComment + * @apiVersion 5.3.3 + * @apiName createCommitComment + * @apiDescription Create a commit comment. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} sha + * @apiParam {String} body + * @apiParam {String} [path] Relative path of the file to comment on. + * @apiParam {Number} [position] Line index in the diff to comment on. + * @apiParam {Number} [line] Deprecated. Use position parameter instead. Line number in the file to comment on. + * @apiExample {js} ex: +github.repos.createCommitComment({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/deployments createDeployment + * @apiVersion 5.3.3 + * @apiName createDeployment + * @apiDescription Create a deployment. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} ref The ref to deploy. This can be a branch, tag, or sha. + * @apiParam {String} repo + * @apiParam {String} [task=deploy] The named task to execute. e.g. deploy or deploy:migrations. Default: deploy + * @apiParam {Boolean} [auto_merge=true] Optional parameter to merge the default branch into the requested ref if it is behind the default branch. Default: true + * @apiParam {Boolean} [production_environment] Specifies if the given environment is a one that end-users directly interact with. Default: true when environment is `production` and false otherwise. (In preview period. See README.) + * @apiParam {String} [payload=""] Optional JSON payload with extra information about the deployment. Default: "" + * @apiParam {String} [environment=none] The name of the environment that was deployed to. e.g. staging or production. Default: none. + * @apiParam {String} [description=""] Optional short description. Default: "" + * @apiParam {Boolean} [transient_environment=false] Specifies if the given environment is specific to the deployment and will no longer exist at some point in the future. Default: false. (In preview period. See README.) + * @apiParam {Array} [required_contexts] Optional array of status contexts verified against commit status checks. If this parameter is omitted from the parameters then all unique contexts will be verified before a deployment is created. To bypass checking entirely pass an empty array. Defaults to all unique contexts. + * @apiExample {js} ex: +github.repos.createDeployment({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/deployments/:id/statuses createDeploymentStatus + * @apiVersion 5.3.3 + * @apiName createDeploymentStatus + * @apiDescription Create a deployment status. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiParam {String} [state] The state of the status. Can be one of pending, success, error, or failure. + * @apiParam {String} [target_url=""] The target URL to associate with this status. This URL should contain output to keep the user updated while the task is running or serve as historical information for what happened in the deployment. Default: "" + * @apiParam {String} [log_url=""] Functionally equivalent to target_url. Default: "". (In preview period. See README.) + * @apiParam {String} [description=""] A short description of the status. Default: "" + * @apiParam {String} [environment_url=""] URL for accessing the deployment environment. Default: "". (In preview period. See README.) + * @apiParam {Boolean} [auto_inactive=true] When true the new `inactive` status is added to all other non-transient, non-production environment deployments with the same repository and environment name as the created status's deployment. Default: true. (In preview period. See README.) + * @apiExample {js} ex: +github.repos.createDeploymentStatus({ ... }); + */ + +/** + * @api {put} /repos/:owner/:repo/contents/:path createFile + * @apiVersion 5.3.3 + * @apiName createFile + * @apiDescription Create a new file in the given repository. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} path The content path. + * @apiParam {String} message The commit message. + * @apiParam {String} content The new file content, Base64 encoded. + * @apiParam {String} [branch] The branch name. If not provided, uses the repository’s default branch (usually master). + * @apiParam {Json} [committer] + * @apiExample {js} ex: +github.repos.createFile({ ... }); + */ + +/** + * @api {post} /orgs/:org/repos createForOrg + * @apiVersion 5.3.3 + * @apiName createForOrg + * @apiDescription Create a new repository for an organization. + * @apiGroup repos + * + * @apiParam {String} org + * @apiParam {String} name + * @apiParam {String} [description] + * @apiParam {String} [homepage] + * @apiParam {Boolean} [private=false] True to create a private repository, false to create a public one. Creating private repositories requires a paid GitHub account. Default is false. + * @apiParam {Boolean} [has_issues=true] True to enable issues for this repository, false to disable them. Default is true. + * @apiParam {Boolean} [has_wiki=true] True to enable the wiki for this repository, false to disable it. Default is true. + * @apiParam {Boolean} [allow_rebase_merge=true] Either true to allow rebase-merging pull requests, or false to prevent rebase-merging. Default: true. (In preview period. See README.) + * @apiParam {Number} [team_id] The id of the team that will be granted access to this repository. This is only valid when creating a repo in an organization. + * @apiParam {Boolean} [auto_init=false] True to create an initial commit with empty README. Default is false + * @apiParam {String} [gitignore_template] Desired language or platform .gitignore template to apply. Ignored if auto_init parameter is not provided. + * @apiParam {String} [license_template] Desired LICENSE template to apply. Use the name of the template without the extension. For example, "mit" or "mozilla". + * @apiParam {Boolean} [allow_squash_merge=true] Either true to allow squash-merging pull requests, or false to prevent squash-merging. Default: true. (In preview period. See README.) + * @apiParam {Boolean} [allow_merge_commit=true] Either true to allow merging pull requests with a merge commit, or false to prevent merging pull requests with merge commits. Default: true. (In preview period. See README.) + * @apiParam {Boolean} [has_downloads=true] True to enable downloads for this repository, false to disable them. Default is true. + * @apiExample {js} ex: +github.repos.createForOrg({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/hooks createHook + * @apiVersion 5.3.3 + * @apiName createHook + * @apiDescription Create a hook. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} name + * @apiParam {Json} config A Hash containing key/value pairs to provide settings for this hook. These settings vary between the services and are defined in the github-services repo. Booleans are stored internally as `1` for true, and `0` for false. Any JSON true/false values will be converted automatically. + * @apiParam {Array} [events=["push"]] Determines what events the hook is triggered for. Default: `['push']`. + * @apiParam {Boolean} [active] Determines whether the hook is actually triggered on pushes. + * @apiExample {js} ex: +github.repos.createHook({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/keys createKey + * @apiVersion 5.3.3 + * @apiName createKey + * @apiDescription Add a new deploy key. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} title + * @apiParam {String} key + * @apiParam {Boolean} [read_only] If true, the key will only be able to read repository contents. Otherwise, the key will be able to read and write. + * @apiExample {js} ex: +github.repos.createKey({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/projects createProject + * @apiVersion 5.3.3 + * @apiName createProject + * @apiDescription Create a project. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} name + * @apiParam {String} body + * @apiExample {js} ex: +github.repos.createProject({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/projects/columns/:id/cards createProjectCard + * @apiVersion 5.3.3 + * @apiName createProjectCard + * @apiDescription Create a project card. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiParam {String} [note] The note of the card. + * @apiParam {String} [content_id] The id of the Issue or Pull Request to associate with this card. + * @apiParam {String} [content_type] The type of content to associate with this card. Can be either 'Issue' or 'PullRequest'. + * @apiExample {js} ex: +github.repos.createProjectCard({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/projects/:number/columns createProjectColumn + * @apiVersion 5.3.3 + * @apiName createProjectColumn + * @apiDescription Create a project column. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiParam {String} name + * @apiExample {js} ex: +github.repos.createProjectColumn({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/releases createRelease + * @apiVersion 5.3.3 + * @apiName createRelease + * @apiDescription Create a release. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} tag_name String of the tag + * @apiParam {String} [target_commitish] Specifies the commitish value that determines where the Git tag is created from. Can be any branch or commit SHA. Unused if the Git tag already exists. Default: the repository's default branch (usually master). + * @apiParam {String} [name] + * @apiParam {String} [body] + * @apiParam {Boolean} [draft=false] true to create a draft (unpublished) release, false to create a published one. Default: false + * @apiParam {Boolean} [prerelease=false] true to identify the release as a prerelease. false to identify the release as a full release. Default: false + * @apiExample {js} ex: +github.repos.createRelease({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/statuses/:sha createStatus + * @apiVersion 5.3.3 + * @apiName createStatus + * @apiDescription Create a status. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} sha + * @apiParam {String} state State of the status - can be one of pending, success, error, or failure. + * @apiParam {String} [target_url] Target url to associate with this status. This URL will be linked from the GitHub UI to allow users to easily see the ‘source’ of the Status. + * @apiParam {String} [description] Short description of the status. + * @apiParam {String} [context] A string label to differentiate this status from the status of other systems. + * @apiExample {js} ex: +github.repos.createStatus({ ... }); + */ + +/** + * @api {delete} /repos/:owner/:repo delete + * @apiVersion 5.3.3 + * @apiName delete + * @apiDescription Delete a repository. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiExample {js} ex: +github.repos.delete({ ... }); + */ + +/** + * @api {delete} /repos/:owner/:repo/releases/assets/:id deleteAsset + * @apiVersion 5.3.3 + * @apiName deleteAsset + * @apiDescription Delete a release asset. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiExample {js} ex: +github.repos.deleteAsset({ ... }); + */ + +/** + * @api {delete} /repos/:owner/:repo/comments/:id deleteCommitComment + * @apiVersion 5.3.3 + * @apiName deleteCommitComment + * @apiDescription Delete a commit comment. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiExample {js} ex: +github.repos.deleteCommitComment({ ... }); + */ + +/** + * @api {delete} /repos/:owner/:repo/downloads/:id deleteDownload + * @apiVersion 5.3.3 + * @apiName deleteDownload + * @apiDescription Delete a download. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiExample {js} ex: +github.repos.deleteDownload({ ... }); + */ + +/** + * @api {delete} /repos/:owner/:repo/contents/:path deleteFile + * @apiVersion 5.3.3 + * @apiName deleteFile + * @apiDescription Delete a file. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} path The content path. + * @apiParam {String} message The commit message. + * @apiParam {String} sha The blob SHA of the file being removed. + * @apiParam {String} [branch] The branch name. If not provided, uses the repository’s default branch (usually master). + * @apiParam {Json} [committer] + * @apiExample {js} ex: +github.repos.deleteFile({ ... }); + */ + +/** + * @api {delete} /repos/:owner/:repo/hooks/:id deleteHook + * @apiVersion 5.3.3 + * @apiName deleteHook + * @apiDescription Deleate a hook. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiExample {js} ex: +github.repos.deleteHook({ ... }); + */ + +/** + * @api {delete} /repositories/:repo/invitations/:id deleteInvite + * @apiVersion 5.3.3 + * @apiName deleteInvite + * @apiDescription Delete a repository invitation. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} repo + * @apiParam {String} id + * @apiExample {js} ex: +github.repos.deleteInvite({ ... }); + */ + +/** + * @api {delete} /repos/:owner/:repo/keys/:id deleteKey + * @apiVersion 5.3.3 + * @apiName deleteKey + * @apiDescription Remove a deploy key. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiExample {js} ex: +github.repos.deleteKey({ ... }); + */ + +/** + * @api {delete} /repos/:owner/:repo/projects/:number deleteProject + * @apiVersion 5.3.3 + * @apiName deleteProject + * @apiDescription Delete a project. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiExample {js} ex: +github.repos.deleteProject({ ... }); + */ + +/** + * @api {delete} /repos/:owner/:repo/projects/columns/cards/:id deleteProjectCard + * @apiVersion 5.3.3 + * @apiName deleteProjectCard + * @apiDescription Delete a project card. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiExample {js} ex: +github.repos.deleteProjectCard({ ... }); + */ + +/** + * @api {delete} /repos/:owner/:repo/projects/columns/:id deleteProjectColumn + * @apiVersion 5.3.3 + * @apiName deleteProjectColumn + * @apiDescription Delete a project column. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiExample {js} ex: +github.repos.deleteProjectColumn({ ... }); + */ + +/** + * @api {delete} /repos/:owner/:repo/releases/:id deleteRelease + * @apiVersion 5.3.3 + * @apiName deleteRelease + * @apiDescription Delete a release + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiExample {js} ex: +github.repos.deleteRelease({ ... }); + */ + +/** + * @api {patch} /repos/:owner/:repo edit + * @apiVersion 5.3.3 + * @apiName edit + * @apiDescription Update a repo. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} name + * @apiParam {String} repo + * @apiParam {String} [description] + * @apiParam {String} [homepage] + * @apiParam {Boolean} [private=false] True to create a private repository, false to create a public one. Creating private repositories requires a paid GitHub account. Default is false. + * @apiParam {Boolean} [allow_rebase_merge=true] Either true to allow rebase-merging pull requests, or false to prevent rebase-merging. Default: true. (In preview period. See README.) + * @apiParam {Boolean} [has_wiki=true] True to enable the wiki for this repository, false to disable it. Default is true. + * @apiParam {Boolean} [has_downloads=true] True to enable downloads for this repository, false to disable them. Default is true. + * @apiParam {String} [default_branch] Updates the default branch for this repository. + * @apiParam {Boolean} [allow_squash_merge=true] Either true to allow squash-merging pull requests, or false to prevent squash-merging. Default: true. (In preview period. See README.) + * @apiParam {Boolean} [allow_merge_commit=true] Either true to allow merging pull requests with a merge commit, or false to prevent merging pull requests with merge commits. Default: true. (In preview period. See README.) + * @apiParam {Boolean} [has_issues=true] True to enable issues for this repository, false to disable them. Default is true. + * @apiExample {js} ex: +github.repos.edit({ ... }); + */ + +/** + * @api {patch} /repos/:owner/:repo/releases/assets/:id editAsset + * @apiVersion 5.3.3 + * @apiName editAsset + * @apiDescription Edit a release asset. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiParam {String} name + * @apiParam {String} [label] An alternate short description of the asset. Used in place of the filename. + * @apiExample {js} ex: +github.repos.editAsset({ ... }); + */ + +/** + * @api {patch} /repos/:owner/:repo/hooks/:id editHook + * @apiVersion 5.3.3 + * @apiName editHook + * @apiDescription Edit a hook. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiParam {String} name + * @apiParam {Json} config A Hash containing key/value pairs to provide settings for this hook. Modifying this will replace the entire config object. These settings vary between the services and are defined in the github-services repo. Booleans are stored internally as `1` for true, and `0` for false. Any JSON true/false values will be converted automatically. + * @apiParam {Array} [events=["push"]] Determines what events the hook is triggered for. This replaces the entire array of events. Default: `['push']`. + * @apiParam {Array} [add_events] Determines a list of events to be added to the list of events that the Hook triggers for. + * @apiParam {Array} [remove_events] Determines a list of events to be removed from the list of events that the Hook triggers for. + * @apiParam {Boolean} [active] Determines whether the hook is actually triggered on pushes. + * @apiExample {js} ex: +github.repos.editHook({ ... }); + */ + +/** + * @api {patch} /repos/:owner/:repo/releases/:id editRelease + * @apiVersion 5.3.3 + * @apiName editRelease + * @apiDescription Edit a release. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiParam {String} tag_name String of the tag + * @apiParam {String} [target_commitish] Specifies the commitish value that determines where the Git tag is created from. Can be any branch or commit SHA. Unused if the Git tag already exists. Default: the repository's default branch (usually master). + * @apiParam {String} [name] + * @apiParam {String} [body] + * @apiParam {Boolean} [draft=false] true to create a draft (unpublished) release, false to create a published one. Default: false + * @apiParam {Boolean} [prerelease=false] true to identify the release as a prerelease. false to identify the release as a full release. Default: false + * @apiExample {js} ex: +github.repos.editRelease({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/forks fork + * @apiVersion 5.3.3 + * @apiName fork + * @apiDescription Create a fork. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} [organization] Optional parameter to specify the organization name if forking into an organization. + * @apiExample {js} ex: +github.repos.fork({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo get + * @apiVersion 5.3.3 + * @apiName get + * @apiDescription Get a repo for a user. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiExample {js} ex: +github.repos.get({ ... }); + */ + +/** + * @api {get} /user/repos getAll + * @apiVersion 5.3.3 + * @apiName getAll + * @apiDescription List your repositories + * @apiGroup repos + * + * @apiParam {String} [visibility=all] Can be one of `all`, `public`, or `private`. Default: `all`. + * @apiParam {String} [affiliation=owner,collaborator,organization_member] Comma-separated list of values. Can include: `owner`, `collaborator`, `organization_member`. + * @apiParam {String} [type=all] Possible values: `all`, `owner`, `public`, `private`, `member`. Default: `all`. + * @apiParam {String} [sort=full_name] Possible values: `created`, `updated`, `pushed`, `full_name`. Default: `full_name`. + * @apiParam {String} [direction=desc] + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.getAll({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/comments getAllCommitComments + * @apiVersion 5.3.3 + * @apiName getAllCommitComments + * @apiDescription List commit comments for a repository. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.getAllCommitComments({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/:archive_format/:ref getArchiveLink + * @apiVersion 5.3.3 + * @apiName getArchiveLink + * @apiDescription Get archive link. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} archive_format=tarball Either tarball or zipball, Deafult: tarball. + * @apiParam {String} [ref] String of the name of the fully qualified reference (ie: heads/master). If it doesn’t have at least one slash, it will be rejected. + * @apiExample {js} ex: +github.repos.getArchiveLink({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/releases/assets/:id getAsset + * @apiVersion 5.3.3 + * @apiName getAsset + * @apiDescription Get a single release asset. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiExample {js} ex: +github.repos.getAsset({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/branches/:branch getBranch + * @apiVersion 5.3.3 + * @apiName getBranch + * @apiDescription Get branch. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} branch + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.getBranch({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/branches/:branch/protection getBranchProtection + * @apiVersion 5.3.3 + * @apiName getBranchProtection + * @apiDescription Get branch protection. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} branch + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.getBranchProtection({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/branches getBranches + * @apiVersion 5.3.3 + * @apiName getBranches + * @apiDescription List branches. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Boolean} [protected] Set to true to only return protected branches + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.getBranches({ ... }); + */ + +/** + * @api {get} /repositories/:id getById + * @apiVersion 5.3.3 + * @apiName getById + * @apiDescription Get a single repo by id. + * @apiGroup repos + * + * @apiParam {String} id + * @apiExample {js} ex: +github.repos.getById({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/traffic/clones getClones + * @apiVersion 5.3.3 + * @apiName getClones + * @apiDescription Get the total number of clones and breakdown per day or week for the last 14 days. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.getClones({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/collaborators getCollaborators + * @apiVersion 5.3.3 + * @apiName getCollaborators + * @apiDescription List collaborators + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.getCollaborators({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/commits/:sha/status getCombinedStatus + * @apiVersion 5.3.3 + * @apiName getCombinedStatus + * @apiDescription Get the combined status for a specific ref. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} sha + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.getCombinedStatus({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/commits/:sha getCommit + * @apiVersion 5.3.3 + * @apiName getCommit + * @apiDescription Get a single commit. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} sha + * @apiExample {js} ex: +github.repos.getCommit({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/comments/:id getCommitComment + * @apiVersion 5.3.3 + * @apiName getCommitComment + * @apiDescription Get a single commit comment. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiExample {js} ex: +github.repos.getCommitComment({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/commits/:sha/comments getCommitComments + * @apiVersion 5.3.3 + * @apiName getCommitComments + * @apiDescription List comments for a single commit. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} sha + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.getCommitComments({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/commits getCommits + * @apiVersion 5.3.3 + * @apiName getCommits + * @apiDescription List commits on a repository. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} [sha] Sha or branch to start listing commits from. + * @apiParam {String} [path] Only commits containing this file path will be returned. + * @apiParam {String} [author] GitHub login or email address by which to filter by commit author. + * @apiParam {Date} [since] Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ + * @apiParam {Date} [until] Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.getCommits({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/contents/:path getContent + * @apiVersion 5.3.3 + * @apiName getContent + * @apiDescription Get the contents of a file or directory in a repository. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} path The content path. + * @apiParam {String} [ref] The String name of the Commit/Branch/Tag. Defaults to master. + * @apiExample {js} ex: +github.repos.getContent({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/contributors getContributors + * @apiVersion 5.3.3 + * @apiName getContributors + * @apiDescription Get contributors for the specified repository. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Boolean} [anon] Set to 1 or true to include anonymous contributors in results. + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.getContributors({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/deployments/:id/statuses getDeploymentStatuses + * @apiVersion 5.3.3 + * @apiName getDeploymentStatuses + * @apiDescription List deployment statuses. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiExample {js} ex: +github.repos.getDeploymentStatuses({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/deployments getDeployments + * @apiVersion 5.3.3 + * @apiName getDeployments + * @apiDescription List deployments. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} [sha=none] The short or long sha that was recorded at creation time. Default: none. + * @apiParam {String} [ref=none] The name of the ref. This can be a branch, tag, or sha. Default: none. + * @apiParam {String} [task=none] The name of the task for the deployment. e.g. deploy or deploy:migrations. Default: none. + * @apiParam {String} [environment=none] The name of the environment that was deployed to. e.g. staging or production. Default: none. + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.getDeployments({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/downloads/:id getDownload + * @apiVersion 5.3.3 + * @apiName getDownload + * @apiDescription Get a single download. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiExample {js} ex: +github.repos.getDownload({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/downloads getDownloads + * @apiVersion 5.3.3 + * @apiName getDownloads + * @apiDescription List downloads for repository. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.getDownloads({ ... }); + */ + +/** + * @api {get} /orgs/:org/repos getForOrg + * @apiVersion 5.3.3 + * @apiName getForOrg + * @apiDescription List repositories for the specified org. + * @apiGroup repos + * + * @apiParam {String} org + * @apiParam {String} [type=all] Possible values: `all`, `public`, `private`, `forks`, `sources`, `member`. Default: `all`. + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.getForOrg({ ... }); + */ + +/** + * @api {get} /users/:user/repos getForUser + * @apiVersion 5.3.3 + * @apiName getForUser + * @apiDescription List public repositories for the specified user. + * @apiGroup repos + * + * @apiParam {String} user + * @apiParam {String} [type=owner] Possible values: `all`, `owner`, `member`. Default: `owner`. + * @apiParam {String} [sort=full_name] Possible values: `created`, `updated`, `pushed`, `full_name`. Default: `full_name`. + * @apiParam {String} [direction=desc] + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.getForUser({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/forks getForks + * @apiVersion 5.3.3 + * @apiName getForks + * @apiDescription List forks. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} [sort=newest] Possible values: `newest`, `oldest`, `stargazers`, default: `newest`. + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.getForks({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/hooks/:id getHook + * @apiVersion 5.3.3 + * @apiName getHook + * @apiDescription Get single hook. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiExample {js} ex: +github.repos.getHook({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/hooks getHooks + * @apiVersion 5.3.3 + * @apiName getHooks + * @apiDescription List hooks. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.getHooks({ ... }); + */ + +/** + * @api {get} /repositories/:repo/invitations getInvites + * @apiVersion 5.3.3 + * @apiName getInvites + * @apiDescription List invitations for a repository. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} repo + * @apiExample {js} ex: +github.repos.getInvites({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/keys/:id getKey + * @apiVersion 5.3.3 + * @apiName getKey + * @apiDescription Get a deploy key. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiExample {js} ex: +github.repos.getKey({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/keys getKeys + * @apiVersion 5.3.3 + * @apiName getKeys + * @apiDescription List deploy keys. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.getKeys({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/languages getLanguages + * @apiVersion 5.3.3 + * @apiName getLanguages + * @apiDescription Get languages for the specified repository. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.getLanguages({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/pages/builds/latest getLatestPagesBuild + * @apiVersion 5.3.3 + * @apiName getLatestPagesBuild + * @apiDescription Get latest Pages build. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiExample {js} ex: +github.repos.getLatestPagesBuild({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/releases/latest getLatestRelease + * @apiVersion 5.3.3 + * @apiName getLatestRelease + * @apiDescription Get the latest release. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiExample {js} ex: +github.repos.getLatestRelease({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/pages getPages + * @apiVersion 5.3.3 + * @apiName getPages + * @apiDescription Get information about a Pages site. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.getPages({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/pages/builds/:id getPagesBuild + * @apiVersion 5.3.3 + * @apiName getPagesBuild + * @apiDescription Get a specific Pages build. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiExample {js} ex: +github.repos.getPagesBuild({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/pages/builds getPagesBuilds + * @apiVersion 5.3.3 + * @apiName getPagesBuilds + * @apiDescription List Pages builds. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.getPagesBuilds({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/traffic/popular/paths getPaths + * @apiVersion 5.3.3 + * @apiName getPaths + * @apiDescription Get the top 10 popular contents over the last 14 days. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.getPaths({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/projects/:number getProject + * @apiVersion 5.3.3 + * @apiName getProject + * @apiDescription List a project. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiExample {js} ex: +github.repos.getProject({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/projects/columns/cards/:id getProjectCard + * @apiVersion 5.3.3 + * @apiName getProjectCard + * @apiDescription Get project card. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiExample {js} ex: +github.repos.getProjectCard({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/projects/columns/:id/cards getProjectCards + * @apiVersion 5.3.3 + * @apiName getProjectCards + * @apiDescription List project cards. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiExample {js} ex: +github.repos.getProjectCards({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/projects/columns/:id getProjectColumn + * @apiVersion 5.3.3 + * @apiName getProjectColumn + * @apiDescription Get a project column. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiExample {js} ex: +github.repos.getProjectColumn({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/projects/:number/columns getProjectColumns + * @apiVersion 5.3.3 + * @apiName getProjectColumns + * @apiDescription List a project's columns. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiExample {js} ex: +github.repos.getProjectColumns({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/projects getProjects + * @apiVersion 5.3.3 + * @apiName getProjects + * @apiDescription List projects. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiExample {js} ex: +github.repos.getProjects({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/branches/:branch/protection/required_status_checks getProtectedBranchRequiredStatusChecks + * @apiVersion 5.3.3 + * @apiName getProtectedBranchRequiredStatusChecks + * @apiDescription Get required status checks of protected branch. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} branch + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.getProtectedBranchRequiredStatusChecks({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/branches/:branch/protection/required_status_checks/contexts getProtectedBranchRequiredStatusChecksContexts + * @apiVersion 5.3.3 + * @apiName getProtectedBranchRequiredStatusChecksContexts + * @apiDescription List required status checks contexts of protected branch. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} branch + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.getProtectedBranchRequiredStatusChecksContexts({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/branches/:branch/protection/restrictions getProtectedBranchRestrictions + * @apiVersion 5.3.3 + * @apiName getProtectedBranchRestrictions + * @apiDescription Get restrictions of protected branch. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} branch + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.getProtectedBranchRestrictions({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/branches/:branch/protection/restrictions/teams getProtectedBranchTeamRestrictions + * @apiVersion 5.3.3 + * @apiName getProtectedBranchTeamRestrictions + * @apiDescription List team restrictions of protected branch. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} branch + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.getProtectedBranchTeamRestrictions({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/branches/:branch/protection/restrictions/users getProtectedBranchUserRestrictions + * @apiVersion 5.3.3 + * @apiName getProtectedBranchUserRestrictions + * @apiDescription List user restrictions of protected branch. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} branch + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.getProtectedBranchUserRestrictions({ ... }); + */ + +/** + * @api {get} /repositories getPublic + * @apiVersion 5.3.3 + * @apiName getPublic + * @apiDescription List all public repositories + * @apiGroup repos + * + * @apiParam {String} [since] The integer ID of the last Repository that you've seen. + * @apiExample {js} ex: +github.repos.getPublic({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/readme getReadme + * @apiVersion 5.3.3 + * @apiName getReadme + * @apiDescription Get the README for the given repository. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} [ref] The name of the commit/branch/tag. Default: the repository’s default branch (usually master) + * @apiExample {js} ex: +github.repos.getReadme({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/traffic/popular/referrers getReferrers + * @apiVersion 5.3.3 + * @apiName getReferrers + * @apiDescription Get the top 10 referrers over the last 14 days. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.getReferrers({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/releases/:id getRelease + * @apiVersion 5.3.3 + * @apiName getRelease + * @apiDescription Get a single release. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiExample {js} ex: +github.repos.getRelease({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/releases/tags/:tag getReleaseByTag + * @apiVersion 5.3.3 + * @apiName getReleaseByTag + * @apiDescription Get a release by tag name. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} tag String of the tag + * @apiExample {js} ex: +github.repos.getReleaseByTag({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/releases getReleases + * @apiVersion 5.3.3 + * @apiName getReleases + * @apiDescription List releases for a repository. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.getReleases({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/commits/:ref getShaOfCommitRef + * @apiVersion 5.3.3 + * @apiName getShaOfCommitRef + * @apiDescription Get the SHA-1 of a commit reference. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} ref String of the name of the fully qualified reference (ie: heads/master). If it doesn’t have at least one slash, it will be rejected. + * @apiExample {js} ex: +github.repos.getShaOfCommitRef({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/stats/code_frequency getStatsCodeFrequency + * @apiVersion 5.3.3 + * @apiName getStatsCodeFrequency + * @apiDescription Get the number of additions and deletions per week. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiExample {js} ex: +github.repos.getStatsCodeFrequency({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/stats/commit_activity getStatsCommitActivity + * @apiVersion 5.3.3 + * @apiName getStatsCommitActivity + * @apiDescription Get the last year of commit activity data. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiExample {js} ex: +github.repos.getStatsCommitActivity({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/stats/contributors getStatsContributors + * @apiVersion 5.3.3 + * @apiName getStatsContributors + * @apiDescription Get contributors list with additions, deletions, and commit counts. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiExample {js} ex: +github.repos.getStatsContributors({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/stats/participation getStatsParticipation + * @apiVersion 5.3.3 + * @apiName getStatsParticipation + * @apiDescription Get the weekly commit count for the repository owner and everyone else. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiExample {js} ex: +github.repos.getStatsParticipation({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/stats/punch_card getStatsPunchCard + * @apiVersion 5.3.3 + * @apiName getStatsPunchCard + * @apiDescription Get the number of commits per hour in each day. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiExample {js} ex: +github.repos.getStatsPunchCard({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/commits/:sha/statuses getStatuses + * @apiVersion 5.3.3 + * @apiName getStatuses + * @apiDescription Get status for a specfic ref. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} sha + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.getStatuses({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/tags getTags + * @apiVersion 5.3.3 + * @apiName getTags + * @apiDescription Get tags for the specified repository. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.getTags({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/teams getTeams + * @apiVersion 5.3.3 + * @apiName getTeams + * @apiDescription Get teams for the specified repository. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.getTeams({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/traffic/views getViews + * @apiVersion 5.3.3 + * @apiName getViews + * @apiDescription Get the total number of views and breakdown per day or week for the last 14 days. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.getViews({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/releases/:id/assets listAssets + * @apiVersion 5.3.3 + * @apiName listAssets + * @apiDescription List assets for a release. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiExample {js} ex: +github.repos.listAssets({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/merges merge + * @apiVersion 5.3.3 + * @apiName merge + * @apiDescription Perform a merge. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} base The branch (or git ref) you want your changes pulled into. This should be an existing branch on the current repository. You cannot submit a pull request to one repo that requests a merge to a base of another repo. + * @apiParam {String} head The branch (or git ref) where your changes are implemented. + * @apiParam {String} [commit_message] Commit message to use for the merge commit. If omitted, a default message will be used. + * @apiExample {js} ex: +github.repos.merge({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/projects/columns/cards/:id/moves moveProjectCard + * @apiVersion 5.3.3 + * @apiName moveProjectCard + * @apiDescription Move a project card. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiParam {String} position Can be one of first, last, or after:, where is the id value of a column in the same project. + * @apiParam {String} [column_id] The id value of a column in the same project. + * @apiExample {js} ex: +github.repos.moveProjectCard({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/projects/columns/:id/moves moveProjectColumn + * @apiVersion 5.3.3 + * @apiName moveProjectColumn + * @apiDescription Move a project column. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiParam {String} position Can be one of first, last, or after:, where is the id value of a column in the same project. + * @apiExample {js} ex: +github.repos.moveProjectColumn({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/hooks/:id/pings pingHook + * @apiVersion 5.3.3 + * @apiName pingHook + * @apiDescription Ping a hook. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiExample {js} ex: +github.repos.pingHook({ ... }); + */ + +/** + * @api {delete} /repos/:owner/:repo/branches/:branch/protection removeBranchProtection + * @apiVersion 5.3.3 + * @apiName removeBranchProtection + * @apiDescription Remove branch protection. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} branch + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.removeBranchProtection({ ... }); + */ + +/** + * @api {delete} /repos/:owner/:repo/collaborators/:collabuser removeCollaborator + * @apiVersion 5.3.3 + * @apiName removeCollaborator + * @apiDescription Remove user as a collaborator. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} collabuser + * @apiExample {js} ex: +github.repos.removeCollaborator({ ... }); + */ + +/** + * @api {delete} /repos/:owner/:repo/branches/:branch/protection/required_status_checks removeProtectedBranchRequiredStatusChecks + * @apiVersion 5.3.3 + * @apiName removeProtectedBranchRequiredStatusChecks + * @apiDescription Remove required status checks of protected branch. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} branch + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.removeProtectedBranchRequiredStatusChecks({ ... }); + */ + +/** + * @api {delete} /repos/:owner/:repo/branches/:branch/protection/required_status_checks/contexts removeProtectedBranchRequiredStatusChecksContexts + * @apiVersion 5.3.3 + * @apiName removeProtectedBranchRequiredStatusChecksContexts + * @apiDescription Remove required status checks contexts of protected branch. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} branch + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.removeProtectedBranchRequiredStatusChecksContexts({ ... }); + */ + +/** + * @api {delete} /repos/:owner/:repo/branches/:branch/protection/restrictions removeProtectedBranchRestrictions + * @apiVersion 5.3.3 + * @apiName removeProtectedBranchRestrictions + * @apiDescription Remove restrictions of protected branch. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} branch + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.removeProtectedBranchRestrictions({ ... }); + */ + +/** + * @api {delete} /repos/:owner/:repo/branches/:branch/protection/restrictions/teams removeProtectedBranchTeamRestrictions + * @apiVersion 5.3.3 + * @apiName removeProtectedBranchTeamRestrictions + * @apiDescription Remove team restrictions of protected branch. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} branch + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.removeProtectedBranchTeamRestrictions({ ... }); + */ + +/** + * @api {delete} /repos/:owner/:repo/branches/:branch/protection/restrictions/users removeProtectedBranchUserRestrictions + * @apiVersion 5.3.3 + * @apiName removeProtectedBranchUserRestrictions + * @apiDescription Remove user restrictions of protected branch. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} branch + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.removeProtectedBranchUserRestrictions({ ... }); + */ + +/** + * @api {put} /repos/:owner/:repo/branches/:branch/protection/required_status_checks/contexts replaceProtectedBranchRequiredStatusChecksContexts + * @apiVersion 5.3.3 + * @apiName replaceProtectedBranchRequiredStatusChecksContexts + * @apiDescription Replace required status checks contexts of protected branch. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} branch + * @apiParam {Array} body An array of protected branch required status checks contexts (e.g. continuous-integration/jenkins). + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.replaceProtectedBranchRequiredStatusChecksContexts({ ... }); + */ + +/** + * @api {put} /repos/:owner/:repo/branches/:branch/protection/restrictions/teams replaceProtectedBranchTeamRestrictions + * @apiVersion 5.3.3 + * @apiName replaceProtectedBranchTeamRestrictions + * @apiDescription Replace team restrictions of protected branch. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} branch + * @apiParam {Array} body An array of team slugs (e.g. justice-league). + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.replaceProtectedBranchTeamRestrictions({ ... }); + */ + +/** + * @api {put} /repos/:owner/:repo/branches/:branch/protection/restrictions/users replaceProtectedBranchUserRestrictions + * @apiVersion 5.3.3 + * @apiName replaceProtectedBranchUserRestrictions + * @apiDescription Replace user restrictions of protected branch. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} branch + * @apiParam {Array} body An array of team slugs (e.g. justice-league). + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.replaceProtectedBranchUserRestrictions({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/pages/builds requestPageBuild + * @apiVersion 5.3.3 + * @apiName requestPageBuild + * @apiDescription Request a page build. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiExample {js} ex: +github.repos.requestPageBuild({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/hooks/:id/tests testHook + * @apiVersion 5.3.3 + * @apiName testHook + * @apiDescription Test a [push] hook. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiExample {js} ex: +github.repos.testHook({ ... }); + */ + +/** + * @api {put} /repos/:owner/:repo/branches/:branch/protection updateBranchProtection + * @apiVersion 5.3.3 + * @apiName updateBranchProtection + * @apiDescription Update branch protection. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} branch + * @apiParam {Json} required_status_checks JSON object that contains the following keys: `include_admins` - Enforce required status checks for repository administrators, `strict` - Require branches to be up to date before merging, `contexts` - The list of status checks to require in order to merge into this branch. This object can have the value of `null` for disabled. + * @apiParam {Json} restrictions JSON object that contains the following keys: `users` - The list of user logins with push access, `teams` - The list of team slugs with push access. This object can have the value of `null` for disabled. + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.updateBranchProtection({ ... }); + */ + +/** + * @api {patch} /repos/:owner/:repo/comments/:id updateCommitComment + * @apiVersion 5.3.3 + * @apiName updateCommitComment + * @apiDescription Update a commit comment. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiParam {String} body + * @apiExample {js} ex: +github.repos.updateCommitComment({ ... }); + */ + +/** + * @api {put} /repos/:owner/:repo/contents/:path updateFile + * @apiVersion 5.3.3 + * @apiName updateFile + * @apiDescription Update a file. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} path The content path. + * @apiParam {String} message The commit message. + * @apiParam {String} content The updated file content, Base64 encoded. + * @apiParam {String} sha The blob SHA of the file being replaced. + * @apiParam {String} [branch] The branch name. If not provided, uses the repository’s default branch (usually master). + * @apiParam {Json} [committer] + * @apiExample {js} ex: +github.repos.updateFile({ ... }); + */ + +/** + * @api {patch} /repositories/:repo/invitations/:id updateInvite + * @apiVersion 5.3.3 + * @apiName updateInvite + * @apiDescription Update a repository invitation. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} repo + * @apiParam {String} id + * @apiParam {String} [permission] The permissions that the associated user will have on the repository. + * @apiExample {js} ex: +github.repos.updateInvite({ ... }); + */ + +/** + * @api {patch} /repos/:owner/:repo/projects/:number updateProject + * @apiVersion 5.3.3 + * @apiName updateProject + * @apiDescription Update a project. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiParam {String} name + * @apiParam {String} body + * @apiExample {js} ex: +github.repos.updateProject({ ... }); + */ + +/** + * @api {patch} /repos/:owner/:repo/projects/columns/cards/:id updateProjectCard + * @apiVersion 5.3.3 + * @apiName updateProjectCard + * @apiDescription Update a project card. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiParam {String} [note] The note of the card. + * @apiExample {js} ex: +github.repos.updateProjectCard({ ... }); + */ + +/** + * @api {patch} /repos/:owner/:repo/projects/columns/:id updateProjectColumn + * @apiVersion 5.3.3 + * @apiName updateProjectColumn + * @apiDescription Update a project column. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiParam {String} name + * @apiExample {js} ex: +github.repos.updateProjectColumn({ ... }); + */ + +/** + * @api {patch} /repos/:owner/:repo/branches/:branch/protection/required_status_checks updateProtectedBranchRequiredStatusChecks + * @apiVersion 5.3.3 + * @apiName updateProtectedBranchRequiredStatusChecks + * @apiDescription Update required status checks of protected branch. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} branch + * @apiParam {Boolean} [include_admins] Enforce required status checks for repository administrators. + * @apiParam {Boolean} [strict] Require branches to be up to date before merging. + * @apiParam {Array} [contexts] The list of status checks to require in order to merge into this branch. + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.updateProtectedBranchRequiredStatusChecks({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/releases/:id/assets uploadAsset + * @apiVersion 5.3.3 + * @apiName uploadAsset + * @apiDescription Upload a release asset. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiParam {String} filePath The file path of the asset. + * @apiParam {String} name The file name of the asset. This should be set in a URI query parameter. + * @apiParam {String} [label] An alternate short description of the asset. Used in place of the filename. This should be set in a URI query parameter. + * @apiExample {js} ex: +github.repos.uploadAsset({ ... }); + */ + +/** + * @api {get} /search/code code + * @apiVersion 5.3.3 + * @apiName code + * @apiDescription Search code. + * @apiGroup search + * + * @apiParam {String} q Search Term + * @apiParam {String} [sort] The sort field. Can only be indexed, which indicates how recently a file has been indexed by the GitHub search infrastructure. Default: results are sorted by best match. + * @apiParam {String} [order=desc] asc or desc + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.search.code({ ... }); + */ + +/** + * @api {get} /legacy/user/email/:email email + * @apiVersion 5.3.3 + * @apiName email + * @apiDescription Search against public email addresses. + * @apiGroup search + * + * @apiParam {String} email The email address + * @apiExample {js} ex: +github.search.email({ ... }); + */ + +/** + * @api {get} /search/issues issues + * @apiVersion 5.3.3 + * @apiName issues + * @apiDescription Search issues. + * @apiGroup search + * + * @apiParam {String} q Search Term + * @apiParam {String} [sort] The sort field. Can be comments, created, or updated. Default: results are sorted by best match. + * @apiParam {String} [order=desc] asc or desc + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.search.issues({ ... }); + */ + +/** + * @api {get} /search/repositories repos + * @apiVersion 5.3.3 + * @apiName repos + * @apiDescription Search repositories. + * @apiGroup search + * + * @apiParam {String} q Search Term + * @apiParam {String} [sort] stars, forks, or updated + * @apiParam {String} [order=desc] asc or desc + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.search.repos({ ... }); + */ + +/** + * @api {get} /search/users users + * @apiVersion 5.3.3 + * @apiName users + * @apiDescription Search users. + * @apiGroup search + * + * @apiParam {String} q Search Term + * @apiParam {String} [sort] The sort field. Can be followers, repositories, or joined. Default: results are sorted by best match. + * @apiParam {String} [order=desc] asc or desc + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.search.users({ ... }); + */ + +/** + * @api {patch} /user/repository_invitations/:id acceptRepoInvite + * @apiVersion 5.3.3 + * @apiName acceptRepoInvite + * @apiDescription Accept a repository invitation. (In preview period. See README.) + * @apiGroup users + * + * @apiParam {String} id + * @apiExample {js} ex: +github.users.acceptRepoInvite({ ... }); + */ + +/** + * @api {post} /user/emails addEmails + * @apiVersion 5.3.3 + * @apiName addEmails + * @apiDescription Add email address(es) + * @apiGroup users + * + * @apiParam {Array} body You can post a single email address or an array of addresses. + * @apiExample {js} ex: +github.users.addEmails({ ... }); + */ + +/** + * @api {get} /user/following/:user checkFollowing + * @apiVersion 5.3.3 + * @apiName checkFollowing + * @apiDescription Check if you are following a user + * @apiGroup users + * + * @apiParam {String} user + * @apiExample {js} ex: +github.users.checkFollowing({ ... }); + */ + +/** + * @api {get} /users/:user/following/:other_user checkIfOneFollowersOther + * @apiVersion 5.3.3 + * @apiName checkIfOneFollowersOther + * @apiDescription Check if one user follows another + * @apiGroup users + * + * @apiParam {String} user + * @apiParam {String} other_user Other user + * @apiExample {js} ex: +github.users.checkIfOneFollowersOther({ ... }); + */ + +/** + * @api {post} /user/gpg_keys createGpgKey + * @apiVersion 5.3.3 + * @apiName createGpgKey + * @apiDescription Create a GPG key. (In preview period. See README.) + * @apiGroup users + * + * @apiParam {String} armored_public_key GPG key contents + * @apiExample {js} ex: +github.users.createGpgKey({ ... }); + */ + +/** + * @api {post} /user/keys createKey + * @apiVersion 5.3.3 + * @apiName createKey + * @apiDescription Create a public key + * @apiGroup users + * + * @apiParam {String} title + * @apiParam {String} key + * @apiExample {js} ex: +github.users.createKey({ ... }); + */ + +/** + * @api {delete} /user/repository_invitations/:id declineRepoInvite + * @apiVersion 5.3.3 + * @apiName declineRepoInvite + * @apiDescription Decline a repository invitation. (In preview period. See README.) + * @apiGroup users + * + * @apiParam {String} id + * @apiExample {js} ex: +github.users.declineRepoInvite({ ... }); + */ + +/** + * @api {delete} /user/emails deleteEmails + * @apiVersion 5.3.3 + * @apiName deleteEmails + * @apiDescription Delete email address(es) + * @apiGroup users + * + * @apiParam {Array} body You can post a single email address or an array of addresses. + * @apiExample {js} ex: +github.users.deleteEmails({ ... }); + */ + +/** + * @api {delete} /user/gpg_keys/:id deleteGpgKey + * @apiVersion 5.3.3 + * @apiName deleteGpgKey + * @apiDescription Delete a GPG key. (In preview period. See README.) + * @apiGroup users + * + * @apiParam {String} id + * @apiExample {js} ex: +github.users.deleteGpgKey({ ... }); + */ + +/** + * @api {delete} /user/keys/:id deleteKey + * @apiVersion 5.3.3 + * @apiName deleteKey + * @apiDescription Delete a public key + * @apiGroup users + * + * @apiParam {String} id + * @apiExample {js} ex: +github.users.deleteKey({ ... }); + */ + +/** + * @api {delete} /users/:user/site_admin demote + * @apiVersion 5.3.3 + * @apiName demote + * @apiDescription Demote a site administrator to an ordinary user + * @apiGroup users + * + * @apiParam {String} user + * @apiExample {js} ex: +github.users.demote({ ... }); + */ + +/** + * @api {patch} /user/memberships/orgs/:org editOrganizationMembership + * @apiVersion 5.3.3 + * @apiName editOrganizationMembership + * @apiDescription Edit your organization membership + * @apiGroup users + * + * @apiParam {String} org + * @apiParam {String} state The state that the membership should be in. Only "active" will be accepted. + * @apiExample {js} ex: +github.users.editOrganizationMembership({ ... }); + */ + +/** + * @api {put} /user/following/:user followUser + * @apiVersion 5.3.3 + * @apiName followUser + * @apiDescription Follow a user + * @apiGroup users + * + * @apiParam {String} user + * @apiExample {js} ex: +github.users.followUser({ ... }); + */ + +/** + * @api {get} /user get + * @apiVersion 5.3.3 + * @apiName get + * @apiDescription Get the authenticated user + * @apiGroup users + * + * @apiExample {js} ex: +github.users.get({ ... }); + */ + +/** + * @api {get} /users getAll + * @apiVersion 5.3.3 + * @apiName getAll + * @apiDescription Get all users + * @apiGroup users + * + * @apiParam {Number} [since] The integer ID of the last User that you’ve seen. + * @apiExample {js} ex: +github.users.getAll({ ... }); + */ + +/** + * @api {get} /user/:id getById + * @apiVersion 5.3.3 + * @apiName getById + * @apiDescription Get a single user by GitHub ID + * @apiGroup users + * + * @apiParam {String} id + * @apiExample {js} ex: +github.users.getById({ ... }); + */ + +/** + * @api {get} /user/emails getEmails + * @apiVersion 5.3.3 + * @apiName getEmails + * @apiDescription List email addresses for a user + * @apiGroup users + * + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.users.getEmails({ ... }); + */ + +/** + * @api {get} /user/followers getFollowers + * @apiVersion 5.3.3 + * @apiName getFollowers + * @apiDescription List the authenticated user's followers + * @apiGroup users + * + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.users.getFollowers({ ... }); + */ + +/** + * @api {get} /users/:user/followers getFollowersForUser + * @apiVersion 5.3.3 + * @apiName getFollowersForUser + * @apiDescription List a user's followers + * @apiGroup users + * + * @apiParam {String} user + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.users.getFollowersForUser({ ... }); + */ + +/** + * @api {get} /user/following getFollowing + * @apiVersion 5.3.3 + * @apiName getFollowing + * @apiDescription List who the authenticated user is following + * @apiGroup users + * + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.users.getFollowing({ ... }); + */ + +/** + * @api {get} /users/:user/following getFollowingForUser + * @apiVersion 5.3.3 + * @apiName getFollowingForUser + * @apiDescription List who a user is following + * @apiGroup users + * + * @apiParam {String} user + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.users.getFollowingForUser({ ... }); + */ + +/** + * @api {get} /users/:user getForUser + * @apiVersion 5.3.3 + * @apiName getForUser + * @apiDescription Get a single user + * @apiGroup users + * + * @apiParam {String} user + * @apiExample {js} ex: +github.users.getForUser({ ... }); + */ + +/** + * @api {get} /user/gpg_keys/:id getGpgKey + * @apiVersion 5.3.3 + * @apiName getGpgKey + * @apiDescription Get a single GPG key. (In preview period. See README.) + * @apiGroup users + * + * @apiParam {String} id + * @apiExample {js} ex: +github.users.getGpgKey({ ... }); + */ + +/** + * @api {get} /user/gpg_keys getGpgKeys + * @apiVersion 5.3.3 + * @apiName getGpgKeys + * @apiDescription List your GPG keys. (In preview period. See README.) + * @apiGroup users + * + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.users.getGpgKeys({ ... }); + */ + +/** + * @api {get} /user/keys/:id getKey + * @apiVersion 5.3.3 + * @apiName getKey + * @apiDescription Get a single public key + * @apiGroup users + * + * @apiParam {String} id + * @apiExample {js} ex: +github.users.getKey({ ... }); + */ + +/** + * @api {get} /user/keys getKeys + * @apiVersion 5.3.3 + * @apiName getKeys + * @apiDescription List your public keys + * @apiGroup users + * + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.users.getKeys({ ... }); + */ + +/** + * @api {get} /users/:user/keys getKeysForUser + * @apiVersion 5.3.3 + * @apiName getKeysForUser + * @apiDescription List public keys for a user + * @apiGroup users + * + * @apiParam {String} user + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.users.getKeysForUser({ ... }); + */ + +/** + * @api {get} /user/memberships/orgs/:org getOrganizationMembership + * @apiVersion 5.3.3 + * @apiName getOrganizationMembership + * @apiDescription Get your organization membership + * @apiGroup users + * + * @apiParam {String} org + * @apiExample {js} ex: +github.users.getOrganizationMembership({ ... }); + */ + +/** + * @api {get} /user/orgs getOrgs + * @apiVersion 5.3.3 + * @apiName getOrgs + * @apiDescription List organizations for the authenticated user. + * @apiGroup users + * + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.users.getOrgs({ ... }); + */ + +/** + * @api {get} /user/repository_invitations getRepoInvites + * @apiVersion 5.3.3 + * @apiName getRepoInvites + * @apiDescription List a user's repository invitations. (In preview period. See README.) + * @apiGroup users + * + * @apiExample {js} ex: +github.users.getRepoInvites({ ... }); + */ + +/** + * @api {get} /user/teams getTeams + * @apiVersion 5.3.3 + * @apiName getTeams + * @apiDescription Get your teams + * @apiGroup users + * + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.users.getTeams({ ... }); + */ + +/** + * @api {put} /users/:user/site_admin promote + * @apiVersion 5.3.3 + * @apiName promote + * @apiDescription Promote an ordinary user to a site administrator + * @apiGroup users + * + * @apiParam {String} user + * @apiExample {js} ex: +github.users.promote({ ... }); + */ + +/** + * @api {put} /users/:user/suspended suspend + * @apiVersion 5.3.3 + * @apiName suspend + * @apiDescription Suspend a user + * @apiGroup users + * + * @apiParam {String} user + * @apiExample {js} ex: +github.users.suspend({ ... }); + */ + +/** + * @api {delete} /user/following/:user unfollowUser + * @apiVersion 5.3.3 + * @apiName unfollowUser + * @apiDescription Unfollow a user + * @apiGroup users + * + * @apiParam {String} user + * @apiExample {js} ex: +github.users.unfollowUser({ ... }); + */ + +/** + * @api {delete} /users/:user/suspended unsuspend + * @apiVersion 5.3.3 + * @apiName unsuspend + * @apiDescription Unsuspend a user + * @apiGroup users + * + * @apiParam {String} user + * @apiExample {js} ex: +github.users.unsuspend({ ... }); + */ + +/** + * @api {patch} /user update + * @apiVersion 5.3.3 + * @apiName update + * @apiDescription Update the authenticated user + * @apiGroup users + * + * @apiParam {String} [name] The new name of the user + * @apiParam {String} [email] Publicly visible email address. + * @apiParam {String} [blog] The new blog URL of the user. + * @apiParam {String} [company] The new company of the user. + * @apiParam {String} [location] The new location of the user. + * @apiParam {Boolean} [hireable] The new hiring availability of the user. + * @apiParam {String} [bio] The new short biography of the user. + * @apiExample {js} ex: +github.users.update({ ... }); + */ + +/** + * @api {get} /notifications/threads/:id/subscription checkNotificationThreadSubscription + * @apiVersion 6.0.0 + * @apiName checkNotificationThreadSubscription + * @apiDescription Check to see if the current user is subscribed to a thread. + * @apiGroup activity + * + * @apiParam {String} id + * @apiExample {js} ex: +github.activity.checkNotificationThreadSubscription({ ... }); + */ + +/** + * @api {get} /user/starred/:owner/:repo checkStarringRepo + * @apiVersion 6.0.0 + * @apiName checkStarringRepo + * @apiDescription Check if you are starring a repository + * @apiGroup activity + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.activity.checkStarringRepo({ ... }); + */ + +/** + * @api {delete} /notifications/threads/:id/subscription deleteNotificationThreadSubscription + * @apiVersion 6.0.0 + * @apiName deleteNotificationThreadSubscription + * @apiDescription Delete a notification thread subscription. + * @apiGroup activity + * + * @apiParam {String} id + * @apiExample {js} ex: +github.activity.deleteNotificationThreadSubscription({ ... }); + */ + +/** + * @api {get} /events getEvents + * @apiVersion 6.0.0 + * @apiName getEvents + * @apiDescription List public events + * @apiGroup activity + * + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.activity.getEvents({ ... }); + */ + +/** + * @api {get} /orgs/:org/events getEventsForOrg + * @apiVersion 6.0.0 + * @apiName getEventsForOrg + * @apiDescription List public events for an organization + * @apiGroup activity + * + * @apiParam {String} org + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.activity.getEventsForOrg({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/events getEventsForRepo + * @apiVersion 6.0.0 + * @apiName getEventsForRepo + * @apiDescription List repository events + * @apiGroup activity + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.activity.getEventsForRepo({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/issues/events getEventsForRepoIssues + * @apiVersion 6.0.0 + * @apiName getEventsForRepoIssues + * @apiDescription List issue events for a repository + * @apiGroup activity + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.activity.getEventsForRepoIssues({ ... }); + */ + +/** + * @api {get} /networks/:owner/:repo/events getEventsForRepoNetwork + * @apiVersion 6.0.0 + * @apiName getEventsForRepoNetwork + * @apiDescription List public events for a network of repositories + * @apiGroup activity + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.activity.getEventsForRepoNetwork({ ... }); + */ + +/** + * @api {get} /users/:username/events getEventsForUser + * @apiVersion 6.0.0 + * @apiName getEventsForUser + * @apiDescription List events performed by a user + * @apiGroup activity + * + * @apiParam {String} username + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.activity.getEventsForUser({ ... }); + */ + +/** + * @api {get} /users/:username/events/orgs/:org getEventsForUserOrg + * @apiVersion 6.0.0 + * @apiName getEventsForUserOrg + * @apiDescription List events for a user's organization + * @apiGroup activity + * + * @apiParam {String} username + * @apiParam {String} org + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.activity.getEventsForUserOrg({ ... }); + */ + +/** + * @api {get} /users/:username/events/public getEventsForUserPublic + * @apiVersion 6.0.0 + * @apiName getEventsForUserPublic + * @apiDescription List public events performed by a user + * @apiGroup activity + * + * @apiParam {String} username + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.activity.getEventsForUserPublic({ ... }); + */ + +/** + * @api {get} /users/:username/received_events getEventsReceived + * @apiVersion 6.0.0 + * @apiName getEventsReceived + * @apiDescription List events that a user has received + * @apiGroup activity + * + * @apiParam {String} username + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.activity.getEventsReceived({ ... }); + */ + +/** + * @api {get} /users/:username/received_events/public getEventsReceivedPublic + * @apiVersion 6.0.0 + * @apiName getEventsReceivedPublic + * @apiDescription List public events that a user has received + * @apiGroup activity + * + * @apiParam {String} username + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.activity.getEventsReceivedPublic({ ... }); + */ + +/** + * @api {get} /feeds getFeeds + * @apiVersion 6.0.0 + * @apiName getFeeds + * @apiDescription Get all feeds available for the authenticated user. + * @apiGroup activity + * + * @apiExample {js} ex: +github.activity.getFeeds({ ... }); + */ + +/** + * @api {get} /notifications/threads/:id getNotificationThread + * @apiVersion 6.0.0 + * @apiName getNotificationThread + * @apiDescription View a single notification thread. + * @apiGroup activity + * + * @apiParam {String} id + * @apiExample {js} ex: +github.activity.getNotificationThread({ ... }); + */ + +/** + * @api {get} /notifications getNotifications + * @apiVersion 6.0.0 + * @apiName getNotifications + * @apiDescription Get all notifications for the current user, grouped by repository. + * @apiGroup activity + * + * @apiParam {Boolean} [all=false] If true, show notifications marked as read. Default: false + * @apiParam {Boolean} [participating=false] If true, only shows notifications in which the user is directly participating or mentioned. Default: false + * @apiParam {Date} [since] Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ + * @apiParam {String} [before] Only show notifications updated before the given time. This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ. + * @apiExample {js} ex: +github.activity.getNotifications({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/notifications getNotificationsForUser + * @apiVersion 6.0.0 + * @apiName getNotificationsForUser + * @apiDescription Get all notifications for the given user. + * @apiGroup activity + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Boolean} [all=false] If true, show notifications marked as read. Default: false + * @apiParam {Boolean} [participating=false] If true, only shows notifications in which the user is directly participating or mentioned. Default: false + * @apiParam {Date} [since] Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ + * @apiParam {String} [before] Only show notifications updated before the given time. This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ. + * @apiExample {js} ex: +github.activity.getNotificationsForUser({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/subscription getRepoSubscription + * @apiVersion 6.0.0 + * @apiName getRepoSubscription + * @apiDescription Get a Repository Subscription. + * @apiGroup activity + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.activity.getRepoSubscription({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/stargazers getStargazersForRepo + * @apiVersion 6.0.0 + * @apiName getStargazersForRepo + * @apiDescription List Stargazers + * @apiGroup activity + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.activity.getStargazersForRepo({ ... }); + */ + +/** + * @api {get} /user/starred getStarredRepos + * @apiVersion 6.0.0 + * @apiName getStarredRepos + * @apiDescription List repositories being starred by the authenticated user + * @apiGroup activity + * + * @apiParam {String} [sort=created] + * @apiParam {String} [direction=desc] + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.activity.getStarredRepos({ ... }); + */ + +/** + * @api {get} /users/:username/starred getStarredReposForUser + * @apiVersion 6.0.0 + * @apiName getStarredReposForUser + * @apiDescription List repositories being starred by a user + * @apiGroup activity + * + * @apiParam {String} username + * @apiParam {String} [sort=created] + * @apiParam {String} [direction=desc] + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.activity.getStarredReposForUser({ ... }); + */ + +/** + * @api {get} /user/subscriptions getWatchedRepos + * @apiVersion 6.0.0 + * @apiName getWatchedRepos + * @apiDescription List repositories being watched by the authenticated user. + * @apiGroup activity + * + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.activity.getWatchedRepos({ ... }); + */ + +/** + * @api {get} /users/:username/subscriptions getWatchedReposForUser + * @apiVersion 6.0.0 + * @apiName getWatchedReposForUser + * @apiDescription List repositories being watched by a user. + * @apiGroup activity + * + * @apiParam {String} username + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.activity.getWatchedReposForUser({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/subscribers getWatchersForRepo + * @apiVersion 6.0.0 + * @apiName getWatchersForRepo + * @apiDescription Get watchers for repository. + * @apiGroup activity + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.activity.getWatchersForRepo({ ... }); + */ + +/** + * @api {patch} /notifications/threads/:id markNotificationThreadAsRead + * @apiVersion 6.0.0 + * @apiName markNotificationThreadAsRead + * @apiDescription Mark a notification thread as read. + * @apiGroup activity + * + * @apiParam {String} id + * @apiExample {js} ex: +github.activity.markNotificationThreadAsRead({ ... }); + */ + +/** + * @api {put} /notifications markNotificationsAsRead + * @apiVersion 6.0.0 + * @apiName markNotificationsAsRead + * @apiDescription Mark notifications as read for authenticated user. + * @apiGroup activity + * + * @apiParam {String} [last_read_at=Time.now] Describes the last point that notifications were checked. Anything updated since this time will not be updated. This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ. Default: Time.now + * @apiExample {js} ex: +github.activity.markNotificationsAsRead({ ... }); + */ + +/** + * @api {put} /repos/:owner/:repo/notifications markNotificationsAsReadForRepo + * @apiVersion 6.0.0 + * @apiName markNotificationsAsReadForRepo + * @apiDescription Mark notifications in a repo as read. + * @apiGroup activity + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} [last_read_at=Time.now] Describes the last point that notifications were checked. Anything updated since this time will not be updated. This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ. Default: Time.now + * @apiExample {js} ex: +github.activity.markNotificationsAsReadForRepo({ ... }); + */ + +/** + * @api {put} /notifications/threads/:id/subscription setNotificationThreadSubscription + * @apiVersion 6.0.0 + * @apiName setNotificationThreadSubscription + * @apiDescription This lets you subscribe or unsubscribe from a conversation. Unsubscribing from a conversation mutes all future notifications (until you comment or get @mentioned once more). + * @apiGroup activity + * + * @apiParam {String} id + * @apiParam {Boolean} [subscribed] Determines if notifications should be received from this thread + * @apiParam {Boolean} [ignored] Determines if all notifications should be blocked from this thread + * @apiExample {js} ex: +github.activity.setNotificationThreadSubscription({ ... }); + */ + +/** + * @api {put} /repos/:owner/:repo/subscription setRepoSubscription + * @apiVersion 6.0.0 + * @apiName setRepoSubscription + * @apiDescription Set a Repository Subscription + * @apiGroup activity + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Boolean} [subscribed] Determines if notifications should be received from this repository. + * @apiParam {Boolean} [ignored] Determines if all notifications should be blocked from this repository. + * @apiExample {js} ex: +github.activity.setRepoSubscription({ ... }); + */ + +/** + * @api {put} /user/starred/:owner/:repo starRepo + * @apiVersion 6.0.0 + * @apiName starRepo + * @apiDescription Star a repository + * @apiGroup activity + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiExample {js} ex: +github.activity.starRepo({ ... }); + */ + +/** + * @api {delete} /user/starred/:owner/:repo unstarRepo + * @apiVersion 6.0.0 + * @apiName unstarRepo + * @apiDescription Unstar a repository + * @apiGroup activity + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiExample {js} ex: +github.activity.unstarRepo({ ... }); + */ + +/** + * @api {delete} /repos/:owner/:repo/subscription unwatchRepo + * @apiVersion 6.0.0 + * @apiName unwatchRepo + * @apiDescription Unwatch a repository. + * @apiGroup activity + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiExample {js} ex: +github.activity.unwatchRepo({ ... }); + */ + +/** + * @api {get} /applications/:client_id/tokens/:access_token check + * @apiVersion 6.0.0 + * @apiName check + * @apiDescription Check an authorization + * @apiGroup authorization + * + * @apiParam {String} access_token OAuth token + * @apiParam {String} [client_id] The 20 character OAuth app client key for which to create the token. + * @apiExample {js} ex: +github.authorization.check({ ... }); + */ + +/** + * @api {post} /authorizations create + * @apiVersion 6.0.0 + * @apiName create + * @apiDescription Create a new authorization. + * @apiGroup authorization + * + * @apiParam {Array} [scopes] A list of scopes that this authorization is in. + * @apiParam {String} [note] A note to remind you what the OAuth token is for. + * @apiParam {String} [note_url] A URL to remind you what app the OAuth token is for. + * @apiParam {String} [client_id] The 20 character OAuth app client key for which to create the token. + * @apiParam {String} [client_secret] The 40 character OAuth app client secret for which to create the token. + * @apiParam {String} [fingerprint] A unique string to distinguish an authorization from others created for the same client ID and user. + * @apiExample {js} ex: +github.authorization.create({ ... }); + */ + +/** + * @api {delete} /authorizations/:id delete + * @apiVersion 6.0.0 + * @apiName delete + * @apiDescription Delete an authorization. + * @apiGroup authorization + * + * @apiParam {String} id + * @apiExample {js} ex: +github.authorization.delete({ ... }); + */ + +/** + * @api {delete} /applications/grants/:id deleteGrant + * @apiVersion 6.0.0 + * @apiName deleteGrant + * @apiDescription Delete a grant. + * @apiGroup authorization + * + * @apiParam {String} id + * @apiExample {js} ex: +github.authorization.deleteGrant({ ... }); + */ + +/** + * @api {get} /authorizations/:id get + * @apiVersion 6.0.0 + * @apiName get + * @apiDescription Get a single authorization. + * @apiGroup authorization + * + * @apiParam {String} id + * @apiExample {js} ex: +github.authorization.get({ ... }); + */ + +/** + * @api {get} /authorizations getAll + * @apiVersion 6.0.0 + * @apiName getAll + * @apiDescription List your authorizations. + * @apiGroup authorization + * + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.authorization.getAll({ ... }); + */ + +/** + * @api {get} /applications/grants/:id getGrant + * @apiVersion 6.0.0 + * @apiName getGrant + * @apiDescription Get a single grant. + * @apiGroup authorization + * + * @apiParam {String} id + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.authorization.getGrant({ ... }); + */ + +/** + * @api {get} /applications/grants getGrants + * @apiVersion 6.0.0 + * @apiName getGrants + * @apiDescription List your grants. + * @apiGroup authorization + * + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.authorization.getGrants({ ... }); + */ + +/** + * @api {put} /authorizations/clients/:client_id getOrCreateAuthorizationForApp + * @apiVersion 6.0.0 + * @apiName getOrCreateAuthorizationForApp + * @apiDescription Get or create an authorization for a specific app. + * @apiGroup authorization + * + * @apiParam {String} client_secret The 40 character OAuth app client secret associated with the client ID specified in the URL. + * @apiParam {String} [client_id] The 20 character OAuth app client key for which to create the token. + * @apiParam {Array} [scopes] A list of scopes that this authorization is in. + * @apiParam {String} [note] A note to remind you what the OAuth token is for. + * @apiParam {String} [note_url] A URL to remind you what app the OAuth token is for. + * @apiParam {String} [fingerprint] A unique string to distinguish an authorization from others created for the same client ID and user. + * @apiExample {js} ex: +github.authorization.getOrCreateAuthorizationForApp({ ... }); + */ + +/** + * @api {put} /authorizations/clients/:client_id/:fingerprint getOrCreateAuthorizationForAppAndFingerprint + * @apiVersion 6.0.0 + * @apiName getOrCreateAuthorizationForAppAndFingerprint + * @apiDescription Get or create an authorization for a specific app and fingerprint. + * @apiGroup authorization + * + * @apiParam {String} client_secret The 40 character OAuth app client secret associated with the client ID specified in the URL. + * @apiParam {String} [client_id] The 20 character OAuth app client key for which to create the token. + * @apiParam {String} [fingerprint] A unique string to distinguish an authorization from others created for the same client ID and user. + * @apiParam {Array} [scopes] A list of scopes that this authorization is in. + * @apiParam {String} [note] A note to remind you what the OAuth token is for. + * @apiParam {String} [note_url] A URL to remind you what app the OAuth token is for. + * @apiExample {js} ex: +github.authorization.getOrCreateAuthorizationForAppAndFingerprint({ ... }); + */ + +/** + * @api {post} /applications/:client_id/tokens/:access_token reset + * @apiVersion 6.0.0 + * @apiName reset + * @apiDescription Reset an authorization + * @apiGroup authorization + * + * @apiParam {String} access_token OAuth token + * @apiParam {String} [client_id] The 20 character OAuth app client key for which to create the token. + * @apiExample {js} ex: +github.authorization.reset({ ... }); + */ + +/** + * @api {delete} /applications/:client_id/tokens/:access_token revoke + * @apiVersion 6.0.0 + * @apiName revoke + * @apiDescription Revoke an authorization for an application + * @apiGroup authorization + * + * @apiParam {String} access_token OAuth token + * @apiParam {String} [client_id] The 20 character OAuth app client key for which to create the token. + * @apiExample {js} ex: +github.authorization.revoke({ ... }); + */ + +/** + * @api {patch} /authorizations/:id update + * @apiVersion 6.0.0 + * @apiName update + * @apiDescription Update an existing authorization. + * @apiGroup authorization + * + * @apiParam {String} id + * @apiParam {Array} [scopes] A list of scopes that this authorization is in. + * @apiParam {Array} [add_scopes] A list of scopes to add to this authorization. + * @apiParam {Array} [remove_scopes] A list of scopes to remove from this authorization. + * @apiParam {String} [note] A note to remind you what the OAuth token is for. + * @apiParam {String} [note_url] A URL to remind you what app the OAuth token is for. + * @apiParam {String} [fingerprint] A unique string to distinguish an authorization from others created for the same client ID and user. + * @apiExample {js} ex: +github.authorization.update({ ... }); + */ + +/** + * @api {post} /admin/organizations createOrg + * @apiVersion 6.0.0 + * @apiName createOrg + * @apiDescription Create an organization + * @apiGroup enterprise + * + * @apiParam {String} login The organization's username. + * @apiParam {String} admin The login of the user who will manage this organization. + * @apiParam {String} [profile_name] The organization's display name. + * @apiExample {js} ex: +github.enterprise.createOrg({ ... }); + */ + +/** + * @api {post} /admin/pre_receive_environments createPreReceiveEnvironment + * @apiVersion 6.0.0 + * @apiName createPreReceiveEnvironment + * @apiDescription Create a pre-receive environment. (In preview period. See README.) + * @apiGroup enterprise + * + * @apiParam {String} name The new pre-receive environment's name. + * @apiParam {String} image_url URL from which to download a tarball of this environment. + * @apiExample {js} ex: +github.enterprise.createPreReceiveEnvironment({ ... }); + */ + +/** + * @api {post} /admin/pre-receive-hooks createPreReceiveHook + * @apiVersion 6.0.0 + * @apiName createPreReceiveHook + * @apiDescription Create a pre-receive hook. (In preview period. See README.) + * @apiGroup enterprise + * + * @apiParam {String} name The name of the hook. + * @apiParam {String} script The script that the hook runs. + * @apiParam {Json} script_repository The GitHub repository where the script is kept. + * @apiParam {Json} environment The pre-receive environment where the script is executed. + * @apiParam {String} [enforcement=disabled] The state of enforcement for this hook. default: disabled + * @apiParam {Boolean} [allow_downstream_configuration=false] Whether enforcement can be overridden at the org or repo level. default: false + * @apiExample {js} ex: +github.enterprise.createPreReceiveHook({ ... }); + */ + +/** + * @api {delete} /admin/pre_receive_environments/:id deletePreReceiveEnvironment + * @apiVersion 6.0.0 + * @apiName deletePreReceiveEnvironment + * @apiDescription Delete a pre-receive environment. (In preview period. See README.) + * @apiGroup enterprise + * + * @apiParam {String} id + * @apiExample {js} ex: +github.enterprise.deletePreReceiveEnvironment({ ... }); + */ + +/** + * @api {delete} /admin/pre_receive_hooks/:id deletePreReceiveHook + * @apiVersion 6.0.0 + * @apiName deletePreReceiveHook + * @apiDescription Delete a pre-receive hook. (In preview period. See README.) + * @apiGroup enterprise + * + * @apiParam {String} id + * @apiExample {js} ex: +github.enterprise.deletePreReceiveHook({ ... }); + */ + +/** + * @api {patch} /admin/pre_receive_environments/:id editPreReceiveEnvironment + * @apiVersion 6.0.0 + * @apiName editPreReceiveEnvironment + * @apiDescription Create a pre-receive environment. (In preview period. See README.) + * @apiGroup enterprise + * + * @apiParam {String} id + * @apiParam {String} name This pre-receive environment's new name. + * @apiParam {String} image_url URL from which to download a tarball of this environment. + * @apiExample {js} ex: +github.enterprise.editPreReceiveEnvironment({ ... }); + */ + +/** + * @api {patch} /admin/pre_receive_hooks/:id editPreReceiveHook + * @apiVersion 6.0.0 + * @apiName editPreReceiveHook + * @apiDescription Edit a pre-receive hook. (In preview period. See README.) + * @apiGroup enterprise + * + * @apiParam {String} id + * @apiParam {Json} body JSON object that contains pre-receive hook info. + * @apiExample {js} ex: +github.enterprise.editPreReceiveHook({ ... }); + */ + +/** + * @api {get} /enterprise/settings/license getLicense + * @apiVersion 6.0.0 + * @apiName getLicense + * @apiDescription Get license information + * @apiGroup enterprise + * + * @apiExample {js} ex: +github.enterprise.getLicense({ ... }); + */ + +/** + * @api {get} /admin/pre-receive-environments/:id getPreReceiveEnvironment + * @apiVersion 6.0.0 + * @apiName getPreReceiveEnvironment + * @apiDescription Get a single pre-receive environment. (In preview period. See README.) + * @apiGroup enterprise + * + * @apiParam {String} id + * @apiExample {js} ex: +github.enterprise.getPreReceiveEnvironment({ ... }); + */ + +/** + * @api {get} /admin/pre-receive-environments/:id/downloads/latest getPreReceiveEnvironmentDownloadStatus + * @apiVersion 6.0.0 + * @apiName getPreReceiveEnvironmentDownloadStatus + * @apiDescription Get a pre-receive environment's download status. (In preview period. See README.) + * @apiGroup enterprise + * + * @apiParam {String} id + * @apiExample {js} ex: +github.enterprise.getPreReceiveEnvironmentDownloadStatus({ ... }); + */ + +/** + * @api {get} /admin/pre_receive_environments getPreReceiveEnvironments + * @apiVersion 6.0.0 + * @apiName getPreReceiveEnvironments + * @apiDescription List pre-receive environments. (In preview period. See README.) + * @apiGroup enterprise + * + * @apiExample {js} ex: +github.enterprise.getPreReceiveEnvironments({ ... }); + */ + +/** + * @api {get} /admin/pre-receive-hooks/:id getPreReceiveHook + * @apiVersion 6.0.0 + * @apiName getPreReceiveHook + * @apiDescription Get a single pre-receive hook. (In preview period. See README.) + * @apiGroup enterprise + * + * @apiParam {String} id + * @apiExample {js} ex: +github.enterprise.getPreReceiveHook({ ... }); + */ + +/** + * @api {get} /admin/pre-receive-hooks getPreReceiveHooks + * @apiVersion 6.0.0 + * @apiName getPreReceiveHooks + * @apiDescription List pre-receive hooks. (In preview period. See README.) + * @apiGroup enterprise + * + * @apiExample {js} ex: +github.enterprise.getPreReceiveHooks({ ... }); + */ + +/** + * @api {post} /staff/indexing_jobs queueIndexingJob + * @apiVersion 6.0.0 + * @apiName queueIndexingJob + * @apiDescription Queue an indexing job + * @apiGroup enterprise + * + * @apiParam {String} target A string representing the item to index. + * @apiExample {js} ex: +github.enterprise.queueIndexingJob({ ... }); + */ + +/** + * @api {get} /enterprise/stats/:type stats + * @apiVersion 6.0.0 + * @apiName stats + * @apiDescription Get statistics. + * @apiGroup enterprise + * + * @apiParam {String} type Possible values: issues, hooks, milestones, orgs, comments, pages, users, gists, pulls, repos, all. + * @apiExample {js} ex: +github.enterprise.stats({ ... }); + */ + +/** + * @api {post} /admin/ldap/teams/:team_id/sync syncLdapForTeam + * @apiVersion 6.0.0 + * @apiName syncLdapForTeam + * @apiDescription Sync LDAP mapping for a team. + * @apiGroup enterprise + * + * @apiParam {Number} team_id + * @apiExample {js} ex: +github.enterprise.syncLdapForTeam({ ... }); + */ + +/** + * @api {post} /admin/ldap/users/:username/sync syncLdapForUser + * @apiVersion 6.0.0 + * @apiName syncLdapForUser + * @apiDescription Sync LDAP mapping for a user. + * @apiGroup enterprise + * + * @apiParam {String} username + * @apiExample {js} ex: +github.enterprise.syncLdapForUser({ ... }); + */ + +/** + * @api {post} /admin/pre_receive_environments/:id/downloads triggerPreReceiveEnvironmentDownload + * @apiVersion 6.0.0 + * @apiName triggerPreReceiveEnvironmentDownload + * @apiDescription Trigger a pre-receive environment download. (In preview period. See README.) + * @apiGroup enterprise + * + * @apiParam {String} id + * @apiExample {js} ex: +github.enterprise.triggerPreReceiveEnvironmentDownload({ ... }); + */ + +/** + * @api {patch} /admin/ldap/teams/:team_id/mapping updateLdapForTeam + * @apiVersion 6.0.0 + * @apiName updateLdapForTeam + * @apiDescription Update LDAP mapping for a team. + * @apiGroup enterprise + * + * @apiParam {Number} team_id + * @apiParam {String} ldap_dn LDAP DN for user + * @apiExample {js} ex: +github.enterprise.updateLdapForTeam({ ... }); + */ + +/** + * @api {patch} /admin/ldap/users/:username/mapping updateLdapForUser + * @apiVersion 6.0.0 + * @apiName updateLdapForUser + * @apiDescription Update LDAP mapping for a user. + * @apiGroup enterprise + * + * @apiParam {String} username + * @apiParam {String} ldap_dn LDAP DN for user + * @apiExample {js} ex: +github.enterprise.updateLdapForUser({ ... }); + */ + +/** + * @api {get} /gists/:id/star checkStar + * @apiVersion 6.0.0 + * @apiName checkStar + * @apiDescription Check if a gist is starred + * @apiGroup gists + * + * @apiParam {String} id + * @apiExample {js} ex: +github.gists.checkStar({ ... }); + */ + +/** + * @api {post} /gists create + * @apiVersion 6.0.0 + * @apiName create + * @apiDescription Create a gist + * @apiGroup gists + * + * @apiParam {Json} files Files that make up this gist. The key of which should be a required string filename and the value another required hash with parameters: 'content' + * @apiParam {Boolean} public + * @apiParam {String} [description] + * @apiExample {js} ex: +github.gists.create({ ... }); + */ + +/** + * @api {post} /gists/:gist_id/comments createComment + * @apiVersion 6.0.0 + * @apiName createComment + * @apiDescription Create a comment + * @apiGroup gists + * + * @apiParam {String} gist_id Id (SHA1 hash) of the gist. + * @apiParam {String} body + * @apiExample {js} ex: +github.gists.createComment({ ... }); + */ + +/** + * @api {delete} /gists/:id delete + * @apiVersion 6.0.0 + * @apiName delete + * @apiDescription Delete a gist + * @apiGroup gists + * + * @apiParam {String} id + * @apiExample {js} ex: +github.gists.delete({ ... }); + */ + +/** + * @api {delete} /gists/:gist_id/comments/:id deleteComment + * @apiVersion 6.0.0 + * @apiName deleteComment + * @apiDescription Delete a comment + * @apiGroup gists + * + * @apiParam {String} gist_id Id (SHA1 hash) of the gist. + * @apiParam {String} id + * @apiExample {js} ex: +github.gists.deleteComment({ ... }); + */ + +/** + * @api {patch} /gists/:id edit + * @apiVersion 6.0.0 + * @apiName edit + * @apiDescription Edit a gist + * @apiGroup gists + * + * @apiParam {String} id + * @apiParam {Json} files Files that make up this gist. The key of which should be a required string filename and the value another required hash with parameters: 'content' + * @apiParam {String} [description] + * @apiParam {String} [content] Updated file contents. + * @apiParam {String} [filename] New name for this file. + * @apiExample {js} ex: +github.gists.edit({ ... }); + */ + +/** + * @api {patch} /gists/:gist_id/comments/:id editComment + * @apiVersion 6.0.0 + * @apiName editComment + * @apiDescription Edit a comment + * @apiGroup gists + * + * @apiParam {String} gist_id Id (SHA1 hash) of the gist. + * @apiParam {String} id + * @apiParam {String} body + * @apiExample {js} ex: +github.gists.editComment({ ... }); + */ + +/** + * @api {post} /gists/:id/forks fork + * @apiVersion 6.0.0 + * @apiName fork + * @apiDescription Fork a gist + * @apiGroup gists + * + * @apiParam {String} id + * @apiExample {js} ex: +github.gists.fork({ ... }); + */ + +/** + * @api {get} /gists/:id get + * @apiVersion 6.0.0 + * @apiName get + * @apiDescription Get a single gist + * @apiGroup gists + * + * @apiParam {String} id + * @apiExample {js} ex: +github.gists.get({ ... }); + */ + +/** + * @api {get} /gists getAll + * @apiVersion 6.0.0 + * @apiName getAll + * @apiDescription List the authenticated user's gists or if called anonymously, this will return all public gists + * @apiGroup gists + * + * @apiParam {Date} [since] Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.gists.getAll({ ... }); + */ + +/** + * @api {get} /gists/:gist_id/comments/:id getComment + * @apiVersion 6.0.0 + * @apiName getComment + * @apiDescription Get a single comment + * @apiGroup gists + * + * @apiParam {String} gist_id Id (SHA1 hash) of the gist. + * @apiParam {String} id + * @apiExample {js} ex: +github.gists.getComment({ ... }); + */ + +/** + * @api {get} /gists/:gist_id/comments getComments + * @apiVersion 6.0.0 + * @apiName getComments + * @apiDescription List comments on a gist + * @apiGroup gists + * + * @apiParam {String} gist_id Id (SHA1 hash) of the gist. + * @apiExample {js} ex: +github.gists.getComments({ ... }); + */ + +/** + * @api {get} /gists/:id/commits getCommits + * @apiVersion 6.0.0 + * @apiName getCommits + * @apiDescription List gist commits + * @apiGroup gists + * + * @apiParam {String} id + * @apiExample {js} ex: +github.gists.getCommits({ ... }); + */ + +/** + * @api {get} /users/:username/gists getForUser + * @apiVersion 6.0.0 + * @apiName getForUser + * @apiDescription List a user's gists + * @apiGroup gists + * + * @apiParam {String} username + * @apiParam {Date} [since] Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.gists.getForUser({ ... }); + */ + +/** + * @api {get} /gists/:id/forks getForks + * @apiVersion 6.0.0 + * @apiName getForks + * @apiDescription List gist forks + * @apiGroup gists + * + * @apiParam {String} id + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.gists.getForks({ ... }); + */ + +/** + * @api {get} /gists/public getPublic + * @apiVersion 6.0.0 + * @apiName getPublic + * @apiDescription List all public gists + * @apiGroup gists + * + * @apiParam {Date} [since] Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ + * @apiExample {js} ex: +github.gists.getPublic({ ... }); + */ + +/** + * @api {get} /gists/:id/:sha getRevision + * @apiVersion 6.0.0 + * @apiName getRevision + * @apiDescription Get a specific revision of a gist + * @apiGroup gists + * + * @apiParam {String} id + * @apiParam {String} sha + * @apiExample {js} ex: +github.gists.getRevision({ ... }); + */ + +/** + * @api {get} /gists/starred getStarred + * @apiVersion 6.0.0 + * @apiName getStarred + * @apiDescription List the authenticated user's starred gists + * @apiGroup gists + * + * @apiParam {Date} [since] Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ + * @apiExample {js} ex: +github.gists.getStarred({ ... }); + */ + +/** + * @api {put} /gists/:id/star star + * @apiVersion 6.0.0 + * @apiName star + * @apiDescription Star a gist + * @apiGroup gists + * + * @apiParam {String} id + * @apiExample {js} ex: +github.gists.star({ ... }); + */ + +/** + * @api {delete} /gists/:id/star unstar + * @apiVersion 6.0.0 + * @apiName unstar + * @apiDescription Unstar a gist + * @apiGroup gists + * + * @apiParam {String} id + * @apiExample {js} ex: +github.gists.unstar({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/git/blobs createBlob + * @apiVersion 6.0.0 + * @apiName createBlob + * @apiDescription Create a Blob + * @apiGroup gitdata + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} content + * @apiParam {String} encoding + * @apiExample {js} ex: +github.gitdata.createBlob({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/git/commits createCommit + * @apiVersion 6.0.0 + * @apiName createCommit + * @apiDescription Create a Commit + * @apiGroup gitdata + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} message String of the commit message + * @apiParam {String} tree String of the SHA of the tree object this commit points to + * @apiParam {Array} parents Array of the SHAs of the commits that were the parents of this commit. If omitted or empty, the commit will be written as a root commit. For a single parent, an array of one SHA should be provided, for a merge commit, an array of more than one should be provided. + * @apiParam {Json} [author] + * @apiParam {Json} [committer] + * @apiExample {js} ex: +github.gitdata.createCommit({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/git/refs createReference + * @apiVersion 6.0.0 + * @apiName createReference + * @apiDescription Create a Reference + * @apiGroup gitdata + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} ref String of the name of the fully qualified reference (ie: heads/master). If it doesn’t have at least one slash, it will be rejected. + * @apiParam {String} sha + * @apiExample {js} ex: +github.gitdata.createReference({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/git/tags createTag + * @apiVersion 6.0.0 + * @apiName createTag + * @apiDescription Create a Tag Object + * @apiGroup gitdata + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} tag String of the tag + * @apiParam {String} message String of the tag message + * @apiParam {String} object String of the SHA of the git object this is tagging + * @apiParam {String} type String of the type of the object we’re tagging. Normally this is a commit but it can also be a tree or a blob. + * @apiParam {Json} tagger JSON object that contains the following keys: `name` - String of the name of the author of the tag, `email` - String of the email of the author of the tag, `date` - Timestamp of when this object was tagged + * @apiExample {js} ex: +github.gitdata.createTag({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/git/trees createTree + * @apiVersion 6.0.0 + * @apiName createTree + * @apiDescription Create a Tree + * @apiGroup gitdata + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Json} tree Array of Hash objects (of path, mode, type and sha) specifying a tree structure + * @apiParam {String} [base_tree] String of the SHA1 of the tree you want to update with new data + * @apiExample {js} ex: +github.gitdata.createTree({ ... }); + */ + +/** + * @api {delete} /repos/:owner/:repo/git/refs/:ref deleteReference + * @apiVersion 6.0.0 + * @apiName deleteReference + * @apiDescription Delete a Reference + * @apiGroup gitdata + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} ref String of the name of the fully qualified reference (ie: heads/master). If it doesn’t have at least one slash, it will be rejected. + * @apiExample {js} ex: +github.gitdata.deleteReference({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/git/blobs/:sha getBlob + * @apiVersion 6.0.0 + * @apiName getBlob + * @apiDescription Get a Blob + * @apiGroup gitdata + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} sha + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.gitdata.getBlob({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/git/commits/:sha getCommit + * @apiVersion 6.0.0 + * @apiName getCommit + * @apiDescription Get a Commit + * @apiGroup gitdata + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} sha + * @apiExample {js} ex: +github.gitdata.getCommit({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/git/commits/:sha getCommitSignatureVerification + * @apiVersion 6.0.0 + * @apiName getCommitSignatureVerification + * @apiDescription Get a Commit Signature Verification. (In preview period. See README.) + * @apiGroup gitdata + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} sha + * @apiExample {js} ex: +github.gitdata.getCommitSignatureVerification({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/git/refs/:ref getReference + * @apiVersion 6.0.0 + * @apiName getReference + * @apiDescription Get a Reference + * @apiGroup gitdata + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} ref String of the name of the fully qualified reference (ie: heads/master). If it doesn’t have at least one slash, it will be rejected. + * @apiExample {js} ex: +github.gitdata.getReference({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/git/refs getReferences + * @apiVersion 6.0.0 + * @apiName getReferences + * @apiDescription Get all References + * @apiGroup gitdata + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.gitdata.getReferences({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/git/tags/:sha getTag + * @apiVersion 6.0.0 + * @apiName getTag + * @apiDescription Get a Tag + * @apiGroup gitdata + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} sha + * @apiExample {js} ex: +github.gitdata.getTag({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/git/tags/:sha getTagSignatureVerification + * @apiVersion 6.0.0 + * @apiName getTagSignatureVerification + * @apiDescription Get a Tag Signature Verification. (In preview period. See README.) + * @apiGroup gitdata + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} sha + * @apiExample {js} ex: +github.gitdata.getTagSignatureVerification({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/git/refs/tags getTags + * @apiVersion 6.0.0 + * @apiName getTags + * @apiDescription Get all tag References + * @apiGroup gitdata + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.gitdata.getTags({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/git/trees/:sha getTree + * @apiVersion 6.0.0 + * @apiName getTree + * @apiDescription Get a Tree + * @apiGroup gitdata + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} sha + * @apiParam {Boolean} [recursive] + * @apiExample {js} ex: +github.gitdata.getTree({ ... }); + */ + +/** + * @api {patch} /repos/:owner/:repo/git/refs/:ref updateReference + * @apiVersion 6.0.0 + * @apiName updateReference + * @apiDescription Update a Reference + * @apiGroup gitdata + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} ref String of the name of the fully qualified reference (ie: heads/master). If it doesn’t have at least one slash, it will be rejected. + * @apiParam {String} sha + * @apiParam {Boolean} [force=false] Boolean indicating whether to force the update or to make sure the update is a fast-forward update. The default is false, so leaving this out or setting it to false will make sure you’re not overwriting work. + * @apiExample {js} ex: +github.gitdata.updateReference({ ... }); + */ + +/** + * @api {post} /installations/:installation_id/repositories/:repository_id addRepoToInstallation + * @apiVersion 6.0.0 + * @apiName addRepoToInstallation + * @apiDescription Add a single repository to an installation. (In preview period. See README.) + * @apiGroup integrations + * + * @apiParam {String} installation_id + * @apiParam {String} repository_id + * @apiExample {js} ex: +github.integrations.addRepoToInstallation({ ... }); + */ + +/** + * @api {post} /installations/:installation_id/access_tokens createInstallationToken + * @apiVersion 6.0.0 + * @apiName createInstallationToken + * @apiDescription Create a new installation token. (In preview period. See README.) + * @apiGroup integrations + * + * @apiParam {String} installation_id + * @apiParam {String} [user_id] The id of the user for whom the integration is acting on behalf of. + * @apiExample {js} ex: +github.integrations.createInstallationToken({ ... }); + */ + +/** + * @api {get} /installation/repositories getInstallationRepositories + * @apiVersion 6.0.0 + * @apiName getInstallationRepositories + * @apiDescription List repositories that are accessible to the authenticated installation. (In preview period. See README.) + * @apiGroup integrations + * + * @apiParam {String} [user_id] The integer ID of a user, to filter results to repositories that are visible to both the installation and the given user. + * @apiExample {js} ex: +github.integrations.getInstallationRepositories({ ... }); + */ + +/** + * @api {get} /integration/installations getInstallations + * @apiVersion 6.0.0 + * @apiName getInstallations + * @apiDescription List the integration's installations. (In preview period. See README.) + * @apiGroup integrations + * + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.integrations.getInstallations({ ... }); + */ + +/** + * @api {post} /integration/identity/user getUserIdentity + * @apiVersion 6.0.0 + * @apiName getUserIdentity + * @apiDescription Request identity of user. (In preview period. See README.) + * @apiGroup integrations + * + * @apiParam {String} [nonce] + * @apiExample {js} ex: +github.integrations.getUserIdentity({ ... }); + */ + +/** + * @api {post} /installations/:installation_id/repositories/:repository_id removeRepoFromInstallation + * @apiVersion 6.0.0 + * @apiName removeRepoFromInstallation + * @apiDescription Remove a single repository from an installation. (In preview period. See README.) + * @apiGroup integrations + * + * @apiParam {String} installation_id + * @apiParam {String} repository_id + * @apiExample {js} ex: +github.integrations.removeRepoFromInstallation({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/issues/:number/assignees addAssigneesToIssue + * @apiVersion 6.0.0 + * @apiName addAssigneesToIssue + * @apiDescription Add assignees to an issue. + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiParam {Array} assignees Logins for the users that should be added to the issue. + * @apiExample {js} ex: +github.issues.addAssigneesToIssue({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/issues/:number/labels addLabels + * @apiVersion 6.0.0 + * @apiName addLabels + * @apiDescription Add labels to an issue + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiParam {Array} body + * @apiExample {js} ex: +github.issues.addLabels({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/assignees/:assignee checkAssignee + * @apiVersion 6.0.0 + * @apiName checkAssignee + * @apiDescription Check assignee + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} assignee Login for the user that this issue should be assigned to. + * @apiExample {js} ex: +github.issues.checkAssignee({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/issues create + * @apiVersion 6.0.0 + * @apiName create + * @apiDescription Create an issue + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} title + * @apiParam {String} [body] + * @apiParam {String} [assignee] Login for the user that this issue should be assigned to. + * @apiParam {Number} [milestone] Milestone to associate this issue with. + * @apiParam {Json} [labels] Array of strings - Labels to associate with this issue. + * @apiParam {Array} [assignees] Logins for Users to assign to this issue. NOTE: Only users with push access can set assignees for new issues. Assignees are silently dropped otherwise. + * @apiExample {js} ex: +github.issues.create({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/issues/:number/comments createComment + * @apiVersion 6.0.0 + * @apiName createComment + * @apiDescription Create a comment + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiParam {String} body + * @apiExample {js} ex: +github.issues.createComment({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/labels createLabel + * @apiVersion 6.0.0 + * @apiName createLabel + * @apiDescription Create a label + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} name + * @apiParam {String} color 6 character hex code, without a leading #. + * @apiExample {js} ex: +github.issues.createLabel({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/milestones createMilestone + * @apiVersion 6.0.0 + * @apiName createMilestone + * @apiDescription Create a milestone + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} title + * @apiParam {String} [state=open] + * @apiParam {String} [description] + * @apiParam {Date} [due_on] Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ + * @apiExample {js} ex: +github.issues.createMilestone({ ... }); + */ + +/** + * @api {delete} /repos/:owner/:repo/issues/comments/:id deleteComment + * @apiVersion 6.0.0 + * @apiName deleteComment + * @apiDescription Delete a comment + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiExample {js} ex: +github.issues.deleteComment({ ... }); + */ + +/** + * @api {delete} /repos/:owner/:repo/labels/:name deleteLabel + * @apiVersion 6.0.0 + * @apiName deleteLabel + * @apiDescription Delete a label + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} name + * @apiExample {js} ex: +github.issues.deleteLabel({ ... }); + */ + +/** + * @api {delete} /repos/:owner/:repo/milestones/:number deleteMilestone + * @apiVersion 6.0.0 + * @apiName deleteMilestone + * @apiDescription Delete a milestone + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiExample {js} ex: +github.issues.deleteMilestone({ ... }); + */ + +/** + * @api {patch} /repos/:owner/:repo/issues/:number edit + * @apiVersion 6.0.0 + * @apiName edit + * @apiDescription Edit an issue + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiParam {String} [title] + * @apiParam {String} [body] + * @apiParam {String} [assignee] Login for the user that this issue should be assigned to. + * @apiParam {String} [state=open] open or closed + * @apiParam {Number} [milestone] Milestone to associate this issue with. + * @apiParam {Json} [labels] Array of strings - Labels to associate with this issue. + * @apiParam {Array} [assignees] Logins for Users to assign to this issue. Pass one or more user logins to replace the set of assignees on this Issue. .Send an empty array ([]) to clear all assignees from the Issue. NOTE: Only users with push access can set assignees for new issues. Assignees are silently dropped otherwise. + * @apiExample {js} ex: +github.issues.edit({ ... }); + */ + +/** + * @api {patch} /repos/:owner/:repo/issues/comments/:id editComment + * @apiVersion 6.0.0 + * @apiName editComment + * @apiDescription Edit a comment + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiParam {String} body + * @apiExample {js} ex: +github.issues.editComment({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/issues/:number get + * @apiVersion 6.0.0 + * @apiName get + * @apiDescription Get a single issue + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiExample {js} ex: +github.issues.get({ ... }); + */ + +/** + * @api {get} /issues getAll + * @apiVersion 6.0.0 + * @apiName getAll + * @apiDescription List all issues across all the authenticated user's visible repositories including owned repositories, member repositories, and organization repositories + * @apiGroup issues + * + * @apiParam {String} [filter] + * @apiParam {String} [state=open] open, closed, or all + * @apiParam {String} [labels] String list of comma separated Label names. Example: bug,ui,@high + * @apiParam {String} [sort=created] + * @apiParam {String} [direction=desc] + * @apiParam {Date} [since] Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.issues.getAll({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/assignees getAssignees + * @apiVersion 6.0.0 + * @apiName getAssignees + * @apiDescription List assignees + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiExample {js} ex: +github.issues.getAssignees({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/issues/comments/:id getComment + * @apiVersion 6.0.0 + * @apiName getComment + * @apiDescription Get a single comment + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiExample {js} ex: +github.issues.getComment({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/issues/:number/comments getComments + * @apiVersion 6.0.0 + * @apiName getComments + * @apiDescription List comments on an issue + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.issues.getComments({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/issues/comments getCommentsForRepo + * @apiVersion 6.0.0 + * @apiName getCommentsForRepo + * @apiDescription List comments in a repository + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} [sort=created] + * @apiParam {String} [direction=desc] + * @apiParam {Date} [since] Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.issues.getCommentsForRepo({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/issues/events/:id getEvent + * @apiVersion 6.0.0 + * @apiName getEvent + * @apiDescription Get a single event + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiExample {js} ex: +github.issues.getEvent({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/issues/:issue_number/events getEvents + * @apiVersion 6.0.0 + * @apiName getEvents + * @apiDescription List events for an issue + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} issue_number + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.issues.getEvents({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/issues/events getEventsForRepo + * @apiVersion 6.0.0 + * @apiName getEventsForRepo + * @apiDescription List events for a repository + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.issues.getEventsForRepo({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/issues/:issue_number/timeline getEventsTimeline + * @apiVersion 6.0.0 + * @apiName getEventsTimeline + * @apiDescription List events for an issue. (In preview period. See README.) + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} issue_number + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.issues.getEventsTimeline({ ... }); + */ + +/** + * @api {get} /orgs/:org/issues getForOrg + * @apiVersion 6.0.0 + * @apiName getForOrg + * @apiDescription List all issues for a given organization for the authenticated user + * @apiGroup issues + * + * @apiParam {String} org + * @apiParam {String} [filter] + * @apiParam {String} [state=open] open, closed, or all + * @apiParam {String} [labels] String list of comma separated Label names. Example: bug,ui,@high + * @apiParam {String} [sort=created] + * @apiParam {String} [direction=desc] + * @apiParam {Date} [since] Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.issues.getForOrg({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/issues getForRepo + * @apiVersion 6.0.0 + * @apiName getForRepo + * @apiDescription List issues for a repository + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} [milestone] + * @apiParam {String} [state=open] open, closed, or all + * @apiParam {String} [assignee] String User login, `none` for Issues with no assigned User. `*` for Issues with any assigned User. + * @apiParam {String} [creator] The user that created the issue. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiParam {String} [labels] String list of comma separated Label names. Example: bug,ui,@high + * @apiParam {String} [sort=created] + * @apiParam {String} [direction=desc] + * @apiParam {Date} [since] Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {String} [mentioned] String User login. + * @apiExample {js} ex: +github.issues.getForRepo({ ... }); + */ + +/** + * @api {get} /user/issues getForUser + * @apiVersion 6.0.0 + * @apiName getForUser + * @apiDescription List all issues across owned and member repositories for the authenticated user + * @apiGroup issues + * + * @apiParam {String} [filter] + * @apiParam {String} [state=open] open, closed, or all + * @apiParam {String} [labels] String list of comma separated Label names. Example: bug,ui,@high + * @apiParam {String} [sort=created] + * @apiParam {String} [direction=desc] + * @apiParam {Date} [since] Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.issues.getForUser({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/issues/:number/labels getIssueLabels + * @apiVersion 6.0.0 + * @apiName getIssueLabels + * @apiDescription List labels on an issue + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiExample {js} ex: +github.issues.getIssueLabels({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/labels/:name getLabel + * @apiVersion 6.0.0 + * @apiName getLabel + * @apiDescription Get a single label + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} name + * @apiExample {js} ex: +github.issues.getLabel({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/labels getLabels + * @apiVersion 6.0.0 + * @apiName getLabels + * @apiDescription List all labels for this repository + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.issues.getLabels({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/milestones/:number getMilestone + * @apiVersion 6.0.0 + * @apiName getMilestone + * @apiDescription Get a single milestone + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiExample {js} ex: +github.issues.getMilestone({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/milestones/:number/labels getMilestoneLabels + * @apiVersion 6.0.0 + * @apiName getMilestoneLabels + * @apiDescription Get labels for every issue in a milestone + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiExample {js} ex: +github.issues.getMilestoneLabels({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/milestones getMilestones + * @apiVersion 6.0.0 + * @apiName getMilestones + * @apiDescription List milestones for a repository + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} [state=open] + * @apiParam {String} [sort=due_on] due_on, completeness, default: due_on + * @apiParam {String} [direction=asc] + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.issues.getMilestones({ ... }); + */ + +/** + * @api {put} /repos/:owner/:repo/issues/:number/lock lock + * @apiVersion 6.0.0 + * @apiName lock + * @apiDescription Users with push access can lock an issue's conversation. + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiExample {js} ex: +github.issues.lock({ ... }); + */ + +/** + * @api {delete} /repos/:owner/:repo/issues/:number/labels removeAllLabels + * @apiVersion 6.0.0 + * @apiName removeAllLabels + * @apiDescription Remove all labels from an issue + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiExample {js} ex: +github.issues.removeAllLabels({ ... }); + */ + +/** + * @api {delete} /repos/:owner/:repo/issues/:number/assignees removeAssigneesFromIssue + * @apiVersion 6.0.0 + * @apiName removeAssigneesFromIssue + * @apiDescription Remove assignees from an issue. + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiParam {Json} body JSON object that contains assignees array of logins for the users that should be removed from the issue. + * @apiExample {js} ex: +github.issues.removeAssigneesFromIssue({ ... }); + */ + +/** + * @api {delete} /repos/:owner/:repo/issues/:number/labels/:name removeLabel + * @apiVersion 6.0.0 + * @apiName removeLabel + * @apiDescription Remove a label from an issue + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiParam {String} name + * @apiExample {js} ex: +github.issues.removeLabel({ ... }); + */ + +/** + * @api {put} /repos/:owner/:repo/issues/:number/labels replaceAllLabels + * @apiVersion 6.0.0 + * @apiName replaceAllLabels + * @apiDescription Replace all labels for an issue + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiParam {Array} body Sending an empty array ([]) will remove all Labels from the Issue. + * @apiExample {js} ex: +github.issues.replaceAllLabels({ ... }); + */ + +/** + * @api {delete} /repos/:owner/:repo/issues/:number/lock unlock + * @apiVersion 6.0.0 + * @apiName unlock + * @apiDescription Users with push access can unlock an issue's conversation. + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiExample {js} ex: +github.issues.unlock({ ... }); + */ + +/** + * @api {patch} /repos/:owner/:repo/labels/:oldname updateLabel + * @apiVersion 6.0.0 + * @apiName updateLabel + * @apiDescription Update a label + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} oldname The old name of the label. + * @apiParam {String} name The new name of the label. + * @apiParam {String} color 6 character hex code, without a leading #. + * @apiExample {js} ex: +github.issues.updateLabel({ ... }); + */ + +/** + * @api {patch} /repos/:owner/:repo/milestones/:number updateMilestone + * @apiVersion 6.0.0 + * @apiName updateMilestone + * @apiDescription Update a milestone + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiParam {String} title + * @apiParam {String} [state=open] + * @apiParam {String} [description] + * @apiParam {Date} [due_on] Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ + * @apiExample {js} ex: +github.issues.updateMilestone({ ... }); + */ + +/** + * @api {delete} /repos/:owner/:repo/import cancelImport + * @apiVersion 6.0.0 + * @apiName cancelImport + * @apiDescription Cancel an import. (In preview period. See README.) + * @apiGroup migrations + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiExample {js} ex: +github.migrations.cancelImport({ ... }); + */ + +/** + * @api {delete} /orgs/:org/migrations/:id/archive deleteMigrationArchive + * @apiVersion 6.0.0 + * @apiName deleteMigrationArchive + * @apiDescription Delete a migration archive. (In preview period. See README.) + * @apiGroup migrations + * + * @apiParam {String} org + * @apiParam {String} id + * @apiExample {js} ex: +github.migrations.deleteMigrationArchive({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/import/authors getImportCommitAuthors + * @apiVersion 6.0.0 + * @apiName getImportCommitAuthors + * @apiDescription Get import commit authors. (In preview period. See README.) + * @apiGroup migrations + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} [since] Only authors found after this id are returned. Provide the highest author ID you've seen so far. New authors may be added to the list at any point while the importer is performing the raw step. + * @apiExample {js} ex: +github.migrations.getImportCommitAuthors({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/import getImportProgress + * @apiVersion 6.0.0 + * @apiName getImportProgress + * @apiDescription Get import progress. (In preview period. See README.) + * @apiGroup migrations + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiExample {js} ex: +github.migrations.getImportProgress({ ... }); + */ + +/** + * @api {get} /:owner/:name/import/large_files getLargeImportFiles + * @apiVersion 6.0.0 + * @apiName getLargeImportFiles + * @apiDescription List files larger than 100MB found during the import. (In preview period. See README.) + * @apiGroup migrations + * + * @apiParam {String} owner + * @apiParam {String} name + * @apiExample {js} ex: +github.migrations.getLargeImportFiles({ ... }); + */ + +/** + * @api {get} /orgs/:org/migrations/:id/archive getMigrationArchiveLink + * @apiVersion 6.0.0 + * @apiName getMigrationArchiveLink + * @apiDescription Get the URL to a migration archive. (In preview period. See README.) + * @apiGroup migrations + * + * @apiParam {String} org + * @apiParam {String} id + * @apiExample {js} ex: +github.migrations.getMigrationArchiveLink({ ... }); + */ + +/** + * @api {get} /orgs/:org/migrations/:id getMigrationStatus + * @apiVersion 6.0.0 + * @apiName getMigrationStatus + * @apiDescription Get the status of a migration. (In preview period. See README.) + * @apiGroup migrations + * + * @apiParam {String} org + * @apiParam {String} id + * @apiExample {js} ex: +github.migrations.getMigrationStatus({ ... }); + */ + +/** + * @api {get} /orgs/:org/migrations getMigrations + * @apiVersion 6.0.0 + * @apiName getMigrations + * @apiDescription Get a list of migrations. (In preview period. See README.) + * @apiGroup migrations + * + * @apiParam {String} org + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.migrations.getMigrations({ ... }); + */ + +/** + * @api {patch} /repos/:owner/:repo/import/authors/:author_id mapImportCommitAuthor + * @apiVersion 6.0.0 + * @apiName mapImportCommitAuthor + * @apiDescription Map a commit author. (In preview period. See README.) + * @apiGroup migrations + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} author_id The commit author id. + * @apiParam {String} [email] The new Git author email. + * @apiParam {String} [name] The new Git author name. + * @apiExample {js} ex: +github.migrations.mapImportCommitAuthor({ ... }); + */ + +/** + * @api {patch} /:owner/:name/import/lfs setImportLfsPreference + * @apiVersion 6.0.0 + * @apiName setImportLfsPreference + * @apiDescription Set import LFS preference. (In preview period. See README.) + * @apiGroup migrations + * + * @apiParam {String} owner + * @apiParam {String} name + * @apiParam {String} use_lfs Can be one of `opt_in` (large files will be stored using Git LFS) or `opt_out` (large files will be removed during the import). + * @apiExample {js} ex: +github.migrations.setImportLfsPreference({ ... }); + */ + +/** + * @api {put} /repos/:owner/:repo/import startImport + * @apiVersion 6.0.0 + * @apiName startImport + * @apiDescription Start an import. (In preview period. See README.) + * @apiGroup migrations + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} vcs_url The URL of the originating repository. + * @apiParam {String} [vcs] The originating VCS type. Please be aware that without this parameter, the import job will take additional time to detect the VCS type before beginning the import. This detection step will be reflected in the response. + * @apiParam {String} [vcs_username] If authentication is required, the username to provide to vcs_url. + * @apiParam {String} [vcs_password] If authentication is required, the password to provide to vcs_url. + * @apiParam {String} [tfvc_project] For a tfvc import, the name of the project that is being imported. + * @apiExample {js} ex: +github.migrations.startImport({ ... }); + */ + +/** + * @api {post} /orgs/:org/migrations startMigration + * @apiVersion 6.0.0 + * @apiName startMigration + * @apiDescription Start a migration. (In preview period. See README.) + * @apiGroup migrations + * + * @apiParam {String} org + * @apiParam {Array} repositories A list of arrays indicating which repositories should be migrated. + * @apiParam {Boolean} [lock_repositories=false] Indicates whether repositories should be locked (to prevent manipulation) while migrating data. Default: false. + * @apiParam {Boolean} [exclude_attachments=false] Indicates whether attachments should be excluded from the migration (to reduce migration archive file size). Default: false. + * @apiExample {js} ex: +github.migrations.startMigration({ ... }); + */ + +/** + * @api {delete} /orgs/:org/migrations/:id/repos/:repo_name/lock unlockRepoLockedForMigration + * @apiVersion 6.0.0 + * @apiName unlockRepoLockedForMigration + * @apiDescription Unlock a repository that was locked for migration. (In preview period. See README.) + * @apiGroup migrations + * + * @apiParam {String} org + * @apiParam {String} id + * @apiParam {String} repo_name + * @apiExample {js} ex: +github.migrations.unlockRepoLockedForMigration({ ... }); + */ + +/** + * @api {patch} /repos/:owner/:repo/import updateImport + * @apiVersion 6.0.0 + * @apiName updateImport + * @apiDescription Update existing import. (In preview period. See README.) + * @apiGroup migrations + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiExample {js} ex: +github.migrations.updateImport({ ... }); + */ + +/** + * @api {get} /emojis getEmojis + * @apiVersion 6.0.0 + * @apiName getEmojis + * @apiDescription Lists all the emojis available to use on GitHub. + * @apiGroup misc + * + * @apiExample {js} ex: +github.misc.getEmojis({ ... }); + */ + +/** + * @api {get} /gitignore/templates/:name getGitignoreTemplate + * @apiVersion 6.0.0 + * @apiName getGitignoreTemplate + * @apiDescription Get a single gitignore template + * @apiGroup misc + * + * @apiParam {String} name The name of the .gitignore template to get e.g. 'C' + * @apiExample {js} ex: +github.misc.getGitignoreTemplate({ ... }); + */ + +/** + * @api {get} /gitignore/templates getGitignoreTemplates + * @apiVersion 6.0.0 + * @apiName getGitignoreTemplates + * @apiDescription Lists available gitignore templates + * @apiGroup misc + * + * @apiExample {js} ex: +github.misc.getGitignoreTemplates({ ... }); + */ + +/** + * @api {get} /licenses/:license getLicense + * @apiVersion 6.0.0 + * @apiName getLicense + * @apiDescription Get an individual license. (In preview period. See README.) + * @apiGroup misc + * + * @apiParam {String} license Ex: /licenses/mit + * @apiExample {js} ex: +github.misc.getLicense({ ... }); + */ + +/** + * @api {get} /licenses getLicenses + * @apiVersion 6.0.0 + * @apiName getLicenses + * @apiDescription List all licenses. (In preview period. See README.) + * @apiGroup misc + * + * @apiExample {js} ex: +github.misc.getLicenses({ ... }); + */ + +/** + * @api {get} /meta getMeta + * @apiVersion 6.0.0 + * @apiName getMeta + * @apiDescription This endpoint provides information about GitHub.com, the service. Or, if you access this endpoint on your organization's GitHub Enterprise installation, this endpoint provides information about that installation. + * @apiGroup misc + * + * @apiExample {js} ex: +github.misc.getMeta({ ... }); + */ + +/** + * @api {get} /rate_limit getRateLimit + * @apiVersion 6.0.0 + * @apiName getRateLimit + * @apiDescription Get your current rate limit status + * @apiGroup misc + * + * @apiExample {js} ex: +github.misc.getRateLimit({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/license getRepoLicense + * @apiVersion 6.0.0 + * @apiName getRepoLicense + * @apiDescription Get the contents of a repository's license. (In preview period. See README.) + * @apiGroup misc + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiExample {js} ex: +github.misc.getRepoLicense({ ... }); + */ + +/** + * @api {post} /markdown renderMarkdown + * @apiVersion 6.0.0 + * @apiName renderMarkdown + * @apiDescription Render an arbitrary Markdown document + * @apiGroup misc + * + * @apiParam {String} text The Markdown text to render + * @apiParam {String} [mode=markdown] The rendering mode, `markdown` to render a document as plain Markdown, just like README files are rendered. `gfm` to render a document as user-content, e.g. like user comments or issues are rendered. In GFM mode, hard line breaks are always taken into account, and issue and user mentions are linked accordingly. + * @apiParam {String} [context] The repository context. Only taken into account when rendering as `gfm` + * @apiExample {js} ex: +github.misc.renderMarkdown({ ... }); + */ + +/** + * @api {post} /markdown/raw renderMarkdownRaw + * @apiVersion 6.0.0 + * @apiName renderMarkdownRaw + * @apiDescription Render a Markdown document in raw mode + * @apiGroup misc + * + * @apiParam {String} data Raw data to send as the body of the request + * @apiExample {js} ex: +github.misc.renderMarkdownRaw({ ... }); + */ + +/** + * @api {put} /orgs/:org/memberships/:username addOrgMembership + * @apiVersion 6.0.0 + * @apiName addOrgMembership + * @apiDescription Add or update organization membership + * @apiGroup orgs + * + * @apiParam {String} org + * @apiParam {String} username + * @apiParam {String} role The role to give the user in the organization. + * @apiExample {js} ex: +github.orgs.addOrgMembership({ ... }); + */ + +/** + * @api {put} /teams/:id/memberships/:username addTeamMembership + * @apiVersion 6.0.0 + * @apiName addTeamMembership + * @apiDescription Add team membership + * @apiGroup orgs + * + * @apiParam {String} id + * @apiParam {String} username + * @apiParam {String} [role=member] The role that this user should have in the team. + * @apiExample {js} ex: +github.orgs.addTeamMembership({ ... }); + */ + +/** + * @api {put} /teams/:id/repos/:org/:repo addTeamRepo + * @apiVersion 6.0.0 + * @apiName addTeamRepo + * @apiDescription Add team repository + * @apiGroup orgs + * + * @apiParam {String} id + * @apiParam {String} org + * @apiParam {String} repo + * @apiParam {String} [permission] `pull` - team members can pull, but not push or administer this repository, `push` - team members can pull and push, but not administer this repository, `admin` - team members can pull, push and administer this repository. + * @apiExample {js} ex: +github.orgs.addTeamRepo({ ... }); + */ + +/** + * @api {get} /orgs/:org/members/:username checkMembership + * @apiVersion 6.0.0 + * @apiName checkMembership + * @apiDescription Check membership + * @apiGroup orgs + * + * @apiParam {String} org + * @apiParam {String} username + * @apiExample {js} ex: +github.orgs.checkMembership({ ... }); + */ + +/** + * @api {get} /orgs/:org/public_members/:username checkPublicMembership + * @apiVersion 6.0.0 + * @apiName checkPublicMembership + * @apiDescription Check public membership + * @apiGroup orgs + * + * @apiParam {String} org + * @apiParam {String} username + * @apiExample {js} ex: +github.orgs.checkPublicMembership({ ... }); + */ + +/** + * @api {get} /teams/:id/repos/:owner/:repo checkTeamRepo + * @apiVersion 6.0.0 + * @apiName checkTeamRepo + * @apiDescription Check if a team manages a repository + * @apiGroup orgs + * + * @apiParam {String} id + * @apiParam {String} owner + * @apiParam {String} repo + * @apiExample {js} ex: +github.orgs.checkTeamRepo({ ... }); + */ + +/** + * @api {delete} /orgs/:org/public_members/:username concealMembership + * @apiVersion 6.0.0 + * @apiName concealMembership + * @apiDescription Conceal a user's membership + * @apiGroup orgs + * + * @apiParam {String} org + * @apiParam {String} username + * @apiExample {js} ex: +github.orgs.concealMembership({ ... }); + */ + +/** + * @api {post} /orgs/:org/hooks createHook + * @apiVersion 6.0.0 + * @apiName createHook + * @apiDescription Create a hook + * @apiGroup orgs + * + * @apiParam {String} org + * @apiParam {String} name Must be passed as "web". + * @apiParam {Json} config Key/value pairs to provide settings for this webhook + * @apiParam {Array} [events=["push"]] Determines what events the hook is triggered for. Default: ["push"]. + * @apiParam {Boolean} [active] Determines whether the hook is actually triggered on pushes. + * @apiExample {js} ex: +github.orgs.createHook({ ... }); + */ + +/** + * @api {post} /orgs/:org/teams createTeam + * @apiVersion 6.0.0 + * @apiName createTeam + * @apiDescription Create team + * @apiGroup orgs + * + * @apiParam {String} org + * @apiParam {String} name + * @apiParam {String} [description] The description of the team. + * @apiParam {Array} [repo_names] The full name (e.g., "organization-name/repository-name") of repositories to add the team to. + * @apiParam {String} [privacy=secret] The level of privacy this team should have. + * @apiExample {js} ex: +github.orgs.createTeam({ ... }); + */ + +/** + * @api {delete} /orgs/:org/hooks/:id deleteHook + * @apiVersion 6.0.0 + * @apiName deleteHook + * @apiDescription Delete a hook + * @apiGroup orgs + * + * @apiParam {String} org + * @apiParam {String} id + * @apiExample {js} ex: +github.orgs.deleteHook({ ... }); + */ + +/** + * @api {delete} /teams/:id deleteTeam + * @apiVersion 6.0.0 + * @apiName deleteTeam + * @apiDescription Delete team + * @apiGroup orgs + * + * @apiParam {String} id + * @apiExample {js} ex: +github.orgs.deleteTeam({ ... }); + */ + +/** + * @api {delete} /teams/:id/repos/:owner/:repo deleteTeamRepo + * @apiVersion 6.0.0 + * @apiName deleteTeamRepo + * @apiDescription Remove team repository + * @apiGroup orgs + * + * @apiParam {String} id + * @apiParam {String} owner + * @apiParam {String} repo + * @apiExample {js} ex: +github.orgs.deleteTeamRepo({ ... }); + */ + +/** + * @api {patch} /orgs/:org/hooks/:id editHook + * @apiVersion 6.0.0 + * @apiName editHook + * @apiDescription Edit a hook + * @apiGroup orgs + * + * @apiParam {String} org + * @apiParam {String} id + * @apiParam {Json} config Key/value pairs to provide settings for this webhook + * @apiParam {Array} [events=["push"]] Determines what events the hook is triggered for. Default: ["push"]. + * @apiParam {Boolean} [active] Determines whether the hook is actually triggered on pushes. + * @apiExample {js} ex: +github.orgs.editHook({ ... }); + */ + +/** + * @api {patch} /teams/:id editTeam + * @apiVersion 6.0.0 + * @apiName editTeam + * @apiDescription Edit team + * @apiGroup orgs + * + * @apiParam {String} id + * @apiParam {String} name + * @apiParam {String} [description] The description of the team. + * @apiParam {String} [privacy=secret] The level of privacy this team should have. + * @apiExample {js} ex: +github.orgs.editTeam({ ... }); + */ + +/** + * @api {get} /orgs/:org get + * @apiVersion 6.0.0 + * @apiName get + * @apiDescription Get an organization + * @apiGroup orgs + * + * @apiParam {String} org + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.orgs.get({ ... }); + */ + +/** + * @api {get} /organizations getAll + * @apiVersion 6.0.0 + * @apiName getAll + * @apiDescription List all organizations + * @apiGroup orgs + * + * @apiParam {String} [since] The integer ID of the last Organization that you've seen. + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.orgs.getAll({ ... }); + */ + +/** + * @api {get} /users/:username/orgs getForUser + * @apiVersion 6.0.0 + * @apiName getForUser + * @apiDescription List public organization memberships for the specified user. + * @apiGroup orgs + * + * @apiParam {String} username + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.orgs.getForUser({ ... }); + */ + +/** + * @api {get} /orgs/:org/hooks/:id getHook + * @apiVersion 6.0.0 + * @apiName getHook + * @apiDescription Get single hook + * @apiGroup orgs + * + * @apiParam {String} org + * @apiParam {String} id + * @apiExample {js} ex: +github.orgs.getHook({ ... }); + */ + +/** + * @api {get} /orgs/:org/hooks getHooks + * @apiVersion 6.0.0 + * @apiName getHooks + * @apiDescription List hooks + * @apiGroup orgs + * + * @apiParam {String} org + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.orgs.getHooks({ ... }); + */ + +/** + * @api {get} /orgs/:org/members getMembers + * @apiVersion 6.0.0 + * @apiName getMembers + * @apiDescription Members list + * @apiGroup orgs + * + * @apiParam {String} org + * @apiParam {String} [filter=all] Filter members returned in the list. + * @apiParam {String} [role=all] Filter members returned by their role. + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.orgs.getMembers({ ... }); + */ + +/** + * @api {get} /orgs/:org/memberships/:username getOrgMembership + * @apiVersion 6.0.0 + * @apiName getOrgMembership + * @apiDescription Get organization membership + * @apiGroup orgs + * + * @apiParam {String} org + * @apiParam {String} username + * @apiExample {js} ex: +github.orgs.getOrgMembership({ ... }); + */ + +/** + * @api {get} /orgs/:org/public_members getPublicMembers + * @apiVersion 6.0.0 + * @apiName getPublicMembers + * @apiDescription Public members list + * @apiGroup orgs + * + * @apiParam {String} org + * @apiExample {js} ex: +github.orgs.getPublicMembers({ ... }); + */ + +/** + * @api {get} /teams/:id getTeam + * @apiVersion 6.0.0 + * @apiName getTeam + * @apiDescription Get team + * @apiGroup orgs + * + * @apiParam {String} id + * @apiExample {js} ex: +github.orgs.getTeam({ ... }); + */ + +/** + * @api {get} /teams/:id/members getTeamMembers + * @apiVersion 6.0.0 + * @apiName getTeamMembers + * @apiDescription List team members + * @apiGroup orgs + * + * @apiParam {String} id + * @apiParam {String} [role=all] Filters members returned by their role in the team. + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.orgs.getTeamMembers({ ... }); + */ + +/** + * @api {get} /teams/:id/memberships/:username getTeamMembership + * @apiVersion 6.0.0 + * @apiName getTeamMembership + * @apiDescription Get team membership + * @apiGroup orgs + * + * @apiParam {String} id + * @apiParam {String} username + * @apiExample {js} ex: +github.orgs.getTeamMembership({ ... }); + */ + +/** + * @api {get} /teams/:id/repos getTeamRepos + * @apiVersion 6.0.0 + * @apiName getTeamRepos + * @apiDescription Get team repos + * @apiGroup orgs + * + * @apiParam {String} id + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.orgs.getTeamRepos({ ... }); + */ + +/** + * @api {get} /orgs/:org/teams getTeams + * @apiVersion 6.0.0 + * @apiName getTeams + * @apiDescription List teams + * @apiGroup orgs + * + * @apiParam {String} org + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.orgs.getTeams({ ... }); + */ + +/** + * @api {post} /orgs/:org/hooks/:id/pings pingHook + * @apiVersion 6.0.0 + * @apiName pingHook + * @apiDescription Ping a hook + * @apiGroup orgs + * + * @apiParam {String} org + * @apiParam {String} id + * @apiExample {js} ex: +github.orgs.pingHook({ ... }); + */ + +/** + * @api {put} /orgs/:org/public_members/:username publicizeMembership + * @apiVersion 6.0.0 + * @apiName publicizeMembership + * @apiDescription Publicize a user's membership + * @apiGroup orgs + * + * @apiParam {String} org + * @apiParam {String} username + * @apiExample {js} ex: +github.orgs.publicizeMembership({ ... }); + */ + +/** + * @api {delete} /orgs/:org/members/:username removeMember + * @apiVersion 6.0.0 + * @apiName removeMember + * @apiDescription Remove a member + * @apiGroup orgs + * + * @apiParam {String} org + * @apiParam {String} username + * @apiExample {js} ex: +github.orgs.removeMember({ ... }); + */ + +/** + * @api {delete} /orgs/:org/memberships/:username removeOrgMembership + * @apiVersion 6.0.0 + * @apiName removeOrgMembership + * @apiDescription Remove organization membership + * @apiGroup orgs + * + * @apiParam {String} org + * @apiParam {String} username + * @apiExample {js} ex: +github.orgs.removeOrgMembership({ ... }); + */ + +/** + * @api {delete} /teams/:id/memberships/:username removeTeamMembership + * @apiVersion 6.0.0 + * @apiName removeTeamMembership + * @apiDescription Remove team membership + * @apiGroup orgs + * + * @apiParam {String} id + * @apiParam {String} username + * @apiExample {js} ex: +github.orgs.removeTeamMembership({ ... }); + */ + +/** + * @api {patch} /orgs/:org update + * @apiVersion 6.0.0 + * @apiName update + * @apiDescription Edit an organization + * @apiGroup orgs + * + * @apiParam {String} org + * @apiParam {String} [billing_email] Billing email address. This address is not publicized. + * @apiParam {String} [company] The company name. + * @apiParam {String} [email] The publicly visible email address. + * @apiParam {String} [location] The location. + * @apiParam {String} [name] The shorthand name of the company. + * @apiParam {String} [description] The description of the company. + * @apiExample {js} ex: +github.orgs.update({ ... }); + */ + +/** + * @api {post} /orgs/:org/projects createOrgProject + * @apiVersion 6.0.0 + * @apiName createOrgProject + * @apiDescription Create an organization project. (In preview period. See README.) + * @apiGroup projects + * + * @apiParam {String} org + * @apiParam {String} name + * @apiParam {String} body + * @apiExample {js} ex: +github.projects.createOrgProject({ ... }); + */ + +/** + * @api {post} /projects/columns/:column_id/cards createProjectCard + * @apiVersion 6.0.0 + * @apiName createProjectCard + * @apiDescription Create a project card. (In preview period. See README.) + * @apiGroup projects + * + * @apiParam {String} column_id + * @apiParam {String} [note] The note of the card. + * @apiParam {String} [content_id] The id of the Issue or Pull Request to associate with this card. + * @apiParam {String} [content_type] The type of content to associate with this card. Can be either 'Issue' or 'PullRequest'. + * @apiExample {js} ex: +github.projects.createProjectCard({ ... }); + */ + +/** + * @api {post} /projects/:project_id/columns createProjectColumn + * @apiVersion 6.0.0 + * @apiName createProjectColumn + * @apiDescription Create a project column. (In preview period. See README.) + * @apiGroup projects + * + * @apiParam {String} project_id + * @apiParam {String} name + * @apiExample {js} ex: +github.projects.createProjectColumn({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/projects createRepoProject + * @apiVersion 6.0.0 + * @apiName createRepoProject + * @apiDescription Create a repository project. (In preview period. See README.) + * @apiGroup projects + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} name + * @apiParam {String} body + * @apiExample {js} ex: +github.projects.createRepoProject({ ... }); + */ + +/** + * @api {delete} /projects/:id deleteProject + * @apiVersion 6.0.0 + * @apiName deleteProject + * @apiDescription Delete a project. (In preview period. See README.) + * @apiGroup projects + * + * @apiParam {String} id + * @apiExample {js} ex: +github.projects.deleteProject({ ... }); + */ + +/** + * @api {delete} /projects/columns/cards/:id deleteProjectCard + * @apiVersion 6.0.0 + * @apiName deleteProjectCard + * @apiDescription Delete a project card. (In preview period. See README.) + * @apiGroup projects + * + * @apiParam {String} id + * @apiExample {js} ex: +github.projects.deleteProjectCard({ ... }); + */ + +/** + * @api {delete} /projects/columns/:id deleteProjectColumn + * @apiVersion 6.0.0 + * @apiName deleteProjectColumn + * @apiDescription Delete a project column. (In preview period. See README.) + * @apiGroup projects + * + * @apiParam {String} id + * @apiExample {js} ex: +github.projects.deleteProjectColumn({ ... }); + */ + +/** + * @api {get} /orgs/:org/projects getOrgProjects + * @apiVersion 6.0.0 + * @apiName getOrgProjects + * @apiDescription List organization projects. (In preview period. See README.) + * @apiGroup projects + * + * @apiParam {String} org + * @apiExample {js} ex: +github.projects.getOrgProjects({ ... }); + */ + +/** + * @api {get} /projects/:id getProject + * @apiVersion 6.0.0 + * @apiName getProject + * @apiDescription Get a project. (In preview period. See README.) + * @apiGroup projects + * + * @apiParam {String} id + * @apiExample {js} ex: +github.projects.getProject({ ... }); + */ + +/** + * @api {get} /projects/columns/cards/:id getProjectCard + * @apiVersion 6.0.0 + * @apiName getProjectCard + * @apiDescription Get project card. (In preview period. See README.) + * @apiGroup projects + * + * @apiParam {String} id + * @apiExample {js} ex: +github.projects.getProjectCard({ ... }); + */ + +/** + * @api {get} /projects/columns/:column_id/cards getProjectCards + * @apiVersion 6.0.0 + * @apiName getProjectCards + * @apiDescription List project cards. (In preview period. See README.) + * @apiGroup projects + * + * @apiParam {String} column_id + * @apiExample {js} ex: +github.projects.getProjectCards({ ... }); + */ + +/** + * @api {get} /projects/columns/:id getProjectColumn + * @apiVersion 6.0.0 + * @apiName getProjectColumn + * @apiDescription Get a project column. (In preview period. See README.) + * @apiGroup projects + * + * @apiParam {String} id + * @apiExample {js} ex: +github.projects.getProjectColumn({ ... }); + */ + +/** + * @api {get} /projects/:project_id/columns getProjectColumns + * @apiVersion 6.0.0 + * @apiName getProjectColumns + * @apiDescription List project columns. (In preview period. See README.) + * @apiGroup projects + * + * @apiParam {String} project_id + * @apiExample {js} ex: +github.projects.getProjectColumns({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/projects getRepoProjects + * @apiVersion 6.0.0 + * @apiName getRepoProjects + * @apiDescription List repository projects. (In preview period. See README.) + * @apiGroup projects + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiExample {js} ex: +github.projects.getRepoProjects({ ... }); + */ + +/** + * @api {post} /projects/columns/cards/:id/moves moveProjectCard + * @apiVersion 6.0.0 + * @apiName moveProjectCard + * @apiDescription Move a project card. (In preview period. See README.) + * @apiGroup projects + * + * @apiParam {String} id + * @apiParam {String} position Can be one of first, last, or after:, where is the id value of a column in the same project. + * @apiParam {String} [column_id] The id value of a column in the same project. + * @apiExample {js} ex: +github.projects.moveProjectCard({ ... }); + */ + +/** + * @api {post} /projects/columns/:id/moves moveProjectColumn + * @apiVersion 6.0.0 + * @apiName moveProjectColumn + * @apiDescription Move a project column. (In preview period. See README.) + * @apiGroup projects + * + * @apiParam {String} id + * @apiParam {String} position Can be one of first, last, or after:, where is the id value of a column in the same project. + * @apiExample {js} ex: +github.projects.moveProjectColumn({ ... }); + */ + +/** + * @api {patch} /projects/:id updateProject + * @apiVersion 6.0.0 + * @apiName updateProject + * @apiDescription Update a project. (In preview period. See README.) + * @apiGroup projects + * + * @apiParam {String} id + * @apiParam {String} name + * @apiParam {String} body + * @apiExample {js} ex: +github.projects.updateProject({ ... }); + */ + +/** + * @api {patch} /projects/columns/cards/:id updateProjectCard + * @apiVersion 6.0.0 + * @apiName updateProjectCard + * @apiDescription Update a project card. (In preview period. See README.) + * @apiGroup projects + * + * @apiParam {String} id + * @apiParam {String} [note] The note of the card. + * @apiExample {js} ex: +github.projects.updateProjectCard({ ... }); + */ + +/** + * @api {patch} /projects/columns/:id updateProjectColumn + * @apiVersion 6.0.0 + * @apiName updateProjectColumn + * @apiDescription Update a project column. (In preview period. See README.) + * @apiGroup projects + * + * @apiParam {String} id + * @apiParam {String} name + * @apiExample {js} ex: +github.projects.updateProjectColumn({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/pulls/:number/merge checkMerged + * @apiVersion 6.0.0 + * @apiName checkMerged + * @apiDescription Get if a pull request has been merged + * @apiGroup pullRequests + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.pullRequests.checkMerged({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/pulls create + * @apiVersion 6.0.0 + * @apiName create + * @apiDescription Create a pull request + * @apiGroup pullRequests + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} title The title of the pull request. + * @apiParam {String} head The branch (or git ref) where your changes are implemented. + * @apiParam {String} base The branch (or git ref) you want your changes pulled into. This should be an existing branch on the current repository. You cannot submit a pull request to one repo that requests a merge to a base of another repo. + * @apiParam {String} [body] The contents of the pull request. + * @apiExample {js} ex: +github.pullRequests.create({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/pulls/:number/comments createComment + * @apiVersion 6.0.0 + * @apiName createComment + * @apiDescription Create a comment + * @apiGroup pullRequests + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiParam {String} body + * @apiParam {String} commit_id Sha of the commit to comment on. + * @apiParam {String} path Relative path of the file to comment on. + * @apiParam {Number} position Column index in the diff to comment on. + * @apiExample {js} ex: +github.pullRequests.createComment({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/pulls/:number/comments createCommentReply + * @apiVersion 6.0.0 + * @apiName createCommentReply + * @apiDescription Reply to existing pull request comment + * @apiGroup pullRequests + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiParam {String} body + * @apiParam {Number} in_reply_to The comment id to reply to. + * @apiExample {js} ex: +github.pullRequests.createCommentReply({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/pulls createFromIssue + * @apiVersion 6.0.0 + * @apiName createFromIssue + * @apiDescription Create a pull request from an existing issue + * @apiGroup pullRequests + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} issue The issue number in this repository to turn into a Pull Request. + * @apiParam {String} head The branch (or git ref) where your changes are implemented. + * @apiParam {String} base The branch (or git ref) you want your changes pulled into. This should be an existing branch on the current repository. You cannot submit a pull request to one repo that requests a merge to a base of another repo. + * @apiExample {js} ex: +github.pullRequests.createFromIssue({ ... }); + */ + +/** + * @api {delete} /repos/:owner/:repo/pulls/comments/:id deleteComment + * @apiVersion 6.0.0 + * @apiName deleteComment + * @apiDescription Delete a comment + * @apiGroup pullRequests + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiExample {js} ex: +github.pullRequests.deleteComment({ ... }); + */ + +/** + * @api {patch} /repos/:owner/:repo/pulls/comments/:id editComment + * @apiVersion 6.0.0 + * @apiName editComment + * @apiDescription Edit a comment + * @apiGroup pullRequests + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiParam {String} body + * @apiExample {js} ex: +github.pullRequests.editComment({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/pulls/:number get + * @apiVersion 6.0.0 + * @apiName get + * @apiDescription Get a single pull request + * @apiGroup pullRequests + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiExample {js} ex: +github.pullRequests.get({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/pulls getAll + * @apiVersion 6.0.0 + * @apiName getAll + * @apiDescription List pull requests + * @apiGroup pullRequests + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} [state=open] open, closed, or all + * @apiParam {String} [head] Filter pulls by head user and branch name in the format of user:ref-name. Example: github:new-script-format. + * @apiParam {String} [base] Filter pulls by base branch name. Example: gh-pages. + * @apiParam {String} [sort=created] Possible values are: `created`, `updated`, `popularity`, `long-running`, Default: `created` + * @apiParam {String} [direction=desc] + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.pullRequests.getAll({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/pulls/comments/:id getComment + * @apiVersion 6.0.0 + * @apiName getComment + * @apiDescription Get a single comment + * @apiGroup pullRequests + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiExample {js} ex: +github.pullRequests.getComment({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/pulls/:number/comments getComments + * @apiVersion 6.0.0 + * @apiName getComments + * @apiDescription List comments on a pull request + * @apiGroup pullRequests + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.pullRequests.getComments({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/pulls/comments getCommentsForRepo + * @apiVersion 6.0.0 + * @apiName getCommentsForRepo + * @apiDescription List comments in a repository + * @apiGroup pullRequests + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} [sort=created] Possible values are: `created`, `updated`, Default: `created` + * @apiParam {String} [direction=desc] + * @apiParam {Date} [since] Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.pullRequests.getCommentsForRepo({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/pulls/:number/commits getCommits + * @apiVersion 6.0.0 + * @apiName getCommits + * @apiDescription List commits on a pull request + * @apiGroup pullRequests + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.pullRequests.getCommits({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/pulls/:number/files getFiles + * @apiVersion 6.0.0 + * @apiName getFiles + * @apiDescription List pull requests files + * @apiGroup pullRequests + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.pullRequests.getFiles({ ... }); + */ + +/** + * @api {put} /repos/:owner/:repo/pulls/:number/merge merge + * @apiVersion 6.0.0 + * @apiName merge + * @apiDescription Merge a pull request (Merge Button) + * @apiGroup pullRequests + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiParam {String} [commit_title] Title for the automatic commit message. (In preview period. See README.) + * @apiParam {String} [commit_message] Extra detail to append to automatic commit message. + * @apiParam {String} [sha] SHA that pull request head must match to allow merge + * @apiParam {String} [merge_method=merge] Merge method to use. Possible values are `merge`, `squash`, or `rebase`. (In preview period. See README.) + * @apiExample {js} ex: +github.pullRequests.merge({ ... }); + */ + +/** + * @api {patch} /repos/:owner/:repo/pulls/:number update + * @apiVersion 6.0.0 + * @apiName update + * @apiDescription Update a pull request + * @apiGroup pullRequests + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiParam {String} base The branch (or git ref) you want your changes pulled into. This should be an existing branch on the current repository. You cannot submit a pull request to one repo that requests a merge to a base of another repo. + * @apiParam {String} [title] The title of the pull request. + * @apiParam {String} [body] The contents of the pull request. + * @apiParam {String} [state=open] + * @apiExample {js} ex: +github.pullRequests.update({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/comments/:id/reactions createForCommitComment + * @apiVersion 6.0.0 + * @apiName createForCommitComment + * @apiDescription Create reaction for a commit comment. (In preview period. See README.) + * @apiGroup reactions + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiParam {String} content The reaction type. + * @apiExample {js} ex: +github.reactions.createForCommitComment({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/issues/:number/reactions createForIssue + * @apiVersion 6.0.0 + * @apiName createForIssue + * @apiDescription Create reaction for an issue. (In preview period. See README.) + * @apiGroup reactions + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiParam {String} content The reaction type. + * @apiExample {js} ex: +github.reactions.createForIssue({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/issues/comments/:id/reactions createForIssueComment + * @apiVersion 6.0.0 + * @apiName createForIssueComment + * @apiDescription Create reaction for an issue comment. (In preview period. See README.) + * @apiGroup reactions + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiParam {String} content The reaction type. + * @apiExample {js} ex: +github.reactions.createForIssueComment({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/pulls/comments/:id/reactions createForPullRequestReviewComment + * @apiVersion 6.0.0 + * @apiName createForPullRequestReviewComment + * @apiDescription Create reaction for a pull request review comment. (In preview period. See README.) + * @apiGroup reactions + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiParam {String} content The reaction type. + * @apiExample {js} ex: +github.reactions.createForPullRequestReviewComment({ ... }); + */ + +/** + * @api {delete} /reactions/:id delete + * @apiVersion 6.0.0 + * @apiName delete + * @apiDescription Delete a reaction. (In preview period. See README.) + * @apiGroup reactions + * + * @apiParam {String} id + * @apiExample {js} ex: +github.reactions.delete({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/comments/:id/reactions getForCommitComment + * @apiVersion 6.0.0 + * @apiName getForCommitComment + * @apiDescription List reactions for a commit comment. (In preview period. See README.) + * @apiGroup reactions + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiParam {String} [content] Indicates which type of reaction to return. + * @apiExample {js} ex: +github.reactions.getForCommitComment({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/issues/:number/reactions getForIssue + * @apiVersion 6.0.0 + * @apiName getForIssue + * @apiDescription List reactions for an issue. (In preview period. See README.) + * @apiGroup reactions + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiParam {String} [content] Indicates which type of reaction to return. + * @apiExample {js} ex: +github.reactions.getForIssue({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/issues/comments/:id/reactions getForIssueComment + * @apiVersion 6.0.0 + * @apiName getForIssueComment + * @apiDescription List reactions for an issue comment. (In preview period. See README.) + * @apiGroup reactions + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiParam {String} [content] Indicates which type of reaction to return. + * @apiExample {js} ex: +github.reactions.getForIssueComment({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/pulls/comments/:id/reactions getForPullRequestReviewComment + * @apiVersion 6.0.0 + * @apiName getForPullRequestReviewComment + * @apiDescription List reactions for a pull request review comment. (In preview period. See README.) + * @apiGroup reactions + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiParam {String} [content] Indicates which type of reaction to return. + * @apiExample {js} ex: +github.reactions.getForPullRequestReviewComment({ ... }); + */ + +/** + * @api {put} /repos/:owner/:repo/collaborators/:username addCollaborator + * @apiVersion 6.0.0 + * @apiName addCollaborator + * @apiDescription Add user as a collaborator + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} username + * @apiParam {String} [permission=push] `pull` - can pull, but not push to or administer this repository, `push` - can pull and push, but not administer this repository, `admin` - can pull, push and administer this repository. + * @apiExample {js} ex: +github.repos.addCollaborator({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/branches/:branch/protection/required_status_checks/contexts addProtectedBranchRequiredStatusChecksContexts + * @apiVersion 6.0.0 + * @apiName addProtectedBranchRequiredStatusChecksContexts + * @apiDescription Add required status checks contexts of protected branch. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} branch + * @apiParam {Array} body An array of protected branch required status checks contexts (e.g. continuous-integration/jenkins). + * @apiExample {js} ex: +github.repos.addProtectedBranchRequiredStatusChecksContexts({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/branches/:branch/protection/restrictions/teams addProtectedBranchTeamRestrictions + * @apiVersion 6.0.0 + * @apiName addProtectedBranchTeamRestrictions + * @apiDescription Add team restrictions of protected branch. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} branch + * @apiParam {Array} body An array of team slugs (e.g. justice-league). + * @apiExample {js} ex: +github.repos.addProtectedBranchTeamRestrictions({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/branches/:branch/protection/restrictions/users addProtectedBranchUserRestrictions + * @apiVersion 6.0.0 + * @apiName addProtectedBranchUserRestrictions + * @apiDescription Add user restrictions of protected branch. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} branch + * @apiParam {Array} body An array of team slugs (e.g. justice-league). + * @apiExample {js} ex: +github.repos.addProtectedBranchUserRestrictions({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/collaborators/:username checkCollaborator + * @apiVersion 6.0.0 + * @apiName checkCollaborator + * @apiDescription Check if user is a collaborator. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} username + * @apiExample {js} ex: +github.repos.checkCollaborator({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/compare/:base...:head compareCommits + * @apiVersion 6.0.0 + * @apiName compareCommits + * @apiDescription Compare two commits. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} base The branch (or git ref) you want your changes pulled into. This should be an existing branch on the current repository. You cannot submit a pull request to one repo that requests a merge to a base of another repo. + * @apiParam {String} head The branch (or git ref) where your changes are implemented. + * @apiExample {js} ex: +github.repos.compareCommits({ ... }); + */ + +/** + * @api {post} /user/repos create + * @apiVersion 6.0.0 + * @apiName create + * @apiDescription Create a new repository for the authenticated user. + * @apiGroup repos + * + * @apiParam {String} name + * @apiParam {Boolean} [allow_rebase_merge=true] Either true to allow rebase-merging pull requests, or false to prevent rebase-merging. Default: true. (In preview period. See README.) + * @apiParam {String} [homepage] + * @apiParam {Boolean} [private=false] True to create a private repository, false to create a public one. Creating private repositories requires a paid GitHub account. Default is false. + * @apiParam {Boolean} [has_issues=true] True to enable issues for this repository, false to disable them. Default is true. + * @apiParam {Boolean} [has_wiki=true] True to enable the wiki for this repository, false to disable it. Default is true. + * @apiParam {Boolean} [has_downloads=true] True to enable downloads for this repository, false to disable them. Default is true. + * @apiParam {String} [description] + * @apiParam {Boolean} [auto_init=false] True to create an initial commit with empty README. Default is false + * @apiParam {String} [gitignore_template] Desired language or platform .gitignore template to apply. Ignored if auto_init parameter is not provided. + * @apiParam {String} [license_template] Desired LICENSE template to apply. Use the name of the template without the extension. For example, "mit" or "mozilla". + * @apiParam {Boolean} [allow_squash_merge=true] Either true to allow squash-merging pull requests, or false to prevent squash-merging. Default: true. (In preview period. See README.) + * @apiParam {Boolean} [allow_merge_commit=true] Either true to allow merging pull requests with a merge commit, or false to prevent merging pull requests with merge commits. Default: true. (In preview period. See README.) + * @apiParam {Number} [team_id] The id of the team that will be granted access to this repository. This is only valid when creating a repository in an organization. + * @apiExample {js} ex: +github.repos.create({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/commits/:sha/comments createCommitComment + * @apiVersion 6.0.0 + * @apiName createCommitComment + * @apiDescription Create a commit comment. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} sha + * @apiParam {String} body + * @apiParam {String} [path] Relative path of the file to comment on. + * @apiParam {Number} [position] Line index in the diff to comment on. + * @apiParam {Number} [line] Deprecated. Use position parameter instead. Line number in the file to comment on. + * @apiExample {js} ex: +github.repos.createCommitComment({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/deployments createDeployment + * @apiVersion 6.0.0 + * @apiName createDeployment + * @apiDescription Create a deployment. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} ref The ref to deploy. This can be a branch, tag, or sha. + * @apiParam {String} repo + * @apiParam {String} [task=deploy] The named task to execute. e.g. deploy or deploy:migrations. Default: deploy + * @apiParam {Boolean} [auto_merge=true] Optional parameter to merge the default branch into the requested ref if it is behind the default branch. Default: true + * @apiParam {Boolean} [production_environment] Specifies if the given environment is a one that end-users directly interact with. Default: true when environment is `production` and false otherwise. (In preview period. See README.) + * @apiParam {String} [payload=""] Optional JSON payload with extra information about the deployment. Default: "" + * @apiParam {String} [environment=none] The name of the environment that was deployed to. e.g. staging or production. Default: none. + * @apiParam {String} [description=""] Optional short description. Default: "" + * @apiParam {Boolean} [transient_environment=false] Specifies if the given environment is specific to the deployment and will no longer exist at some point in the future. Default: false. (In preview period. See README.) + * @apiParam {Array} [required_contexts] Optional array of status contexts verified against commit status checks. If this parameter is omitted from the parameters then all unique contexts will be verified before a deployment is created. To bypass checking entirely pass an empty array. Defaults to all unique contexts. + * @apiExample {js} ex: +github.repos.createDeployment({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/deployments/:id/statuses createDeploymentStatus + * @apiVersion 6.0.0 + * @apiName createDeploymentStatus + * @apiDescription Create a deployment status. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiParam {String} [state] The state of the status. Can be one of pending, success, error, or failure. + * @apiParam {String} [target_url=""] The target URL to associate with this status. This URL should contain output to keep the user updated while the task is running or serve as historical information for what happened in the deployment. Default: "" + * @apiParam {String} [log_url=""] Functionally equivalent to target_url. Default: "". (In preview period. See README.) + * @apiParam {String} [description=""] A short description of the status. Default: "" + * @apiParam {String} [environment_url=""] URL for accessing the deployment environment. Default: "". (In preview period. See README.) + * @apiParam {Boolean} [auto_inactive=true] When true the new `inactive` status is added to all other non-transient, non-production environment deployments with the same repository and environment name as the created status's deployment. Default: true. (In preview period. See README.) + * @apiExample {js} ex: +github.repos.createDeploymentStatus({ ... }); + */ + +/** + * @api {put} /repos/:owner/:repo/contents/:path createFile + * @apiVersion 6.0.0 + * @apiName createFile + * @apiDescription Create a new file in the given repository. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} path The content path. + * @apiParam {String} message The commit message. + * @apiParam {String} content The new file content, Base64 encoded. + * @apiParam {String} [branch] The branch name. If not provided, uses the repository’s default branch (usually master). + * @apiParam {Json} [committer] + * @apiExample {js} ex: +github.repos.createFile({ ... }); + */ + +/** + * @api {post} /orgs/:org/repos createForOrg + * @apiVersion 6.0.0 + * @apiName createForOrg + * @apiDescription Create a new repository for an organization. + * @apiGroup repos + * + * @apiParam {String} org + * @apiParam {String} name + * @apiParam {String} [description] + * @apiParam {String} [homepage] + * @apiParam {Boolean} [private=false] True to create a private repository, false to create a public one. Creating private repositories requires a paid GitHub account. Default is false. + * @apiParam {Boolean} [has_issues=true] True to enable issues for this repository, false to disable them. Default is true. + * @apiParam {Boolean} [has_wiki=true] True to enable the wiki for this repository, false to disable it. Default is true. + * @apiParam {Boolean} [allow_rebase_merge=true] Either true to allow rebase-merging pull requests, or false to prevent rebase-merging. Default: true. (In preview period. See README.) + * @apiParam {Number} [team_id] The id of the team that will be granted access to this repository. This is only valid when creating a repo in an organization. + * @apiParam {Boolean} [auto_init=false] True to create an initial commit with empty README. Default is false + * @apiParam {String} [gitignore_template] Desired language or platform .gitignore template to apply. Ignored if auto_init parameter is not provided. + * @apiParam {String} [license_template] Desired LICENSE template to apply. Use the name of the template without the extension. For example, "mit" or "mozilla". + * @apiParam {Boolean} [allow_squash_merge=true] Either true to allow squash-merging pull requests, or false to prevent squash-merging. Default: true. (In preview period. See README.) + * @apiParam {Boolean} [allow_merge_commit=true] Either true to allow merging pull requests with a merge commit, or false to prevent merging pull requests with merge commits. Default: true. (In preview period. See README.) + * @apiParam {Boolean} [has_downloads=true] True to enable downloads for this repository, false to disable them. Default is true. + * @apiExample {js} ex: +github.repos.createForOrg({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/hooks createHook + * @apiVersion 6.0.0 + * @apiName createHook + * @apiDescription Create a hook. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} name + * @apiParam {Json} config A Hash containing key/value pairs to provide settings for this hook. These settings vary between the services and are defined in the github-services repo. Booleans are stored internally as `1` for true, and `0` for false. Any JSON true/false values will be converted automatically. + * @apiParam {Array} [events=["push"]] Determines what events the hook is triggered for. Default: `['push']`. + * @apiParam {Boolean} [active] Determines whether the hook is actually triggered on pushes. + * @apiExample {js} ex: +github.repos.createHook({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/keys createKey + * @apiVersion 6.0.0 + * @apiName createKey + * @apiDescription Add a new deploy key. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} title + * @apiParam {String} key + * @apiParam {Boolean} [read_only] If true, the key will only be able to read repository contents. Otherwise, the key will be able to read and write. + * @apiExample {js} ex: +github.repos.createKey({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/releases createRelease + * @apiVersion 6.0.0 + * @apiName createRelease + * @apiDescription Create a release. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} tag_name String of the tag + * @apiParam {String} [target_commitish] Specifies the commitish value that determines where the Git tag is created from. Can be any branch or commit SHA. Unused if the Git tag already exists. Default: the repository's default branch (usually master). + * @apiParam {String} [name] + * @apiParam {String} [body] + * @apiParam {Boolean} [draft=false] true to create a draft (unpublished) release, false to create a published one. Default: false + * @apiParam {Boolean} [prerelease=false] true to identify the release as a prerelease. false to identify the release as a full release. Default: false + * @apiExample {js} ex: +github.repos.createRelease({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/statuses/:sha createStatus + * @apiVersion 6.0.0 + * @apiName createStatus + * @apiDescription Create a status. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} sha + * @apiParam {String} state State of the status - can be one of pending, success, error, or failure. + * @apiParam {String} [target_url] Target url to associate with this status. This URL will be linked from the GitHub UI to allow users to easily see the ‘source’ of the Status. + * @apiParam {String} [description] Short description of the status. + * @apiParam {String} [context] A string label to differentiate this status from the status of other systems. + * @apiExample {js} ex: +github.repos.createStatus({ ... }); + */ + +/** + * @api {delete} /repos/:owner/:repo delete + * @apiVersion 6.0.0 + * @apiName delete + * @apiDescription Delete a repository. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiExample {js} ex: +github.repos.delete({ ... }); + */ + +/** + * @api {delete} /repos/:owner/:repo/releases/assets/:id deleteAsset + * @apiVersion 6.0.0 + * @apiName deleteAsset + * @apiDescription Delete a release asset. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiExample {js} ex: +github.repos.deleteAsset({ ... }); + */ + +/** + * @api {delete} /repos/:owner/:repo/comments/:id deleteCommitComment + * @apiVersion 6.0.0 + * @apiName deleteCommitComment + * @apiDescription Delete a commit comment. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiExample {js} ex: +github.repos.deleteCommitComment({ ... }); + */ + +/** + * @api {delete} /repos/:owner/:repo/downloads/:id deleteDownload + * @apiVersion 6.0.0 + * @apiName deleteDownload + * @apiDescription Delete a download. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiExample {js} ex: +github.repos.deleteDownload({ ... }); + */ + +/** + * @api {delete} /repos/:owner/:repo/contents/:path deleteFile + * @apiVersion 6.0.0 + * @apiName deleteFile + * @apiDescription Delete a file. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} path The content path. + * @apiParam {String} message The commit message. + * @apiParam {String} sha The blob SHA of the file being removed. + * @apiParam {String} [branch] The branch name. If not provided, uses the repository’s default branch (usually master). + * @apiParam {Json} [committer] + * @apiExample {js} ex: +github.repos.deleteFile({ ... }); + */ + +/** + * @api {delete} /repos/:owner/:repo/hooks/:id deleteHook + * @apiVersion 6.0.0 + * @apiName deleteHook + * @apiDescription Deleate a hook. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiExample {js} ex: +github.repos.deleteHook({ ... }); + */ + +/** + * @api {delete} /repositories/:repo_id/invitations/:invitation_id deleteInvite + * @apiVersion 6.0.0 + * @apiName deleteInvite + * @apiDescription Delete a repository invitation. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} repo_id + * @apiParam {String} invitation_id + * @apiExample {js} ex: +github.repos.deleteInvite({ ... }); + */ + +/** + * @api {delete} /repos/:owner/:repo/keys/:id deleteKey + * @apiVersion 6.0.0 + * @apiName deleteKey + * @apiDescription Remove a deploy key. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiExample {js} ex: +github.repos.deleteKey({ ... }); + */ + +/** + * @api {delete} /repos/:owner/:repo/releases/:id deleteRelease + * @apiVersion 6.0.0 + * @apiName deleteRelease + * @apiDescription Delete a release + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiExample {js} ex: +github.repos.deleteRelease({ ... }); + */ + +/** + * @api {patch} /repos/:owner/:repo edit + * @apiVersion 6.0.0 + * @apiName edit + * @apiDescription Update a repo. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} name + * @apiParam {String} repo + * @apiParam {String} [description] + * @apiParam {String} [homepage] + * @apiParam {Boolean} [private=false] True to create a private repository, false to create a public one. Creating private repositories requires a paid GitHub account. Default is false. + * @apiParam {Boolean} [allow_rebase_merge=true] Either true to allow rebase-merging pull requests, or false to prevent rebase-merging. Default: true. (In preview period. See README.) + * @apiParam {Boolean} [has_wiki=true] True to enable the wiki for this repository, false to disable it. Default is true. + * @apiParam {Boolean} [has_downloads=true] True to enable downloads for this repository, false to disable them. Default is true. + * @apiParam {String} [default_branch] Updates the default branch for this repository. + * @apiParam {Boolean} [allow_squash_merge=true] Either true to allow squash-merging pull requests, or false to prevent squash-merging. Default: true. (In preview period. See README.) + * @apiParam {Boolean} [allow_merge_commit=true] Either true to allow merging pull requests with a merge commit, or false to prevent merging pull requests with merge commits. Default: true. (In preview period. See README.) + * @apiParam {Boolean} [has_issues=true] True to enable issues for this repository, false to disable them. Default is true. + * @apiExample {js} ex: +github.repos.edit({ ... }); + */ + +/** + * @api {patch} /repos/:owner/:repo/releases/assets/:id editAsset + * @apiVersion 6.0.0 + * @apiName editAsset + * @apiDescription Edit a release asset. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiParam {String} name + * @apiParam {String} [label] An alternate short description of the asset. Used in place of the filename. + * @apiExample {js} ex: +github.repos.editAsset({ ... }); + */ + +/** + * @api {patch} /repos/:owner/:repo/hooks/:id editHook + * @apiVersion 6.0.0 + * @apiName editHook + * @apiDescription Edit a hook. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiParam {String} name + * @apiParam {Json} config A Hash containing key/value pairs to provide settings for this hook. Modifying this will replace the entire config object. These settings vary between the services and are defined in the github-services repo. Booleans are stored internally as `1` for true, and `0` for false. Any JSON true/false values will be converted automatically. + * @apiParam {Array} [events=["push"]] Determines what events the hook is triggered for. This replaces the entire array of events. Default: `['push']`. + * @apiParam {Array} [add_events] Determines a list of events to be added to the list of events that the Hook triggers for. + * @apiParam {Array} [remove_events] Determines a list of events to be removed from the list of events that the Hook triggers for. + * @apiParam {Boolean} [active] Determines whether the hook is actually triggered on pushes. + * @apiExample {js} ex: +github.repos.editHook({ ... }); + */ + +/** + * @api {patch} /repos/:owner/:repo/releases/:id editRelease + * @apiVersion 6.0.0 + * @apiName editRelease + * @apiDescription Edit a release. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiParam {String} tag_name String of the tag + * @apiParam {String} [target_commitish] Specifies the commitish value that determines where the Git tag is created from. Can be any branch or commit SHA. Unused if the Git tag already exists. Default: the repository's default branch (usually master). + * @apiParam {String} [name] + * @apiParam {String} [body] + * @apiParam {Boolean} [draft=false] true to create a draft (unpublished) release, false to create a published one. Default: false + * @apiParam {Boolean} [prerelease=false] true to identify the release as a prerelease. false to identify the release as a full release. Default: false + * @apiExample {js} ex: +github.repos.editRelease({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/forks fork + * @apiVersion 6.0.0 + * @apiName fork + * @apiDescription Create a fork. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} [organization] Optional parameter to specify the organization name if forking into an organization. + * @apiExample {js} ex: +github.repos.fork({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo get + * @apiVersion 6.0.0 + * @apiName get + * @apiDescription Get a repo for a user. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiExample {js} ex: +github.repos.get({ ... }); + */ + +/** + * @api {get} /user/repos getAll + * @apiVersion 6.0.0 + * @apiName getAll + * @apiDescription List your repositories + * @apiGroup repos + * + * @apiParam {String} [visibility=all] Can be one of `all`, `public`, or `private`. Default: `all`. + * @apiParam {String} [affiliation=owner,collaborator,organization_member] Comma-separated list of values. Can include: `owner`, `collaborator`, `organization_member`. + * @apiParam {String} [type=all] Possible values: `all`, `owner`, `public`, `private`, `member`. Default: `all`. + * @apiParam {String} [sort=full_name] Possible values: `created`, `updated`, `pushed`, `full_name`. Default: `full_name`. + * @apiParam {String} [direction=desc] + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.getAll({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/comments getAllCommitComments + * @apiVersion 6.0.0 + * @apiName getAllCommitComments + * @apiDescription List commit comments for a repository. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.getAllCommitComments({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/:archive_format/:ref getArchiveLink + * @apiVersion 6.0.0 + * @apiName getArchiveLink + * @apiDescription Get archive link. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} archive_format=tarball Either tarball or zipball, Deafult: tarball. + * @apiParam {String} [ref] String of the name of the fully qualified reference (ie: heads/master). If it doesn’t have at least one slash, it will be rejected. + * @apiExample {js} ex: +github.repos.getArchiveLink({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/releases/assets/:id getAsset + * @apiVersion 6.0.0 + * @apiName getAsset + * @apiDescription Get a single release asset. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiExample {js} ex: +github.repos.getAsset({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/branches/:branch getBranch + * @apiVersion 6.0.0 + * @apiName getBranch + * @apiDescription Get branch. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} branch + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.getBranch({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/branches/:branch/protection getBranchProtection + * @apiVersion 6.0.0 + * @apiName getBranchProtection + * @apiDescription Get branch protection. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} branch + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.getBranchProtection({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/branches getBranches + * @apiVersion 6.0.0 + * @apiName getBranches + * @apiDescription List branches. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Boolean} [protected] Set to true to only return protected branches + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.getBranches({ ... }); + */ + +/** + * @api {get} /repositories/:id getById + * @apiVersion 6.0.0 + * @apiName getById + * @apiDescription Get a single repo by id. + * @apiGroup repos + * + * @apiParam {String} id + * @apiExample {js} ex: +github.repos.getById({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/traffic/clones getClones + * @apiVersion 6.0.0 + * @apiName getClones + * @apiDescription Get the total number of clones and breakdown per day or week for the last 14 days. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.getClones({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/collaborators getCollaborators + * @apiVersion 6.0.0 + * @apiName getCollaborators + * @apiDescription List collaborators + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.getCollaborators({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/commits/:ref/status getCombinedStatus + * @apiVersion 6.0.0 + * @apiName getCombinedStatus + * @apiDescription Get the combined status for a specific ref. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} ref Ref to fetch the status for. It can be a SHA, a branch name, or a tag name. + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.getCombinedStatus({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/commits/:sha getCommit + * @apiVersion 6.0.0 + * @apiName getCommit + * @apiDescription Get a single commit. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} sha + * @apiExample {js} ex: +github.repos.getCommit({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/comments/:id getCommitComment + * @apiVersion 6.0.0 + * @apiName getCommitComment + * @apiDescription Get a single commit comment. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiExample {js} ex: +github.repos.getCommitComment({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/commits/:ref/comments getCommitComments + * @apiVersion 6.0.0 + * @apiName getCommitComments + * @apiDescription List comments for a single commit. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} ref + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.getCommitComments({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/commits getCommits + * @apiVersion 6.0.0 + * @apiName getCommits + * @apiDescription List commits on a repository. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} [sha] Sha or branch to start listing commits from. + * @apiParam {String} [path] Only commits containing this file path will be returned. + * @apiParam {String} [author] GitHub login or email address by which to filter by commit author. + * @apiParam {Date} [since] Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ + * @apiParam {Date} [until] Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.getCommits({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/contents/:path getContent + * @apiVersion 6.0.0 + * @apiName getContent + * @apiDescription Get the contents of a file or directory in a repository. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} path The content path. + * @apiParam {String} [ref] The String name of the Commit/Branch/Tag. Defaults to master. + * @apiExample {js} ex: +github.repos.getContent({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/contributors getContributors + * @apiVersion 6.0.0 + * @apiName getContributors + * @apiDescription Get contributors for the specified repository. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Boolean} [anon] Set to 1 or true to include anonymous contributors in results. + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.getContributors({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/deployments/:id/statuses getDeploymentStatuses + * @apiVersion 6.0.0 + * @apiName getDeploymentStatuses + * @apiDescription List deployment statuses. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiExample {js} ex: +github.repos.getDeploymentStatuses({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/deployments getDeployments + * @apiVersion 6.0.0 + * @apiName getDeployments + * @apiDescription List deployments. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} [sha=none] The short or long sha that was recorded at creation time. Default: none. + * @apiParam {String} [ref=none] The name of the ref. This can be a branch, tag, or sha. Default: none. + * @apiParam {String} [task=none] The name of the task for the deployment. e.g. deploy or deploy:migrations. Default: none. + * @apiParam {String} [environment=none] The name of the environment that was deployed to. e.g. staging or production. Default: none. + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.getDeployments({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/downloads/:id getDownload + * @apiVersion 6.0.0 + * @apiName getDownload + * @apiDescription Get a single download. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiExample {js} ex: +github.repos.getDownload({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/downloads getDownloads + * @apiVersion 6.0.0 + * @apiName getDownloads + * @apiDescription List downloads for repository. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.getDownloads({ ... }); + */ + +/** + * @api {get} /orgs/:org/repos getForOrg + * @apiVersion 6.0.0 + * @apiName getForOrg + * @apiDescription List repositories for the specified org. + * @apiGroup repos + * + * @apiParam {String} org + * @apiParam {String} [type=all] Possible values: `all`, `public`, `private`, `forks`, `sources`, `member`. Default: `all`. + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.getForOrg({ ... }); + */ + +/** + * @api {get} /users/:username/repos getForUser + * @apiVersion 6.0.0 + * @apiName getForUser + * @apiDescription List public repositories for the specified user. + * @apiGroup repos + * + * @apiParam {String} username + * @apiParam {String} [type=owner] Possible values: `all`, `owner`, `member`. Default: `owner`. + * @apiParam {String} [sort=full_name] Possible values: `created`, `updated`, `pushed`, `full_name`. Default: `full_name`. + * @apiParam {String} [direction=desc] + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.getForUser({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/forks getForks + * @apiVersion 6.0.0 + * @apiName getForks + * @apiDescription List forks. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} [sort=newest] Possible values: `newest`, `oldest`, `stargazers`, default: `newest`. + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.getForks({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/hooks/:id getHook + * @apiVersion 6.0.0 + * @apiName getHook + * @apiDescription Get single hook. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiExample {js} ex: +github.repos.getHook({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/hooks getHooks + * @apiVersion 6.0.0 + * @apiName getHooks + * @apiDescription List hooks. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.getHooks({ ... }); + */ + +/** + * @api {get} /repositories/:repo_id/invitations getInvites + * @apiVersion 6.0.0 + * @apiName getInvites + * @apiDescription List invitations for a repository. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} repo_id + * @apiExample {js} ex: +github.repos.getInvites({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/keys/:id getKey + * @apiVersion 6.0.0 + * @apiName getKey + * @apiDescription Get a deploy key. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiExample {js} ex: +github.repos.getKey({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/keys getKeys + * @apiVersion 6.0.0 + * @apiName getKeys + * @apiDescription List deploy keys. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.getKeys({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/languages getLanguages + * @apiVersion 6.0.0 + * @apiName getLanguages + * @apiDescription Get languages for the specified repository. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.getLanguages({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/pages/builds/latest getLatestPagesBuild + * @apiVersion 6.0.0 + * @apiName getLatestPagesBuild + * @apiDescription Get latest Pages build. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiExample {js} ex: +github.repos.getLatestPagesBuild({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/releases/latest getLatestRelease + * @apiVersion 6.0.0 + * @apiName getLatestRelease + * @apiDescription Get the latest release. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiExample {js} ex: +github.repos.getLatestRelease({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/pages getPages + * @apiVersion 6.0.0 + * @apiName getPages + * @apiDescription Get information about a Pages site. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.getPages({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/pages/builds/:id getPagesBuild + * @apiVersion 6.0.0 + * @apiName getPagesBuild + * @apiDescription Get a specific Pages build. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiExample {js} ex: +github.repos.getPagesBuild({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/pages/builds getPagesBuilds + * @apiVersion 6.0.0 + * @apiName getPagesBuilds + * @apiDescription List Pages builds. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.getPagesBuilds({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/traffic/popular/paths getPaths + * @apiVersion 6.0.0 + * @apiName getPaths + * @apiDescription Get the top 10 popular contents over the last 14 days. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.getPaths({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/branches/:branch/protection/required_status_checks getProtectedBranchRequiredStatusChecks + * @apiVersion 6.0.0 + * @apiName getProtectedBranchRequiredStatusChecks + * @apiDescription Get required status checks of protected branch. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} branch + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.getProtectedBranchRequiredStatusChecks({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/branches/:branch/protection/required_status_checks/contexts getProtectedBranchRequiredStatusChecksContexts + * @apiVersion 6.0.0 + * @apiName getProtectedBranchRequiredStatusChecksContexts + * @apiDescription List required status checks contexts of protected branch. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} branch + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.getProtectedBranchRequiredStatusChecksContexts({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/branches/:branch/protection/restrictions getProtectedBranchRestrictions + * @apiVersion 6.0.0 + * @apiName getProtectedBranchRestrictions + * @apiDescription Get restrictions of protected branch. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} branch + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.getProtectedBranchRestrictions({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/branches/:branch/protection/restrictions/teams getProtectedBranchTeamRestrictions + * @apiVersion 6.0.0 + * @apiName getProtectedBranchTeamRestrictions + * @apiDescription List team restrictions of protected branch. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} branch + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.getProtectedBranchTeamRestrictions({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/branches/:branch/protection/restrictions/users getProtectedBranchUserRestrictions + * @apiVersion 6.0.0 + * @apiName getProtectedBranchUserRestrictions + * @apiDescription List user restrictions of protected branch. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} branch + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.getProtectedBranchUserRestrictions({ ... }); + */ + +/** + * @api {get} /repositories getPublic + * @apiVersion 6.0.0 + * @apiName getPublic + * @apiDescription List all public repositories + * @apiGroup repos + * + * @apiParam {String} [since] The integer ID of the last Repository that you've seen. + * @apiExample {js} ex: +github.repos.getPublic({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/readme getReadme + * @apiVersion 6.0.0 + * @apiName getReadme + * @apiDescription Get the README for the given repository. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} [ref] The name of the commit/branch/tag. Default: the repository’s default branch (usually master) + * @apiExample {js} ex: +github.repos.getReadme({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/traffic/popular/referrers getReferrers + * @apiVersion 6.0.0 + * @apiName getReferrers + * @apiDescription Get the top 10 referrers over the last 14 days. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.getReferrers({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/releases/:id getRelease + * @apiVersion 6.0.0 + * @apiName getRelease + * @apiDescription Get a single release. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiExample {js} ex: +github.repos.getRelease({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/releases/tags/:tag getReleaseByTag + * @apiVersion 6.0.0 + * @apiName getReleaseByTag + * @apiDescription Get a release by tag name. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} tag String of the tag + * @apiExample {js} ex: +github.repos.getReleaseByTag({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/releases getReleases + * @apiVersion 6.0.0 + * @apiName getReleases + * @apiDescription List releases for a repository. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.getReleases({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/commits/:ref getShaOfCommitRef + * @apiVersion 6.0.0 + * @apiName getShaOfCommitRef + * @apiDescription Get the SHA-1 of a commit reference. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} ref String of the name of the fully qualified reference (ie: heads/master). If it doesn’t have at least one slash, it will be rejected. + * @apiExample {js} ex: +github.repos.getShaOfCommitRef({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/stats/code_frequency getStatsCodeFrequency + * @apiVersion 6.0.0 + * @apiName getStatsCodeFrequency + * @apiDescription Get the number of additions and deletions per week. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiExample {js} ex: +github.repos.getStatsCodeFrequency({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/stats/commit_activity getStatsCommitActivity + * @apiVersion 6.0.0 + * @apiName getStatsCommitActivity + * @apiDescription Get the last year of commit activity data. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiExample {js} ex: +github.repos.getStatsCommitActivity({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/stats/contributors getStatsContributors + * @apiVersion 6.0.0 + * @apiName getStatsContributors + * @apiDescription Get contributors list with additions, deletions, and commit counts. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiExample {js} ex: +github.repos.getStatsContributors({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/stats/participation getStatsParticipation + * @apiVersion 6.0.0 + * @apiName getStatsParticipation + * @apiDescription Get the weekly commit count for the repository owner and everyone else. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiExample {js} ex: +github.repos.getStatsParticipation({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/stats/punch_card getStatsPunchCard + * @apiVersion 6.0.0 + * @apiName getStatsPunchCard + * @apiDescription Get the number of commits per hour in each day. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiExample {js} ex: +github.repos.getStatsPunchCard({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/commits/:ref/statuses getStatuses + * @apiVersion 6.0.0 + * @apiName getStatuses + * @apiDescription List statuses for a specfic ref. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} ref Ref to list the statuses from. It can be a SHA, a branch name, or a tag name. + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.getStatuses({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/tags getTags + * @apiVersion 6.0.0 + * @apiName getTags + * @apiDescription Get tags for the specified repository. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.getTags({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/teams getTeams + * @apiVersion 6.0.0 + * @apiName getTeams + * @apiDescription Get teams for the specified repository. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.getTeams({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/traffic/views getViews + * @apiVersion 6.0.0 + * @apiName getViews + * @apiDescription Get the total number of views and breakdown per day or week for the last 14 days. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.getViews({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/releases/:id/assets listAssets + * @apiVersion 6.0.0 + * @apiName listAssets + * @apiDescription List assets for a release. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiExample {js} ex: +github.repos.listAssets({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/merges merge + * @apiVersion 6.0.0 + * @apiName merge + * @apiDescription Perform a merge. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} base The branch (or git ref) you want your changes pulled into. This should be an existing branch on the current repository. You cannot submit a pull request to one repo that requests a merge to a base of another repo. + * @apiParam {String} head The branch (or git ref) where your changes are implemented. + * @apiParam {String} [commit_message] Commit message to use for the merge commit. If omitted, a default message will be used. + * @apiExample {js} ex: +github.repos.merge({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/hooks/:id/pings pingHook + * @apiVersion 6.0.0 + * @apiName pingHook + * @apiDescription Ping a hook. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiExample {js} ex: +github.repos.pingHook({ ... }); + */ + +/** + * @api {delete} /repos/:owner/:repo/branches/:branch/protection removeBranchProtection + * @apiVersion 6.0.0 + * @apiName removeBranchProtection + * @apiDescription Remove branch protection. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} branch + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.removeBranchProtection({ ... }); + */ + +/** + * @api {delete} /repos/:owner/:repo/collaborators/:username removeCollaborator + * @apiVersion 6.0.0 + * @apiName removeCollaborator + * @apiDescription Remove user as a collaborator. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} username + * @apiExample {js} ex: +github.repos.removeCollaborator({ ... }); + */ + +/** + * @api {delete} /repos/:owner/:repo/branches/:branch/protection/required_status_checks removeProtectedBranchRequiredStatusChecks + * @apiVersion 6.0.0 + * @apiName removeProtectedBranchRequiredStatusChecks + * @apiDescription Remove required status checks of protected branch. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} branch + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.removeProtectedBranchRequiredStatusChecks({ ... }); + */ + +/** + * @api {delete} /repos/:owner/:repo/branches/:branch/protection/required_status_checks/contexts removeProtectedBranchRequiredStatusChecksContexts + * @apiVersion 6.0.0 + * @apiName removeProtectedBranchRequiredStatusChecksContexts + * @apiDescription Remove required status checks contexts of protected branch. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} branch + * @apiParam {Array} body An array of protected branch required status checks contexts (e.g. continuous-integration/jenkins). + * @apiExample {js} ex: +github.repos.removeProtectedBranchRequiredStatusChecksContexts({ ... }); + */ + +/** + * @api {delete} /repos/:owner/:repo/branches/:branch/protection/restrictions removeProtectedBranchRestrictions + * @apiVersion 6.0.0 + * @apiName removeProtectedBranchRestrictions + * @apiDescription Remove restrictions of protected branch. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} branch + * @apiExample {js} ex: +github.repos.removeProtectedBranchRestrictions({ ... }); + */ + +/** + * @api {delete} /repos/:owner/:repo/branches/:branch/protection/restrictions/teams removeProtectedBranchTeamRestrictions + * @apiVersion 6.0.0 + * @apiName removeProtectedBranchTeamRestrictions + * @apiDescription Remove team restrictions of protected branch. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} branch + * @apiParam {Array} body An array of team slugs (e.g. justice-league). + * @apiExample {js} ex: +github.repos.removeProtectedBranchTeamRestrictions({ ... }); + */ + +/** + * @api {delete} /repos/:owner/:repo/branches/:branch/protection/restrictions/users removeProtectedBranchUserRestrictions + * @apiVersion 6.0.0 + * @apiName removeProtectedBranchUserRestrictions + * @apiDescription Remove user restrictions of protected branch. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} branch + * @apiParam {Array} body An array of team slugs (e.g. justice-league). + * @apiExample {js} ex: +github.repos.removeProtectedBranchUserRestrictions({ ... }); + */ + +/** + * @api {put} /repos/:owner/:repo/branches/:branch/protection/required_status_checks/contexts replaceProtectedBranchRequiredStatusChecksContexts + * @apiVersion 6.0.0 + * @apiName replaceProtectedBranchRequiredStatusChecksContexts + * @apiDescription Replace required status checks contexts of protected branch. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} branch + * @apiParam {Array} body An array of protected branch required status checks contexts (e.g. continuous-integration/jenkins). + * @apiExample {js} ex: +github.repos.replaceProtectedBranchRequiredStatusChecksContexts({ ... }); + */ + +/** + * @api {put} /repos/:owner/:repo/branches/:branch/protection/restrictions/teams replaceProtectedBranchTeamRestrictions + * @apiVersion 6.0.0 + * @apiName replaceProtectedBranchTeamRestrictions + * @apiDescription Replace team restrictions of protected branch. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} branch + * @apiParam {Array} body An array of team slugs (e.g. justice-league). + * @apiExample {js} ex: +github.repos.replaceProtectedBranchTeamRestrictions({ ... }); + */ + +/** + * @api {put} /repos/:owner/:repo/branches/:branch/protection/restrictions/users replaceProtectedBranchUserRestrictions + * @apiVersion 6.0.0 + * @apiName replaceProtectedBranchUserRestrictions + * @apiDescription Replace user restrictions of protected branch. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} branch + * @apiParam {Array} body An array of team slugs (e.g. justice-league). + * @apiExample {js} ex: +github.repos.replaceProtectedBranchUserRestrictions({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/pages/builds requestPageBuild + * @apiVersion 6.0.0 + * @apiName requestPageBuild + * @apiDescription Request a page build. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiExample {js} ex: +github.repos.requestPageBuild({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/hooks/:id/tests testHook + * @apiVersion 6.0.0 + * @apiName testHook + * @apiDescription Test a [push] hook. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiExample {js} ex: +github.repos.testHook({ ... }); + */ + +/** + * @api {put} /repos/:owner/:repo/branches/:branch/protection updateBranchProtection + * @apiVersion 6.0.0 + * @apiName updateBranchProtection + * @apiDescription Update branch protection. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} branch + * @apiParam {Json} required_status_checks JSON object that contains the following keys: `include_admins` - Enforce required status checks for repository administrators, `strict` - Require branches to be up to date before merging, `contexts` - The list of status checks to require in order to merge into this branch. This object can have the value of `null` for disabled. + * @apiParam {Json} restrictions JSON object that contains the following keys: `users` - The list of user logins with push access, `teams` - The list of team slugs with push access. This object can have the value of `null` for disabled. + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.updateBranchProtection({ ... }); + */ + +/** + * @api {patch} /repos/:owner/:repo/comments/:id updateCommitComment + * @apiVersion 6.0.0 + * @apiName updateCommitComment + * @apiDescription Update a commit comment. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiParam {String} body + * @apiExample {js} ex: +github.repos.updateCommitComment({ ... }); + */ + +/** + * @api {put} /repos/:owner/:repo/contents/:path updateFile + * @apiVersion 6.0.0 + * @apiName updateFile + * @apiDescription Update a file. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} path The content path. + * @apiParam {String} message The commit message. + * @apiParam {String} content The updated file content, Base64 encoded. + * @apiParam {String} sha The blob SHA of the file being replaced. + * @apiParam {String} [branch] The branch name. If not provided, uses the repository’s default branch (usually master). + * @apiParam {Json} [committer] + * @apiExample {js} ex: +github.repos.updateFile({ ... }); + */ + +/** + * @api {patch} /repositories/:repo_id/invitations/:invitation_id updateInvite + * @apiVersion 6.0.0 + * @apiName updateInvite + * @apiDescription Update a repository invitation. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} repo_id + * @apiParam {String} invitation_id + * @apiParam {String} [permission] The permissions that the associated user will have on the repository. + * @apiExample {js} ex: +github.repos.updateInvite({ ... }); + */ + +/** + * @api {patch} /repos/:owner/:repo/branches/:branch/protection/required_status_checks updateProtectedBranchRequiredStatusChecks + * @apiVersion 6.0.0 + * @apiName updateProtectedBranchRequiredStatusChecks + * @apiDescription Update required status checks of protected branch. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} branch + * @apiParam {Boolean} [include_admins] Enforce required status checks for repository administrators. + * @apiParam {Boolean} [strict] Require branches to be up to date before merging. + * @apiParam {Array} [contexts] The list of status checks to require in order to merge into this branch. + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.updateProtectedBranchRequiredStatusChecks({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/releases/:id/assets uploadAsset + * @apiVersion 6.0.0 + * @apiName uploadAsset + * @apiDescription Upload a release asset. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiParam {String} filePath The file path of the asset. + * @apiParam {String} name The file name of the asset. This should be set in a URI query parameter. + * @apiParam {String} [label] An alternate short description of the asset. Used in place of the filename. This should be set in a URI query parameter. + * @apiExample {js} ex: +github.repos.uploadAsset({ ... }); + */ + +/** + * @api {get} /search/code code + * @apiVersion 6.0.0 + * @apiName code + * @apiDescription Search code. + * @apiGroup search + * + * @apiParam {String} q Search Term + * @apiParam {String} [sort] The sort field. Can only be indexed, which indicates how recently a file has been indexed by the GitHub search infrastructure. Default: results are sorted by best match. + * @apiParam {String} [order=desc] asc or desc + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.search.code({ ... }); + */ + +/** + * @api {get} /legacy/user/email/:email email + * @apiVersion 6.0.0 + * @apiName email + * @apiDescription Search against public email addresses. + * @apiGroup search + * + * @apiParam {String} email The email address + * @apiExample {js} ex: +github.search.email({ ... }); + */ + +/** + * @api {get} /search/issues issues + * @apiVersion 6.0.0 + * @apiName issues + * @apiDescription Search issues. + * @apiGroup search + * + * @apiParam {String} q Search Term + * @apiParam {String} [sort] The sort field. Can be comments, created, or updated. Default: results are sorted by best match. + * @apiParam {String} [order=desc] asc or desc + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.search.issues({ ... }); + */ + +/** + * @api {get} /search/repositories repos + * @apiVersion 6.0.0 + * @apiName repos + * @apiDescription Search repositories. + * @apiGroup search + * + * @apiParam {String} q Search Term + * @apiParam {String} [sort] stars, forks, or updated + * @apiParam {String} [order=desc] asc or desc + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.search.repos({ ... }); + */ + +/** + * @api {get} /search/users users + * @apiVersion 6.0.0 + * @apiName users + * @apiDescription Search users. + * @apiGroup search + * + * @apiParam {String} q Search Term + * @apiParam {String} [sort] The sort field. Can be followers, repositories, or joined. Default: results are sorted by best match. + * @apiParam {String} [order=desc] asc or desc + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.search.users({ ... }); + */ + +/** + * @api {patch} /user/repository_invitations/:invitation_id acceptRepoInvite + * @apiVersion 6.0.0 + * @apiName acceptRepoInvite + * @apiDescription Accept a repository invitation. (In preview period. See README.) + * @apiGroup users + * + * @apiParam {String} invitation_id + * @apiExample {js} ex: +github.users.acceptRepoInvite({ ... }); + */ + +/** + * @api {post} /user/emails addEmails + * @apiVersion 6.0.0 + * @apiName addEmails + * @apiDescription Add email address(es) + * @apiGroup users + * + * @apiParam {Array} body You can post a single email address or an array of addresses. + * @apiExample {js} ex: +github.users.addEmails({ ... }); + */ + +/** + * @api {get} /user/following/:username checkFollowing + * @apiVersion 6.0.0 + * @apiName checkFollowing + * @apiDescription Check if you are following a user + * @apiGroup users + * + * @apiParam {String} username + * @apiExample {js} ex: +github.users.checkFollowing({ ... }); + */ + +/** + * @api {get} /users/:username/following/:target_user checkIfOneFollowersOther + * @apiVersion 6.0.0 + * @apiName checkIfOneFollowersOther + * @apiDescription Check if one user follows another + * @apiGroup users + * + * @apiParam {String} username + * @apiParam {String} target_user + * @apiExample {js} ex: +github.users.checkIfOneFollowersOther({ ... }); + */ + +/** + * @api {post} /user/gpg_keys createGpgKey + * @apiVersion 6.0.0 + * @apiName createGpgKey + * @apiDescription Create a GPG key. (In preview period. See README.) + * @apiGroup users + * + * @apiParam {String} armored_public_key GPG key contents + * @apiExample {js} ex: +github.users.createGpgKey({ ... }); + */ + +/** + * @api {post} /user/keys createKey + * @apiVersion 6.0.0 + * @apiName createKey + * @apiDescription Create a public key + * @apiGroup users + * + * @apiParam {String} title + * @apiParam {String} key + * @apiExample {js} ex: +github.users.createKey({ ... }); + */ + +/** + * @api {delete} /user/repository_invitations/:invitation_id declineRepoInvite + * @apiVersion 6.0.0 + * @apiName declineRepoInvite + * @apiDescription Decline a repository invitation. (In preview period. See README.) + * @apiGroup users + * + * @apiParam {String} invitation_id + * @apiExample {js} ex: +github.users.declineRepoInvite({ ... }); + */ + +/** + * @api {delete} /user/emails deleteEmails + * @apiVersion 6.0.0 + * @apiName deleteEmails + * @apiDescription Delete email address(es) + * @apiGroup users + * + * @apiParam {Array} body You can post a single email address or an array of addresses. + * @apiExample {js} ex: +github.users.deleteEmails({ ... }); + */ + +/** + * @api {delete} /user/gpg_keys/:id deleteGpgKey + * @apiVersion 6.0.0 + * @apiName deleteGpgKey + * @apiDescription Delete a GPG key. (In preview period. See README.) + * @apiGroup users + * + * @apiParam {String} id + * @apiExample {js} ex: +github.users.deleteGpgKey({ ... }); + */ + +/** + * @api {delete} /user/keys/:id deleteKey + * @apiVersion 6.0.0 + * @apiName deleteKey + * @apiDescription Delete a public key + * @apiGroup users + * + * @apiParam {String} id + * @apiExample {js} ex: +github.users.deleteKey({ ... }); + */ + +/** + * @api {delete} /users/:username/site_admin demote + * @apiVersion 6.0.0 + * @apiName demote + * @apiDescription Demote a site administrator to an ordinary user + * @apiGroup users + * + * @apiParam {String} username + * @apiExample {js} ex: +github.users.demote({ ... }); + */ + +/** + * @api {patch} /user/memberships/orgs/:org editOrgMembership + * @apiVersion 6.0.0 + * @apiName editOrgMembership + * @apiDescription Edit your organization membership + * @apiGroup users + * + * @apiParam {String} org + * @apiParam {String} state The state that the membership should be in. Only "active" will be accepted. + * @apiExample {js} ex: +github.users.editOrgMembership({ ... }); + */ + +/** + * @api {put} /user/following/:username followUser + * @apiVersion 6.0.0 + * @apiName followUser + * @apiDescription Follow a user + * @apiGroup users + * + * @apiParam {String} username + * @apiExample {js} ex: +github.users.followUser({ ... }); + */ + +/** + * @api {get} /user get + * @apiVersion 6.0.0 + * @apiName get + * @apiDescription Get the authenticated user + * @apiGroup users + * + * @apiExample {js} ex: +github.users.get({ ... }); + */ + +/** + * @api {get} /users getAll + * @apiVersion 6.0.0 + * @apiName getAll + * @apiDescription Get all users + * @apiGroup users + * + * @apiParam {Number} [since] The integer ID of the last User that you’ve seen. + * @apiExample {js} ex: +github.users.getAll({ ... }); + */ + +/** + * @api {get} /user/:id getById + * @apiVersion 6.0.0 + * @apiName getById + * @apiDescription Get a single user by GitHub ID + * @apiGroup users + * + * @apiParam {String} id + * @apiExample {js} ex: +github.users.getById({ ... }); + */ + +/** + * @api {get} /user/emails getEmails + * @apiVersion 6.0.0 + * @apiName getEmails + * @apiDescription List email addresses for a user + * @apiGroup users + * + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.users.getEmails({ ... }); + */ + +/** + * @api {get} /user/followers getFollowers + * @apiVersion 6.0.0 + * @apiName getFollowers + * @apiDescription List the authenticated user's followers + * @apiGroup users + * + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.users.getFollowers({ ... }); + */ + +/** + * @api {get} /users/:username/followers getFollowersForUser + * @apiVersion 6.0.0 + * @apiName getFollowersForUser + * @apiDescription List a user's followers + * @apiGroup users + * + * @apiParam {String} username + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.users.getFollowersForUser({ ... }); + */ + +/** + * @api {get} /user/following getFollowing + * @apiVersion 6.0.0 + * @apiName getFollowing + * @apiDescription List who the authenticated user is following + * @apiGroup users + * + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.users.getFollowing({ ... }); + */ + +/** + * @api {get} /users/:username/following getFollowingForUser + * @apiVersion 6.0.0 + * @apiName getFollowingForUser + * @apiDescription List who a user is following + * @apiGroup users + * + * @apiParam {String} username + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.users.getFollowingForUser({ ... }); + */ + +/** + * @api {get} /users/:username getForUser + * @apiVersion 6.0.0 + * @apiName getForUser + * @apiDescription Get a single user + * @apiGroup users + * + * @apiParam {String} username + * @apiExample {js} ex: +github.users.getForUser({ ... }); + */ + +/** + * @api {get} /user/gpg_keys/:id getGpgKey + * @apiVersion 6.0.0 + * @apiName getGpgKey + * @apiDescription Get a single GPG key. (In preview period. See README.) + * @apiGroup users + * + * @apiParam {String} id + * @apiExample {js} ex: +github.users.getGpgKey({ ... }); + */ + +/** + * @api {get} /user/gpg_keys getGpgKeys + * @apiVersion 6.0.0 + * @apiName getGpgKeys + * @apiDescription List your GPG keys. (In preview period. See README.) + * @apiGroup users + * + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.users.getGpgKeys({ ... }); + */ + +/** + * @api {get} /user/keys/:id getKey + * @apiVersion 6.0.0 + * @apiName getKey + * @apiDescription Get a single public key + * @apiGroup users + * + * @apiParam {String} id + * @apiExample {js} ex: +github.users.getKey({ ... }); + */ + +/** + * @api {get} /user/keys getKeys + * @apiVersion 6.0.0 + * @apiName getKeys + * @apiDescription List your public keys + * @apiGroup users + * + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.users.getKeys({ ... }); + */ + +/** + * @api {get} /users/:username/keys getKeysForUser + * @apiVersion 6.0.0 + * @apiName getKeysForUser + * @apiDescription List public keys for a user + * @apiGroup users + * + * @apiParam {String} username + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.users.getKeysForUser({ ... }); + */ + +/** + * @api {get} /user/memberships/orgs/:org getOrgMembership + * @apiVersion 6.0.0 + * @apiName getOrgMembership + * @apiDescription Get your organization membership + * @apiGroup users + * + * @apiParam {String} org + * @apiExample {js} ex: +github.users.getOrgMembership({ ... }); + */ + +/** + * @api {get} /user/memberships/orgs getOrgMemberships + * @apiVersion 6.0.0 + * @apiName getOrgMemberships + * @apiDescription List your organization memberships + * @apiGroup users + * + * @apiParam {String} [state] Indicates the state of the memberships to return. Can be either active or pending. If not specified, both active and pending memberships are returned. + * @apiExample {js} ex: +github.users.getOrgMemberships({ ... }); + */ + +/** + * @api {get} /user/orgs getOrgs + * @apiVersion 6.0.0 + * @apiName getOrgs + * @apiDescription List organizations for the authenticated user. + * @apiGroup users + * + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.users.getOrgs({ ... }); + */ + +/** + * @api {get} /user/repository_invitations getRepoInvites + * @apiVersion 6.0.0 + * @apiName getRepoInvites + * @apiDescription List a user's repository invitations. (In preview period. See README.) + * @apiGroup users + * + * @apiExample {js} ex: +github.users.getRepoInvites({ ... }); + */ + +/** + * @api {get} /user/teams getTeams + * @apiVersion 6.0.0 + * @apiName getTeams + * @apiDescription Get your teams + * @apiGroup users + * + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.users.getTeams({ ... }); + */ + +/** + * @api {put} /users/:username/site_admin promote + * @apiVersion 6.0.0 + * @apiName promote + * @apiDescription Promote an ordinary user to a site administrator + * @apiGroup users + * + * @apiParam {String} username + * @apiExample {js} ex: +github.users.promote({ ... }); + */ + +/** + * @api {put} /users/:username/suspended suspend + * @apiVersion 6.0.0 + * @apiName suspend + * @apiDescription Suspend a user + * @apiGroup users + * + * @apiParam {String} username + * @apiExample {js} ex: +github.users.suspend({ ... }); + */ + +/** + * @api {delete} /user/following/:username unfollowUser + * @apiVersion 6.0.0 + * @apiName unfollowUser + * @apiDescription Unfollow a user + * @apiGroup users + * + * @apiParam {String} username + * @apiExample {js} ex: +github.users.unfollowUser({ ... }); + */ + +/** + * @api {delete} /users/:username/suspended unsuspend + * @apiVersion 6.0.0 + * @apiName unsuspend + * @apiDescription Unsuspend a user + * @apiGroup users + * + * @apiParam {String} username + * @apiExample {js} ex: +github.users.unsuspend({ ... }); + */ + +/** + * @api {patch} /user update + * @apiVersion 6.0.0 + * @apiName update + * @apiDescription Update the authenticated user + * @apiGroup users + * + * @apiParam {String} [name] The new name of the user + * @apiParam {String} [email] Publicly visible email address. + * @apiParam {String} [blog] The new blog URL of the user. + * @apiParam {String} [company] The new company of the user. + * @apiParam {String} [location] The new location of the user. + * @apiParam {Boolean} [hireable] The new hiring availability of the user. + * @apiParam {String} [bio] The new short biography of the user. + * @apiExample {js} ex: +github.users.update({ ... }); + */ + +/** + * @api {get} /notifications/threads/:id/subscription checkNotificationThreadSubscription + * @apiVersion 6.0.3 + * @apiName checkNotificationThreadSubscription + * @apiDescription Check to see if the current user is subscribed to a thread. + * @apiGroup activity + * + * @apiParam {String} id + * @apiExample {js} ex: +github.activity.checkNotificationThreadSubscription({ ... }); + */ + +/** + * @api {get} /user/starred/:owner/:repo checkStarringRepo + * @apiVersion 6.0.3 + * @apiName checkStarringRepo + * @apiDescription Check if you are starring a repository + * @apiGroup activity + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.activity.checkStarringRepo({ ... }); + */ + +/** + * @api {delete} /notifications/threads/:id/subscription deleteNotificationThreadSubscription + * @apiVersion 6.0.3 + * @apiName deleteNotificationThreadSubscription + * @apiDescription Delete a notification thread subscription. + * @apiGroup activity + * + * @apiParam {String} id + * @apiExample {js} ex: +github.activity.deleteNotificationThreadSubscription({ ... }); + */ + +/** + * @api {get} /events getEvents + * @apiVersion 6.0.3 + * @apiName getEvents + * @apiDescription List public events + * @apiGroup activity + * + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.activity.getEvents({ ... }); + */ + +/** + * @api {get} /orgs/:org/events getEventsForOrg + * @apiVersion 6.0.3 + * @apiName getEventsForOrg + * @apiDescription List public events for an organization + * @apiGroup activity + * + * @apiParam {String} org + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.activity.getEventsForOrg({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/events getEventsForRepo + * @apiVersion 6.0.3 + * @apiName getEventsForRepo + * @apiDescription List repository events + * @apiGroup activity + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.activity.getEventsForRepo({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/issues/events getEventsForRepoIssues + * @apiVersion 6.0.3 + * @apiName getEventsForRepoIssues + * @apiDescription List issue events for a repository + * @apiGroup activity + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.activity.getEventsForRepoIssues({ ... }); + */ + +/** + * @api {get} /networks/:owner/:repo/events getEventsForRepoNetwork + * @apiVersion 6.0.3 + * @apiName getEventsForRepoNetwork + * @apiDescription List public events for a network of repositories + * @apiGroup activity + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.activity.getEventsForRepoNetwork({ ... }); + */ + +/** + * @api {get} /users/:username/events getEventsForUser + * @apiVersion 6.0.3 + * @apiName getEventsForUser + * @apiDescription List events performed by a user + * @apiGroup activity + * + * @apiParam {String} username + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.activity.getEventsForUser({ ... }); + */ + +/** + * @api {get} /users/:username/events/orgs/:org getEventsForUserOrg + * @apiVersion 6.0.3 + * @apiName getEventsForUserOrg + * @apiDescription List events for a user's organization + * @apiGroup activity + * + * @apiParam {String} username + * @apiParam {String} org + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.activity.getEventsForUserOrg({ ... }); + */ + +/** + * @api {get} /users/:username/events/public getEventsForUserPublic + * @apiVersion 6.0.3 + * @apiName getEventsForUserPublic + * @apiDescription List public events performed by a user + * @apiGroup activity + * + * @apiParam {String} username + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.activity.getEventsForUserPublic({ ... }); + */ + +/** + * @api {get} /users/:username/received_events getEventsReceived + * @apiVersion 6.0.3 + * @apiName getEventsReceived + * @apiDescription List events that a user has received + * @apiGroup activity + * + * @apiParam {String} username + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.activity.getEventsReceived({ ... }); + */ + +/** + * @api {get} /users/:username/received_events/public getEventsReceivedPublic + * @apiVersion 6.0.3 + * @apiName getEventsReceivedPublic + * @apiDescription List public events that a user has received + * @apiGroup activity + * + * @apiParam {String} username + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.activity.getEventsReceivedPublic({ ... }); + */ + +/** + * @api {get} /feeds getFeeds + * @apiVersion 6.0.3 + * @apiName getFeeds + * @apiDescription Get all feeds available for the authenticated user. + * @apiGroup activity + * + * @apiExample {js} ex: +github.activity.getFeeds({ ... }); + */ + +/** + * @api {get} /notifications/threads/:id getNotificationThread + * @apiVersion 6.0.3 + * @apiName getNotificationThread + * @apiDescription View a single notification thread. + * @apiGroup activity + * + * @apiParam {String} id + * @apiExample {js} ex: +github.activity.getNotificationThread({ ... }); + */ + +/** + * @api {get} /notifications getNotifications + * @apiVersion 6.0.3 + * @apiName getNotifications + * @apiDescription Get all notifications for the current user, grouped by repository. + * @apiGroup activity + * + * @apiParam {Boolean} [all=false] If true, show notifications marked as read. Default: false + * @apiParam {Boolean} [participating=false] If true, only shows notifications in which the user is directly participating or mentioned. Default: false + * @apiParam {Date} [since] Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ + * @apiParam {String} [before] Only show notifications updated before the given time. This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ. + * @apiExample {js} ex: +github.activity.getNotifications({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/notifications getNotificationsForUser + * @apiVersion 6.0.3 + * @apiName getNotificationsForUser + * @apiDescription Get all notifications for the given user. + * @apiGroup activity + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Boolean} [all=false] If true, show notifications marked as read. Default: false + * @apiParam {Boolean} [participating=false] If true, only shows notifications in which the user is directly participating or mentioned. Default: false + * @apiParam {Date} [since] Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ + * @apiParam {String} [before] Only show notifications updated before the given time. This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ. + * @apiExample {js} ex: +github.activity.getNotificationsForUser({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/subscription getRepoSubscription + * @apiVersion 6.0.3 + * @apiName getRepoSubscription + * @apiDescription Get a Repository Subscription. + * @apiGroup activity + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.activity.getRepoSubscription({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/stargazers getStargazersForRepo + * @apiVersion 6.0.3 + * @apiName getStargazersForRepo + * @apiDescription List Stargazers + * @apiGroup activity + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.activity.getStargazersForRepo({ ... }); + */ + +/** + * @api {get} /user/starred getStarredRepos + * @apiVersion 6.0.3 + * @apiName getStarredRepos + * @apiDescription List repositories being starred by the authenticated user + * @apiGroup activity + * + * @apiParam {String=created,updated} [sort=created] + * @apiParam {String=asc,desc} [direction=desc] + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.activity.getStarredRepos({ ... }); + */ + +/** + * @api {get} /users/:username/starred getStarredReposForUser + * @apiVersion 6.0.3 + * @apiName getStarredReposForUser + * @apiDescription List repositories being starred by a user + * @apiGroup activity + * + * @apiParam {String} username + * @apiParam {String=created,updated} [sort=created] + * @apiParam {String=asc,desc} [direction=desc] + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.activity.getStarredReposForUser({ ... }); + */ + +/** + * @api {get} /user/subscriptions getWatchedRepos + * @apiVersion 6.0.3 + * @apiName getWatchedRepos + * @apiDescription List repositories being watched by the authenticated user. + * @apiGroup activity + * + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.activity.getWatchedRepos({ ... }); + */ + +/** + * @api {get} /users/:username/subscriptions getWatchedReposForUser + * @apiVersion 6.0.3 + * @apiName getWatchedReposForUser + * @apiDescription List repositories being watched by a user. + * @apiGroup activity + * + * @apiParam {String} username + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.activity.getWatchedReposForUser({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/subscribers getWatchersForRepo + * @apiVersion 6.0.3 + * @apiName getWatchersForRepo + * @apiDescription Get watchers for repository. + * @apiGroup activity + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.activity.getWatchersForRepo({ ... }); + */ + +/** + * @api {patch} /notifications/threads/:id markNotificationThreadAsRead + * @apiVersion 6.0.3 + * @apiName markNotificationThreadAsRead + * @apiDescription Mark a notification thread as read. + * @apiGroup activity + * + * @apiParam {String} id + * @apiExample {js} ex: +github.activity.markNotificationThreadAsRead({ ... }); + */ + +/** + * @api {put} /notifications markNotificationsAsRead + * @apiVersion 6.0.3 + * @apiName markNotificationsAsRead + * @apiDescription Mark notifications as read for authenticated user. + * @apiGroup activity + * + * @apiParam {String} [last_read_at=Time.now] Describes the last point that notifications were checked. Anything updated since this time will not be updated. This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ. Default: Time.now + * @apiExample {js} ex: +github.activity.markNotificationsAsRead({ ... }); + */ + +/** + * @api {put} /repos/:owner/:repo/notifications markNotificationsAsReadForRepo + * @apiVersion 6.0.3 + * @apiName markNotificationsAsReadForRepo + * @apiDescription Mark notifications in a repo as read. + * @apiGroup activity + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} [last_read_at=Time.now] Describes the last point that notifications were checked. Anything updated since this time will not be updated. This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ. Default: Time.now + * @apiExample {js} ex: +github.activity.markNotificationsAsReadForRepo({ ... }); + */ + +/** + * @api {put} /notifications/threads/:id/subscription setNotificationThreadSubscription + * @apiVersion 6.0.3 + * @apiName setNotificationThreadSubscription + * @apiDescription This lets you subscribe or unsubscribe from a conversation. Unsubscribing from a conversation mutes all future notifications (until you comment or get @mentioned once more). + * @apiGroup activity + * + * @apiParam {String} id + * @apiParam {Boolean} [subscribed] Determines if notifications should be received from this thread + * @apiParam {Boolean} [ignored] Determines if all notifications should be blocked from this thread + * @apiExample {js} ex: +github.activity.setNotificationThreadSubscription({ ... }); + */ + +/** + * @api {put} /repos/:owner/:repo/subscription setRepoSubscription + * @apiVersion 6.0.3 + * @apiName setRepoSubscription + * @apiDescription Set a Repository Subscription + * @apiGroup activity + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Boolean} [subscribed] Determines if notifications should be received from this repository. + * @apiParam {Boolean} [ignored] Determines if all notifications should be blocked from this repository. + * @apiExample {js} ex: +github.activity.setRepoSubscription({ ... }); + */ + +/** + * @api {put} /user/starred/:owner/:repo starRepo + * @apiVersion 6.0.3 + * @apiName starRepo + * @apiDescription Star a repository + * @apiGroup activity + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiExample {js} ex: +github.activity.starRepo({ ... }); + */ + +/** + * @api {delete} /user/starred/:owner/:repo unstarRepo + * @apiVersion 6.0.3 + * @apiName unstarRepo + * @apiDescription Unstar a repository + * @apiGroup activity + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiExample {js} ex: +github.activity.unstarRepo({ ... }); + */ + +/** + * @api {delete} /repos/:owner/:repo/subscription unwatchRepo + * @apiVersion 6.0.3 + * @apiName unwatchRepo + * @apiDescription Unwatch a repository. + * @apiGroup activity + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiExample {js} ex: +github.activity.unwatchRepo({ ... }); + */ + +/** + * @api {get} /applications/:client_id/tokens/:access_token check + * @apiVersion 6.0.3 + * @apiName check + * @apiDescription Check an authorization + * @apiGroup authorization + * + * @apiParam {String} access_token OAuth token + * @apiParam {String} [client_id] The 20 character OAuth app client key for which to create the token. + * @apiExample {js} ex: +github.authorization.check({ ... }); + */ + +/** + * @api {post} /authorizations create + * @apiVersion 6.0.3 + * @apiName create + * @apiDescription Create a new authorization. + * @apiGroup authorization + * + * @apiParam {Array} [scopes] A list of scopes that this authorization is in. + * @apiParam {String} [note] A note to remind you what the OAuth token is for. + * @apiParam {String} [note_url] A URL to remind you what app the OAuth token is for. + * @apiParam {String} [client_id] The 20 character OAuth app client key for which to create the token. + * @apiParam {String} [client_secret] The 40 character OAuth app client secret for which to create the token. + * @apiParam {String} [fingerprint] A unique string to distinguish an authorization from others created for the same client ID and user. + * @apiExample {js} ex: +github.authorization.create({ ... }); + */ + +/** + * @api {delete} /authorizations/:id delete + * @apiVersion 6.0.3 + * @apiName delete + * @apiDescription Delete an authorization. + * @apiGroup authorization + * + * @apiParam {String} id + * @apiExample {js} ex: +github.authorization.delete({ ... }); + */ + +/** + * @api {delete} /applications/grants/:id deleteGrant + * @apiVersion 6.0.3 + * @apiName deleteGrant + * @apiDescription Delete a grant. + * @apiGroup authorization + * + * @apiParam {String} id + * @apiExample {js} ex: +github.authorization.deleteGrant({ ... }); + */ + +/** + * @api {get} /authorizations/:id get + * @apiVersion 6.0.3 + * @apiName get + * @apiDescription Get a single authorization. + * @apiGroup authorization + * + * @apiParam {String} id + * @apiExample {js} ex: +github.authorization.get({ ... }); + */ + +/** + * @api {get} /authorizations getAll + * @apiVersion 6.0.3 + * @apiName getAll + * @apiDescription List your authorizations. + * @apiGroup authorization + * + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.authorization.getAll({ ... }); + */ + +/** + * @api {get} /applications/grants/:id getGrant + * @apiVersion 6.0.3 + * @apiName getGrant + * @apiDescription Get a single grant. + * @apiGroup authorization + * + * @apiParam {String} id + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.authorization.getGrant({ ... }); + */ + +/** + * @api {get} /applications/grants getGrants + * @apiVersion 6.0.3 + * @apiName getGrants + * @apiDescription List your grants. + * @apiGroup authorization + * + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.authorization.getGrants({ ... }); + */ + +/** + * @api {put} /authorizations/clients/:client_id getOrCreateAuthorizationForApp + * @apiVersion 6.0.3 + * @apiName getOrCreateAuthorizationForApp + * @apiDescription Get or create an authorization for a specific app. + * @apiGroup authorization + * + * @apiParam {String} client_secret The 40 character OAuth app client secret associated with the client ID specified in the URL. + * @apiParam {String} [client_id] The 20 character OAuth app client key for which to create the token. + * @apiParam {Array} [scopes] A list of scopes that this authorization is in. + * @apiParam {String} [note] A note to remind you what the OAuth token is for. + * @apiParam {String} [note_url] A URL to remind you what app the OAuth token is for. + * @apiParam {String} [fingerprint] A unique string to distinguish an authorization from others created for the same client ID and user. + * @apiExample {js} ex: +github.authorization.getOrCreateAuthorizationForApp({ ... }); + */ + +/** + * @api {put} /authorizations/clients/:client_id/:fingerprint getOrCreateAuthorizationForAppAndFingerprint + * @apiVersion 6.0.3 + * @apiName getOrCreateAuthorizationForAppAndFingerprint + * @apiDescription Get or create an authorization for a specific app and fingerprint. + * @apiGroup authorization + * + * @apiParam {String} client_secret The 40 character OAuth app client secret associated with the client ID specified in the URL. + * @apiParam {String} [client_id] The 20 character OAuth app client key for which to create the token. + * @apiParam {String} [fingerprint] A unique string to distinguish an authorization from others created for the same client ID and user. + * @apiParam {Array} [scopes] A list of scopes that this authorization is in. + * @apiParam {String} [note] A note to remind you what the OAuth token is for. + * @apiParam {String} [note_url] A URL to remind you what app the OAuth token is for. + * @apiExample {js} ex: +github.authorization.getOrCreateAuthorizationForAppAndFingerprint({ ... }); + */ + +/** + * @api {post} /applications/:client_id/tokens/:access_token reset + * @apiVersion 6.0.3 + * @apiName reset + * @apiDescription Reset an authorization + * @apiGroup authorization + * + * @apiParam {String} access_token OAuth token + * @apiParam {String} [client_id] The 20 character OAuth app client key for which to create the token. + * @apiExample {js} ex: +github.authorization.reset({ ... }); + */ + +/** + * @api {delete} /applications/:client_id/tokens/:access_token revoke + * @apiVersion 6.0.3 + * @apiName revoke + * @apiDescription Revoke an authorization for an application + * @apiGroup authorization + * + * @apiParam {String} access_token OAuth token + * @apiParam {String} [client_id] The 20 character OAuth app client key for which to create the token. + * @apiExample {js} ex: +github.authorization.revoke({ ... }); + */ + +/** + * @api {patch} /authorizations/:id update + * @apiVersion 6.0.3 + * @apiName update + * @apiDescription Update an existing authorization. + * @apiGroup authorization + * + * @apiParam {String} id + * @apiParam {Array} [scopes] A list of scopes that this authorization is in. + * @apiParam {Array} [add_scopes] A list of scopes to add to this authorization. + * @apiParam {Array} [remove_scopes] A list of scopes to remove from this authorization. + * @apiParam {String} [note] A note to remind you what the OAuth token is for. + * @apiParam {String} [note_url] A URL to remind you what app the OAuth token is for. + * @apiParam {String} [fingerprint] A unique string to distinguish an authorization from others created for the same client ID and user. + * @apiExample {js} ex: +github.authorization.update({ ... }); + */ + +/** + * @api {post} /admin/organizations createOrg + * @apiVersion 6.0.3 + * @apiName createOrg + * @apiDescription Create an organization + * @apiGroup enterprise + * + * @apiParam {String} login The organization's username. + * @apiParam {String} admin The login of the user who will manage this organization. + * @apiParam {String} [profile_name] The organization's display name. + * @apiExample {js} ex: +github.enterprise.createOrg({ ... }); + */ + +/** + * @api {post} /admin/pre_receive_environments createPreReceiveEnvironment + * @apiVersion 6.0.3 + * @apiName createPreReceiveEnvironment + * @apiDescription Create a pre-receive environment. (In preview period. See README.) + * @apiGroup enterprise + * + * @apiParam {String} name The new pre-receive environment's name. + * @apiParam {String} image_url URL from which to download a tarball of this environment. + * @apiExample {js} ex: +github.enterprise.createPreReceiveEnvironment({ ... }); + */ + +/** + * @api {post} /admin/pre-receive-hooks createPreReceiveHook + * @apiVersion 6.0.3 + * @apiName createPreReceiveHook + * @apiDescription Create a pre-receive hook. (In preview period. See README.) + * @apiGroup enterprise + * + * @apiParam {String} name The name of the hook. + * @apiParam {String} script The script that the hook runs. + * @apiParam {Json} script_repository The GitHub repository where the script is kept. + * @apiParam {Json} environment The pre-receive environment where the script is executed. + * @apiParam {String} [enforcement=disabled] The state of enforcement for this hook. default: disabled + * @apiParam {Boolean} [allow_downstream_configuration=false] Whether enforcement can be overridden at the org or repo level. default: false + * @apiExample {js} ex: +github.enterprise.createPreReceiveHook({ ... }); + */ + +/** + * @api {delete} /admin/pre_receive_environments/:id deletePreReceiveEnvironment + * @apiVersion 6.0.3 + * @apiName deletePreReceiveEnvironment + * @apiDescription Delete a pre-receive environment. (In preview period. See README.) + * @apiGroup enterprise + * + * @apiParam {String} id + * @apiExample {js} ex: +github.enterprise.deletePreReceiveEnvironment({ ... }); + */ + +/** + * @api {delete} /admin/pre_receive_hooks/:id deletePreReceiveHook + * @apiVersion 6.0.3 + * @apiName deletePreReceiveHook + * @apiDescription Delete a pre-receive hook. (In preview period. See README.) + * @apiGroup enterprise + * + * @apiParam {String} id + * @apiExample {js} ex: +github.enterprise.deletePreReceiveHook({ ... }); + */ + +/** + * @api {patch} /admin/pre_receive_environments/:id editPreReceiveEnvironment + * @apiVersion 6.0.3 + * @apiName editPreReceiveEnvironment + * @apiDescription Create a pre-receive environment. (In preview period. See README.) + * @apiGroup enterprise + * + * @apiParam {String} id + * @apiParam {String} name This pre-receive environment's new name. + * @apiParam {String} image_url URL from which to download a tarball of this environment. + * @apiExample {js} ex: +github.enterprise.editPreReceiveEnvironment({ ... }); + */ + +/** + * @api {patch} /admin/pre_receive_hooks/:id editPreReceiveHook + * @apiVersion 6.0.3 + * @apiName editPreReceiveHook + * @apiDescription Edit a pre-receive hook. (In preview period. See README.) + * @apiGroup enterprise + * + * @apiParam {String} id + * @apiParam {Json} body JSON object that contains pre-receive hook info. + * @apiExample {js} ex: +github.enterprise.editPreReceiveHook({ ... }); + */ + +/** + * @api {get} /enterprise/settings/license getLicense + * @apiVersion 6.0.3 + * @apiName getLicense + * @apiDescription Get license information + * @apiGroup enterprise + * + * @apiExample {js} ex: +github.enterprise.getLicense({ ... }); + */ + +/** + * @api {get} /admin/pre-receive-environments/:id getPreReceiveEnvironment + * @apiVersion 6.0.3 + * @apiName getPreReceiveEnvironment + * @apiDescription Get a single pre-receive environment. (In preview period. See README.) + * @apiGroup enterprise + * + * @apiParam {String} id + * @apiExample {js} ex: +github.enterprise.getPreReceiveEnvironment({ ... }); + */ + +/** + * @api {get} /admin/pre-receive-environments/:id/downloads/latest getPreReceiveEnvironmentDownloadStatus + * @apiVersion 6.0.3 + * @apiName getPreReceiveEnvironmentDownloadStatus + * @apiDescription Get a pre-receive environment's download status. (In preview period. See README.) + * @apiGroup enterprise + * + * @apiParam {String} id + * @apiExample {js} ex: +github.enterprise.getPreReceiveEnvironmentDownloadStatus({ ... }); + */ + +/** + * @api {get} /admin/pre_receive_environments getPreReceiveEnvironments + * @apiVersion 6.0.3 + * @apiName getPreReceiveEnvironments + * @apiDescription List pre-receive environments. (In preview period. See README.) + * @apiGroup enterprise + * + * @apiExample {js} ex: +github.enterprise.getPreReceiveEnvironments({ ... }); + */ + +/** + * @api {get} /admin/pre-receive-hooks/:id getPreReceiveHook + * @apiVersion 6.0.3 + * @apiName getPreReceiveHook + * @apiDescription Get a single pre-receive hook. (In preview period. See README.) + * @apiGroup enterprise + * + * @apiParam {String} id + * @apiExample {js} ex: +github.enterprise.getPreReceiveHook({ ... }); + */ + +/** + * @api {get} /admin/pre-receive-hooks getPreReceiveHooks + * @apiVersion 6.0.3 + * @apiName getPreReceiveHooks + * @apiDescription List pre-receive hooks. (In preview period. See README.) + * @apiGroup enterprise + * + * @apiExample {js} ex: +github.enterprise.getPreReceiveHooks({ ... }); + */ + +/** + * @api {post} /staff/indexing_jobs queueIndexingJob + * @apiVersion 6.0.3 + * @apiName queueIndexingJob + * @apiDescription Queue an indexing job + * @apiGroup enterprise + * + * @apiParam {String} target A string representing the item to index. + * @apiExample {js} ex: +github.enterprise.queueIndexingJob({ ... }); + */ + +/** + * @api {get} /enterprise/stats/:type stats + * @apiVersion 6.0.3 + * @apiName stats + * @apiDescription Get statistics. + * @apiGroup enterprise + * + * @apiParam {String=issues,hooks,milestones,orgs,comments,pages,users,gists,pulls,repos,all} type Possible values: issues, hooks, milestones, orgs, comments, pages, users, gists, pulls, repos, all. + * @apiExample {js} ex: +github.enterprise.stats({ ... }); + */ + +/** + * @api {post} /admin/ldap/teams/:team_id/sync syncLdapForTeam + * @apiVersion 6.0.3 + * @apiName syncLdapForTeam + * @apiDescription Sync LDAP mapping for a team. + * @apiGroup enterprise + * + * @apiParam {Number} team_id + * @apiExample {js} ex: +github.enterprise.syncLdapForTeam({ ... }); + */ + +/** + * @api {post} /admin/ldap/users/:username/sync syncLdapForUser + * @apiVersion 6.0.3 + * @apiName syncLdapForUser + * @apiDescription Sync LDAP mapping for a user. + * @apiGroup enterprise + * + * @apiParam {String} username + * @apiExample {js} ex: +github.enterprise.syncLdapForUser({ ... }); + */ + +/** + * @api {post} /admin/pre_receive_environments/:id/downloads triggerPreReceiveEnvironmentDownload + * @apiVersion 6.0.3 + * @apiName triggerPreReceiveEnvironmentDownload + * @apiDescription Trigger a pre-receive environment download. (In preview period. See README.) + * @apiGroup enterprise + * + * @apiParam {String} id + * @apiExample {js} ex: +github.enterprise.triggerPreReceiveEnvironmentDownload({ ... }); + */ + +/** + * @api {patch} /admin/ldap/teams/:team_id/mapping updateLdapForTeam + * @apiVersion 6.0.3 + * @apiName updateLdapForTeam + * @apiDescription Update LDAP mapping for a team. + * @apiGroup enterprise + * + * @apiParam {Number} team_id + * @apiParam {String} ldap_dn LDAP DN for user + * @apiExample {js} ex: +github.enterprise.updateLdapForTeam({ ... }); + */ + +/** + * @api {patch} /admin/ldap/users/:username/mapping updateLdapForUser + * @apiVersion 6.0.3 + * @apiName updateLdapForUser + * @apiDescription Update LDAP mapping for a user. + * @apiGroup enterprise + * + * @apiParam {String} username + * @apiParam {String} ldap_dn LDAP DN for user + * @apiExample {js} ex: +github.enterprise.updateLdapForUser({ ... }); + */ + +/** + * @api {get} /gists/:id/star checkStar + * @apiVersion 6.0.3 + * @apiName checkStar + * @apiDescription Check if a gist is starred + * @apiGroup gists + * + * @apiParam {String} id + * @apiExample {js} ex: +github.gists.checkStar({ ... }); + */ + +/** + * @api {post} /gists create + * @apiVersion 6.0.3 + * @apiName create + * @apiDescription Create a gist + * @apiGroup gists + * + * @apiParam {Json} files Files that make up this gist. The key of which should be a required string filename and the value another required hash with parameters: 'content' + * @apiParam {Boolean} public + * @apiParam {String} [description] + * @apiExample {js} ex: +github.gists.create({ ... }); + */ + +/** + * @api {post} /gists/:gist_id/comments createComment + * @apiVersion 6.0.3 + * @apiName createComment + * @apiDescription Create a comment + * @apiGroup gists + * + * @apiParam {String} gist_id Id (SHA1 hash) of the gist. + * @apiParam {String} body + * @apiExample {js} ex: +github.gists.createComment({ ... }); + */ + +/** + * @api {delete} /gists/:id delete + * @apiVersion 6.0.3 + * @apiName delete + * @apiDescription Delete a gist + * @apiGroup gists + * + * @apiParam {String} id + * @apiExample {js} ex: +github.gists.delete({ ... }); + */ + +/** + * @api {delete} /gists/:gist_id/comments/:id deleteComment + * @apiVersion 6.0.3 + * @apiName deleteComment + * @apiDescription Delete a comment + * @apiGroup gists + * + * @apiParam {String} gist_id Id (SHA1 hash) of the gist. + * @apiParam {String} id + * @apiExample {js} ex: +github.gists.deleteComment({ ... }); + */ + +/** + * @api {patch} /gists/:id edit + * @apiVersion 6.0.3 + * @apiName edit + * @apiDescription Edit a gist + * @apiGroup gists + * + * @apiParam {String} id + * @apiParam {Json} files Files that make up this gist. The key of which should be a required string filename and the value another required hash with parameters: 'content' + * @apiParam {String} [description] + * @apiParam {String} [content] Updated file contents. + * @apiParam {String} [filename] New name for this file. + * @apiExample {js} ex: +github.gists.edit({ ... }); + */ + +/** + * @api {patch} /gists/:gist_id/comments/:id editComment + * @apiVersion 6.0.3 + * @apiName editComment + * @apiDescription Edit a comment + * @apiGroup gists + * + * @apiParam {String} gist_id Id (SHA1 hash) of the gist. + * @apiParam {String} id + * @apiParam {String} body + * @apiExample {js} ex: +github.gists.editComment({ ... }); + */ + +/** + * @api {post} /gists/:id/forks fork + * @apiVersion 6.0.3 + * @apiName fork + * @apiDescription Fork a gist + * @apiGroup gists + * + * @apiParam {String} id + * @apiExample {js} ex: +github.gists.fork({ ... }); + */ + +/** + * @api {get} /gists/:id get + * @apiVersion 6.0.3 + * @apiName get + * @apiDescription Get a single gist + * @apiGroup gists + * + * @apiParam {String} id + * @apiExample {js} ex: +github.gists.get({ ... }); + */ + +/** + * @api {get} /gists getAll + * @apiVersion 6.0.3 + * @apiName getAll + * @apiDescription List the authenticated user's gists or if called anonymously, this will return all public gists + * @apiGroup gists + * + * @apiParam {Date} [since] Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.gists.getAll({ ... }); + */ + +/** + * @api {get} /gists/:gist_id/comments/:id getComment + * @apiVersion 6.0.3 + * @apiName getComment + * @apiDescription Get a single comment + * @apiGroup gists + * + * @apiParam {String} gist_id Id (SHA1 hash) of the gist. + * @apiParam {String} id + * @apiExample {js} ex: +github.gists.getComment({ ... }); + */ + +/** + * @api {get} /gists/:gist_id/comments getComments + * @apiVersion 6.0.3 + * @apiName getComments + * @apiDescription List comments on a gist + * @apiGroup gists + * + * @apiParam {String} gist_id Id (SHA1 hash) of the gist. + * @apiExample {js} ex: +github.gists.getComments({ ... }); + */ + +/** + * @api {get} /gists/:id/commits getCommits + * @apiVersion 6.0.3 + * @apiName getCommits + * @apiDescription List gist commits + * @apiGroup gists + * + * @apiParam {String} id + * @apiExample {js} ex: +github.gists.getCommits({ ... }); + */ + +/** + * @api {get} /users/:username/gists getForUser + * @apiVersion 6.0.3 + * @apiName getForUser + * @apiDescription List a user's gists + * @apiGroup gists + * + * @apiParam {String} username + * @apiParam {Date} [since] Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.gists.getForUser({ ... }); + */ + +/** + * @api {get} /gists/:id/forks getForks + * @apiVersion 6.0.3 + * @apiName getForks + * @apiDescription List gist forks + * @apiGroup gists + * + * @apiParam {String} id + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.gists.getForks({ ... }); + */ + +/** + * @api {get} /gists/public getPublic + * @apiVersion 6.0.3 + * @apiName getPublic + * @apiDescription List all public gists + * @apiGroup gists + * + * @apiParam {Date} [since] Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ + * @apiExample {js} ex: +github.gists.getPublic({ ... }); + */ + +/** + * @api {get} /gists/:id/:sha getRevision + * @apiVersion 6.0.3 + * @apiName getRevision + * @apiDescription Get a specific revision of a gist + * @apiGroup gists + * + * @apiParam {String} id + * @apiParam {String} sha + * @apiExample {js} ex: +github.gists.getRevision({ ... }); + */ + +/** + * @api {get} /gists/starred getStarred + * @apiVersion 6.0.3 + * @apiName getStarred + * @apiDescription List the authenticated user's starred gists + * @apiGroup gists + * + * @apiParam {Date} [since] Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ + * @apiExample {js} ex: +github.gists.getStarred({ ... }); + */ + +/** + * @api {put} /gists/:id/star star + * @apiVersion 6.0.3 + * @apiName star + * @apiDescription Star a gist + * @apiGroup gists + * + * @apiParam {String} id + * @apiExample {js} ex: +github.gists.star({ ... }); + */ + +/** + * @api {delete} /gists/:id/star unstar + * @apiVersion 6.0.3 + * @apiName unstar + * @apiDescription Unstar a gist + * @apiGroup gists + * + * @apiParam {String} id + * @apiExample {js} ex: +github.gists.unstar({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/git/blobs createBlob + * @apiVersion 6.0.3 + * @apiName createBlob + * @apiDescription Create a Blob + * @apiGroup gitdata + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} content + * @apiParam {String} encoding + * @apiExample {js} ex: +github.gitdata.createBlob({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/git/commits createCommit + * @apiVersion 6.0.3 + * @apiName createCommit + * @apiDescription Create a Commit + * @apiGroup gitdata + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} message String of the commit message + * @apiParam {String} tree String of the SHA of the tree object this commit points to + * @apiParam {Array} parents Array of the SHAs of the commits that were the parents of this commit. If omitted or empty, the commit will be written as a root commit. For a single parent, an array of one SHA should be provided, for a merge commit, an array of more than one should be provided. + * @apiParam {Json} [author] + * @apiParam {Json} [committer] + * @apiExample {js} ex: +github.gitdata.createCommit({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/git/refs createReference + * @apiVersion 6.0.3 + * @apiName createReference + * @apiDescription Create a Reference + * @apiGroup gitdata + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} ref The name of the fully qualified reference (ie: refs/heads/master). If it doesn't start with 'refs' and have at least two slashes, it will be rejected. + * @apiParam {String} sha + * @apiExample {js} ex: +github.gitdata.createReference({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/git/tags createTag + * @apiVersion 6.0.3 + * @apiName createTag + * @apiDescription Create a Tag Object + * @apiGroup gitdata + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} tag String of the tag + * @apiParam {String} message String of the tag message + * @apiParam {String} object String of the SHA of the git object this is tagging + * @apiParam {String} type String of the type of the object we’re tagging. Normally this is a commit but it can also be a tree or a blob. + * @apiParam {Json} tagger JSON object that contains the following keys: `name` - String of the name of the author of the tag, `email` - String of the email of the author of the tag, `date` - Timestamp of when this object was tagged + * @apiExample {js} ex: +github.gitdata.createTag({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/git/trees createTree + * @apiVersion 6.0.3 + * @apiName createTree + * @apiDescription Create a Tree + * @apiGroup gitdata + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Json} tree Array of Hash objects (of path, mode, type and sha) specifying a tree structure + * @apiParam {String} [base_tree] String of the SHA1 of the tree you want to update with new data + * @apiExample {js} ex: +github.gitdata.createTree({ ... }); + */ + +/** + * @api {delete} /repos/:owner/:repo/git/refs/:ref deleteReference + * @apiVersion 6.0.3 + * @apiName deleteReference + * @apiDescription Delete a Reference + * @apiGroup gitdata + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} ref String of the name of the fully qualified reference (ie: heads/master). If it doesn’t have at least one slash, it will be rejected. + * @apiExample {js} ex: +github.gitdata.deleteReference({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/git/blobs/:sha getBlob + * @apiVersion 6.0.3 + * @apiName getBlob + * @apiDescription Get a Blob + * @apiGroup gitdata + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} sha + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.gitdata.getBlob({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/git/commits/:sha getCommit + * @apiVersion 6.0.3 + * @apiName getCommit + * @apiDescription Get a Commit + * @apiGroup gitdata + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} sha + * @apiExample {js} ex: +github.gitdata.getCommit({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/git/commits/:sha getCommitSignatureVerification + * @apiVersion 6.0.3 + * @apiName getCommitSignatureVerification + * @apiDescription Get a Commit Signature Verification. (In preview period. See README.) + * @apiGroup gitdata + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} sha + * @apiExample {js} ex: +github.gitdata.getCommitSignatureVerification({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/git/refs/:ref getReference + * @apiVersion 6.0.3 + * @apiName getReference + * @apiDescription Get a Reference + * @apiGroup gitdata + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} ref String of the name of the fully qualified reference (ie: heads/master). If it doesn’t have at least one slash, it will be rejected. + * @apiExample {js} ex: +github.gitdata.getReference({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/git/refs getReferences + * @apiVersion 6.0.3 + * @apiName getReferences + * @apiDescription Get all References + * @apiGroup gitdata + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.gitdata.getReferences({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/git/tags/:sha getTag + * @apiVersion 6.0.3 + * @apiName getTag + * @apiDescription Get a Tag + * @apiGroup gitdata + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} sha + * @apiExample {js} ex: +github.gitdata.getTag({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/git/tags/:sha getTagSignatureVerification + * @apiVersion 6.0.3 + * @apiName getTagSignatureVerification + * @apiDescription Get a Tag Signature Verification. (In preview period. See README.) + * @apiGroup gitdata + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} sha + * @apiExample {js} ex: +github.gitdata.getTagSignatureVerification({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/git/refs/tags getTags + * @apiVersion 6.0.3 + * @apiName getTags + * @apiDescription Get all tag References + * @apiGroup gitdata + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.gitdata.getTags({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/git/trees/:sha getTree + * @apiVersion 6.0.3 + * @apiName getTree + * @apiDescription Get a Tree + * @apiGroup gitdata + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} sha + * @apiParam {Boolean} [recursive] + * @apiExample {js} ex: +github.gitdata.getTree({ ... }); + */ + +/** + * @api {patch} /repos/:owner/:repo/git/refs/:ref updateReference + * @apiVersion 6.0.3 + * @apiName updateReference + * @apiDescription Update a Reference + * @apiGroup gitdata + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} ref String of the name of the fully qualified reference (ie: heads/master). If it doesn’t have at least one slash, it will be rejected. + * @apiParam {String} sha + * @apiParam {Boolean} [force=false] Boolean indicating whether to force the update or to make sure the update is a fast-forward update. The default is false, so leaving this out or setting it to false will make sure you’re not overwriting work. + * @apiExample {js} ex: +github.gitdata.updateReference({ ... }); + */ + +/** + * @api {post} /installations/:installation_id/repositories/:repository_id addRepoToInstallation + * @apiVersion 6.0.3 + * @apiName addRepoToInstallation + * @apiDescription Add a single repository to an installation. (In preview period. See README.) + * @apiGroup integrations + * + * @apiParam {String} installation_id + * @apiParam {String} repository_id + * @apiExample {js} ex: +github.integrations.addRepoToInstallation({ ... }); + */ + +/** + * @api {post} /installations/:installation_id/access_tokens createInstallationToken + * @apiVersion 6.0.3 + * @apiName createInstallationToken + * @apiDescription Create a new installation token. (In preview period. See README.) + * @apiGroup integrations + * + * @apiParam {String} installation_id + * @apiParam {String} [user_id] The id of the user for whom the integration is acting on behalf of. + * @apiExample {js} ex: +github.integrations.createInstallationToken({ ... }); + */ + +/** + * @api {get} /installation/repositories getInstallationRepositories + * @apiVersion 6.0.3 + * @apiName getInstallationRepositories + * @apiDescription List repositories that are accessible to the authenticated installation. (In preview period. See README.) + * @apiGroup integrations + * + * @apiParam {String} [user_id] The integer ID of a user, to filter results to repositories that are visible to both the installation and the given user. + * @apiExample {js} ex: +github.integrations.getInstallationRepositories({ ... }); + */ + +/** + * @api {get} /integration/installations getInstallations + * @apiVersion 6.0.3 + * @apiName getInstallations + * @apiDescription List the integration's installations. (In preview period. See README.) + * @apiGroup integrations + * + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.integrations.getInstallations({ ... }); + */ + +/** + * @api {post} /integration/identity/user getUserIdentity + * @apiVersion 6.0.3 + * @apiName getUserIdentity + * @apiDescription Request identity of user. (In preview period. See README.) + * @apiGroup integrations + * + * @apiParam {String} [nonce] + * @apiExample {js} ex: +github.integrations.getUserIdentity({ ... }); + */ + +/** + * @api {post} /installations/:installation_id/repositories/:repository_id removeRepoFromInstallation + * @apiVersion 6.0.3 + * @apiName removeRepoFromInstallation + * @apiDescription Remove a single repository from an installation. (In preview period. See README.) + * @apiGroup integrations + * + * @apiParam {String} installation_id + * @apiParam {String} repository_id + * @apiExample {js} ex: +github.integrations.removeRepoFromInstallation({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/issues/:number/assignees addAssigneesToIssue + * @apiVersion 6.0.3 + * @apiName addAssigneesToIssue + * @apiDescription Add assignees to an issue. + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiParam {Array} assignees Logins for the users that should be added to the issue. + * @apiExample {js} ex: +github.issues.addAssigneesToIssue({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/issues/:number/labels addLabels + * @apiVersion 6.0.3 + * @apiName addLabels + * @apiDescription Add labels to an issue + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiParam {Array} body + * @apiExample {js} ex: +github.issues.addLabels({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/assignees/:assignee checkAssignee + * @apiVersion 6.0.3 + * @apiName checkAssignee + * @apiDescription Check assignee + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} assignee Login for the user that this issue should be assigned to. + * @apiExample {js} ex: +github.issues.checkAssignee({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/issues create + * @apiVersion 6.0.3 + * @apiName create + * @apiDescription Create an issue + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} title + * @apiParam {String} [body] + * @apiParam {String} [assignee] Login for the user that this issue should be assigned to. + * @apiParam {Number} [milestone] Milestone to associate this issue with. + * @apiParam {Json} [labels] Array of strings - Labels to associate with this issue. + * @apiParam {Array} [assignees] Logins for Users to assign to this issue. NOTE: Only users with push access can set assignees for new issues. Assignees are silently dropped otherwise. + * @apiExample {js} ex: +github.issues.create({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/issues/:number/comments createComment + * @apiVersion 6.0.3 + * @apiName createComment + * @apiDescription Create a comment + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiParam {String} body + * @apiExample {js} ex: +github.issues.createComment({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/labels createLabel + * @apiVersion 6.0.3 + * @apiName createLabel + * @apiDescription Create a label + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} name + * @apiParam {String} color 6 character hex code, without a leading #. + * @apiExample {js} ex: +github.issues.createLabel({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/milestones createMilestone + * @apiVersion 6.0.3 + * @apiName createMilestone + * @apiDescription Create a milestone + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} title + * @apiParam {String=open,closed,all} [state=open] + * @apiParam {String} [description] + * @apiParam {Date} [due_on] Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ + * @apiExample {js} ex: +github.issues.createMilestone({ ... }); + */ + +/** + * @api {delete} /repos/:owner/:repo/issues/comments/:id deleteComment + * @apiVersion 6.0.3 + * @apiName deleteComment + * @apiDescription Delete a comment + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiExample {js} ex: +github.issues.deleteComment({ ... }); + */ + +/** + * @api {delete} /repos/:owner/:repo/labels/:name deleteLabel + * @apiVersion 6.0.3 + * @apiName deleteLabel + * @apiDescription Delete a label + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} name + * @apiExample {js} ex: +github.issues.deleteLabel({ ... }); + */ + +/** + * @api {delete} /repos/:owner/:repo/milestones/:number deleteMilestone + * @apiVersion 6.0.3 + * @apiName deleteMilestone + * @apiDescription Delete a milestone + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiExample {js} ex: +github.issues.deleteMilestone({ ... }); + */ + +/** + * @api {patch} /repos/:owner/:repo/issues/:number edit + * @apiVersion 6.0.3 + * @apiName edit + * @apiDescription Edit an issue + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiParam {String} [title] + * @apiParam {String} [body] + * @apiParam {String} [assignee] Login for the user that this issue should be assigned to. + * @apiParam {String=open,closed} [state=open] open or closed + * @apiParam {Number} [milestone] Milestone to associate this issue with. + * @apiParam {Json} [labels] Array of strings - Labels to associate with this issue. + * @apiParam {Array} [assignees] Logins for Users to assign to this issue. Pass one or more user logins to replace the set of assignees on this Issue. .Send an empty array ([]) to clear all assignees from the Issue. NOTE: Only users with push access can set assignees for new issues. Assignees are silently dropped otherwise. + * @apiExample {js} ex: +github.issues.edit({ ... }); + */ + +/** + * @api {patch} /repos/:owner/:repo/issues/comments/:id editComment + * @apiVersion 6.0.3 + * @apiName editComment + * @apiDescription Edit a comment + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiParam {String} body + * @apiExample {js} ex: +github.issues.editComment({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/issues/:number get + * @apiVersion 6.0.3 + * @apiName get + * @apiDescription Get a single issue + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiExample {js} ex: +github.issues.get({ ... }); + */ + +/** + * @api {get} /issues getAll + * @apiVersion 6.0.3 + * @apiName getAll + * @apiDescription List all issues across all the authenticated user's visible repositories including owned repositories, member repositories, and organization repositories + * @apiGroup issues + * + * @apiParam {String=all,assigned,created,mentioned,subscribed} [filter] + * @apiParam {String=open,closed,all} [state=open] open, closed, or all + * @apiParam {String} [labels] String list of comma separated Label names. Example: bug,ui,@high + * @apiParam {String=created,updated,comments} [sort=created] + * @apiParam {String=asc,desc} [direction=desc] + * @apiParam {Date} [since] Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.issues.getAll({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/assignees getAssignees + * @apiVersion 6.0.3 + * @apiName getAssignees + * @apiDescription List assignees + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiExample {js} ex: +github.issues.getAssignees({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/issues/comments/:id getComment + * @apiVersion 6.0.3 + * @apiName getComment + * @apiDescription Get a single comment + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiExample {js} ex: +github.issues.getComment({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/issues/:number/comments getComments + * @apiVersion 6.0.3 + * @apiName getComments + * @apiDescription List comments on an issue + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.issues.getComments({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/issues/comments getCommentsForRepo + * @apiVersion 6.0.3 + * @apiName getCommentsForRepo + * @apiDescription List comments in a repository + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String=created,updated} [sort=created] + * @apiParam {String=asc,desc} [direction=desc] + * @apiParam {Date} [since] Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.issues.getCommentsForRepo({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/issues/events/:id getEvent + * @apiVersion 6.0.3 + * @apiName getEvent + * @apiDescription Get a single event + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiExample {js} ex: +github.issues.getEvent({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/issues/:issue_number/events getEvents + * @apiVersion 6.0.3 + * @apiName getEvents + * @apiDescription List events for an issue + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} issue_number + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.issues.getEvents({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/issues/events getEventsForRepo + * @apiVersion 6.0.3 + * @apiName getEventsForRepo + * @apiDescription List events for a repository + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.issues.getEventsForRepo({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/issues/:issue_number/timeline getEventsTimeline + * @apiVersion 6.0.3 + * @apiName getEventsTimeline + * @apiDescription List events for an issue. (In preview period. See README.) + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} issue_number + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.issues.getEventsTimeline({ ... }); + */ + +/** + * @api {get} /orgs/:org/issues getForOrg + * @apiVersion 6.0.3 + * @apiName getForOrg + * @apiDescription List all issues for a given organization for the authenticated user + * @apiGroup issues + * + * @apiParam {String} org + * @apiParam {String=all,assigned,created,mentioned,subscribed} [filter] + * @apiParam {String=open,closed,all} [state=open] open, closed, or all + * @apiParam {String} [labels] String list of comma separated Label names. Example: bug,ui,@high + * @apiParam {String=created,updated,comments} [sort=created] + * @apiParam {String=asc,desc} [direction=desc] + * @apiParam {Date} [since] Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.issues.getForOrg({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/issues getForRepo + * @apiVersion 6.0.3 + * @apiName getForRepo + * @apiDescription List issues for a repository + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} [milestone] + * @apiParam {String=open,closed,all} [state=open] open, closed, or all + * @apiParam {String} [assignee] String User login, `none` for Issues with no assigned User. `*` for Issues with any assigned User. + * @apiParam {String} [creator] The user that created the issue. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiParam {String} [labels] String list of comma separated Label names. Example: bug,ui,@high + * @apiParam {String=created,updated,comments} [sort=created] + * @apiParam {String=asc,desc} [direction=desc] + * @apiParam {Date} [since] Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {String} [mentioned] String User login. + * @apiExample {js} ex: +github.issues.getForRepo({ ... }); + */ + +/** + * @api {get} /user/issues getForUser + * @apiVersion 6.0.3 + * @apiName getForUser + * @apiDescription List all issues across owned and member repositories for the authenticated user + * @apiGroup issues + * + * @apiParam {String=all,assigned,created,mentioned,subscribed} [filter] + * @apiParam {String=open,closed,all} [state=open] open, closed, or all + * @apiParam {String} [labels] String list of comma separated Label names. Example: bug,ui,@high + * @apiParam {String=created,updated,comments} [sort=created] + * @apiParam {String=asc,desc} [direction=desc] + * @apiParam {Date} [since] Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.issues.getForUser({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/issues/:number/labels getIssueLabels + * @apiVersion 6.0.3 + * @apiName getIssueLabels + * @apiDescription List labels on an issue + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiExample {js} ex: +github.issues.getIssueLabels({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/labels/:name getLabel + * @apiVersion 6.0.3 + * @apiName getLabel + * @apiDescription Get a single label + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} name + * @apiExample {js} ex: +github.issues.getLabel({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/labels getLabels + * @apiVersion 6.0.3 + * @apiName getLabels + * @apiDescription List all labels for this repository + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.issues.getLabels({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/milestones/:number getMilestone + * @apiVersion 6.0.3 + * @apiName getMilestone + * @apiDescription Get a single milestone + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiExample {js} ex: +github.issues.getMilestone({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/milestones/:number/labels getMilestoneLabels + * @apiVersion 6.0.3 + * @apiName getMilestoneLabels + * @apiDescription Get labels for every issue in a milestone + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiExample {js} ex: +github.issues.getMilestoneLabels({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/milestones getMilestones + * @apiVersion 6.0.3 + * @apiName getMilestones + * @apiDescription List milestones for a repository + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String=open,closed,all} [state=open] + * @apiParam {String=due_on,completeness} [sort=due_on] due_on, completeness, default: due_on + * @apiParam {String=asc,desc} [direction=asc] + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.issues.getMilestones({ ... }); + */ + +/** + * @api {put} /repos/:owner/:repo/issues/:number/lock lock + * @apiVersion 6.0.3 + * @apiName lock + * @apiDescription Users with push access can lock an issue's conversation. + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiExample {js} ex: +github.issues.lock({ ... }); + */ + +/** + * @api {delete} /repos/:owner/:repo/issues/:number/labels removeAllLabels + * @apiVersion 6.0.3 + * @apiName removeAllLabels + * @apiDescription Remove all labels from an issue + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiExample {js} ex: +github.issues.removeAllLabels({ ... }); + */ + +/** + * @api {delete} /repos/:owner/:repo/issues/:number/assignees removeAssigneesFromIssue + * @apiVersion 6.0.3 + * @apiName removeAssigneesFromIssue + * @apiDescription Remove assignees from an issue. + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiParam {Json} body JSON object that contains assignees array of logins for the users that should be removed from the issue. + * @apiExample {js} ex: +github.issues.removeAssigneesFromIssue({ ... }); + */ + +/** + * @api {delete} /repos/:owner/:repo/issues/:number/labels/:name removeLabel + * @apiVersion 6.0.3 + * @apiName removeLabel + * @apiDescription Remove a label from an issue + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiParam {String} name + * @apiExample {js} ex: +github.issues.removeLabel({ ... }); + */ + +/** + * @api {put} /repos/:owner/:repo/issues/:number/labels replaceAllLabels + * @apiVersion 6.0.3 + * @apiName replaceAllLabels + * @apiDescription Replace all labels for an issue + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiParam {Array} body Sending an empty array ([]) will remove all Labels from the Issue. + * @apiExample {js} ex: +github.issues.replaceAllLabels({ ... }); + */ + +/** + * @api {delete} /repos/:owner/:repo/issues/:number/lock unlock + * @apiVersion 6.0.3 + * @apiName unlock + * @apiDescription Users with push access can unlock an issue's conversation. + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiExample {js} ex: +github.issues.unlock({ ... }); + */ + +/** + * @api {patch} /repos/:owner/:repo/labels/:oldname updateLabel + * @apiVersion 6.0.3 + * @apiName updateLabel + * @apiDescription Update a label + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} oldname The old name of the label. + * @apiParam {String} name The new name of the label. + * @apiParam {String} color 6 character hex code, without a leading #. + * @apiExample {js} ex: +github.issues.updateLabel({ ... }); + */ + +/** + * @api {patch} /repos/:owner/:repo/milestones/:number updateMilestone + * @apiVersion 6.0.3 + * @apiName updateMilestone + * @apiDescription Update a milestone + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiParam {String} title + * @apiParam {String=open,closed,all} [state=open] + * @apiParam {String} [description] + * @apiParam {Date} [due_on] Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ + * @apiExample {js} ex: +github.issues.updateMilestone({ ... }); + */ + +/** + * @api {delete} /repos/:owner/:repo/import cancelImport + * @apiVersion 6.0.3 + * @apiName cancelImport + * @apiDescription Cancel an import. (In preview period. See README.) + * @apiGroup migrations + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiExample {js} ex: +github.migrations.cancelImport({ ... }); + */ + +/** + * @api {delete} /orgs/:org/migrations/:id/archive deleteMigrationArchive + * @apiVersion 6.0.3 + * @apiName deleteMigrationArchive + * @apiDescription Delete a migration archive. (In preview period. See README.) + * @apiGroup migrations + * + * @apiParam {String} org + * @apiParam {String} id + * @apiExample {js} ex: +github.migrations.deleteMigrationArchive({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/import/authors getImportCommitAuthors + * @apiVersion 6.0.3 + * @apiName getImportCommitAuthors + * @apiDescription Get import commit authors. (In preview period. See README.) + * @apiGroup migrations + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} [since] Only authors found after this id are returned. Provide the highest author ID you've seen so far. New authors may be added to the list at any point while the importer is performing the raw step. + * @apiExample {js} ex: +github.migrations.getImportCommitAuthors({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/import getImportProgress + * @apiVersion 6.0.3 + * @apiName getImportProgress + * @apiDescription Get import progress. (In preview period. See README.) + * @apiGroup migrations + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiExample {js} ex: +github.migrations.getImportProgress({ ... }); + */ + +/** + * @api {get} /:owner/:name/import/large_files getLargeImportFiles + * @apiVersion 6.0.3 + * @apiName getLargeImportFiles + * @apiDescription List files larger than 100MB found during the import. (In preview period. See README.) + * @apiGroup migrations + * + * @apiParam {String} owner + * @apiParam {String} name + * @apiExample {js} ex: +github.migrations.getLargeImportFiles({ ... }); + */ + +/** + * @api {get} /orgs/:org/migrations/:id/archive getMigrationArchiveLink + * @apiVersion 6.0.3 + * @apiName getMigrationArchiveLink + * @apiDescription Get the URL to a migration archive. (In preview period. See README.) + * @apiGroup migrations + * + * @apiParam {String} org + * @apiParam {String} id + * @apiExample {js} ex: +github.migrations.getMigrationArchiveLink({ ... }); + */ + +/** + * @api {get} /orgs/:org/migrations/:id getMigrationStatus + * @apiVersion 6.0.3 + * @apiName getMigrationStatus + * @apiDescription Get the status of a migration. (In preview period. See README.) + * @apiGroup migrations + * + * @apiParam {String} org + * @apiParam {String} id + * @apiExample {js} ex: +github.migrations.getMigrationStatus({ ... }); + */ + +/** + * @api {get} /orgs/:org/migrations getMigrations + * @apiVersion 6.0.3 + * @apiName getMigrations + * @apiDescription Get a list of migrations. (In preview period. See README.) + * @apiGroup migrations + * + * @apiParam {String} org + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.migrations.getMigrations({ ... }); + */ + +/** + * @api {patch} /repos/:owner/:repo/import/authors/:author_id mapImportCommitAuthor + * @apiVersion 6.0.3 + * @apiName mapImportCommitAuthor + * @apiDescription Map a commit author. (In preview period. See README.) + * @apiGroup migrations + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} author_id The commit author id. + * @apiParam {String} [email] The new Git author email. + * @apiParam {String} [name] The new Git author name. + * @apiExample {js} ex: +github.migrations.mapImportCommitAuthor({ ... }); + */ + +/** + * @api {patch} /:owner/:name/import/lfs setImportLfsPreference + * @apiVersion 6.0.3 + * @apiName setImportLfsPreference + * @apiDescription Set import LFS preference. (In preview period. See README.) + * @apiGroup migrations + * + * @apiParam {String} owner + * @apiParam {String} name + * @apiParam {String} use_lfs Can be one of `opt_in` (large files will be stored using Git LFS) or `opt_out` (large files will be removed during the import). + * @apiExample {js} ex: +github.migrations.setImportLfsPreference({ ... }); + */ + +/** + * @api {put} /repos/:owner/:repo/import startImport + * @apiVersion 6.0.3 + * @apiName startImport + * @apiDescription Start an import. (In preview period. See README.) + * @apiGroup migrations + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} vcs_url The URL of the originating repository. + * @apiParam {String=subversion,git,mercurial,tfvc} [vcs] The originating VCS type. Please be aware that without this parameter, the import job will take additional time to detect the VCS type before beginning the import. This detection step will be reflected in the response. + * @apiParam {String} [vcs_username] If authentication is required, the username to provide to vcs_url. + * @apiParam {String} [vcs_password] If authentication is required, the password to provide to vcs_url. + * @apiParam {String} [tfvc_project] For a tfvc import, the name of the project that is being imported. + * @apiExample {js} ex: +github.migrations.startImport({ ... }); + */ + +/** + * @api {post} /orgs/:org/migrations startMigration + * @apiVersion 6.0.3 + * @apiName startMigration + * @apiDescription Start a migration. (In preview period. See README.) + * @apiGroup migrations + * + * @apiParam {String} org + * @apiParam {Array} repositories A list of arrays indicating which repositories should be migrated. + * @apiParam {Boolean} [lock_repositories=false] Indicates whether repositories should be locked (to prevent manipulation) while migrating data. Default: false. + * @apiParam {Boolean} [exclude_attachments=false] Indicates whether attachments should be excluded from the migration (to reduce migration archive file size). Default: false. + * @apiExample {js} ex: +github.migrations.startMigration({ ... }); + */ + +/** + * @api {delete} /orgs/:org/migrations/:id/repos/:repo_name/lock unlockRepoLockedForMigration + * @apiVersion 6.0.3 + * @apiName unlockRepoLockedForMigration + * @apiDescription Unlock a repository that was locked for migration. (In preview period. See README.) + * @apiGroup migrations + * + * @apiParam {String} org + * @apiParam {String} id + * @apiParam {String} repo_name + * @apiExample {js} ex: +github.migrations.unlockRepoLockedForMigration({ ... }); + */ + +/** + * @api {patch} /repos/:owner/:repo/import updateImport + * @apiVersion 6.0.3 + * @apiName updateImport + * @apiDescription Update existing import. (In preview period. See README.) + * @apiGroup migrations + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiExample {js} ex: +github.migrations.updateImport({ ... }); + */ + +/** + * @api {get} /emojis getEmojis + * @apiVersion 6.0.3 + * @apiName getEmojis + * @apiDescription Lists all the emojis available to use on GitHub. + * @apiGroup misc + * + * @apiExample {js} ex: +github.misc.getEmojis({ ... }); + */ + +/** + * @api {get} /gitignore/templates/:name getGitignoreTemplate + * @apiVersion 6.0.3 + * @apiName getGitignoreTemplate + * @apiDescription Get a single gitignore template + * @apiGroup misc + * + * @apiParam {String} name The name of the .gitignore template to get e.g. 'C' + * @apiExample {js} ex: +github.misc.getGitignoreTemplate({ ... }); + */ + +/** + * @api {get} /gitignore/templates getGitignoreTemplates + * @apiVersion 6.0.3 + * @apiName getGitignoreTemplates + * @apiDescription Lists available gitignore templates + * @apiGroup misc + * + * @apiExample {js} ex: +github.misc.getGitignoreTemplates({ ... }); + */ + +/** + * @api {get} /licenses/:license getLicense + * @apiVersion 6.0.3 + * @apiName getLicense + * @apiDescription Get an individual license. (In preview period. See README.) + * @apiGroup misc + * + * @apiParam {String} license Ex: /licenses/mit + * @apiExample {js} ex: +github.misc.getLicense({ ... }); + */ + +/** + * @api {get} /licenses getLicenses + * @apiVersion 6.0.3 + * @apiName getLicenses + * @apiDescription List all licenses. (In preview period. See README.) + * @apiGroup misc + * + * @apiExample {js} ex: +github.misc.getLicenses({ ... }); + */ + +/** + * @api {get} /meta getMeta + * @apiVersion 6.0.3 + * @apiName getMeta + * @apiDescription This endpoint provides information about GitHub.com, the service. Or, if you access this endpoint on your organization's GitHub Enterprise installation, this endpoint provides information about that installation. + * @apiGroup misc + * + * @apiExample {js} ex: +github.misc.getMeta({ ... }); + */ + +/** + * @api {get} /rate_limit getRateLimit + * @apiVersion 6.0.3 + * @apiName getRateLimit + * @apiDescription Get your current rate limit status + * @apiGroup misc + * + * @apiExample {js} ex: +github.misc.getRateLimit({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/license getRepoLicense + * @apiVersion 6.0.3 + * @apiName getRepoLicense + * @apiDescription Get the contents of a repository's license. (In preview period. See README.) + * @apiGroup misc + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiExample {js} ex: +github.misc.getRepoLicense({ ... }); + */ + +/** + * @api {post} /markdown renderMarkdown + * @apiVersion 6.0.3 + * @apiName renderMarkdown + * @apiDescription Render an arbitrary Markdown document + * @apiGroup misc + * + * @apiParam {String} text The Markdown text to render + * @apiParam {String=markdown,gfm} [mode=markdown] The rendering mode, `markdown` to render a document as plain Markdown, just like README files are rendered. `gfm` to render a document as user-content, e.g. like user comments or issues are rendered. In GFM mode, hard line breaks are always taken into account, and issue and user mentions are linked accordingly. + * @apiParam {String} [context] The repository context. Only taken into account when rendering as `gfm` + * @apiExample {js} ex: +github.misc.renderMarkdown({ ... }); + */ + +/** + * @api {post} /markdown/raw renderMarkdownRaw + * @apiVersion 6.0.3 + * @apiName renderMarkdownRaw + * @apiDescription Render a Markdown document in raw mode + * @apiGroup misc + * + * @apiParam {String} data Raw data to send as the body of the request + * @apiExample {js} ex: +github.misc.renderMarkdownRaw({ ... }); + */ + +/** + * @api {put} /orgs/:org/memberships/:username addOrgMembership + * @apiVersion 6.0.3 + * @apiName addOrgMembership + * @apiDescription Add or update organization membership + * @apiGroup orgs + * + * @apiParam {String} org + * @apiParam {String} username + * @apiParam {String=admin,member} role The role to give the user in the organization. + * @apiExample {js} ex: +github.orgs.addOrgMembership({ ... }); + */ + +/** + * @api {put} /teams/:id/memberships/:username addTeamMembership + * @apiVersion 6.0.3 + * @apiName addTeamMembership + * @apiDescription Add team membership + * @apiGroup orgs + * + * @apiParam {String} id + * @apiParam {String} username + * @apiParam {String=member,maintainer} [role=member] The role that this user should have in the team. + * @apiExample {js} ex: +github.orgs.addTeamMembership({ ... }); + */ + +/** + * @api {put} /teams/:id/repos/:org/:repo addTeamRepo + * @apiVersion 6.0.3 + * @apiName addTeamRepo + * @apiDescription Add team repository + * @apiGroup orgs + * + * @apiParam {String} id + * @apiParam {String} org + * @apiParam {String} repo + * @apiParam {String=pull,push,admin} [permission] `pull` - team members can pull, but not push or administer this repository, `push` - team members can pull and push, but not administer this repository, `admin` - team members can pull, push and administer this repository. + * @apiExample {js} ex: +github.orgs.addTeamRepo({ ... }); + */ + +/** + * @api {get} /orgs/:org/members/:username checkMembership + * @apiVersion 6.0.3 + * @apiName checkMembership + * @apiDescription Check membership + * @apiGroup orgs + * + * @apiParam {String} org + * @apiParam {String} username + * @apiExample {js} ex: +github.orgs.checkMembership({ ... }); + */ + +/** + * @api {get} /orgs/:org/public_members/:username checkPublicMembership + * @apiVersion 6.0.3 + * @apiName checkPublicMembership + * @apiDescription Check public membership + * @apiGroup orgs + * + * @apiParam {String} org + * @apiParam {String} username + * @apiExample {js} ex: +github.orgs.checkPublicMembership({ ... }); + */ + +/** + * @api {get} /teams/:id/repos/:owner/:repo checkTeamRepo + * @apiVersion 6.0.3 + * @apiName checkTeamRepo + * @apiDescription Check if a team manages a repository + * @apiGroup orgs + * + * @apiParam {String} id + * @apiParam {String} owner + * @apiParam {String} repo + * @apiExample {js} ex: +github.orgs.checkTeamRepo({ ... }); + */ + +/** + * @api {delete} /orgs/:org/public_members/:username concealMembership + * @apiVersion 6.0.3 + * @apiName concealMembership + * @apiDescription Conceal a user's membership + * @apiGroup orgs + * + * @apiParam {String} org + * @apiParam {String} username + * @apiExample {js} ex: +github.orgs.concealMembership({ ... }); + */ + +/** + * @api {post} /orgs/:org/hooks createHook + * @apiVersion 6.0.3 + * @apiName createHook + * @apiDescription Create a hook + * @apiGroup orgs + * + * @apiParam {String} org + * @apiParam {String} name Must be passed as "web". + * @apiParam {Json} config Key/value pairs to provide settings for this webhook + * @apiParam {Array} [events=["push"]] Determines what events the hook is triggered for. Default: ["push"]. + * @apiParam {Boolean} [active] Determines whether the hook is actually triggered on pushes. + * @apiExample {js} ex: +github.orgs.createHook({ ... }); + */ + +/** + * @api {post} /orgs/:org/teams createTeam + * @apiVersion 6.0.3 + * @apiName createTeam + * @apiDescription Create team + * @apiGroup orgs + * + * @apiParam {String} org + * @apiParam {String} name + * @apiParam {String} [description] The description of the team. + * @apiParam {Array} [repo_names] The full name (e.g., "organization-name/repository-name") of repositories to add the team to. + * @apiParam {String=secret,closed} [privacy=secret] The level of privacy this team should have. + * @apiExample {js} ex: +github.orgs.createTeam({ ... }); + */ + +/** + * @api {delete} /orgs/:org/hooks/:id deleteHook + * @apiVersion 6.0.3 + * @apiName deleteHook + * @apiDescription Delete a hook + * @apiGroup orgs + * + * @apiParam {String} org + * @apiParam {String} id + * @apiExample {js} ex: +github.orgs.deleteHook({ ... }); + */ + +/** + * @api {delete} /teams/:id deleteTeam + * @apiVersion 6.0.3 + * @apiName deleteTeam + * @apiDescription Delete team + * @apiGroup orgs + * + * @apiParam {String} id + * @apiExample {js} ex: +github.orgs.deleteTeam({ ... }); + */ + +/** + * @api {delete} /teams/:id/repos/:owner/:repo deleteTeamRepo + * @apiVersion 6.0.3 + * @apiName deleteTeamRepo + * @apiDescription Remove team repository + * @apiGroup orgs + * + * @apiParam {String} id + * @apiParam {String} owner + * @apiParam {String} repo + * @apiExample {js} ex: +github.orgs.deleteTeamRepo({ ... }); + */ + +/** + * @api {patch} /orgs/:org/hooks/:id editHook + * @apiVersion 6.0.3 + * @apiName editHook + * @apiDescription Edit a hook + * @apiGroup orgs + * + * @apiParam {String} org + * @apiParam {String} id + * @apiParam {Json} config Key/value pairs to provide settings for this webhook + * @apiParam {Array} [events=["push"]] Determines what events the hook is triggered for. Default: ["push"]. + * @apiParam {Boolean} [active] Determines whether the hook is actually triggered on pushes. + * @apiExample {js} ex: +github.orgs.editHook({ ... }); + */ + +/** + * @api {patch} /teams/:id editTeam + * @apiVersion 6.0.3 + * @apiName editTeam + * @apiDescription Edit team + * @apiGroup orgs + * + * @apiParam {String} id + * @apiParam {String} name + * @apiParam {String} [description] The description of the team. + * @apiParam {String=secret,closed} [privacy=secret] The level of privacy this team should have. + * @apiExample {js} ex: +github.orgs.editTeam({ ... }); + */ + +/** + * @api {get} /orgs/:org get + * @apiVersion 6.0.3 + * @apiName get + * @apiDescription Get an organization + * @apiGroup orgs + * + * @apiParam {String} org + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.orgs.get({ ... }); + */ + +/** + * @api {get} /organizations getAll + * @apiVersion 6.0.3 + * @apiName getAll + * @apiDescription List all organizations + * @apiGroup orgs + * + * @apiParam {String} [since] The integer ID of the last Organization that you've seen. + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.orgs.getAll({ ... }); + */ + +/** + * @api {get} /users/:username/orgs getForUser + * @apiVersion 6.0.3 + * @apiName getForUser + * @apiDescription List public organization memberships for the specified user. + * @apiGroup orgs + * + * @apiParam {String} username + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.orgs.getForUser({ ... }); + */ + +/** + * @api {get} /orgs/:org/hooks/:id getHook + * @apiVersion 6.0.3 + * @apiName getHook + * @apiDescription Get single hook + * @apiGroup orgs + * + * @apiParam {String} org + * @apiParam {String} id + * @apiExample {js} ex: +github.orgs.getHook({ ... }); + */ + +/** + * @api {get} /orgs/:org/hooks getHooks + * @apiVersion 6.0.3 + * @apiName getHooks + * @apiDescription List hooks + * @apiGroup orgs + * + * @apiParam {String} org + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.orgs.getHooks({ ... }); + */ + +/** + * @api {get} /orgs/:org/members getMembers + * @apiVersion 6.0.3 + * @apiName getMembers + * @apiDescription Members list + * @apiGroup orgs + * + * @apiParam {String} org + * @apiParam {String=all,2fa_disabled} [filter=all] Filter members returned in the list. + * @apiParam {String=all,admin,member} [role=all] Filter members returned by their role. + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.orgs.getMembers({ ... }); + */ + +/** + * @api {get} /orgs/:org/memberships/:username getOrgMembership + * @apiVersion 6.0.3 + * @apiName getOrgMembership + * @apiDescription Get organization membership + * @apiGroup orgs + * + * @apiParam {String} org + * @apiParam {String} username + * @apiExample {js} ex: +github.orgs.getOrgMembership({ ... }); + */ + +/** + * @api {get} /orgs/:org/public_members getPublicMembers + * @apiVersion 6.0.3 + * @apiName getPublicMembers + * @apiDescription Public members list + * @apiGroup orgs + * + * @apiParam {String} org + * @apiExample {js} ex: +github.orgs.getPublicMembers({ ... }); + */ + +/** + * @api {get} /teams/:id getTeam + * @apiVersion 6.0.3 + * @apiName getTeam + * @apiDescription Get team + * @apiGroup orgs + * + * @apiParam {String} id + * @apiExample {js} ex: +github.orgs.getTeam({ ... }); + */ + +/** + * @api {get} /teams/:id/members getTeamMembers + * @apiVersion 6.0.3 + * @apiName getTeamMembers + * @apiDescription List team members + * @apiGroup orgs + * + * @apiParam {String} id + * @apiParam {String=member,maintainer,all} [role=all] Filters members returned by their role in the team. + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.orgs.getTeamMembers({ ... }); + */ + +/** + * @api {get} /teams/:id/memberships/:username getTeamMembership + * @apiVersion 6.0.3 + * @apiName getTeamMembership + * @apiDescription Get team membership + * @apiGroup orgs + * + * @apiParam {String} id + * @apiParam {String} username + * @apiExample {js} ex: +github.orgs.getTeamMembership({ ... }); + */ + +/** + * @api {get} /teams/:id/repos getTeamRepos + * @apiVersion 6.0.3 + * @apiName getTeamRepos + * @apiDescription Get team repos + * @apiGroup orgs + * + * @apiParam {String} id + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.orgs.getTeamRepos({ ... }); + */ + +/** + * @api {get} /orgs/:org/teams getTeams + * @apiVersion 6.0.3 + * @apiName getTeams + * @apiDescription List teams + * @apiGroup orgs + * + * @apiParam {String} org + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.orgs.getTeams({ ... }); + */ + +/** + * @api {post} /orgs/:org/hooks/:id/pings pingHook + * @apiVersion 6.0.3 + * @apiName pingHook + * @apiDescription Ping a hook + * @apiGroup orgs + * + * @apiParam {String} org + * @apiParam {String} id + * @apiExample {js} ex: +github.orgs.pingHook({ ... }); + */ + +/** + * @api {put} /orgs/:org/public_members/:username publicizeMembership + * @apiVersion 6.0.3 + * @apiName publicizeMembership + * @apiDescription Publicize a user's membership + * @apiGroup orgs + * + * @apiParam {String} org + * @apiParam {String} username + * @apiExample {js} ex: +github.orgs.publicizeMembership({ ... }); + */ + +/** + * @api {delete} /orgs/:org/members/:username removeMember + * @apiVersion 6.0.3 + * @apiName removeMember + * @apiDescription Remove a member + * @apiGroup orgs + * + * @apiParam {String} org + * @apiParam {String} username + * @apiExample {js} ex: +github.orgs.removeMember({ ... }); + */ + +/** + * @api {delete} /orgs/:org/memberships/:username removeOrgMembership + * @apiVersion 6.0.3 + * @apiName removeOrgMembership + * @apiDescription Remove organization membership + * @apiGroup orgs + * + * @apiParam {String} org + * @apiParam {String} username + * @apiExample {js} ex: +github.orgs.removeOrgMembership({ ... }); + */ + +/** + * @api {delete} /teams/:id/memberships/:username removeTeamMembership + * @apiVersion 6.0.3 + * @apiName removeTeamMembership + * @apiDescription Remove team membership + * @apiGroup orgs + * + * @apiParam {String} id + * @apiParam {String} username + * @apiExample {js} ex: +github.orgs.removeTeamMembership({ ... }); + */ + +/** + * @api {patch} /orgs/:org update + * @apiVersion 6.0.3 + * @apiName update + * @apiDescription Edit an organization + * @apiGroup orgs + * + * @apiParam {String} org + * @apiParam {String} [billing_email] Billing email address. This address is not publicized. + * @apiParam {String} [company] The company name. + * @apiParam {String} [email] The publicly visible email address. + * @apiParam {String} [location] The location. + * @apiParam {String} [name] The shorthand name of the company. + * @apiParam {String} [description] The description of the company. + * @apiExample {js} ex: +github.orgs.update({ ... }); + */ + +/** + * @api {post} /orgs/:org/projects createOrgProject + * @apiVersion 6.0.3 + * @apiName createOrgProject + * @apiDescription Create an organization project. (In preview period. See README.) + * @apiGroup projects + * + * @apiParam {String} org + * @apiParam {String} name + * @apiParam {String} body + * @apiExample {js} ex: +github.projects.createOrgProject({ ... }); + */ + +/** + * @api {post} /projects/columns/:column_id/cards createProjectCard + * @apiVersion 6.0.3 + * @apiName createProjectCard + * @apiDescription Create a project card. (In preview period. See README.) + * @apiGroup projects + * + * @apiParam {String} column_id + * @apiParam {String} [note] The note of the card. + * @apiParam {String} [content_id] The id of the Issue or Pull Request to associate with this card. + * @apiParam {String} [content_type] The type of content to associate with this card. Can be either 'Issue' or 'PullRequest'. + * @apiExample {js} ex: +github.projects.createProjectCard({ ... }); + */ + +/** + * @api {post} /projects/:project_id/columns createProjectColumn + * @apiVersion 6.0.3 + * @apiName createProjectColumn + * @apiDescription Create a project column. (In preview period. See README.) + * @apiGroup projects + * + * @apiParam {String} project_id + * @apiParam {String} name + * @apiExample {js} ex: +github.projects.createProjectColumn({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/projects createRepoProject + * @apiVersion 6.0.3 + * @apiName createRepoProject + * @apiDescription Create a repository project. (In preview period. See README.) + * @apiGroup projects + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} name + * @apiParam {String} body + * @apiExample {js} ex: +github.projects.createRepoProject({ ... }); + */ + +/** + * @api {delete} /projects/:id deleteProject + * @apiVersion 6.0.3 + * @apiName deleteProject + * @apiDescription Delete a project. (In preview period. See README.) + * @apiGroup projects + * + * @apiParam {String} id + * @apiExample {js} ex: +github.projects.deleteProject({ ... }); + */ + +/** + * @api {delete} /projects/columns/cards/:id deleteProjectCard + * @apiVersion 6.0.3 + * @apiName deleteProjectCard + * @apiDescription Delete a project card. (In preview period. See README.) + * @apiGroup projects + * + * @apiParam {String} id + * @apiExample {js} ex: +github.projects.deleteProjectCard({ ... }); + */ + +/** + * @api {delete} /projects/columns/:id deleteProjectColumn + * @apiVersion 6.0.3 + * @apiName deleteProjectColumn + * @apiDescription Delete a project column. (In preview period. See README.) + * @apiGroup projects + * + * @apiParam {String} id + * @apiExample {js} ex: +github.projects.deleteProjectColumn({ ... }); + */ + +/** + * @api {get} /orgs/:org/projects getOrgProjects + * @apiVersion 6.0.3 + * @apiName getOrgProjects + * @apiDescription List organization projects. (In preview period. See README.) + * @apiGroup projects + * + * @apiParam {String} org + * @apiExample {js} ex: +github.projects.getOrgProjects({ ... }); + */ + +/** + * @api {get} /projects/:id getProject + * @apiVersion 6.0.3 + * @apiName getProject + * @apiDescription Get a project. (In preview period. See README.) + * @apiGroup projects + * + * @apiParam {String} id + * @apiExample {js} ex: +github.projects.getProject({ ... }); + */ + +/** + * @api {get} /projects/columns/cards/:id getProjectCard + * @apiVersion 6.0.3 + * @apiName getProjectCard + * @apiDescription Get project card. (In preview period. See README.) + * @apiGroup projects + * + * @apiParam {String} id + * @apiExample {js} ex: +github.projects.getProjectCard({ ... }); + */ + +/** + * @api {get} /projects/columns/:column_id/cards getProjectCards + * @apiVersion 6.0.3 + * @apiName getProjectCards + * @apiDescription List project cards. (In preview period. See README.) + * @apiGroup projects + * + * @apiParam {String} column_id + * @apiExample {js} ex: +github.projects.getProjectCards({ ... }); + */ + +/** + * @api {get} /projects/columns/:id getProjectColumn + * @apiVersion 6.0.3 + * @apiName getProjectColumn + * @apiDescription Get a project column. (In preview period. See README.) + * @apiGroup projects + * + * @apiParam {String} id + * @apiExample {js} ex: +github.projects.getProjectColumn({ ... }); + */ + +/** + * @api {get} /projects/:project_id/columns getProjectColumns + * @apiVersion 6.0.3 + * @apiName getProjectColumns + * @apiDescription List project columns. (In preview period. See README.) + * @apiGroup projects + * + * @apiParam {String} project_id + * @apiExample {js} ex: +github.projects.getProjectColumns({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/projects getRepoProjects + * @apiVersion 6.0.3 + * @apiName getRepoProjects + * @apiDescription List repository projects. (In preview period. See README.) + * @apiGroup projects + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiExample {js} ex: +github.projects.getRepoProjects({ ... }); + */ + +/** + * @api {post} /projects/columns/cards/:id/moves moveProjectCard + * @apiVersion 6.0.3 + * @apiName moveProjectCard + * @apiDescription Move a project card. (In preview period. See README.) + * @apiGroup projects + * + * @apiParam {String} id + * @apiParam {String} position Can be one of first, last, or after:, where is the id value of a column in the same project. + * @apiParam {String} [column_id] The id value of a column in the same project. + * @apiExample {js} ex: +github.projects.moveProjectCard({ ... }); + */ + +/** + * @api {post} /projects/columns/:id/moves moveProjectColumn + * @apiVersion 6.0.3 + * @apiName moveProjectColumn + * @apiDescription Move a project column. (In preview period. See README.) + * @apiGroup projects + * + * @apiParam {String} id + * @apiParam {String} position Can be one of first, last, or after:, where is the id value of a column in the same project. + * @apiExample {js} ex: +github.projects.moveProjectColumn({ ... }); + */ + +/** + * @api {patch} /projects/:id updateProject + * @apiVersion 6.0.3 + * @apiName updateProject + * @apiDescription Update a project. (In preview period. See README.) + * @apiGroup projects + * + * @apiParam {String} id + * @apiParam {String} name + * @apiParam {String} body + * @apiExample {js} ex: +github.projects.updateProject({ ... }); + */ + +/** + * @api {patch} /projects/columns/cards/:id updateProjectCard + * @apiVersion 6.0.3 + * @apiName updateProjectCard + * @apiDescription Update a project card. (In preview period. See README.) + * @apiGroup projects + * + * @apiParam {String} id + * @apiParam {String} [note] The note of the card. + * @apiExample {js} ex: +github.projects.updateProjectCard({ ... }); + */ + +/** + * @api {patch} /projects/columns/:id updateProjectColumn + * @apiVersion 6.0.3 + * @apiName updateProjectColumn + * @apiDescription Update a project column. (In preview period. See README.) + * @apiGroup projects + * + * @apiParam {String} id + * @apiParam {String} name + * @apiExample {js} ex: +github.projects.updateProjectColumn({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/pulls/:number/merge checkMerged + * @apiVersion 6.0.3 + * @apiName checkMerged + * @apiDescription Get if a pull request has been merged + * @apiGroup pullRequests + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.pullRequests.checkMerged({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/pulls create + * @apiVersion 6.0.3 + * @apiName create + * @apiDescription Create a pull request + * @apiGroup pullRequests + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} title The title of the pull request. + * @apiParam {String} head The branch (or git ref) where your changes are implemented. + * @apiParam {String} base The branch (or git ref) you want your changes pulled into. This should be an existing branch on the current repository. You cannot submit a pull request to one repo that requests a merge to a base of another repo. + * @apiParam {String} [body] The contents of the pull request. + * @apiExample {js} ex: +github.pullRequests.create({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/pulls/:number/comments createComment + * @apiVersion 6.0.3 + * @apiName createComment + * @apiDescription Create a comment + * @apiGroup pullRequests + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiParam {String} body + * @apiParam {String} commit_id Sha of the commit to comment on. + * @apiParam {String} path Relative path of the file to comment on. + * @apiParam {Number} position Column index in the diff to comment on. + * @apiExample {js} ex: +github.pullRequests.createComment({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/pulls/:number/comments createCommentReply + * @apiVersion 6.0.3 + * @apiName createCommentReply + * @apiDescription Reply to existing pull request comment + * @apiGroup pullRequests + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiParam {String} body + * @apiParam {Number} in_reply_to The comment id to reply to. + * @apiExample {js} ex: +github.pullRequests.createCommentReply({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/pulls createFromIssue + * @apiVersion 6.0.3 + * @apiName createFromIssue + * @apiDescription Create a pull request from an existing issue + * @apiGroup pullRequests + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} issue The issue number in this repository to turn into a Pull Request. + * @apiParam {String} head The branch (or git ref) where your changes are implemented. + * @apiParam {String} base The branch (or git ref) you want your changes pulled into. This should be an existing branch on the current repository. You cannot submit a pull request to one repo that requests a merge to a base of another repo. + * @apiExample {js} ex: +github.pullRequests.createFromIssue({ ... }); + */ + +/** + * @api {delete} /repos/:owner/:repo/pulls/comments/:id deleteComment + * @apiVersion 6.0.3 + * @apiName deleteComment + * @apiDescription Delete a comment + * @apiGroup pullRequests + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiExample {js} ex: +github.pullRequests.deleteComment({ ... }); + */ + +/** + * @api {patch} /repos/:owner/:repo/pulls/comments/:id editComment + * @apiVersion 6.0.3 + * @apiName editComment + * @apiDescription Edit a comment + * @apiGroup pullRequests + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiParam {String} body + * @apiExample {js} ex: +github.pullRequests.editComment({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/pulls/:number get + * @apiVersion 6.0.3 + * @apiName get + * @apiDescription Get a single pull request + * @apiGroup pullRequests + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiExample {js} ex: +github.pullRequests.get({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/pulls getAll + * @apiVersion 6.0.3 + * @apiName getAll + * @apiDescription List pull requests + * @apiGroup pullRequests + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String=open,closed,all} [state=open] open, closed, or all + * @apiParam {String} [head] Filter pulls by head user and branch name in the format of user:ref-name. Example: github:new-script-format. + * @apiParam {String} [base] Filter pulls by base branch name. Example: gh-pages. + * @apiParam {String=created,updated,popularity,long-running} [sort=created] Possible values are: `created`, `updated`, `popularity`, `long-running`, Default: `created` + * @apiParam {String=asc,desc} [direction=desc] + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.pullRequests.getAll({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/pulls/comments/:id getComment + * @apiVersion 6.0.3 + * @apiName getComment + * @apiDescription Get a single comment + * @apiGroup pullRequests + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiExample {js} ex: +github.pullRequests.getComment({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/pulls/:number/comments getComments + * @apiVersion 6.0.3 + * @apiName getComments + * @apiDescription List comments on a pull request + * @apiGroup pullRequests + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.pullRequests.getComments({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/pulls/comments getCommentsForRepo + * @apiVersion 6.0.3 + * @apiName getCommentsForRepo + * @apiDescription List comments in a repository + * @apiGroup pullRequests + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String=created,updated} [sort=created] Possible values are: `created`, `updated`, Default: `created` + * @apiParam {String=asc,desc} [direction=desc] + * @apiParam {Date} [since] Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.pullRequests.getCommentsForRepo({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/pulls/:number/commits getCommits + * @apiVersion 6.0.3 + * @apiName getCommits + * @apiDescription List commits on a pull request + * @apiGroup pullRequests + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.pullRequests.getCommits({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/pulls/:number/files getFiles + * @apiVersion 6.0.3 + * @apiName getFiles + * @apiDescription List pull requests files + * @apiGroup pullRequests + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.pullRequests.getFiles({ ... }); + */ + +/** + * @api {put} /repos/:owner/:repo/pulls/:number/merge merge + * @apiVersion 6.0.3 + * @apiName merge + * @apiDescription Merge a pull request (Merge Button) + * @apiGroup pullRequests + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiParam {String} [commit_title] Title for the automatic commit message. (In preview period. See README.) + * @apiParam {String} [commit_message] Extra detail to append to automatic commit message. + * @apiParam {String} [sha] SHA that pull request head must match to allow merge + * @apiParam {String=merge,squash,rebase} [merge_method=merge] Merge method to use. Possible values are `merge`, `squash`, or `rebase`. (In preview period. See README.) + * @apiExample {js} ex: +github.pullRequests.merge({ ... }); + */ + +/** + * @api {patch} /repos/:owner/:repo/pulls/:number update + * @apiVersion 6.0.3 + * @apiName update + * @apiDescription Update a pull request + * @apiGroup pullRequests + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiParam {String} base The branch (or git ref) you want your changes pulled into. This should be an existing branch on the current repository. You cannot submit a pull request to one repo that requests a merge to a base of another repo. + * @apiParam {String} [title] The title of the pull request. + * @apiParam {String} [body] The contents of the pull request. + * @apiParam {String=open,closed,all} [state=open] + * @apiExample {js} ex: +github.pullRequests.update({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/comments/:id/reactions createForCommitComment + * @apiVersion 6.0.3 + * @apiName createForCommitComment + * @apiDescription Create reaction for a commit comment. (In preview period. See README.) + * @apiGroup reactions + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiParam {String=+1,-1,laugh,confused,heart,hooray} content The reaction type. + * @apiExample {js} ex: +github.reactions.createForCommitComment({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/issues/:number/reactions createForIssue + * @apiVersion 6.0.3 + * @apiName createForIssue + * @apiDescription Create reaction for an issue. (In preview period. See README.) + * @apiGroup reactions + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiParam {String=+1,-1,laugh,confused,heart,hooray} content The reaction type. + * @apiExample {js} ex: +github.reactions.createForIssue({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/issues/comments/:id/reactions createForIssueComment + * @apiVersion 6.0.3 + * @apiName createForIssueComment + * @apiDescription Create reaction for an issue comment. (In preview period. See README.) + * @apiGroup reactions + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiParam {String=+1,-1,laugh,confused,heart,hooray} content The reaction type. + * @apiExample {js} ex: +github.reactions.createForIssueComment({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/pulls/comments/:id/reactions createForPullRequestReviewComment + * @apiVersion 6.0.3 + * @apiName createForPullRequestReviewComment + * @apiDescription Create reaction for a pull request review comment. (In preview period. See README.) + * @apiGroup reactions + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiParam {String=+1,-1,laugh,confused,heart,hooray} content The reaction type. + * @apiExample {js} ex: +github.reactions.createForPullRequestReviewComment({ ... }); + */ + +/** + * @api {delete} /reactions/:id delete + * @apiVersion 6.0.3 + * @apiName delete + * @apiDescription Delete a reaction. (In preview period. See README.) + * @apiGroup reactions + * + * @apiParam {String} id + * @apiExample {js} ex: +github.reactions.delete({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/comments/:id/reactions getForCommitComment + * @apiVersion 6.0.3 + * @apiName getForCommitComment + * @apiDescription List reactions for a commit comment. (In preview period. See README.) + * @apiGroup reactions + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiParam {String=+1,-1,laugh,confused,heart,hooray} [content] Indicates which type of reaction to return. + * @apiExample {js} ex: +github.reactions.getForCommitComment({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/issues/:number/reactions getForIssue + * @apiVersion 6.0.3 + * @apiName getForIssue + * @apiDescription List reactions for an issue. (In preview period. See README.) + * @apiGroup reactions + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiParam {String=+1,-1,laugh,confused,heart,hooray} [content] Indicates which type of reaction to return. + * @apiExample {js} ex: +github.reactions.getForIssue({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/issues/comments/:id/reactions getForIssueComment + * @apiVersion 6.0.3 + * @apiName getForIssueComment + * @apiDescription List reactions for an issue comment. (In preview period. See README.) + * @apiGroup reactions + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiParam {String=+1,-1,laugh,confused,heart,hooray} [content] Indicates which type of reaction to return. + * @apiExample {js} ex: +github.reactions.getForIssueComment({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/pulls/comments/:id/reactions getForPullRequestReviewComment + * @apiVersion 6.0.3 + * @apiName getForPullRequestReviewComment + * @apiDescription List reactions for a pull request review comment. (In preview period. See README.) + * @apiGroup reactions + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiParam {String=+1,-1,laugh,confused,heart,hooray} [content] Indicates which type of reaction to return. + * @apiExample {js} ex: +github.reactions.getForPullRequestReviewComment({ ... }); + */ + +/** + * @api {put} /repos/:owner/:repo/collaborators/:username addCollaborator + * @apiVersion 6.0.3 + * @apiName addCollaborator + * @apiDescription Add user as a collaborator + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} username + * @apiParam {String=pull,push,admin} [permission=push] `pull` - can pull, but not push to or administer this repository, `push` - can pull and push, but not administer this repository, `admin` - can pull, push and administer this repository. + * @apiExample {js} ex: +github.repos.addCollaborator({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/branches/:branch/protection/required_status_checks/contexts addProtectedBranchRequiredStatusChecksContexts + * @apiVersion 6.0.3 + * @apiName addProtectedBranchRequiredStatusChecksContexts + * @apiDescription Add required status checks contexts of protected branch. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} branch + * @apiParam {Array} body An array of protected branch required status checks contexts (e.g. continuous-integration/jenkins). + * @apiExample {js} ex: +github.repos.addProtectedBranchRequiredStatusChecksContexts({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/branches/:branch/protection/restrictions/teams addProtectedBranchTeamRestrictions + * @apiVersion 6.0.3 + * @apiName addProtectedBranchTeamRestrictions + * @apiDescription Add team restrictions of protected branch. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} branch + * @apiParam {Array} body An array of team slugs (e.g. justice-league). + * @apiExample {js} ex: +github.repos.addProtectedBranchTeamRestrictions({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/branches/:branch/protection/restrictions/users addProtectedBranchUserRestrictions + * @apiVersion 6.0.3 + * @apiName addProtectedBranchUserRestrictions + * @apiDescription Add user restrictions of protected branch. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} branch + * @apiParam {Array} body An array of team slugs (e.g. justice-league). + * @apiExample {js} ex: +github.repos.addProtectedBranchUserRestrictions({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/collaborators/:username checkCollaborator + * @apiVersion 6.0.3 + * @apiName checkCollaborator + * @apiDescription Check if user is a collaborator. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} username + * @apiExample {js} ex: +github.repos.checkCollaborator({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/compare/:base...:head compareCommits + * @apiVersion 6.0.3 + * @apiName compareCommits + * @apiDescription Compare two commits. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} base The branch (or git ref) you want your changes pulled into. This should be an existing branch on the current repository. You cannot submit a pull request to one repo that requests a merge to a base of another repo. + * @apiParam {String} head The branch (or git ref) where your changes are implemented. + * @apiExample {js} ex: +github.repos.compareCommits({ ... }); + */ + +/** + * @api {post} /user/repos create + * @apiVersion 6.0.3 + * @apiName create + * @apiDescription Create a new repository for the authenticated user. + * @apiGroup repos + * + * @apiParam {String} name + * @apiParam {Boolean} [allow_rebase_merge=true] Either true to allow rebase-merging pull requests, or false to prevent rebase-merging. Default: true. (In preview period. See README.) + * @apiParam {String} [homepage] + * @apiParam {Boolean} [private=false] True to create a private repository, false to create a public one. Creating private repositories requires a paid GitHub account. Default is false. + * @apiParam {Boolean} [has_issues=true] True to enable issues for this repository, false to disable them. Default is true. + * @apiParam {Boolean} [has_wiki=true] True to enable the wiki for this repository, false to disable it. Default is true. + * @apiParam {Boolean} [has_downloads=true] True to enable downloads for this repository, false to disable them. Default is true. + * @apiParam {String} [description] + * @apiParam {Boolean} [auto_init=false] True to create an initial commit with empty README. Default is false + * @apiParam {String} [gitignore_template] Desired language or platform .gitignore template to apply. Ignored if auto_init parameter is not provided. + * @apiParam {String} [license_template] Desired LICENSE template to apply. Use the name of the template without the extension. For example, "mit" or "mozilla". + * @apiParam {Boolean} [allow_squash_merge=true] Either true to allow squash-merging pull requests, or false to prevent squash-merging. Default: true. (In preview period. See README.) + * @apiParam {Boolean} [allow_merge_commit=true] Either true to allow merging pull requests with a merge commit, or false to prevent merging pull requests with merge commits. Default: true. (In preview period. See README.) + * @apiParam {Number} [team_id] The id of the team that will be granted access to this repository. This is only valid when creating a repository in an organization. + * @apiExample {js} ex: +github.repos.create({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/commits/:sha/comments createCommitComment + * @apiVersion 6.0.3 + * @apiName createCommitComment + * @apiDescription Create a commit comment. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} sha + * @apiParam {String} body + * @apiParam {String} [path] Relative path of the file to comment on. + * @apiParam {Number} [position] Line index in the diff to comment on. + * @apiParam {Number} [line] Deprecated. Use position parameter instead. Line number in the file to comment on. + * @apiExample {js} ex: +github.repos.createCommitComment({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/deployments createDeployment + * @apiVersion 6.0.3 + * @apiName createDeployment + * @apiDescription Create a deployment. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} ref The ref to deploy. This can be a branch, tag, or sha. + * @apiParam {String} repo + * @apiParam {String} [task=deploy] The named task to execute. e.g. deploy or deploy:migrations. Default: deploy + * @apiParam {Boolean} [auto_merge=true] Optional parameter to merge the default branch into the requested ref if it is behind the default branch. Default: true + * @apiParam {Boolean} [production_environment] Specifies if the given environment is a one that end-users directly interact with. Default: true when environment is `production` and false otherwise. (In preview period. See README.) + * @apiParam {String} [payload=""] Optional JSON payload with extra information about the deployment. Default: "" + * @apiParam {String} [environment=none] The name of the environment that was deployed to. e.g. staging or production. Default: none. + * @apiParam {String} [description=""] Optional short description. Default: "" + * @apiParam {Boolean} [transient_environment=false] Specifies if the given environment is specific to the deployment and will no longer exist at some point in the future. Default: false. (In preview period. See README.) + * @apiParam {Array} [required_contexts] Optional array of status contexts verified against commit status checks. If this parameter is omitted from the parameters then all unique contexts will be verified before a deployment is created. To bypass checking entirely pass an empty array. Defaults to all unique contexts. + * @apiExample {js} ex: +github.repos.createDeployment({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/deployments/:id/statuses createDeploymentStatus + * @apiVersion 6.0.3 + * @apiName createDeploymentStatus + * @apiDescription Create a deployment status. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiParam {String} [state] The state of the status. Can be one of pending, success, error, or failure. + * @apiParam {String} [target_url=""] The target URL to associate with this status. This URL should contain output to keep the user updated while the task is running or serve as historical information for what happened in the deployment. Default: "" + * @apiParam {String} [log_url=""] Functionally equivalent to target_url. Default: "". (In preview period. See README.) + * @apiParam {String} [description=""] A short description of the status. Default: "" + * @apiParam {String} [environment_url=""] URL for accessing the deployment environment. Default: "". (In preview period. See README.) + * @apiParam {Boolean} [auto_inactive=true] When true the new `inactive` status is added to all other non-transient, non-production environment deployments with the same repository and environment name as the created status's deployment. Default: true. (In preview period. See README.) + * @apiExample {js} ex: +github.repos.createDeploymentStatus({ ... }); + */ + +/** + * @api {put} /repos/:owner/:repo/contents/:path createFile + * @apiVersion 6.0.3 + * @apiName createFile + * @apiDescription Create a new file in the given repository. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} path The content path. + * @apiParam {String} message The commit message. + * @apiParam {String} content The new file content, Base64 encoded. + * @apiParam {String} [branch] The branch name. If not provided, uses the repository’s default branch (usually master). + * @apiParam {Json} [committer] + * @apiExample {js} ex: +github.repos.createFile({ ... }); + */ + +/** + * @api {post} /orgs/:org/repos createForOrg + * @apiVersion 6.0.3 + * @apiName createForOrg + * @apiDescription Create a new repository for an organization. + * @apiGroup repos + * + * @apiParam {String} org + * @apiParam {String} name + * @apiParam {String} [description] + * @apiParam {String} [homepage] + * @apiParam {Boolean} [private=false] True to create a private repository, false to create a public one. Creating private repositories requires a paid GitHub account. Default is false. + * @apiParam {Boolean} [has_issues=true] True to enable issues for this repository, false to disable them. Default is true. + * @apiParam {Boolean} [has_wiki=true] True to enable the wiki for this repository, false to disable it. Default is true. + * @apiParam {Boolean} [allow_rebase_merge=true] Either true to allow rebase-merging pull requests, or false to prevent rebase-merging. Default: true. (In preview period. See README.) + * @apiParam {Number} [team_id] The id of the team that will be granted access to this repository. This is only valid when creating a repo in an organization. + * @apiParam {Boolean} [auto_init=false] True to create an initial commit with empty README. Default is false + * @apiParam {String} [gitignore_template] Desired language or platform .gitignore template to apply. Ignored if auto_init parameter is not provided. + * @apiParam {String} [license_template] Desired LICENSE template to apply. Use the name of the template without the extension. For example, "mit" or "mozilla". + * @apiParam {Boolean} [allow_squash_merge=true] Either true to allow squash-merging pull requests, or false to prevent squash-merging. Default: true. (In preview period. See README.) + * @apiParam {Boolean} [allow_merge_commit=true] Either true to allow merging pull requests with a merge commit, or false to prevent merging pull requests with merge commits. Default: true. (In preview period. See README.) + * @apiParam {Boolean} [has_downloads=true] True to enable downloads for this repository, false to disable them. Default is true. + * @apiExample {js} ex: +github.repos.createForOrg({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/hooks createHook + * @apiVersion 6.0.3 + * @apiName createHook + * @apiDescription Create a hook. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} name + * @apiParam {Json} config A Hash containing key/value pairs to provide settings for this hook. These settings vary between the services and are defined in the github-services repo. Booleans are stored internally as `1` for true, and `0` for false. Any JSON true/false values will be converted automatically. + * @apiParam {Array} [events=["push"]] Determines what events the hook is triggered for. Default: `['push']`. + * @apiParam {Boolean} [active] Determines whether the hook is actually triggered on pushes. + * @apiExample {js} ex: +github.repos.createHook({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/keys createKey + * @apiVersion 6.0.3 + * @apiName createKey + * @apiDescription Add a new deploy key. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} title + * @apiParam {String} key + * @apiParam {Boolean} [read_only] If true, the key will only be able to read repository contents. Otherwise, the key will be able to read and write. + * @apiExample {js} ex: +github.repos.createKey({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/releases createRelease + * @apiVersion 6.0.3 + * @apiName createRelease + * @apiDescription Create a release. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} tag_name String of the tag + * @apiParam {String} [target_commitish] Specifies the commitish value that determines where the Git tag is created from. Can be any branch or commit SHA. Unused if the Git tag already exists. Default: the repository's default branch (usually master). + * @apiParam {String} [name] + * @apiParam {String} [body] + * @apiParam {Boolean} [draft=false] true to create a draft (unpublished) release, false to create a published one. Default: false + * @apiParam {Boolean} [prerelease=false] true to identify the release as a prerelease. false to identify the release as a full release. Default: false + * @apiExample {js} ex: +github.repos.createRelease({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/statuses/:sha createStatus + * @apiVersion 6.0.3 + * @apiName createStatus + * @apiDescription Create a status. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} sha + * @apiParam {String=pending,success,error,failure} state State of the status - can be one of pending, success, error, or failure. + * @apiParam {String} [target_url] Target url to associate with this status. This URL will be linked from the GitHub UI to allow users to easily see the ‘source’ of the Status. + * @apiParam {String} [description] Short description of the status. + * @apiParam {String} [context] A string label to differentiate this status from the status of other systems. + * @apiExample {js} ex: +github.repos.createStatus({ ... }); + */ + +/** + * @api {delete} /repos/:owner/:repo delete + * @apiVersion 6.0.3 + * @apiName delete + * @apiDescription Delete a repository. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiExample {js} ex: +github.repos.delete({ ... }); + */ + +/** + * @api {delete} /repos/:owner/:repo/releases/assets/:id deleteAsset + * @apiVersion 6.0.3 + * @apiName deleteAsset + * @apiDescription Delete a release asset. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiExample {js} ex: +github.repos.deleteAsset({ ... }); + */ + +/** + * @api {delete} /repos/:owner/:repo/comments/:id deleteCommitComment + * @apiVersion 6.0.3 + * @apiName deleteCommitComment + * @apiDescription Delete a commit comment. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiExample {js} ex: +github.repos.deleteCommitComment({ ... }); + */ + +/** + * @api {delete} /repos/:owner/:repo/downloads/:id deleteDownload + * @apiVersion 6.0.3 + * @apiName deleteDownload + * @apiDescription Delete a download. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiExample {js} ex: +github.repos.deleteDownload({ ... }); + */ + +/** + * @api {delete} /repos/:owner/:repo/contents/:path deleteFile + * @apiVersion 6.0.3 + * @apiName deleteFile + * @apiDescription Delete a file. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} path The content path. + * @apiParam {String} message The commit message. + * @apiParam {String} sha The blob SHA of the file being removed. + * @apiParam {String} [branch] The branch name. If not provided, uses the repository’s default branch (usually master). + * @apiParam {Json} [committer] + * @apiExample {js} ex: +github.repos.deleteFile({ ... }); + */ + +/** + * @api {delete} /repos/:owner/:repo/hooks/:id deleteHook + * @apiVersion 6.0.3 + * @apiName deleteHook + * @apiDescription Deleate a hook. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiExample {js} ex: +github.repos.deleteHook({ ... }); + */ + +/** + * @api {delete} /repositories/:repo_id/invitations/:invitation_id deleteInvite + * @apiVersion 6.0.3 + * @apiName deleteInvite + * @apiDescription Delete a repository invitation. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} repo_id + * @apiParam {String} invitation_id + * @apiExample {js} ex: +github.repos.deleteInvite({ ... }); + */ + +/** + * @api {delete} /repos/:owner/:repo/keys/:id deleteKey + * @apiVersion 6.0.3 + * @apiName deleteKey + * @apiDescription Remove a deploy key. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiExample {js} ex: +github.repos.deleteKey({ ... }); + */ + +/** + * @api {delete} /repos/:owner/:repo/releases/:id deleteRelease + * @apiVersion 6.0.3 + * @apiName deleteRelease + * @apiDescription Delete a release + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiExample {js} ex: +github.repos.deleteRelease({ ... }); + */ + +/** + * @api {patch} /repos/:owner/:repo edit + * @apiVersion 6.0.3 + * @apiName edit + * @apiDescription Update a repo. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} name + * @apiParam {String} repo + * @apiParam {String} [description] + * @apiParam {String} [homepage] + * @apiParam {Boolean} [private=false] True to create a private repository, false to create a public one. Creating private repositories requires a paid GitHub account. Default is false. + * @apiParam {Boolean} [allow_rebase_merge=true] Either true to allow rebase-merging pull requests, or false to prevent rebase-merging. Default: true. (In preview period. See README.) + * @apiParam {Boolean} [has_wiki=true] True to enable the wiki for this repository, false to disable it. Default is true. + * @apiParam {Boolean} [has_downloads=true] True to enable downloads for this repository, false to disable them. Default is true. + * @apiParam {String} [default_branch] Updates the default branch for this repository. + * @apiParam {Boolean} [allow_squash_merge=true] Either true to allow squash-merging pull requests, or false to prevent squash-merging. Default: true. (In preview period. See README.) + * @apiParam {Boolean} [allow_merge_commit=true] Either true to allow merging pull requests with a merge commit, or false to prevent merging pull requests with merge commits. Default: true. (In preview period. See README.) + * @apiParam {Boolean} [has_issues=true] True to enable issues for this repository, false to disable them. Default is true. + * @apiExample {js} ex: +github.repos.edit({ ... }); + */ + +/** + * @api {patch} /repos/:owner/:repo/releases/assets/:id editAsset + * @apiVersion 6.0.3 + * @apiName editAsset + * @apiDescription Edit a release asset. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiParam {String} name + * @apiParam {String} [label] An alternate short description of the asset. Used in place of the filename. + * @apiExample {js} ex: +github.repos.editAsset({ ... }); + */ + +/** + * @api {patch} /repos/:owner/:repo/hooks/:id editHook + * @apiVersion 6.0.3 + * @apiName editHook + * @apiDescription Edit a hook. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiParam {String} name + * @apiParam {Json} config A Hash containing key/value pairs to provide settings for this hook. Modifying this will replace the entire config object. These settings vary between the services and are defined in the github-services repo. Booleans are stored internally as `1` for true, and `0` for false. Any JSON true/false values will be converted automatically. + * @apiParam {Array} [events=["push"]] Determines what events the hook is triggered for. This replaces the entire array of events. Default: `['push']`. + * @apiParam {Array} [add_events] Determines a list of events to be added to the list of events that the Hook triggers for. + * @apiParam {Array} [remove_events] Determines a list of events to be removed from the list of events that the Hook triggers for. + * @apiParam {Boolean} [active] Determines whether the hook is actually triggered on pushes. + * @apiExample {js} ex: +github.repos.editHook({ ... }); + */ + +/** + * @api {patch} /repos/:owner/:repo/releases/:id editRelease + * @apiVersion 6.0.3 + * @apiName editRelease + * @apiDescription Edit a release. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiParam {String} tag_name String of the tag + * @apiParam {String} [target_commitish] Specifies the commitish value that determines where the Git tag is created from. Can be any branch or commit SHA. Unused if the Git tag already exists. Default: the repository's default branch (usually master). + * @apiParam {String} [name] + * @apiParam {String} [body] + * @apiParam {Boolean} [draft=false] true to create a draft (unpublished) release, false to create a published one. Default: false + * @apiParam {Boolean} [prerelease=false] true to identify the release as a prerelease. false to identify the release as a full release. Default: false + * @apiExample {js} ex: +github.repos.editRelease({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/forks fork + * @apiVersion 6.0.3 + * @apiName fork + * @apiDescription Create a fork. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} [organization] Optional parameter to specify the organization name if forking into an organization. + * @apiExample {js} ex: +github.repos.fork({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo get + * @apiVersion 6.0.3 + * @apiName get + * @apiDescription Get a repo for a user. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiExample {js} ex: +github.repos.get({ ... }); + */ + +/** + * @api {get} /user/repos getAll + * @apiVersion 6.0.3 + * @apiName getAll + * @apiDescription List your repositories + * @apiGroup repos + * + * @apiParam {String=all,public,private} [visibility=all] Can be one of `all`, `public`, or `private`. Default: `all`. + * @apiParam {String} [affiliation=owner,collaborator,organization_member] Comma-separated list of values. Can include: `owner`, `collaborator`, `organization_member`. + * @apiParam {String=all,owner,public,private,member} [type=all] Possible values: `all`, `owner`, `public`, `private`, `member`. Default: `all`. + * @apiParam {String=created,updated,pushed,full_name} [sort=full_name] Possible values: `created`, `updated`, `pushed`, `full_name`. Default: `full_name`. + * @apiParam {String=asc,desc} [direction=desc] + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.getAll({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/comments getAllCommitComments + * @apiVersion 6.0.3 + * @apiName getAllCommitComments + * @apiDescription List commit comments for a repository. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.getAllCommitComments({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/:archive_format/:ref getArchiveLink + * @apiVersion 6.0.3 + * @apiName getArchiveLink + * @apiDescription Get archive link. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String=tarball,zipball} archive_format=tarball Either tarball or zipball, Deafult: tarball. + * @apiParam {String} [ref] A valid Git reference. Default: the repository’s default branch (usually master). + * @apiExample {js} ex: +github.repos.getArchiveLink({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/releases/assets/:id getAsset + * @apiVersion 6.0.3 + * @apiName getAsset + * @apiDescription Get a single release asset. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiExample {js} ex: +github.repos.getAsset({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/branches/:branch getBranch + * @apiVersion 6.0.3 + * @apiName getBranch + * @apiDescription Get branch. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} branch + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.getBranch({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/branches/:branch/protection getBranchProtection + * @apiVersion 6.0.3 + * @apiName getBranchProtection + * @apiDescription Get branch protection. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} branch + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.getBranchProtection({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/branches getBranches + * @apiVersion 6.0.3 + * @apiName getBranches + * @apiDescription List branches. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Boolean} [protected] Set to true to only return protected branches + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.getBranches({ ... }); + */ + +/** + * @api {get} /repositories/:id getById + * @apiVersion 6.0.3 + * @apiName getById + * @apiDescription Get a single repo by id. + * @apiGroup repos + * + * @apiParam {String} id + * @apiExample {js} ex: +github.repos.getById({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/traffic/clones getClones + * @apiVersion 6.0.3 + * @apiName getClones + * @apiDescription Get the total number of clones and breakdown per day or week for the last 14 days. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.getClones({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/collaborators getCollaborators + * @apiVersion 6.0.3 + * @apiName getCollaborators + * @apiDescription List collaborators + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.getCollaborators({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/commits/:ref/status getCombinedStatus + * @apiVersion 6.0.3 + * @apiName getCombinedStatus + * @apiDescription Get the combined status for a specific ref. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} ref Ref to fetch the status for. It can be a SHA, a branch name, or a tag name. + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.getCombinedStatus({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/commits/:sha getCommit + * @apiVersion 6.0.3 + * @apiName getCommit + * @apiDescription Get a single commit. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} sha + * @apiExample {js} ex: +github.repos.getCommit({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/comments/:id getCommitComment + * @apiVersion 6.0.3 + * @apiName getCommitComment + * @apiDescription Get a single commit comment. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiExample {js} ex: +github.repos.getCommitComment({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/commits/:ref/comments getCommitComments + * @apiVersion 6.0.3 + * @apiName getCommitComments + * @apiDescription List comments for a single commit. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} ref + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.getCommitComments({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/commits getCommits + * @apiVersion 6.0.3 + * @apiName getCommits + * @apiDescription List commits on a repository. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} [sha] Sha or branch to start listing commits from. + * @apiParam {String} [path] Only commits containing this file path will be returned. + * @apiParam {String} [author] GitHub login or email address by which to filter by commit author. + * @apiParam {Date} [since] Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ + * @apiParam {Date} [until] Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.getCommits({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/contents/:path getContent + * @apiVersion 6.0.3 + * @apiName getContent + * @apiDescription Get the contents of a file or directory in a repository. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} path The content path. + * @apiParam {String} [ref] The String name of the Commit/Branch/Tag. Defaults to master. + * @apiExample {js} ex: +github.repos.getContent({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/contributors getContributors + * @apiVersion 6.0.3 + * @apiName getContributors + * @apiDescription Get contributors for the specified repository. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Boolean} [anon] Set to 1 or true to include anonymous contributors in results. + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.getContributors({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/deployments/:id/statuses getDeploymentStatuses + * @apiVersion 6.0.3 + * @apiName getDeploymentStatuses + * @apiDescription List deployment statuses. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiExample {js} ex: +github.repos.getDeploymentStatuses({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/deployments getDeployments + * @apiVersion 6.0.3 + * @apiName getDeployments + * @apiDescription List deployments. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} [sha=none] The short or long sha that was recorded at creation time. Default: none. + * @apiParam {String} [ref=none] The name of the ref. This can be a branch, tag, or sha. Default: none. + * @apiParam {String} [task=none] The name of the task for the deployment. e.g. deploy or deploy:migrations. Default: none. + * @apiParam {String} [environment=none] The name of the environment that was deployed to. e.g. staging or production. Default: none. + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.getDeployments({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/downloads/:id getDownload + * @apiVersion 6.0.3 + * @apiName getDownload + * @apiDescription Get a single download. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiExample {js} ex: +github.repos.getDownload({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/downloads getDownloads + * @apiVersion 6.0.3 + * @apiName getDownloads + * @apiDescription List downloads for repository. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.getDownloads({ ... }); + */ + +/** + * @api {get} /orgs/:org/repos getForOrg + * @apiVersion 6.0.3 + * @apiName getForOrg + * @apiDescription List repositories for the specified org. + * @apiGroup repos + * + * @apiParam {String} org + * @apiParam {String=all,public,private,forks,sources,member} [type=all] Possible values: `all`, `public`, `private`, `forks`, `sources`, `member`. Default: `all`. + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.getForOrg({ ... }); + */ + +/** + * @api {get} /users/:username/repos getForUser + * @apiVersion 6.0.3 + * @apiName getForUser + * @apiDescription List public repositories for the specified user. + * @apiGroup repos + * + * @apiParam {String} username + * @apiParam {String=all,owner,member} [type=owner] Possible values: `all`, `owner`, `member`. Default: `owner`. + * @apiParam {String=created,updated,pushed,full_name} [sort=full_name] Possible values: `created`, `updated`, `pushed`, `full_name`. Default: `full_name`. + * @apiParam {String=asc,desc} [direction=desc] + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.getForUser({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/forks getForks + * @apiVersion 6.0.3 + * @apiName getForks + * @apiDescription List forks. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String=newest,oldest,stargazers} [sort=newest] Possible values: `newest`, `oldest`, `stargazers`, default: `newest`. + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.getForks({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/hooks/:id getHook + * @apiVersion 6.0.3 + * @apiName getHook + * @apiDescription Get single hook. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiExample {js} ex: +github.repos.getHook({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/hooks getHooks + * @apiVersion 6.0.3 + * @apiName getHooks + * @apiDescription List hooks. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.getHooks({ ... }); + */ + +/** + * @api {get} /repositories/:repo_id/invitations getInvites + * @apiVersion 6.0.3 + * @apiName getInvites + * @apiDescription List invitations for a repository. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} repo_id + * @apiExample {js} ex: +github.repos.getInvites({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/keys/:id getKey + * @apiVersion 6.0.3 + * @apiName getKey + * @apiDescription Get a deploy key. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiExample {js} ex: +github.repos.getKey({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/keys getKeys + * @apiVersion 6.0.3 + * @apiName getKeys + * @apiDescription List deploy keys. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.getKeys({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/languages getLanguages + * @apiVersion 6.0.3 + * @apiName getLanguages + * @apiDescription Get languages for the specified repository. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.getLanguages({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/pages/builds/latest getLatestPagesBuild + * @apiVersion 6.0.3 + * @apiName getLatestPagesBuild + * @apiDescription Get latest Pages build. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiExample {js} ex: +github.repos.getLatestPagesBuild({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/releases/latest getLatestRelease + * @apiVersion 6.0.3 + * @apiName getLatestRelease + * @apiDescription Get the latest release. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiExample {js} ex: +github.repos.getLatestRelease({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/pages getPages + * @apiVersion 6.0.3 + * @apiName getPages + * @apiDescription Get information about a Pages site. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.getPages({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/pages/builds/:id getPagesBuild + * @apiVersion 6.0.3 + * @apiName getPagesBuild + * @apiDescription Get a specific Pages build. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiExample {js} ex: +github.repos.getPagesBuild({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/pages/builds getPagesBuilds + * @apiVersion 6.0.3 + * @apiName getPagesBuilds + * @apiDescription List Pages builds. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.getPagesBuilds({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/traffic/popular/paths getPaths + * @apiVersion 6.0.3 + * @apiName getPaths + * @apiDescription Get the top 10 popular contents over the last 14 days. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.getPaths({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/branches/:branch/protection/required_status_checks getProtectedBranchRequiredStatusChecks + * @apiVersion 6.0.3 + * @apiName getProtectedBranchRequiredStatusChecks + * @apiDescription Get required status checks of protected branch. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} branch + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.getProtectedBranchRequiredStatusChecks({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/branches/:branch/protection/required_status_checks/contexts getProtectedBranchRequiredStatusChecksContexts + * @apiVersion 6.0.3 + * @apiName getProtectedBranchRequiredStatusChecksContexts + * @apiDescription List required status checks contexts of protected branch. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} branch + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.getProtectedBranchRequiredStatusChecksContexts({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/branches/:branch/protection/restrictions getProtectedBranchRestrictions + * @apiVersion 6.0.3 + * @apiName getProtectedBranchRestrictions + * @apiDescription Get restrictions of protected branch. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} branch + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.getProtectedBranchRestrictions({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/branches/:branch/protection/restrictions/teams getProtectedBranchTeamRestrictions + * @apiVersion 6.0.3 + * @apiName getProtectedBranchTeamRestrictions + * @apiDescription List team restrictions of protected branch. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} branch + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.getProtectedBranchTeamRestrictions({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/branches/:branch/protection/restrictions/users getProtectedBranchUserRestrictions + * @apiVersion 6.0.3 + * @apiName getProtectedBranchUserRestrictions + * @apiDescription List user restrictions of protected branch. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} branch + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.getProtectedBranchUserRestrictions({ ... }); + */ + +/** + * @api {get} /repositories getPublic + * @apiVersion 6.0.3 + * @apiName getPublic + * @apiDescription List all public repositories + * @apiGroup repos + * + * @apiParam {String} [since] The integer ID of the last Repository that you've seen. + * @apiExample {js} ex: +github.repos.getPublic({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/readme getReadme + * @apiVersion 6.0.3 + * @apiName getReadme + * @apiDescription Get the README for the given repository. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} [ref] The name of the commit/branch/tag. Default: the repository’s default branch (usually master) + * @apiExample {js} ex: +github.repos.getReadme({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/traffic/popular/referrers getReferrers + * @apiVersion 6.0.3 + * @apiName getReferrers + * @apiDescription Get the top 10 referrers over the last 14 days. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.getReferrers({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/releases/:id getRelease + * @apiVersion 6.0.3 + * @apiName getRelease + * @apiDescription Get a single release. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiExample {js} ex: +github.repos.getRelease({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/releases/tags/:tag getReleaseByTag + * @apiVersion 6.0.3 + * @apiName getReleaseByTag + * @apiDescription Get a release by tag name. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} tag String of the tag + * @apiExample {js} ex: +github.repos.getReleaseByTag({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/releases getReleases + * @apiVersion 6.0.3 + * @apiName getReleases + * @apiDescription List releases for a repository. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.getReleases({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/commits/:ref getShaOfCommitRef + * @apiVersion 6.0.3 + * @apiName getShaOfCommitRef + * @apiDescription Get the SHA-1 of a commit reference. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} ref String of the name of the fully qualified reference (ie: heads/master). If it doesn’t have at least one slash, it will be rejected. + * @apiExample {js} ex: +github.repos.getShaOfCommitRef({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/stats/code_frequency getStatsCodeFrequency + * @apiVersion 6.0.3 + * @apiName getStatsCodeFrequency + * @apiDescription Get the number of additions and deletions per week. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiExample {js} ex: +github.repos.getStatsCodeFrequency({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/stats/commit_activity getStatsCommitActivity + * @apiVersion 6.0.3 + * @apiName getStatsCommitActivity + * @apiDescription Get the last year of commit activity data. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiExample {js} ex: +github.repos.getStatsCommitActivity({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/stats/contributors getStatsContributors + * @apiVersion 6.0.3 + * @apiName getStatsContributors + * @apiDescription Get contributors list with additions, deletions, and commit counts. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiExample {js} ex: +github.repos.getStatsContributors({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/stats/participation getStatsParticipation + * @apiVersion 6.0.3 + * @apiName getStatsParticipation + * @apiDescription Get the weekly commit count for the repository owner and everyone else. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiExample {js} ex: +github.repos.getStatsParticipation({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/stats/punch_card getStatsPunchCard + * @apiVersion 6.0.3 + * @apiName getStatsPunchCard + * @apiDescription Get the number of commits per hour in each day. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiExample {js} ex: +github.repos.getStatsPunchCard({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/commits/:ref/statuses getStatuses + * @apiVersion 6.0.3 + * @apiName getStatuses + * @apiDescription List statuses for a specfic ref. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} ref Ref to list the statuses from. It can be a SHA, a branch name, or a tag name. + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.getStatuses({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/tags getTags + * @apiVersion 6.0.3 + * @apiName getTags + * @apiDescription Get tags for the specified repository. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.getTags({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/teams getTeams + * @apiVersion 6.0.3 + * @apiName getTeams + * @apiDescription Get teams for the specified repository. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.getTeams({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/traffic/views getViews + * @apiVersion 6.0.3 + * @apiName getViews + * @apiDescription Get the total number of views and breakdown per day or week for the last 14 days. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.getViews({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/releases/:id/assets listAssets + * @apiVersion 6.0.3 + * @apiName listAssets + * @apiDescription List assets for a release. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiExample {js} ex: +github.repos.listAssets({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/merges merge + * @apiVersion 6.0.3 + * @apiName merge + * @apiDescription Perform a merge. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} base The branch (or git ref) you want your changes pulled into. This should be an existing branch on the current repository. You cannot submit a pull request to one repo that requests a merge to a base of another repo. + * @apiParam {String} head The branch (or git ref) where your changes are implemented. + * @apiParam {String} [commit_message] Commit message to use for the merge commit. If omitted, a default message will be used. + * @apiExample {js} ex: +github.repos.merge({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/hooks/:id/pings pingHook + * @apiVersion 6.0.3 + * @apiName pingHook + * @apiDescription Ping a hook. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiExample {js} ex: +github.repos.pingHook({ ... }); + */ + +/** + * @api {delete} /repos/:owner/:repo/branches/:branch/protection removeBranchProtection + * @apiVersion 6.0.3 + * @apiName removeBranchProtection + * @apiDescription Remove branch protection. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} branch + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.removeBranchProtection({ ... }); + */ + +/** + * @api {delete} /repos/:owner/:repo/collaborators/:username removeCollaborator + * @apiVersion 6.0.3 + * @apiName removeCollaborator + * @apiDescription Remove user as a collaborator. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} username + * @apiExample {js} ex: +github.repos.removeCollaborator({ ... }); + */ + +/** + * @api {delete} /repos/:owner/:repo/branches/:branch/protection/required_status_checks removeProtectedBranchRequiredStatusChecks + * @apiVersion 6.0.3 + * @apiName removeProtectedBranchRequiredStatusChecks + * @apiDescription Remove required status checks of protected branch. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} branch + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.removeProtectedBranchRequiredStatusChecks({ ... }); + */ + +/** + * @api {delete} /repos/:owner/:repo/branches/:branch/protection/required_status_checks/contexts removeProtectedBranchRequiredStatusChecksContexts + * @apiVersion 6.0.3 + * @apiName removeProtectedBranchRequiredStatusChecksContexts + * @apiDescription Remove required status checks contexts of protected branch. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} branch + * @apiParam {Array} body An array of protected branch required status checks contexts (e.g. continuous-integration/jenkins). + * @apiExample {js} ex: +github.repos.removeProtectedBranchRequiredStatusChecksContexts({ ... }); + */ + +/** + * @api {delete} /repos/:owner/:repo/branches/:branch/protection/restrictions removeProtectedBranchRestrictions + * @apiVersion 6.0.3 + * @apiName removeProtectedBranchRestrictions + * @apiDescription Remove restrictions of protected branch. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} branch + * @apiExample {js} ex: +github.repos.removeProtectedBranchRestrictions({ ... }); + */ + +/** + * @api {delete} /repos/:owner/:repo/branches/:branch/protection/restrictions/teams removeProtectedBranchTeamRestrictions + * @apiVersion 6.0.3 + * @apiName removeProtectedBranchTeamRestrictions + * @apiDescription Remove team restrictions of protected branch. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} branch + * @apiParam {Array} body An array of team slugs (e.g. justice-league). + * @apiExample {js} ex: +github.repos.removeProtectedBranchTeamRestrictions({ ... }); + */ + +/** + * @api {delete} /repos/:owner/:repo/branches/:branch/protection/restrictions/users removeProtectedBranchUserRestrictions + * @apiVersion 6.0.3 + * @apiName removeProtectedBranchUserRestrictions + * @apiDescription Remove user restrictions of protected branch. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} branch + * @apiParam {Array} body An array of team slugs (e.g. justice-league). + * @apiExample {js} ex: +github.repos.removeProtectedBranchUserRestrictions({ ... }); + */ + +/** + * @api {put} /repos/:owner/:repo/branches/:branch/protection/required_status_checks/contexts replaceProtectedBranchRequiredStatusChecksContexts + * @apiVersion 6.0.3 + * @apiName replaceProtectedBranchRequiredStatusChecksContexts + * @apiDescription Replace required status checks contexts of protected branch. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} branch + * @apiParam {Array} body An array of protected branch required status checks contexts (e.g. continuous-integration/jenkins). + * @apiExample {js} ex: +github.repos.replaceProtectedBranchRequiredStatusChecksContexts({ ... }); + */ + +/** + * @api {put} /repos/:owner/:repo/branches/:branch/protection/restrictions/teams replaceProtectedBranchTeamRestrictions + * @apiVersion 6.0.3 + * @apiName replaceProtectedBranchTeamRestrictions + * @apiDescription Replace team restrictions of protected branch. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} branch + * @apiParam {Array} body An array of team slugs (e.g. justice-league). + * @apiExample {js} ex: +github.repos.replaceProtectedBranchTeamRestrictions({ ... }); + */ + +/** + * @api {put} /repos/:owner/:repo/branches/:branch/protection/restrictions/users replaceProtectedBranchUserRestrictions + * @apiVersion 6.0.3 + * @apiName replaceProtectedBranchUserRestrictions + * @apiDescription Replace user restrictions of protected branch. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} branch + * @apiParam {Array} body An array of team slugs (e.g. justice-league). + * @apiExample {js} ex: +github.repos.replaceProtectedBranchUserRestrictions({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/pages/builds requestPageBuild + * @apiVersion 6.0.3 + * @apiName requestPageBuild + * @apiDescription Request a page build. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiExample {js} ex: +github.repos.requestPageBuild({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/hooks/:id/tests testHook + * @apiVersion 6.0.3 + * @apiName testHook + * @apiDescription Test a [push] hook. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiExample {js} ex: +github.repos.testHook({ ... }); + */ + +/** + * @api {put} /repos/:owner/:repo/branches/:branch/protection updateBranchProtection + * @apiVersion 6.0.3 + * @apiName updateBranchProtection + * @apiDescription Update branch protection. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} branch + * @apiParam {Json} required_status_checks JSON object that contains the following keys: `include_admins` - Enforce required status checks for repository administrators, `strict` - Require branches to be up to date before merging, `contexts` - The list of status checks to require in order to merge into this branch. This object can have the value of `null` for disabled. + * @apiParam {Json} restrictions JSON object that contains the following keys: `users` - The list of user logins with push access, `teams` - The list of team slugs with push access. This object can have the value of `null` for disabled. + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.updateBranchProtection({ ... }); + */ + +/** + * @api {patch} /repos/:owner/:repo/comments/:id updateCommitComment + * @apiVersion 6.0.3 + * @apiName updateCommitComment + * @apiDescription Update a commit comment. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiParam {String} body + * @apiExample {js} ex: +github.repos.updateCommitComment({ ... }); + */ + +/** + * @api {put} /repos/:owner/:repo/contents/:path updateFile + * @apiVersion 6.0.3 + * @apiName updateFile + * @apiDescription Update a file. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} path The content path. + * @apiParam {String} message The commit message. + * @apiParam {String} content The updated file content, Base64 encoded. + * @apiParam {String} sha The blob SHA of the file being replaced. + * @apiParam {String} [branch] The branch name. If not provided, uses the repository’s default branch (usually master). + * @apiParam {Json} [committer] + * @apiExample {js} ex: +github.repos.updateFile({ ... }); + */ + +/** + * @api {patch} /repositories/:repo_id/invitations/:invitation_id updateInvite + * @apiVersion 6.0.3 + * @apiName updateInvite + * @apiDescription Update a repository invitation. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} repo_id + * @apiParam {String} invitation_id + * @apiParam {String=read,write,admin} [permission] The permissions that the associated user will have on the repository. + * @apiExample {js} ex: +github.repos.updateInvite({ ... }); + */ + +/** + * @api {patch} /repos/:owner/:repo/branches/:branch/protection/required_status_checks updateProtectedBranchRequiredStatusChecks + * @apiVersion 6.0.3 + * @apiName updateProtectedBranchRequiredStatusChecks + * @apiDescription Update required status checks of protected branch. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} branch + * @apiParam {Boolean} [include_admins] Enforce required status checks for repository administrators. + * @apiParam {Boolean} [strict] Require branches to be up to date before merging. + * @apiParam {Array} [contexts] The list of status checks to require in order to merge into this branch. + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.updateProtectedBranchRequiredStatusChecks({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/releases/:id/assets uploadAsset + * @apiVersion 6.0.3 + * @apiName uploadAsset + * @apiDescription Upload a release asset. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiParam {String} filePath The file path of the asset. + * @apiParam {String} name The file name of the asset. This should be set in a URI query parameter. + * @apiParam {String} [label] An alternate short description of the asset. Used in place of the filename. This should be set in a URI query parameter. + * @apiExample {js} ex: +github.repos.uploadAsset({ ... }); + */ + +/** + * @api {get} /search/code code + * @apiVersion 6.0.3 + * @apiName code + * @apiDescription Search code. + * @apiGroup search + * + * @apiParam {String} q Search Term + * @apiParam {String=indexed} [sort] The sort field. Can only be indexed, which indicates how recently a file has been indexed by the GitHub search infrastructure. Default: results are sorted by best match. + * @apiParam {String=asc,desc} [order=desc] asc or desc + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.search.code({ ... }); + */ + +/** + * @api {get} /legacy/user/email/:email email + * @apiVersion 6.0.3 + * @apiName email + * @apiDescription Search against public email addresses. + * @apiGroup search + * + * @apiParam {String} email The email address + * @apiExample {js} ex: +github.search.email({ ... }); + */ + +/** + * @api {get} /search/issues issues + * @apiVersion 6.0.3 + * @apiName issues + * @apiDescription Search issues. + * @apiGroup search + * + * @apiParam {String} q Search Term + * @apiParam {String=comments,created,updated} [sort] The sort field. Can be comments, created, or updated. Default: results are sorted by best match. + * @apiParam {String=asc,desc} [order=desc] asc or desc + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.search.issues({ ... }); + */ + +/** + * @api {get} /search/repositories repos + * @apiVersion 6.0.3 + * @apiName repos + * @apiDescription Search repositories. + * @apiGroup search + * + * @apiParam {String} q Search Term + * @apiParam {String=stars,forks,updated} [sort] stars, forks, or updated + * @apiParam {String=asc,desc} [order=desc] asc or desc + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.search.repos({ ... }); + */ + +/** + * @api {get} /search/users users + * @apiVersion 6.0.3 + * @apiName users + * @apiDescription Search users. + * @apiGroup search + * + * @apiParam {String} q Search Term + * @apiParam {String=followers,repositories,joined} [sort] The sort field. Can be followers, repositories, or joined. Default: results are sorted by best match. + * @apiParam {String=asc,desc} [order=desc] asc or desc + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.search.users({ ... }); + */ + +/** + * @api {patch} /user/repository_invitations/:invitation_id acceptRepoInvite + * @apiVersion 6.0.3 + * @apiName acceptRepoInvite + * @apiDescription Accept a repository invitation. (In preview period. See README.) + * @apiGroup users + * + * @apiParam {String} invitation_id + * @apiExample {js} ex: +github.users.acceptRepoInvite({ ... }); + */ + +/** + * @api {post} /user/emails addEmails + * @apiVersion 6.0.3 + * @apiName addEmails + * @apiDescription Add email address(es) + * @apiGroup users + * + * @apiParam {Array} body You can post a single email address or an array of addresses. + * @apiExample {js} ex: +github.users.addEmails({ ... }); + */ + +/** + * @api {get} /user/following/:username checkFollowing + * @apiVersion 6.0.3 + * @apiName checkFollowing + * @apiDescription Check if you are following a user + * @apiGroup users + * + * @apiParam {String} username + * @apiExample {js} ex: +github.users.checkFollowing({ ... }); + */ + +/** + * @api {get} /users/:username/following/:target_user checkIfOneFollowersOther + * @apiVersion 6.0.3 + * @apiName checkIfOneFollowersOther + * @apiDescription Check if one user follows another + * @apiGroup users + * + * @apiParam {String} username + * @apiParam {String} target_user + * @apiExample {js} ex: +github.users.checkIfOneFollowersOther({ ... }); + */ + +/** + * @api {post} /user/gpg_keys createGpgKey + * @apiVersion 6.0.3 + * @apiName createGpgKey + * @apiDescription Create a GPG key. (In preview period. See README.) + * @apiGroup users + * + * @apiParam {String} armored_public_key GPG key contents + * @apiExample {js} ex: +github.users.createGpgKey({ ... }); + */ + +/** + * @api {post} /user/keys createKey + * @apiVersion 6.0.3 + * @apiName createKey + * @apiDescription Create a public key + * @apiGroup users + * + * @apiParam {String} title + * @apiParam {String} key + * @apiExample {js} ex: +github.users.createKey({ ... }); + */ + +/** + * @api {delete} /user/repository_invitations/:invitation_id declineRepoInvite + * @apiVersion 6.0.3 + * @apiName declineRepoInvite + * @apiDescription Decline a repository invitation. (In preview period. See README.) + * @apiGroup users + * + * @apiParam {String} invitation_id + * @apiExample {js} ex: +github.users.declineRepoInvite({ ... }); + */ + +/** + * @api {delete} /user/emails deleteEmails + * @apiVersion 6.0.3 + * @apiName deleteEmails + * @apiDescription Delete email address(es) + * @apiGroup users + * + * @apiParam {Array} body You can post a single email address or an array of addresses. + * @apiExample {js} ex: +github.users.deleteEmails({ ... }); + */ + +/** + * @api {delete} /user/gpg_keys/:id deleteGpgKey + * @apiVersion 6.0.3 + * @apiName deleteGpgKey + * @apiDescription Delete a GPG key. (In preview period. See README.) + * @apiGroup users + * + * @apiParam {String} id + * @apiExample {js} ex: +github.users.deleteGpgKey({ ... }); + */ + +/** + * @api {delete} /user/keys/:id deleteKey + * @apiVersion 6.0.3 + * @apiName deleteKey + * @apiDescription Delete a public key + * @apiGroup users + * + * @apiParam {String} id + * @apiExample {js} ex: +github.users.deleteKey({ ... }); + */ + +/** + * @api {delete} /users/:username/site_admin demote + * @apiVersion 6.0.3 + * @apiName demote + * @apiDescription Demote a site administrator to an ordinary user + * @apiGroup users + * + * @apiParam {String} username + * @apiExample {js} ex: +github.users.demote({ ... }); + */ + +/** + * @api {patch} /user/memberships/orgs/:org editOrgMembership + * @apiVersion 6.0.3 + * @apiName editOrgMembership + * @apiDescription Edit your organization membership + * @apiGroup users + * + * @apiParam {String} org + * @apiParam {String=active} state The state that the membership should be in. Only "active" will be accepted. + * @apiExample {js} ex: +github.users.editOrgMembership({ ... }); + */ + +/** + * @api {put} /user/following/:username followUser + * @apiVersion 6.0.3 + * @apiName followUser + * @apiDescription Follow a user + * @apiGroup users + * + * @apiParam {String} username + * @apiExample {js} ex: +github.users.followUser({ ... }); + */ + +/** + * @api {get} /user get + * @apiVersion 6.0.3 + * @apiName get + * @apiDescription Get the authenticated user + * @apiGroup users + * + * @apiExample {js} ex: +github.users.get({ ... }); + */ + +/** + * @api {get} /users getAll + * @apiVersion 6.0.3 + * @apiName getAll + * @apiDescription Get all users + * @apiGroup users + * + * @apiParam {Number} [since] The integer ID of the last User that you’ve seen. + * @apiExample {js} ex: +github.users.getAll({ ... }); + */ + +/** + * @api {get} /user/:id getById + * @apiVersion 6.0.3 + * @apiName getById + * @apiDescription Get a single user by GitHub ID + * @apiGroup users + * + * @apiParam {String} id + * @apiExample {js} ex: +github.users.getById({ ... }); + */ + +/** + * @api {get} /user/emails getEmails + * @apiVersion 6.0.3 + * @apiName getEmails + * @apiDescription List email addresses for a user + * @apiGroup users + * + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.users.getEmails({ ... }); + */ + +/** + * @api {get} /user/followers getFollowers + * @apiVersion 6.0.3 + * @apiName getFollowers + * @apiDescription List the authenticated user's followers + * @apiGroup users + * + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.users.getFollowers({ ... }); + */ + +/** + * @api {get} /users/:username/followers getFollowersForUser + * @apiVersion 6.0.3 + * @apiName getFollowersForUser + * @apiDescription List a user's followers + * @apiGroup users + * + * @apiParam {String} username + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.users.getFollowersForUser({ ... }); + */ + +/** + * @api {get} /user/following getFollowing + * @apiVersion 6.0.3 + * @apiName getFollowing + * @apiDescription List who the authenticated user is following + * @apiGroup users + * + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.users.getFollowing({ ... }); + */ + +/** + * @api {get} /users/:username/following getFollowingForUser + * @apiVersion 6.0.3 + * @apiName getFollowingForUser + * @apiDescription List who a user is following + * @apiGroup users + * + * @apiParam {String} username + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.users.getFollowingForUser({ ... }); + */ + +/** + * @api {get} /users/:username getForUser + * @apiVersion 6.0.3 + * @apiName getForUser + * @apiDescription Get a single user + * @apiGroup users + * + * @apiParam {String} username + * @apiExample {js} ex: +github.users.getForUser({ ... }); + */ + +/** + * @api {get} /user/gpg_keys/:id getGpgKey + * @apiVersion 6.0.3 + * @apiName getGpgKey + * @apiDescription Get a single GPG key. (In preview period. See README.) + * @apiGroup users + * + * @apiParam {String} id + * @apiExample {js} ex: +github.users.getGpgKey({ ... }); + */ + +/** + * @api {get} /user/gpg_keys getGpgKeys + * @apiVersion 6.0.3 + * @apiName getGpgKeys + * @apiDescription List your GPG keys. (In preview period. See README.) + * @apiGroup users + * + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.users.getGpgKeys({ ... }); + */ + +/** + * @api {get} /user/keys/:id getKey + * @apiVersion 6.0.3 + * @apiName getKey + * @apiDescription Get a single public key + * @apiGroup users + * + * @apiParam {String} id + * @apiExample {js} ex: +github.users.getKey({ ... }); + */ + +/** + * @api {get} /user/keys getKeys + * @apiVersion 6.0.3 + * @apiName getKeys + * @apiDescription List your public keys + * @apiGroup users + * + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.users.getKeys({ ... }); + */ + +/** + * @api {get} /users/:username/keys getKeysForUser + * @apiVersion 6.0.3 + * @apiName getKeysForUser + * @apiDescription List public keys for a user + * @apiGroup users + * + * @apiParam {String} username + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.users.getKeysForUser({ ... }); + */ + +/** + * @api {get} /user/memberships/orgs/:org getOrgMembership + * @apiVersion 6.0.3 + * @apiName getOrgMembership + * @apiDescription Get your organization membership + * @apiGroup users + * + * @apiParam {String} org + * @apiExample {js} ex: +github.users.getOrgMembership({ ... }); + */ + +/** + * @api {get} /user/memberships/orgs getOrgMemberships + * @apiVersion 6.0.3 + * @apiName getOrgMemberships + * @apiDescription List your organization memberships + * @apiGroup users + * + * @apiParam {String=active,pending} [state] Indicates the state of the memberships to return. Can be either active or pending. If not specified, both active and pending memberships are returned. + * @apiExample {js} ex: +github.users.getOrgMemberships({ ... }); + */ + +/** + * @api {get} /user/orgs getOrgs + * @apiVersion 6.0.3 + * @apiName getOrgs + * @apiDescription List organizations for the authenticated user. + * @apiGroup users + * + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.users.getOrgs({ ... }); + */ + +/** + * @api {get} /user/repository_invitations getRepoInvites + * @apiVersion 6.0.3 + * @apiName getRepoInvites + * @apiDescription List a user's repository invitations. (In preview period. See README.) + * @apiGroup users + * + * @apiExample {js} ex: +github.users.getRepoInvites({ ... }); + */ + +/** + * @api {get} /user/teams getTeams + * @apiVersion 6.0.3 + * @apiName getTeams + * @apiDescription Get your teams + * @apiGroup users + * + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.users.getTeams({ ... }); + */ + +/** + * @api {put} /users/:username/site_admin promote + * @apiVersion 6.0.3 + * @apiName promote + * @apiDescription Promote an ordinary user to a site administrator + * @apiGroup users + * + * @apiParam {String} username + * @apiExample {js} ex: +github.users.promote({ ... }); + */ + +/** + * @api {put} /users/:username/suspended suspend + * @apiVersion 6.0.3 + * @apiName suspend + * @apiDescription Suspend a user + * @apiGroup users + * + * @apiParam {String} username + * @apiExample {js} ex: +github.users.suspend({ ... }); + */ + +/** + * @api {delete} /user/following/:username unfollowUser + * @apiVersion 6.0.3 + * @apiName unfollowUser + * @apiDescription Unfollow a user + * @apiGroup users + * + * @apiParam {String} username + * @apiExample {js} ex: +github.users.unfollowUser({ ... }); + */ + +/** + * @api {delete} /users/:username/suspended unsuspend + * @apiVersion 6.0.3 + * @apiName unsuspend + * @apiDescription Unsuspend a user + * @apiGroup users + * + * @apiParam {String} username + * @apiExample {js} ex: +github.users.unsuspend({ ... }); + */ + +/** + * @api {patch} /user update + * @apiVersion 6.0.3 + * @apiName update + * @apiDescription Update the authenticated user + * @apiGroup users + * + * @apiParam {String} [name] The new name of the user + * @apiParam {String} [email] Publicly visible email address. + * @apiParam {String} [blog] The new blog URL of the user. + * @apiParam {String} [company] The new company of the user. + * @apiParam {String} [location] The new location of the user. + * @apiParam {Boolean} [hireable] The new hiring availability of the user. + * @apiParam {String} [bio] The new short biography of the user. + * @apiExample {js} ex: +github.users.update({ ... }); + */ + +/** + * @api {get} /notifications/threads/:id/subscription checkNotificationThreadSubscription + * @apiVersion 8.2.1 + * @apiName checkNotificationThreadSubscription + * @apiDescription Check to see if the current user is subscribed to a thread. + * @apiGroup activity + * + * @apiParam {String} id + * @apiExample {js} ex: +github.activity.checkNotificationThreadSubscription({ ... }); + */ + +/** + * @api {get} /user/starred/:owner/:repo checkStarringRepo + * @apiVersion 8.2.1 + * @apiName checkStarringRepo + * @apiDescription Check if you are starring a repository + * @apiGroup activity + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.activity.checkStarringRepo({ ... }); + */ + +/** + * @api {delete} /notifications/threads/:id/subscription deleteNotificationThreadSubscription + * @apiVersion 8.2.1 + * @apiName deleteNotificationThreadSubscription + * @apiDescription Delete a notification thread subscription. + * @apiGroup activity + * + * @apiParam {String} id + * @apiExample {js} ex: +github.activity.deleteNotificationThreadSubscription({ ... }); + */ + +/** + * @api {get} /events getEvents + * @apiVersion 8.2.1 + * @apiName getEvents + * @apiDescription List public events + * @apiGroup activity + * + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.activity.getEvents({ ... }); + */ + +/** + * @api {get} /orgs/:org/events getEventsForOrg + * @apiVersion 8.2.1 + * @apiName getEventsForOrg + * @apiDescription List public events for an organization + * @apiGroup activity + * + * @apiParam {String} org + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.activity.getEventsForOrg({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/events getEventsForRepo + * @apiVersion 8.2.1 + * @apiName getEventsForRepo + * @apiDescription List repository events + * @apiGroup activity + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.activity.getEventsForRepo({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/issues/events getEventsForRepoIssues + * @apiVersion 8.2.1 + * @apiName getEventsForRepoIssues + * @apiDescription List issue events for a repository + * @apiGroup activity + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.activity.getEventsForRepoIssues({ ... }); + */ + +/** + * @api {get} /networks/:owner/:repo/events getEventsForRepoNetwork + * @apiVersion 8.2.1 + * @apiName getEventsForRepoNetwork + * @apiDescription List public events for a network of repositories + * @apiGroup activity + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.activity.getEventsForRepoNetwork({ ... }); + */ + +/** + * @api {get} /users/:username/events getEventsForUser + * @apiVersion 8.2.1 + * @apiName getEventsForUser + * @apiDescription List events performed by a user + * @apiGroup activity + * + * @apiParam {String} username + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.activity.getEventsForUser({ ... }); + */ + +/** + * @api {get} /users/:username/events/orgs/:org getEventsForUserOrg + * @apiVersion 8.2.1 + * @apiName getEventsForUserOrg + * @apiDescription List events for a user's organization + * @apiGroup activity + * + * @apiParam {String} username + * @apiParam {String} org + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.activity.getEventsForUserOrg({ ... }); + */ + +/** + * @api {get} /users/:username/events/public getEventsForUserPublic + * @apiVersion 8.2.1 + * @apiName getEventsForUserPublic + * @apiDescription List public events performed by a user + * @apiGroup activity + * + * @apiParam {String} username + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.activity.getEventsForUserPublic({ ... }); + */ + +/** + * @api {get} /users/:username/received_events getEventsReceived + * @apiVersion 8.2.1 + * @apiName getEventsReceived + * @apiDescription List events that a user has received + * @apiGroup activity + * + * @apiParam {String} username + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.activity.getEventsReceived({ ... }); + */ + +/** + * @api {get} /users/:username/received_events/public getEventsReceivedPublic + * @apiVersion 8.2.1 + * @apiName getEventsReceivedPublic + * @apiDescription List public events that a user has received + * @apiGroup activity + * + * @apiParam {String} username + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.activity.getEventsReceivedPublic({ ... }); + */ + +/** + * @api {get} /feeds getFeeds + * @apiVersion 8.2.1 + * @apiName getFeeds + * @apiDescription Get all feeds available for the authenticated user. + * @apiGroup activity + * + * @apiExample {js} ex: +github.activity.getFeeds({ ... }); + */ + +/** + * @api {get} /notifications/threads/:id getNotificationThread + * @apiVersion 8.2.1 + * @apiName getNotificationThread + * @apiDescription View a single notification thread. + * @apiGroup activity + * + * @apiParam {String} id + * @apiExample {js} ex: +github.activity.getNotificationThread({ ... }); + */ + +/** + * @api {get} /notifications getNotifications + * @apiVersion 8.2.1 + * @apiName getNotifications + * @apiDescription Get all notifications for the current user, grouped by repository. + * @apiGroup activity + * + * @apiParam {Boolean} [all=false] If true, show notifications marked as read. Default: false + * @apiParam {Boolean} [participating=false] If true, only shows notifications in which the user is directly participating or mentioned. Default: false + * @apiParam {Date} [since] Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ + * @apiParam {String} [before] Only show notifications updated before the given time. This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ. + * @apiExample {js} ex: +github.activity.getNotifications({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/notifications getNotificationsForUser + * @apiVersion 8.2.1 + * @apiName getNotificationsForUser + * @apiDescription Get all notifications for the given user. + * @apiGroup activity + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Boolean} [all=false] If true, show notifications marked as read. Default: false + * @apiParam {Boolean} [participating=false] If true, only shows notifications in which the user is directly participating or mentioned. Default: false + * @apiParam {Date} [since] Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ + * @apiParam {String} [before] Only show notifications updated before the given time. This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ. + * @apiExample {js} ex: +github.activity.getNotificationsForUser({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/subscription getRepoSubscription + * @apiVersion 8.2.1 + * @apiName getRepoSubscription + * @apiDescription Get a Repository Subscription. + * @apiGroup activity + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.activity.getRepoSubscription({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/stargazers getStargazersForRepo + * @apiVersion 8.2.1 + * @apiName getStargazersForRepo + * @apiDescription List Stargazers + * @apiGroup activity + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.activity.getStargazersForRepo({ ... }); + */ + +/** + * @api {get} /user/starred getStarredRepos + * @apiVersion 8.2.1 + * @apiName getStarredRepos + * @apiDescription List repositories being starred by the authenticated user + * @apiGroup activity + * + * @apiParam {String=created,updated} [sort=created] + * @apiParam {String=asc,desc} [direction=desc] + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.activity.getStarredRepos({ ... }); + */ + +/** + * @api {get} /users/:username/starred getStarredReposForUser + * @apiVersion 8.2.1 + * @apiName getStarredReposForUser + * @apiDescription List repositories being starred by a user + * @apiGroup activity + * + * @apiParam {String} username + * @apiParam {String=created,updated} [sort=created] + * @apiParam {String=asc,desc} [direction=desc] + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.activity.getStarredReposForUser({ ... }); + */ + +/** + * @api {get} /user/subscriptions getWatchedRepos + * @apiVersion 8.2.1 + * @apiName getWatchedRepos + * @apiDescription List repositories being watched by the authenticated user. + * @apiGroup activity + * + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.activity.getWatchedRepos({ ... }); + */ + +/** + * @api {get} /users/:username/subscriptions getWatchedReposForUser + * @apiVersion 8.2.1 + * @apiName getWatchedReposForUser + * @apiDescription List repositories being watched by a user. + * @apiGroup activity + * + * @apiParam {String} username + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.activity.getWatchedReposForUser({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/subscribers getWatchersForRepo + * @apiVersion 8.2.1 + * @apiName getWatchersForRepo + * @apiDescription Get watchers for repository. + * @apiGroup activity + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.activity.getWatchersForRepo({ ... }); + */ + +/** + * @api {patch} /notifications/threads/:id markNotificationThreadAsRead + * @apiVersion 8.2.1 + * @apiName markNotificationThreadAsRead + * @apiDescription Mark a notification thread as read. + * @apiGroup activity + * + * @apiParam {String} id + * @apiExample {js} ex: +github.activity.markNotificationThreadAsRead({ ... }); + */ + +/** + * @api {put} /notifications markNotificationsAsRead + * @apiVersion 8.2.1 + * @apiName markNotificationsAsRead + * @apiDescription Mark notifications as read for authenticated user. + * @apiGroup activity + * + * @apiParam {String} [last_read_at=Time.now] Describes the last point that notifications were checked. Anything updated since this time will not be updated. This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ. Default: Time.now + * @apiExample {js} ex: +github.activity.markNotificationsAsRead({ ... }); + */ + +/** + * @api {put} /repos/:owner/:repo/notifications markNotificationsAsReadForRepo + * @apiVersion 8.2.1 + * @apiName markNotificationsAsReadForRepo + * @apiDescription Mark notifications in a repo as read. + * @apiGroup activity + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} [last_read_at=Time.now] Describes the last point that notifications were checked. Anything updated since this time will not be updated. This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ. Default: Time.now + * @apiExample {js} ex: +github.activity.markNotificationsAsReadForRepo({ ... }); + */ + +/** + * @api {put} /notifications/threads/:id/subscription setNotificationThreadSubscription + * @apiVersion 8.2.1 + * @apiName setNotificationThreadSubscription + * @apiDescription This lets you subscribe or unsubscribe from a conversation. Unsubscribing from a conversation mutes all future notifications (until you comment or get @mentioned once more). + * @apiGroup activity + * + * @apiParam {String} id + * @apiParam {Boolean} [subscribed] Determines if notifications should be received from this thread + * @apiParam {Boolean} [ignored] Determines if all notifications should be blocked from this thread + * @apiExample {js} ex: +github.activity.setNotificationThreadSubscription({ ... }); + */ + +/** + * @api {put} /repos/:owner/:repo/subscription setRepoSubscription + * @apiVersion 8.2.1 + * @apiName setRepoSubscription + * @apiDescription Set a Repository Subscription + * @apiGroup activity + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Boolean} [subscribed] Determines if notifications should be received from this repository. + * @apiParam {Boolean} [ignored] Determines if all notifications should be blocked from this repository. + * @apiExample {js} ex: +github.activity.setRepoSubscription({ ... }); + */ + +/** + * @api {put} /user/starred/:owner/:repo starRepo + * @apiVersion 8.2.1 + * @apiName starRepo + * @apiDescription Star a repository + * @apiGroup activity + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiExample {js} ex: +github.activity.starRepo({ ... }); + */ + +/** + * @api {delete} /user/starred/:owner/:repo unstarRepo + * @apiVersion 8.2.1 + * @apiName unstarRepo + * @apiDescription Unstar a repository + * @apiGroup activity + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiExample {js} ex: +github.activity.unstarRepo({ ... }); + */ + +/** + * @api {delete} /repos/:owner/:repo/subscription unwatchRepo + * @apiVersion 8.2.1 + * @apiName unwatchRepo + * @apiDescription Unwatch a repository. + * @apiGroup activity + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiExample {js} ex: +github.activity.unwatchRepo({ ... }); + */ + +/** + * @api {get} /applications/:client_id/tokens/:access_token check + * @apiVersion 8.2.1 + * @apiName check + * @apiDescription Check an authorization + * @apiGroup authorization + * + * @apiParam {String} access_token OAuth token + * @apiParam {String} [client_id] The 20 character OAuth app client key for which to create the token. + * @apiExample {js} ex: +github.authorization.check({ ... }); + */ + +/** + * @api {post} /authorizations create + * @apiVersion 8.2.1 + * @apiName create + * @apiDescription Create a new authorization. + * @apiGroup authorization + * + * @apiParam {Array} [scopes] A list of scopes that this authorization is in. + * @apiParam {String} [note] A note to remind you what the OAuth token is for. + * @apiParam {String} [note_url] A URL to remind you what app the OAuth token is for. + * @apiParam {String} [client_id] The 20 character OAuth app client key for which to create the token. + * @apiParam {String} [client_secret] The 40 character OAuth app client secret for which to create the token. + * @apiParam {String} [fingerprint] A unique string to distinguish an authorization from others created for the same client ID and user. + * @apiExample {js} ex: +github.authorization.create({ ... }); + */ + +/** + * @api {delete} /authorizations/:id delete + * @apiVersion 8.2.1 + * @apiName delete + * @apiDescription Delete an authorization. + * @apiGroup authorization + * + * @apiParam {String} id + * @apiExample {js} ex: +github.authorization.delete({ ... }); + */ + +/** + * @api {delete} /applications/grants/:id deleteGrant + * @apiVersion 8.2.1 + * @apiName deleteGrant + * @apiDescription Delete a grant. + * @apiGroup authorization + * + * @apiParam {String} id + * @apiExample {js} ex: +github.authorization.deleteGrant({ ... }); + */ + +/** + * @api {get} /authorizations/:id get + * @apiVersion 8.2.1 + * @apiName get + * @apiDescription Get a single authorization. + * @apiGroup authorization + * + * @apiParam {String} id + * @apiExample {js} ex: +github.authorization.get({ ... }); + */ + +/** + * @api {get} /authorizations getAll + * @apiVersion 8.2.1 + * @apiName getAll + * @apiDescription List your authorizations. + * @apiGroup authorization + * + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.authorization.getAll({ ... }); + */ + +/** + * @api {get} /applications/grants/:id getGrant + * @apiVersion 8.2.1 + * @apiName getGrant + * @apiDescription Get a single grant. + * @apiGroup authorization + * + * @apiParam {String} id + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.authorization.getGrant({ ... }); + */ + +/** + * @api {get} /applications/grants getGrants + * @apiVersion 8.2.1 + * @apiName getGrants + * @apiDescription List your grants. + * @apiGroup authorization + * + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.authorization.getGrants({ ... }); + */ + +/** + * @api {put} /authorizations/clients/:client_id getOrCreateAuthorizationForApp + * @apiVersion 8.2.1 + * @apiName getOrCreateAuthorizationForApp + * @apiDescription Get or create an authorization for a specific app. + * @apiGroup authorization + * + * @apiParam {String} client_secret The 40 character OAuth app client secret associated with the client ID specified in the URL. + * @apiParam {String} [client_id] The 20 character OAuth app client key for which to create the token. + * @apiParam {Array} [scopes] A list of scopes that this authorization is in. + * @apiParam {String} [note] A note to remind you what the OAuth token is for. + * @apiParam {String} [note_url] A URL to remind you what app the OAuth token is for. + * @apiParam {String} [fingerprint] A unique string to distinguish an authorization from others created for the same client ID and user. + * @apiExample {js} ex: +github.authorization.getOrCreateAuthorizationForApp({ ... }); + */ + +/** + * @api {put} /authorizations/clients/:client_id/:fingerprint getOrCreateAuthorizationForAppAndFingerprint + * @apiVersion 8.2.1 + * @apiName getOrCreateAuthorizationForAppAndFingerprint + * @apiDescription Get or create an authorization for a specific app and fingerprint. + * @apiGroup authorization + * + * @apiParam {String} client_secret The 40 character OAuth app client secret associated with the client ID specified in the URL. + * @apiParam {String} [client_id] The 20 character OAuth app client key for which to create the token. + * @apiParam {String} [fingerprint] A unique string to distinguish an authorization from others created for the same client ID and user. + * @apiParam {Array} [scopes] A list of scopes that this authorization is in. + * @apiParam {String} [note] A note to remind you what the OAuth token is for. + * @apiParam {String} [note_url] A URL to remind you what app the OAuth token is for. + * @apiExample {js} ex: +github.authorization.getOrCreateAuthorizationForAppAndFingerprint({ ... }); + */ + +/** + * @api {post} /applications/:client_id/tokens/:access_token reset + * @apiVersion 8.2.1 + * @apiName reset + * @apiDescription Reset an authorization + * @apiGroup authorization + * + * @apiParam {String} access_token OAuth token + * @apiParam {String} [client_id] The 20 character OAuth app client key for which to create the token. + * @apiExample {js} ex: +github.authorization.reset({ ... }); + */ + +/** + * @api {delete} /applications/:client_id/tokens/:access_token revoke + * @apiVersion 8.2.1 + * @apiName revoke + * @apiDescription Revoke an authorization for an application + * @apiGroup authorization + * + * @apiParam {String} access_token OAuth token + * @apiParam {String} [client_id] The 20 character OAuth app client key for which to create the token. + * @apiExample {js} ex: +github.authorization.revoke({ ... }); + */ + +/** + * @api {patch} /authorizations/:id update + * @apiVersion 8.2.1 + * @apiName update + * @apiDescription Update an existing authorization. + * @apiGroup authorization + * + * @apiParam {String} id + * @apiParam {Array} [scopes] A list of scopes that this authorization is in. + * @apiParam {Array} [add_scopes] A list of scopes to add to this authorization. + * @apiParam {Array} [remove_scopes] A list of scopes to remove from this authorization. + * @apiParam {String} [note] A note to remind you what the OAuth token is for. + * @apiParam {String} [note_url] A URL to remind you what app the OAuth token is for. + * @apiParam {String} [fingerprint] A unique string to distinguish an authorization from others created for the same client ID and user. + * @apiExample {js} ex: +github.authorization.update({ ... }); + */ + +/** + * @api {post} /admin/organizations createOrg + * @apiVersion 8.2.1 + * @apiName createOrg + * @apiDescription Create an organization + * @apiGroup enterprise + * + * @apiParam {String} login The organization's username. + * @apiParam {String} admin The login of the user who will manage this organization. + * @apiParam {String} [profile_name] The organization's display name. + * @apiExample {js} ex: +github.enterprise.createOrg({ ... }); + */ + +/** + * @api {post} /admin/pre_receive_environments createPreReceiveEnvironment + * @apiVersion 8.2.1 + * @apiName createPreReceiveEnvironment + * @apiDescription Create a pre-receive environment. (In preview period. See README.) + * @apiGroup enterprise + * + * @apiParam {String} name The new pre-receive environment's name. + * @apiParam {String} image_url URL from which to download a tarball of this environment. + * @apiExample {js} ex: +github.enterprise.createPreReceiveEnvironment({ ... }); + */ + +/** + * @api {post} /admin/pre-receive-hooks createPreReceiveHook + * @apiVersion 8.2.1 + * @apiName createPreReceiveHook + * @apiDescription Create a pre-receive hook. (In preview period. See README.) + * @apiGroup enterprise + * + * @apiParam {String} name The name of the hook. + * @apiParam {String} script The script that the hook runs. + * @apiParam {Json} script_repository The GitHub repository where the script is kept. + * @apiParam {Json} environment The pre-receive environment where the script is executed. + * @apiParam {String} [enforcement=disabled] The state of enforcement for this hook. default: disabled + * @apiParam {Boolean} [allow_downstream_configuration=false] Whether enforcement can be overridden at the org or repo level. default: false + * @apiExample {js} ex: +github.enterprise.createPreReceiveHook({ ... }); + */ + +/** + * @api {delete} /admin/pre_receive_environments/:id deletePreReceiveEnvironment + * @apiVersion 8.2.1 + * @apiName deletePreReceiveEnvironment + * @apiDescription Delete a pre-receive environment. (In preview period. See README.) + * @apiGroup enterprise + * + * @apiParam {String} id + * @apiExample {js} ex: +github.enterprise.deletePreReceiveEnvironment({ ... }); + */ + +/** + * @api {delete} /admin/pre_receive_hooks/:id deletePreReceiveHook + * @apiVersion 8.2.1 + * @apiName deletePreReceiveHook + * @apiDescription Delete a pre-receive hook. (In preview period. See README.) + * @apiGroup enterprise + * + * @apiParam {String} id + * @apiExample {js} ex: +github.enterprise.deletePreReceiveHook({ ... }); + */ + +/** + * @api {patch} /admin/pre_receive_environments/:id editPreReceiveEnvironment + * @apiVersion 8.2.1 + * @apiName editPreReceiveEnvironment + * @apiDescription Create a pre-receive environment. (In preview period. See README.) + * @apiGroup enterprise + * + * @apiParam {String} id + * @apiParam {String} name This pre-receive environment's new name. + * @apiParam {String} image_url URL from which to download a tarball of this environment. + * @apiExample {js} ex: +github.enterprise.editPreReceiveEnvironment({ ... }); + */ + +/** + * @api {patch} /admin/pre_receive_hooks/:id editPreReceiveHook + * @apiVersion 8.2.1 + * @apiName editPreReceiveHook + * @apiDescription Edit a pre-receive hook. (In preview period. See README.) + * @apiGroup enterprise + * + * @apiParam {String} id + * @apiParam {Json} hook JSON object that contains pre-receive hook info. + * @apiExample {js} ex: +github.enterprise.editPreReceiveHook({ ... }); + */ + +/** + * @api {get} /enterprise/settings/license getLicense + * @apiVersion 8.2.1 + * @apiName getLicense + * @apiDescription Get license information + * @apiGroup enterprise + * + * @apiExample {js} ex: +github.enterprise.getLicense({ ... }); + */ + +/** + * @api {get} /admin/pre-receive-environments/:id getPreReceiveEnvironment + * @apiVersion 8.2.1 + * @apiName getPreReceiveEnvironment + * @apiDescription Get a single pre-receive environment. (In preview period. See README.) + * @apiGroup enterprise + * + * @apiParam {String} id + * @apiExample {js} ex: +github.enterprise.getPreReceiveEnvironment({ ... }); + */ + +/** + * @api {get} /admin/pre-receive-environments/:id/downloads/latest getPreReceiveEnvironmentDownloadStatus + * @apiVersion 8.2.1 + * @apiName getPreReceiveEnvironmentDownloadStatus + * @apiDescription Get a pre-receive environment's download status. (In preview period. See README.) + * @apiGroup enterprise + * + * @apiParam {String} id + * @apiExample {js} ex: +github.enterprise.getPreReceiveEnvironmentDownloadStatus({ ... }); + */ + +/** + * @api {get} /admin/pre_receive_environments getPreReceiveEnvironments + * @apiVersion 8.2.1 + * @apiName getPreReceiveEnvironments + * @apiDescription List pre-receive environments. (In preview period. See README.) + * @apiGroup enterprise + * + * @apiExample {js} ex: +github.enterprise.getPreReceiveEnvironments({ ... }); + */ + +/** + * @api {get} /admin/pre-receive-hooks/:id getPreReceiveHook + * @apiVersion 8.2.1 + * @apiName getPreReceiveHook + * @apiDescription Get a single pre-receive hook. (In preview period. See README.) + * @apiGroup enterprise + * + * @apiParam {String} id + * @apiExample {js} ex: +github.enterprise.getPreReceiveHook({ ... }); + */ + +/** + * @api {get} /admin/pre-receive-hooks getPreReceiveHooks + * @apiVersion 8.2.1 + * @apiName getPreReceiveHooks + * @apiDescription List pre-receive hooks. (In preview period. See README.) + * @apiGroup enterprise + * + * @apiExample {js} ex: +github.enterprise.getPreReceiveHooks({ ... }); + */ + +/** + * @api {post} /staff/indexing_jobs queueIndexingJob + * @apiVersion 8.2.1 + * @apiName queueIndexingJob + * @apiDescription Queue an indexing job + * @apiGroup enterprise + * + * @apiParam {String} target A string representing the item to index. + * @apiExample {js} ex: +github.enterprise.queueIndexingJob({ ... }); + */ + +/** + * @api {get} /enterprise/stats/:type stats + * @apiVersion 8.2.1 + * @apiName stats + * @apiDescription Get statistics. + * @apiGroup enterprise + * + * @apiParam {String=issues,hooks,milestones,orgs,comments,pages,users,gists,pulls,repos,all} type Possible values: issues, hooks, milestones, orgs, comments, pages, users, gists, pulls, repos, all. + * @apiExample {js} ex: +github.enterprise.stats({ ... }); + */ + +/** + * @api {post} /admin/ldap/teams/:team_id/sync syncLdapForTeam + * @apiVersion 8.2.1 + * @apiName syncLdapForTeam + * @apiDescription Sync LDAP mapping for a team. + * @apiGroup enterprise + * + * @apiParam {Number} team_id + * @apiExample {js} ex: +github.enterprise.syncLdapForTeam({ ... }); + */ + +/** + * @api {post} /admin/ldap/users/:username/sync syncLdapForUser + * @apiVersion 8.2.1 + * @apiName syncLdapForUser + * @apiDescription Sync LDAP mapping for a user. + * @apiGroup enterprise + * + * @apiParam {String} username + * @apiExample {js} ex: +github.enterprise.syncLdapForUser({ ... }); + */ + +/** + * @api {post} /admin/pre_receive_environments/:id/downloads triggerPreReceiveEnvironmentDownload + * @apiVersion 8.2.1 + * @apiName triggerPreReceiveEnvironmentDownload + * @apiDescription Trigger a pre-receive environment download. (In preview period. See README.) + * @apiGroup enterprise + * + * @apiParam {String} id + * @apiExample {js} ex: +github.enterprise.triggerPreReceiveEnvironmentDownload({ ... }); + */ + +/** + * @api {patch} /admin/ldap/teams/:team_id/mapping updateLdapForTeam + * @apiVersion 8.2.1 + * @apiName updateLdapForTeam + * @apiDescription Update LDAP mapping for a team. + * @apiGroup enterprise + * + * @apiParam {Number} team_id + * @apiParam {String} ldap_dn LDAP DN for user + * @apiExample {js} ex: +github.enterprise.updateLdapForTeam({ ... }); + */ + +/** + * @api {patch} /admin/ldap/users/:username/mapping updateLdapForUser + * @apiVersion 8.2.1 + * @apiName updateLdapForUser + * @apiDescription Update LDAP mapping for a user. + * @apiGroup enterprise + * + * @apiParam {String} username + * @apiParam {String} ldap_dn LDAP DN for user + * @apiExample {js} ex: +github.enterprise.updateLdapForUser({ ... }); + */ + +/** + * @api {get} /gists/:id/star checkStar + * @apiVersion 8.2.1 + * @apiName checkStar + * @apiDescription Check if a gist is starred + * @apiGroup gists + * + * @apiParam {String} id + * @apiExample {js} ex: +github.gists.checkStar({ ... }); + */ + +/** + * @api {post} /gists create + * @apiVersion 8.2.1 + * @apiName create + * @apiDescription Create a gist + * @apiGroup gists + * + * @apiParam {Json} files Files that make up this gist. The key of which should be a required string filename and the value another required hash with parameters: 'content' + * @apiParam {Boolean} public + * @apiParam {String} [description] + * @apiExample {js} ex: +github.gists.create({ ... }); + */ + +/** + * @api {post} /gists/:gist_id/comments createComment + * @apiVersion 8.2.1 + * @apiName createComment + * @apiDescription Create a comment + * @apiGroup gists + * + * @apiParam {String} gist_id Id (SHA1 hash) of the gist. + * @apiParam {String} body + * @apiExample {js} ex: +github.gists.createComment({ ... }); + */ + +/** + * @api {delete} /gists/:id delete + * @apiVersion 8.2.1 + * @apiName delete + * @apiDescription Delete a gist + * @apiGroup gists + * + * @apiParam {String} id + * @apiExample {js} ex: +github.gists.delete({ ... }); + */ + +/** + * @api {delete} /gists/:gist_id/comments/:id deleteComment + * @apiVersion 8.2.1 + * @apiName deleteComment + * @apiDescription Delete a comment + * @apiGroup gists + * + * @apiParam {String} gist_id Id (SHA1 hash) of the gist. + * @apiParam {String} id + * @apiExample {js} ex: +github.gists.deleteComment({ ... }); + */ + +/** + * @api {patch} /gists/:id edit + * @apiVersion 8.2.1 + * @apiName edit + * @apiDescription Edit a gist + * @apiGroup gists + * + * @apiParam {String} id + * @apiParam {Json} files Files that make up this gist. The key of which should be a required string filename and the value another required hash with parameters: 'content' + * @apiParam {String} [description] + * @apiParam {String} [content] Updated file contents. + * @apiParam {String} [filename] New name for this file. + * @apiExample {js} ex: +github.gists.edit({ ... }); + */ + +/** + * @api {patch} /gists/:gist_id/comments/:id editComment + * @apiVersion 8.2.1 + * @apiName editComment + * @apiDescription Edit a comment + * @apiGroup gists + * + * @apiParam {String} gist_id Id (SHA1 hash) of the gist. + * @apiParam {String} id + * @apiParam {String} body + * @apiExample {js} ex: +github.gists.editComment({ ... }); + */ + +/** + * @api {post} /gists/:id/forks fork + * @apiVersion 8.2.1 + * @apiName fork + * @apiDescription Fork a gist + * @apiGroup gists + * + * @apiParam {String} id + * @apiExample {js} ex: +github.gists.fork({ ... }); + */ + +/** + * @api {get} /gists/:id get + * @apiVersion 8.2.1 + * @apiName get + * @apiDescription Get a single gist + * @apiGroup gists + * + * @apiParam {String} id + * @apiExample {js} ex: +github.gists.get({ ... }); + */ + +/** + * @api {get} /gists getAll + * @apiVersion 8.2.1 + * @apiName getAll + * @apiDescription List the authenticated user's gists or if called anonymously, this will return all public gists + * @apiGroup gists + * + * @apiParam {Date} [since] Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.gists.getAll({ ... }); + */ + +/** + * @api {get} /gists/:gist_id/comments/:id getComment + * @apiVersion 8.2.1 + * @apiName getComment + * @apiDescription Get a single comment + * @apiGroup gists + * + * @apiParam {String} gist_id Id (SHA1 hash) of the gist. + * @apiParam {String} id + * @apiExample {js} ex: +github.gists.getComment({ ... }); + */ + +/** + * @api {get} /gists/:gist_id/comments getComments + * @apiVersion 8.2.1 + * @apiName getComments + * @apiDescription List comments on a gist + * @apiGroup gists + * + * @apiParam {String} gist_id Id (SHA1 hash) of the gist. + * @apiExample {js} ex: +github.gists.getComments({ ... }); + */ + +/** + * @api {get} /gists/:id/commits getCommits + * @apiVersion 8.2.1 + * @apiName getCommits + * @apiDescription List gist commits + * @apiGroup gists + * + * @apiParam {String} id + * @apiExample {js} ex: +github.gists.getCommits({ ... }); + */ + +/** + * @api {get} /users/:username/gists getForUser + * @apiVersion 8.2.1 + * @apiName getForUser + * @apiDescription List a user's gists + * @apiGroup gists + * + * @apiParam {String} username + * @apiParam {Date} [since] Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.gists.getForUser({ ... }); + */ + +/** + * @api {get} /gists/:id/forks getForks + * @apiVersion 8.2.1 + * @apiName getForks + * @apiDescription List gist forks + * @apiGroup gists + * + * @apiParam {String} id + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.gists.getForks({ ... }); + */ + +/** + * @api {get} /gists/public getPublic + * @apiVersion 8.2.1 + * @apiName getPublic + * @apiDescription List all public gists + * @apiGroup gists + * + * @apiParam {Date} [since] Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ + * @apiExample {js} ex: +github.gists.getPublic({ ... }); + */ + +/** + * @api {get} /gists/:id/:sha getRevision + * @apiVersion 8.2.1 + * @apiName getRevision + * @apiDescription Get a specific revision of a gist + * @apiGroup gists + * + * @apiParam {String} id + * @apiParam {String} sha + * @apiExample {js} ex: +github.gists.getRevision({ ... }); + */ + +/** + * @api {get} /gists/starred getStarred + * @apiVersion 8.2.1 + * @apiName getStarred + * @apiDescription List the authenticated user's starred gists + * @apiGroup gists + * + * @apiParam {Date} [since] Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ + * @apiExample {js} ex: +github.gists.getStarred({ ... }); + */ + +/** + * @api {put} /gists/:id/star star + * @apiVersion 8.2.1 + * @apiName star + * @apiDescription Star a gist + * @apiGroup gists + * + * @apiParam {String} id + * @apiExample {js} ex: +github.gists.star({ ... }); + */ + +/** + * @api {delete} /gists/:id/star unstar + * @apiVersion 8.2.1 + * @apiName unstar + * @apiDescription Unstar a gist + * @apiGroup gists + * + * @apiParam {String} id + * @apiExample {js} ex: +github.gists.unstar({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/git/blobs createBlob + * @apiVersion 8.2.1 + * @apiName createBlob + * @apiDescription Create a Blob + * @apiGroup gitdata + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} content + * @apiParam {String} encoding + * @apiExample {js} ex: +github.gitdata.createBlob({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/git/commits createCommit + * @apiVersion 8.2.1 + * @apiName createCommit + * @apiDescription Create a Commit + * @apiGroup gitdata + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} message String of the commit message + * @apiParam {String} tree String of the SHA of the tree object this commit points to + * @apiParam {Array} parents Array of the SHAs of the commits that were the parents of this commit. If omitted or empty, the commit will be written as a root commit. For a single parent, an array of one SHA should be provided, for a merge commit, an array of more than one should be provided. + * @apiParam {Json} [author] + * @apiParam {Json} [committer] + * @apiExample {js} ex: +github.gitdata.createCommit({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/git/refs createReference + * @apiVersion 8.2.1 + * @apiName createReference + * @apiDescription Create a Reference + * @apiGroup gitdata + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} ref The name of the fully qualified reference (ie: refs/heads/master). If it doesn't start with 'refs' and have at least two slashes, it will be rejected. + * @apiParam {String} sha + * @apiExample {js} ex: +github.gitdata.createReference({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/git/tags createTag + * @apiVersion 8.2.1 + * @apiName createTag + * @apiDescription Create a Tag Object + * @apiGroup gitdata + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} tag String of the tag + * @apiParam {String} message String of the tag message + * @apiParam {String} object String of the SHA of the git object this is tagging + * @apiParam {String} type String of the type of the object we’re tagging. Normally this is a commit but it can also be a tree or a blob. + * @apiParam {Json} tagger JSON object that contains the following keys: `name` - String of the name of the author of the tag, `email` - String of the email of the author of the tag, `date` - Timestamp of when this object was tagged + * @apiExample {js} ex: +github.gitdata.createTag({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/git/trees createTree + * @apiVersion 8.2.1 + * @apiName createTree + * @apiDescription Create a Tree + * @apiGroup gitdata + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Json} tree Array of Hash objects (of path, mode, type and sha) specifying a tree structure + * @apiParam {String} [base_tree] String of the SHA1 of the tree you want to update with new data + * @apiExample {js} ex: +github.gitdata.createTree({ ... }); + */ + +/** + * @api {delete} /repos/:owner/:repo/git/refs/:ref deleteReference + * @apiVersion 8.2.1 + * @apiName deleteReference + * @apiDescription Delete a Reference + * @apiGroup gitdata + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} ref String of the name of the fully qualified reference (ie: heads/master). If it doesn’t have at least one slash, it will be rejected. + * @apiExample {js} ex: +github.gitdata.deleteReference({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/git/blobs/:sha getBlob + * @apiVersion 8.2.1 + * @apiName getBlob + * @apiDescription Get a Blob + * @apiGroup gitdata + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} sha + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.gitdata.getBlob({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/git/commits/:sha getCommit + * @apiVersion 8.2.1 + * @apiName getCommit + * @apiDescription Get a Commit + * @apiGroup gitdata + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} sha + * @apiExample {js} ex: +github.gitdata.getCommit({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/git/commits/:sha getCommitSignatureVerification + * @apiVersion 8.2.1 + * @apiName getCommitSignatureVerification + * @apiDescription Get a Commit Signature Verification. (In preview period. See README.) + * @apiGroup gitdata + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} sha + * @apiExample {js} ex: +github.gitdata.getCommitSignatureVerification({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/git/refs/:ref getReference + * @apiVersion 8.2.1 + * @apiName getReference + * @apiDescription Get a Reference + * @apiGroup gitdata + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} ref String of the name of the fully qualified reference (ie: heads/master). If it doesn’t have at least one slash, it will be rejected. + * @apiExample {js} ex: +github.gitdata.getReference({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/git/refs/ getReferences + * @apiVersion 8.2.1 + * @apiName getReferences + * @apiDescription Get all References + * @apiGroup gitdata + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.gitdata.getReferences({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/git/tags/:sha getTag + * @apiVersion 8.2.1 + * @apiName getTag + * @apiDescription Get a Tag + * @apiGroup gitdata + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} sha + * @apiExample {js} ex: +github.gitdata.getTag({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/git/tags/:sha getTagSignatureVerification + * @apiVersion 8.2.1 + * @apiName getTagSignatureVerification + * @apiDescription Get a Tag Signature Verification. (In preview period. See README.) + * @apiGroup gitdata + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} sha + * @apiExample {js} ex: +github.gitdata.getTagSignatureVerification({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/git/refs/tags getTags + * @apiVersion 8.2.1 + * @apiName getTags + * @apiDescription Get all tag References + * @apiGroup gitdata + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.gitdata.getTags({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/git/trees/:sha getTree + * @apiVersion 8.2.1 + * @apiName getTree + * @apiDescription Get a Tree + * @apiGroup gitdata + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} sha + * @apiParam {Boolean} [recursive] + * @apiExample {js} ex: +github.gitdata.getTree({ ... }); + */ + +/** + * @api {patch} /repos/:owner/:repo/git/refs/:ref updateReference + * @apiVersion 8.2.1 + * @apiName updateReference + * @apiDescription Update a Reference + * @apiGroup gitdata + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} ref String of the name of the fully qualified reference (ie: heads/master). If it doesn’t have at least one slash, it will be rejected. + * @apiParam {String} sha + * @apiParam {Boolean} [force=false] Boolean indicating whether to force the update or to make sure the update is a fast-forward update. The default is false, so leaving this out or setting it to false will make sure you’re not overwriting work. + * @apiExample {js} ex: +github.gitdata.updateReference({ ... }); + */ + +/** + * @api {post} /installations/:installation_id/repositories/:repository_id addRepoToInstallation + * @apiVersion 8.2.1 + * @apiName addRepoToInstallation + * @apiDescription Add a single repository to an installation. (In preview period. See README.) + * @apiGroup integrations + * + * @apiParam {String} installation_id + * @apiParam {String} repository_id + * @apiExample {js} ex: +github.integrations.addRepoToInstallation({ ... }); + */ + +/** + * @api {post} /installations/:installation_id/access_tokens createInstallationToken + * @apiVersion 8.2.1 + * @apiName createInstallationToken + * @apiDescription Create a new installation token. (In preview period. See README.) + * @apiGroup integrations + * + * @apiParam {String} installation_id + * @apiParam {String} [user_id] The id of the user for whom the integration is acting on behalf of. + * @apiExample {js} ex: +github.integrations.createInstallationToken({ ... }); + */ + +/** + * @api {get} /installation/repositories getInstallationRepositories + * @apiVersion 8.2.1 + * @apiName getInstallationRepositories + * @apiDescription List repositories that are accessible to the authenticated installation. (In preview period. See README.) + * @apiGroup integrations + * + * @apiParam {String} [user_id] The integer ID of a user, to filter results to repositories that are visible to both the installation and the given user. + * @apiExample {js} ex: +github.integrations.getInstallationRepositories({ ... }); + */ + +/** + * @api {get} /integration/installations getInstallations + * @apiVersion 8.2.1 + * @apiName getInstallations + * @apiDescription List the integration's installations. (In preview period. See README.) + * @apiGroup integrations + * + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.integrations.getInstallations({ ... }); + */ + +/** + * @api {post} /integration/identity/user getUserIdentity + * @apiVersion 8.2.1 + * @apiName getUserIdentity + * @apiDescription Request identity of user. (In preview period. See README.) + * @apiGroup integrations + * + * @apiParam {String} [nonce] + * @apiExample {js} ex: +github.integrations.getUserIdentity({ ... }); + */ + +/** + * @api {post} /installations/:installation_id/repositories/:repository_id removeRepoFromInstallation + * @apiVersion 8.2.1 + * @apiName removeRepoFromInstallation + * @apiDescription Remove a single repository from an installation. (In preview period. See README.) + * @apiGroup integrations + * + * @apiParam {String} installation_id + * @apiParam {String} repository_id + * @apiExample {js} ex: +github.integrations.removeRepoFromInstallation({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/issues/:number/assignees addAssigneesToIssue + * @apiVersion 8.2.1 + * @apiName addAssigneesToIssue + * @apiDescription Add assignees to an issue. + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiParam {Array} assignees Logins for the users that should be added to the issue. + * @apiExample {js} ex: +github.issues.addAssigneesToIssue({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/issues/:number/labels addLabels + * @apiVersion 8.2.1 + * @apiName addLabels + * @apiDescription Add labels to an issue + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiParam {Array} labels + * @apiExample {js} ex: +github.issues.addLabels({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/assignees/:assignee checkAssignee + * @apiVersion 8.2.1 + * @apiName checkAssignee + * @apiDescription Check assignee + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} assignee Login for the user that this issue should be assigned to. + * @apiExample {js} ex: +github.issues.checkAssignee({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/issues create + * @apiVersion 8.2.1 + * @apiName create + * @apiDescription Create an issue + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} title + * @apiParam {String} [body] + * @apiParam {String} [assignee] Login for the user that this issue should be assigned to. + * @apiParam {Number} [milestone] Milestone to associate this issue with. + * @apiParam {Array} [labels] Array of strings - Labels to associate with this issue. + * @apiParam {Array} [assignees] Logins for Users to assign to this issue. NOTE: Only users with push access can set assignees for new issues. Assignees are silently dropped otherwise. + * @apiExample {js} ex: +github.issues.create({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/issues/:number/comments createComment + * @apiVersion 8.2.1 + * @apiName createComment + * @apiDescription Create a comment + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiParam {String} body + * @apiExample {js} ex: +github.issues.createComment({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/labels createLabel + * @apiVersion 8.2.1 + * @apiName createLabel + * @apiDescription Create a label + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} name + * @apiParam {String} color 6 character hex code, without a leading #. + * @apiExample {js} ex: +github.issues.createLabel({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/milestones createMilestone + * @apiVersion 8.2.1 + * @apiName createMilestone + * @apiDescription Create a milestone + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} title + * @apiParam {String=open,closed,all} [state=open] + * @apiParam {String} [description] + * @apiParam {Date} [due_on] Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ + * @apiExample {js} ex: +github.issues.createMilestone({ ... }); + */ + +/** + * @api {delete} /repos/:owner/:repo/issues/comments/:id deleteComment + * @apiVersion 8.2.1 + * @apiName deleteComment + * @apiDescription Delete a comment + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiExample {js} ex: +github.issues.deleteComment({ ... }); + */ + +/** + * @api {delete} /repos/:owner/:repo/labels/:name deleteLabel + * @apiVersion 8.2.1 + * @apiName deleteLabel + * @apiDescription Delete a label + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} name + * @apiExample {js} ex: +github.issues.deleteLabel({ ... }); + */ + +/** + * @api {delete} /repos/:owner/:repo/milestones/:number deleteMilestone + * @apiVersion 8.2.1 + * @apiName deleteMilestone + * @apiDescription Delete a milestone + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiExample {js} ex: +github.issues.deleteMilestone({ ... }); + */ + +/** + * @api {patch} /repos/:owner/:repo/issues/:number edit + * @apiVersion 8.2.1 + * @apiName edit + * @apiDescription Edit an issue + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiParam {String} [title] + * @apiParam {String} [body] + * @apiParam {String} [assignee] Login for the user that this issue should be assigned to. + * @apiParam {String=open,closed} [state=open] open or closed + * @apiParam {Number} [milestone] Milestone to associate this issue with. + * @apiParam {Array} [labels] Array of strings - Labels to associate with this issue. + * @apiParam {Array} [assignees] Logins for Users to assign to this issue. NOTE: Only users with push access can set assignees for new issues. Assignees are silently dropped otherwise. + * @apiExample {js} ex: +github.issues.edit({ ... }); + */ + +/** + * @api {patch} /repos/:owner/:repo/issues/comments/:id editComment + * @apiVersion 8.2.1 + * @apiName editComment + * @apiDescription Edit a comment + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiParam {String} body + * @apiExample {js} ex: +github.issues.editComment({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/issues/:number get + * @apiVersion 8.2.1 + * @apiName get + * @apiDescription Get a single issue + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiExample {js} ex: +github.issues.get({ ... }); + */ + +/** + * @api {get} /issues getAll + * @apiVersion 8.2.1 + * @apiName getAll + * @apiDescription List all issues across all the authenticated user's visible repositories including owned repositories, member repositories, and organization repositories + * @apiGroup issues + * + * @apiParam {String=all,assigned,created,mentioned,subscribed} [filter] + * @apiParam {String=open,closed,all} [state=open] open, closed, or all + * @apiParam {String} [labels] String list of comma separated Label names. Example: bug,ui,@high + * @apiParam {String=created,updated,comments} [sort=created] + * @apiParam {String=asc,desc} [direction=desc] + * @apiParam {Date} [since] Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.issues.getAll({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/assignees getAssignees + * @apiVersion 8.2.1 + * @apiName getAssignees + * @apiDescription List assignees + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiExample {js} ex: +github.issues.getAssignees({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/issues/comments/:id getComment + * @apiVersion 8.2.1 + * @apiName getComment + * @apiDescription Get a single comment + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiExample {js} ex: +github.issues.getComment({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/issues/:number/comments getComments + * @apiVersion 8.2.1 + * @apiName getComments + * @apiDescription List comments on an issue + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.issues.getComments({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/issues/comments getCommentsForRepo + * @apiVersion 8.2.1 + * @apiName getCommentsForRepo + * @apiDescription List comments in a repository + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String=created,updated} [sort=created] + * @apiParam {String=asc,desc} [direction=desc] + * @apiParam {Date} [since] Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.issues.getCommentsForRepo({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/issues/events/:id getEvent + * @apiVersion 8.2.1 + * @apiName getEvent + * @apiDescription Get a single event + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiExample {js} ex: +github.issues.getEvent({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/issues/:issue_number/events getEvents + * @apiVersion 8.2.1 + * @apiName getEvents + * @apiDescription List events for an issue + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} issue_number + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.issues.getEvents({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/issues/events getEventsForRepo + * @apiVersion 8.2.1 + * @apiName getEventsForRepo + * @apiDescription List events for a repository + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.issues.getEventsForRepo({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/issues/:issue_number/timeline getEventsTimeline + * @apiVersion 8.2.1 + * @apiName getEventsTimeline + * @apiDescription List events for an issue. (In preview period. See README.) + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} issue_number + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.issues.getEventsTimeline({ ... }); + */ + +/** + * @api {get} /orgs/:org/issues getForOrg + * @apiVersion 8.2.1 + * @apiName getForOrg + * @apiDescription List all issues for a given organization for the authenticated user + * @apiGroup issues + * + * @apiParam {String} org + * @apiParam {String=all,assigned,created,mentioned,subscribed} [filter] + * @apiParam {String=open,closed,all} [state=open] open, closed, or all + * @apiParam {String} [labels] String list of comma separated Label names. Example: bug,ui,@high + * @apiParam {String=created,updated,comments} [sort=created] + * @apiParam {String=asc,desc} [direction=desc] + * @apiParam {Date} [since] Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.issues.getForOrg({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/issues getForRepo + * @apiVersion 8.2.1 + * @apiName getForRepo + * @apiDescription List issues for a repository + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} [milestone] + * @apiParam {String=open,closed,all} [state=open] open, closed, or all + * @apiParam {String} [assignee] String User login, `none` for Issues with no assigned User. `*` for Issues with any assigned User. + * @apiParam {String} [creator] The user that created the issue. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiParam {String} [labels] String list of comma separated Label names. Example: bug,ui,@high + * @apiParam {String=created,updated,comments} [sort=created] + * @apiParam {String=asc,desc} [direction=desc] + * @apiParam {Date} [since] Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {String} [mentioned] String User login. + * @apiExample {js} ex: +github.issues.getForRepo({ ... }); + */ + +/** + * @api {get} /user/issues getForUser + * @apiVersion 8.2.1 + * @apiName getForUser + * @apiDescription List all issues across owned and member repositories for the authenticated user + * @apiGroup issues + * + * @apiParam {String=all,assigned,created,mentioned,subscribed} [filter] + * @apiParam {String=open,closed,all} [state=open] open, closed, or all + * @apiParam {String} [labels] String list of comma separated Label names. Example: bug,ui,@high + * @apiParam {String=created,updated,comments} [sort=created] + * @apiParam {String=asc,desc} [direction=desc] + * @apiParam {Date} [since] Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.issues.getForUser({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/issues/:number/labels getIssueLabels + * @apiVersion 8.2.1 + * @apiName getIssueLabels + * @apiDescription List labels on an issue + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiExample {js} ex: +github.issues.getIssueLabels({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/labels/:name getLabel + * @apiVersion 8.2.1 + * @apiName getLabel + * @apiDescription Get a single label + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} name + * @apiExample {js} ex: +github.issues.getLabel({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/labels getLabels + * @apiVersion 8.2.1 + * @apiName getLabels + * @apiDescription List all labels for this repository + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.issues.getLabels({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/milestones/:number getMilestone + * @apiVersion 8.2.1 + * @apiName getMilestone + * @apiDescription Get a single milestone + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiExample {js} ex: +github.issues.getMilestone({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/milestones/:number/labels getMilestoneLabels + * @apiVersion 8.2.1 + * @apiName getMilestoneLabels + * @apiDescription Get labels for every issue in a milestone + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiExample {js} ex: +github.issues.getMilestoneLabels({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/milestones getMilestones + * @apiVersion 8.2.1 + * @apiName getMilestones + * @apiDescription List milestones for a repository + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String=open,closed,all} [state=open] + * @apiParam {String=due_on,completeness} [sort=due_on] due_on, completeness, default: due_on + * @apiParam {String=asc,desc} [direction=asc] + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.issues.getMilestones({ ... }); + */ + +/** + * @api {put} /repos/:owner/:repo/issues/:number/lock lock + * @apiVersion 8.2.1 + * @apiName lock + * @apiDescription Users with push access can lock an issue's conversation. + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiExample {js} ex: +github.issues.lock({ ... }); + */ + +/** + * @api {delete} /repos/:owner/:repo/issues/:number/labels removeAllLabels + * @apiVersion 8.2.1 + * @apiName removeAllLabels + * @apiDescription Remove all labels from an issue + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiExample {js} ex: +github.issues.removeAllLabels({ ... }); + */ + +/** + * @api {delete} /repos/:owner/:repo/issues/:number/assignees removeAssigneesFromIssue + * @apiVersion 8.2.1 + * @apiName removeAssigneesFromIssue + * @apiDescription Remove assignees from an issue. + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiParam {Array} [assignees] Logins for Users to assign to this issue. NOTE: Only users with push access can set assignees for new issues. Assignees are silently dropped otherwise. + * @apiExample {js} ex: +github.issues.removeAssigneesFromIssue({ ... }); + */ + +/** + * @api {delete} /repos/:owner/:repo/issues/:number/labels/:name removeLabel + * @apiVersion 8.2.1 + * @apiName removeLabel + * @apiDescription Remove a label from an issue + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiParam {String} name + * @apiExample {js} ex: +github.issues.removeLabel({ ... }); + */ + +/** + * @api {put} /repos/:owner/:repo/issues/:number/labels replaceAllLabels + * @apiVersion 8.2.1 + * @apiName replaceAllLabels + * @apiDescription Replace all labels for an issue + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiParam {Array} labels Sending an empty array ([]) will remove all Labels from the Issue. + * @apiExample {js} ex: +github.issues.replaceAllLabels({ ... }); + */ + +/** + * @api {delete} /repos/:owner/:repo/issues/:number/lock unlock + * @apiVersion 8.2.1 + * @apiName unlock + * @apiDescription Users with push access can unlock an issue's conversation. + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiExample {js} ex: +github.issues.unlock({ ... }); + */ + +/** + * @api {patch} /repos/:owner/:repo/labels/:oldname updateLabel + * @apiVersion 8.2.1 + * @apiName updateLabel + * @apiDescription Update a label + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} oldname The old name of the label. + * @apiParam {String} name The new name of the label. + * @apiParam {String} color 6 character hex code, without a leading #. + * @apiExample {js} ex: +github.issues.updateLabel({ ... }); + */ + +/** + * @api {patch} /repos/:owner/:repo/milestones/:number updateMilestone + * @apiVersion 8.2.1 + * @apiName updateMilestone + * @apiDescription Update a milestone + * @apiGroup issues + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiParam {String} title + * @apiParam {String=open,closed,all} [state=open] + * @apiParam {String} [description] + * @apiParam {Date} [due_on] Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ + * @apiExample {js} ex: +github.issues.updateMilestone({ ... }); + */ + +/** + * @api {delete} /repos/:owner/:repo/import cancelImport + * @apiVersion 8.2.1 + * @apiName cancelImport + * @apiDescription Cancel an import. (In preview period. See README.) + * @apiGroup migrations + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiExample {js} ex: +github.migrations.cancelImport({ ... }); + */ + +/** + * @api {delete} /orgs/:org/migrations/:id/archive deleteMigrationArchive + * @apiVersion 8.2.1 + * @apiName deleteMigrationArchive + * @apiDescription Delete a migration archive. (In preview period. See README.) + * @apiGroup migrations + * + * @apiParam {String} org + * @apiParam {String} id + * @apiExample {js} ex: +github.migrations.deleteMigrationArchive({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/import/authors getImportCommitAuthors + * @apiVersion 8.2.1 + * @apiName getImportCommitAuthors + * @apiDescription Get import commit authors. (In preview period. See README.) + * @apiGroup migrations + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} [since] Only authors found after this id are returned. Provide the highest author ID you've seen so far. New authors may be added to the list at any point while the importer is performing the raw step. + * @apiExample {js} ex: +github.migrations.getImportCommitAuthors({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/import getImportProgress + * @apiVersion 8.2.1 + * @apiName getImportProgress + * @apiDescription Get import progress. (In preview period. See README.) + * @apiGroup migrations + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiExample {js} ex: +github.migrations.getImportProgress({ ... }); + */ + +/** + * @api {get} /:owner/:name/import/large_files getLargeImportFiles + * @apiVersion 8.2.1 + * @apiName getLargeImportFiles + * @apiDescription List files larger than 100MB found during the import. (In preview period. See README.) + * @apiGroup migrations + * + * @apiParam {String} owner + * @apiParam {String} name + * @apiExample {js} ex: +github.migrations.getLargeImportFiles({ ... }); + */ + +/** + * @api {get} /orgs/:org/migrations/:id/archive getMigrationArchiveLink + * @apiVersion 8.2.1 + * @apiName getMigrationArchiveLink + * @apiDescription Get the URL to a migration archive. (In preview period. See README.) + * @apiGroup migrations + * + * @apiParam {String} org + * @apiParam {String} id + * @apiExample {js} ex: +github.migrations.getMigrationArchiveLink({ ... }); + */ + +/** + * @api {get} /orgs/:org/migrations/:id getMigrationStatus + * @apiVersion 8.2.1 + * @apiName getMigrationStatus + * @apiDescription Get the status of a migration. (In preview period. See README.) + * @apiGroup migrations + * + * @apiParam {String} org + * @apiParam {String} id + * @apiExample {js} ex: +github.migrations.getMigrationStatus({ ... }); + */ + +/** + * @api {get} /orgs/:org/migrations getMigrations + * @apiVersion 8.2.1 + * @apiName getMigrations + * @apiDescription Get a list of migrations. (In preview period. See README.) + * @apiGroup migrations + * + * @apiParam {String} org + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.migrations.getMigrations({ ... }); + */ + +/** + * @api {patch} /repos/:owner/:repo/import/authors/:author_id mapImportCommitAuthor + * @apiVersion 8.2.1 + * @apiName mapImportCommitAuthor + * @apiDescription Map a commit author. (In preview period. See README.) + * @apiGroup migrations + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} author_id The commit author id. + * @apiParam {String} [email] The new Git author email. + * @apiParam {String} [name] The new Git author name. + * @apiExample {js} ex: +github.migrations.mapImportCommitAuthor({ ... }); + */ + +/** + * @api {patch} /:owner/:name/import/lfs setImportLfsPreference + * @apiVersion 8.2.1 + * @apiName setImportLfsPreference + * @apiDescription Set import LFS preference. (In preview period. See README.) + * @apiGroup migrations + * + * @apiParam {String} owner + * @apiParam {String} name + * @apiParam {String} use_lfs Can be one of `opt_in` (large files will be stored using Git LFS) or `opt_out` (large files will be removed during the import). + * @apiExample {js} ex: +github.migrations.setImportLfsPreference({ ... }); + */ + +/** + * @api {put} /repos/:owner/:repo/import startImport + * @apiVersion 8.2.1 + * @apiName startImport + * @apiDescription Start an import. (In preview period. See README.) + * @apiGroup migrations + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} vcs_url The URL of the originating repository. + * @apiParam {String=subversion,git,mercurial,tfvc} [vcs] The originating VCS type. Please be aware that without this parameter, the import job will take additional time to detect the VCS type before beginning the import. This detection step will be reflected in the response. + * @apiParam {String} [vcs_username] If authentication is required, the username to provide to vcs_url. + * @apiParam {String} [vcs_password] If authentication is required, the password to provide to vcs_url. + * @apiParam {String} [tfvc_project] For a tfvc import, the name of the project that is being imported. + * @apiExample {js} ex: +github.migrations.startImport({ ... }); + */ + +/** + * @api {post} /orgs/:org/migrations startMigration + * @apiVersion 8.2.1 + * @apiName startMigration + * @apiDescription Start a migration. (In preview period. See README.) + * @apiGroup migrations + * + * @apiParam {String} org + * @apiParam {Array} repositories A list of arrays indicating which repositories should be migrated. + * @apiParam {Boolean} [lock_repositories=false] Indicates whether repositories should be locked (to prevent manipulation) while migrating data. Default: false. + * @apiParam {Boolean} [exclude_attachments=false] Indicates whether attachments should be excluded from the migration (to reduce migration archive file size). Default: false. + * @apiExample {js} ex: +github.migrations.startMigration({ ... }); + */ + +/** + * @api {delete} /orgs/:org/migrations/:id/repos/:repo_name/lock unlockRepoLockedForMigration + * @apiVersion 8.2.1 + * @apiName unlockRepoLockedForMigration + * @apiDescription Unlock a repository that was locked for migration. (In preview period. See README.) + * @apiGroup migrations + * + * @apiParam {String} org + * @apiParam {String} id + * @apiParam {String} repo_name + * @apiExample {js} ex: +github.migrations.unlockRepoLockedForMigration({ ... }); + */ + +/** + * @api {patch} /repos/:owner/:repo/import updateImport + * @apiVersion 8.2.1 + * @apiName updateImport + * @apiDescription Update existing import. (In preview period. See README.) + * @apiGroup migrations + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiExample {js} ex: +github.migrations.updateImport({ ... }); + */ + +/** + * @api {get} /emojis getEmojis + * @apiVersion 8.2.1 + * @apiName getEmojis + * @apiDescription Lists all the emojis available to use on GitHub. + * @apiGroup misc + * + * @apiExample {js} ex: +github.misc.getEmojis({ ... }); + */ + +/** + * @api {get} /gitignore/templates/:name getGitignoreTemplate + * @apiVersion 8.2.1 + * @apiName getGitignoreTemplate + * @apiDescription Get a single gitignore template + * @apiGroup misc + * + * @apiParam {String} name The name of the .gitignore template to get e.g. 'C' + * @apiExample {js} ex: +github.misc.getGitignoreTemplate({ ... }); + */ + +/** + * @api {get} /gitignore/templates getGitignoreTemplates + * @apiVersion 8.2.1 + * @apiName getGitignoreTemplates + * @apiDescription Lists available gitignore templates + * @apiGroup misc + * + * @apiExample {js} ex: +github.misc.getGitignoreTemplates({ ... }); + */ + +/** + * @api {get} /licenses/:license getLicense + * @apiVersion 8.2.1 + * @apiName getLicense + * @apiDescription Get an individual license. (In preview period. See README.) + * @apiGroup misc + * + * @apiParam {String} license Ex: /licenses/mit + * @apiExample {js} ex: +github.misc.getLicense({ ... }); + */ + +/** + * @api {get} /licenses getLicenses + * @apiVersion 8.2.1 + * @apiName getLicenses + * @apiDescription List all licenses. (In preview period. See README.) + * @apiGroup misc + * + * @apiExample {js} ex: +github.misc.getLicenses({ ... }); + */ + +/** + * @api {get} /meta getMeta + * @apiVersion 8.2.1 + * @apiName getMeta + * @apiDescription This endpoint provides information about GitHub.com, the service. Or, if you access this endpoint on your organization's GitHub Enterprise installation, this endpoint provides information about that installation. + * @apiGroup misc + * + * @apiExample {js} ex: +github.misc.getMeta({ ... }); + */ + +/** + * @api {get} /rate_limit getRateLimit + * @apiVersion 8.2.1 + * @apiName getRateLimit + * @apiDescription Get your current rate limit status + * @apiGroup misc + * + * @apiExample {js} ex: +github.misc.getRateLimit({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/license getRepoLicense + * @apiVersion 8.2.1 + * @apiName getRepoLicense + * @apiDescription Get the contents of a repository's license. (In preview period. See README.) + * @apiGroup misc + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiExample {js} ex: +github.misc.getRepoLicense({ ... }); + */ + +/** + * @api {post} /markdown renderMarkdown + * @apiVersion 8.2.1 + * @apiName renderMarkdown + * @apiDescription Render an arbitrary Markdown document + * @apiGroup misc + * + * @apiParam {String} text The Markdown text to render + * @apiParam {String=markdown,gfm} [mode=markdown] The rendering mode, `markdown` to render a document as plain Markdown, just like README files are rendered. `gfm` to render a document as user-content, e.g. like user comments or issues are rendered. In GFM mode, hard line breaks are always taken into account, and issue and user mentions are linked accordingly. + * @apiParam {String} [context] The repository context. Only taken into account when rendering as `gfm` + * @apiExample {js} ex: +github.misc.renderMarkdown({ ... }); + */ + +/** + * @api {post} /markdown/raw renderMarkdownRaw + * @apiVersion 8.2.1 + * @apiName renderMarkdownRaw + * @apiDescription Render a Markdown document in raw mode + * @apiGroup misc + * + * @apiParam {String} data Raw data to send as the body of the request + * @apiExample {js} ex: +github.misc.renderMarkdownRaw({ ... }); + */ + +/** + * @api {put} /orgs/:org/memberships/:username addOrgMembership + * @apiVersion 8.2.1 + * @apiName addOrgMembership + * @apiDescription Add or update organization membership + * @apiGroup orgs + * + * @apiParam {String} org + * @apiParam {String} username + * @apiParam {String=admin,member} role The role to give the user in the organization. + * @apiExample {js} ex: +github.orgs.addOrgMembership({ ... }); + */ + +/** + * @api {put} /teams/:id/memberships/:username addTeamMembership + * @apiVersion 8.2.1 + * @apiName addTeamMembership + * @apiDescription Add team membership + * @apiGroup orgs + * + * @apiParam {String} id + * @apiParam {String} username + * @apiParam {String=member,maintainer} [role=member] The role that this user should have in the team. + * @apiExample {js} ex: +github.orgs.addTeamMembership({ ... }); + */ + +/** + * @api {put} /teams/:id/repos/:org/:repo addTeamRepo + * @apiVersion 8.2.1 + * @apiName addTeamRepo + * @apiDescription Add team repository + * @apiGroup orgs + * + * @apiParam {String} id + * @apiParam {String} org + * @apiParam {String} repo + * @apiParam {String=pull,push,admin} [permission] `pull` - team members can pull, but not push or administer this repository, `push` - team members can pull and push, but not administer this repository, `admin` - team members can pull, push and administer this repository. + * @apiExample {js} ex: +github.orgs.addTeamRepo({ ... }); + */ + +/** + * @api {get} /orgs/:org/members/:username checkMembership + * @apiVersion 8.2.1 + * @apiName checkMembership + * @apiDescription Check membership + * @apiGroup orgs + * + * @apiParam {String} org + * @apiParam {String} username + * @apiExample {js} ex: +github.orgs.checkMembership({ ... }); + */ + +/** + * @api {get} /orgs/:org/public_members/:username checkPublicMembership + * @apiVersion 8.2.1 + * @apiName checkPublicMembership + * @apiDescription Check public membership + * @apiGroup orgs + * + * @apiParam {String} org + * @apiParam {String} username + * @apiExample {js} ex: +github.orgs.checkPublicMembership({ ... }); + */ + +/** + * @api {get} /teams/:id/repos/:owner/:repo checkTeamRepo + * @apiVersion 8.2.1 + * @apiName checkTeamRepo + * @apiDescription Check if a team manages a repository + * @apiGroup orgs + * + * @apiParam {String} id + * @apiParam {String} owner + * @apiParam {String} repo + * @apiExample {js} ex: +github.orgs.checkTeamRepo({ ... }); + */ + +/** + * @api {delete} /orgs/:org/public_members/:username concealMembership + * @apiVersion 8.2.1 + * @apiName concealMembership + * @apiDescription Conceal a user's membership + * @apiGroup orgs + * + * @apiParam {String} org + * @apiParam {String} username + * @apiExample {js} ex: +github.orgs.concealMembership({ ... }); + */ + +/** + * @api {put} /orgs/:org/outside_collaborator/:username convertMemberToOutsideCollaborator + * @apiVersion 8.2.1 + * @apiName convertMemberToOutsideCollaborator + * @apiDescription Convert member to outside collaborator. + * @apiGroup orgs + * + * @apiParam {String} org + * @apiParam {String} username + * @apiExample {js} ex: +github.orgs.convertMemberToOutsideCollaborator({ ... }); + */ + +/** + * @api {post} /orgs/:org/hooks createHook + * @apiVersion 8.2.1 + * @apiName createHook + * @apiDescription Create a hook + * @apiGroup orgs + * + * @apiParam {String} org + * @apiParam {String} name Must be passed as "web". + * @apiParam {Json} config Key/value pairs to provide settings for this webhook + * @apiParam {Array} [events=["push"]] Determines what events the hook is triggered for. Default: ["push"]. + * @apiParam {Boolean} [active] Determines whether the hook is actually triggered on pushes. + * @apiExample {js} ex: +github.orgs.createHook({ ... }); + */ + +/** + * @api {post} /orgs/:org/teams createTeam + * @apiVersion 8.2.1 + * @apiName createTeam + * @apiDescription Create team + * @apiGroup orgs + * + * @apiParam {String} org + * @apiParam {String} name + * @apiParam {String} [description] The description of the team. + * @apiParam {Array} [maintainers] The logins of organization members to add as maintainers of the team. + * @apiParam {Array} [repo_names] The full name (e.g., "organization-name/repository-name") of repositories to add the team to. + * @apiParam {String=secret,closed} [privacy=secret] The level of privacy this team should have. + * @apiExample {js} ex: +github.orgs.createTeam({ ... }); + */ + +/** + * @api {delete} /orgs/:org/hooks/:id deleteHook + * @apiVersion 8.2.1 + * @apiName deleteHook + * @apiDescription Delete a hook + * @apiGroup orgs + * + * @apiParam {String} org + * @apiParam {String} id + * @apiExample {js} ex: +github.orgs.deleteHook({ ... }); + */ + +/** + * @api {delete} /teams/:id deleteTeam + * @apiVersion 8.2.1 + * @apiName deleteTeam + * @apiDescription Delete team + * @apiGroup orgs + * + * @apiParam {String} id + * @apiExample {js} ex: +github.orgs.deleteTeam({ ... }); + */ + +/** + * @api {delete} /teams/:id/repos/:owner/:repo deleteTeamRepo + * @apiVersion 8.2.1 + * @apiName deleteTeamRepo + * @apiDescription Remove team repository + * @apiGroup orgs + * + * @apiParam {String} id + * @apiParam {String} owner + * @apiParam {String} repo + * @apiExample {js} ex: +github.orgs.deleteTeamRepo({ ... }); + */ + +/** + * @api {patch} /orgs/:org/hooks/:id editHook + * @apiVersion 8.2.1 + * @apiName editHook + * @apiDescription Edit a hook + * @apiGroup orgs + * + * @apiParam {String} org + * @apiParam {String} id + * @apiParam {Json} config Key/value pairs to provide settings for this webhook + * @apiParam {Array} [events=["push"]] Determines what events the hook is triggered for. Default: ["push"]. + * @apiParam {Boolean} [active] Determines whether the hook is actually triggered on pushes. + * @apiExample {js} ex: +github.orgs.editHook({ ... }); + */ + +/** + * @api {patch} /teams/:id editTeam + * @apiVersion 8.2.1 + * @apiName editTeam + * @apiDescription Edit team + * @apiGroup orgs + * + * @apiParam {String} id + * @apiParam {String} name + * @apiParam {String} [description] The description of the team. + * @apiParam {String=secret,closed} [privacy=secret] The level of privacy this team should have. + * @apiExample {js} ex: +github.orgs.editTeam({ ... }); + */ + +/** + * @api {get} /orgs/:org get + * @apiVersion 8.2.1 + * @apiName get + * @apiDescription Get an organization + * @apiGroup orgs + * + * @apiParam {String} org + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.orgs.get({ ... }); + */ + +/** + * @api {get} /organizations getAll + * @apiVersion 8.2.1 + * @apiName getAll + * @apiDescription List all organizations + * @apiGroup orgs + * + * @apiParam {String} [since] The integer ID of the last Organization that you've seen. + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.orgs.getAll({ ... }); + */ + +/** + * @api {get} /users/:username/orgs getForUser + * @apiVersion 8.2.1 + * @apiName getForUser + * @apiDescription List public organization memberships for the specified user. + * @apiGroup orgs + * + * @apiParam {String} username + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.orgs.getForUser({ ... }); + */ + +/** + * @api {get} /orgs/:org/hooks/:id getHook + * @apiVersion 8.2.1 + * @apiName getHook + * @apiDescription Get single hook + * @apiGroup orgs + * + * @apiParam {String} org + * @apiParam {String} id + * @apiExample {js} ex: +github.orgs.getHook({ ... }); + */ + +/** + * @api {get} /orgs/:org/hooks getHooks + * @apiVersion 8.2.1 + * @apiName getHooks + * @apiDescription List hooks + * @apiGroup orgs + * + * @apiParam {String} org + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.orgs.getHooks({ ... }); + */ + +/** + * @api {get} /orgs/:org/members getMembers + * @apiVersion 8.2.1 + * @apiName getMembers + * @apiDescription Members list + * @apiGroup orgs + * + * @apiParam {String} org + * @apiParam {String=all,2fa_disabled} [filter=all] Filter members returned in the list. + * @apiParam {String=all,admin,member} [role=all] Filter members returned by their role. + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.orgs.getMembers({ ... }); + */ + +/** + * @api {get} /orgs/:org/memberships/:username getOrgMembership + * @apiVersion 8.2.1 + * @apiName getOrgMembership + * @apiDescription Get organization membership + * @apiGroup orgs + * + * @apiParam {String} org + * @apiParam {String} username + * @apiExample {js} ex: +github.orgs.getOrgMembership({ ... }); + */ + +/** + * @api {get} /orgs/:org/outside_collaborators getOutsideCollaborators + * @apiVersion 8.2.1 + * @apiName getOutsideCollaborators + * @apiDescription List all users who are outside collaborators of an organization. + * @apiGroup orgs + * + * @apiParam {String} org + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.orgs.getOutsideCollaborators({ ... }); + */ + +/** + * @api {get} /orgs/:org/invitations getPendingOrgInvites + * @apiVersion 8.2.1 + * @apiName getPendingOrgInvites + * @apiDescription List pending organization invites. + * @apiGroup orgs + * + * @apiParam {String} org + * @apiExample {js} ex: +github.orgs.getPendingOrgInvites({ ... }); + */ + +/** + * @api {get} /teams/:id/invitations getPendingTeamInvites + * @apiVersion 8.2.1 + * @apiName getPendingTeamInvites + * @apiDescription List pending team invitations. + * @apiGroup orgs + * + * @apiParam {String} id + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.orgs.getPendingTeamInvites({ ... }); + */ + +/** + * @api {get} /orgs/:org/public_members getPublicMembers + * @apiVersion 8.2.1 + * @apiName getPublicMembers + * @apiDescription Public members list + * @apiGroup orgs + * + * @apiParam {String} org + * @apiExample {js} ex: +github.orgs.getPublicMembers({ ... }); + */ + +/** + * @api {get} /teams/:id getTeam + * @apiVersion 8.2.1 + * @apiName getTeam + * @apiDescription Get team + * @apiGroup orgs + * + * @apiParam {String} id + * @apiExample {js} ex: +github.orgs.getTeam({ ... }); + */ + +/** + * @api {get} /teams/:id/members getTeamMembers + * @apiVersion 8.2.1 + * @apiName getTeamMembers + * @apiDescription List team members + * @apiGroup orgs + * + * @apiParam {String} id + * @apiParam {String=member,maintainer,all} [role=all] Filters members returned by their role in the team. + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.orgs.getTeamMembers({ ... }); + */ + +/** + * @api {get} /teams/:id/memberships/:username getTeamMembership + * @apiVersion 8.2.1 + * @apiName getTeamMembership + * @apiDescription Get team membership + * @apiGroup orgs + * + * @apiParam {String} id + * @apiParam {String} username + * @apiExample {js} ex: +github.orgs.getTeamMembership({ ... }); + */ + +/** + * @api {get} /teams/:id/repos getTeamRepos + * @apiVersion 8.2.1 + * @apiName getTeamRepos + * @apiDescription Get team repos + * @apiGroup orgs + * + * @apiParam {String} id + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.orgs.getTeamRepos({ ... }); + */ + +/** + * @api {get} /orgs/:org/teams getTeams + * @apiVersion 8.2.1 + * @apiName getTeams + * @apiDescription List teams + * @apiGroup orgs + * + * @apiParam {String} org + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.orgs.getTeams({ ... }); + */ + +/** + * @api {post} /orgs/:org/hooks/:id/pings pingHook + * @apiVersion 8.2.1 + * @apiName pingHook + * @apiDescription Ping a hook + * @apiGroup orgs + * + * @apiParam {String} org + * @apiParam {String} id + * @apiExample {js} ex: +github.orgs.pingHook({ ... }); + */ + +/** + * @api {put} /orgs/:org/public_members/:username publicizeMembership + * @apiVersion 8.2.1 + * @apiName publicizeMembership + * @apiDescription Publicize a user's membership + * @apiGroup orgs + * + * @apiParam {String} org + * @apiParam {String} username + * @apiExample {js} ex: +github.orgs.publicizeMembership({ ... }); + */ + +/** + * @api {delete} /orgs/:org/members/:username removeMember + * @apiVersion 8.2.1 + * @apiName removeMember + * @apiDescription Remove a member + * @apiGroup orgs + * + * @apiParam {String} org + * @apiParam {String} username + * @apiExample {js} ex: +github.orgs.removeMember({ ... }); + */ + +/** + * @api {delete} /orgs/:org/memberships/:username removeOrgMembership + * @apiVersion 8.2.1 + * @apiName removeOrgMembership + * @apiDescription Remove organization membership + * @apiGroup orgs + * + * @apiParam {String} org + * @apiParam {String} username + * @apiExample {js} ex: +github.orgs.removeOrgMembership({ ... }); + */ + +/** + * @api {delete} /orgs/:org/outside_collaborator/:username removeOutsideCollaborator + * @apiVersion 8.2.1 + * @apiName removeOutsideCollaborator + * @apiDescription Remove outside collaborator. + * @apiGroup orgs + * + * @apiParam {String} org + * @apiParam {String} username + * @apiExample {js} ex: +github.orgs.removeOutsideCollaborator({ ... }); + */ + +/** + * @api {delete} /teams/:id/memberships/:username removeTeamMembership + * @apiVersion 8.2.1 + * @apiName removeTeamMembership + * @apiDescription Remove team membership + * @apiGroup orgs + * + * @apiParam {String} id + * @apiParam {String} username + * @apiExample {js} ex: +github.orgs.removeTeamMembership({ ... }); + */ + +/** + * @api {patch} /orgs/:org update + * @apiVersion 8.2.1 + * @apiName update + * @apiDescription Edit an organization + * @apiGroup orgs + * + * @apiParam {String} org + * @apiParam {String} [billing_email] Billing email address. This address is not publicized. + * @apiParam {String} [company] The company name. + * @apiParam {String} [email] The publicly visible email address. + * @apiParam {String} [location] The location. + * @apiParam {String} [name] The shorthand name of the company. + * @apiParam {String} [description] The description of the company. + * @apiParam {String=read,write,admin,none} [default_repository_permission=read] Default permission level members have for organization repositories. + * @apiParam {Boolean} [members_can_create_repositories=true] Toggles ability of non-admin organization members to create repositories. + * @apiExample {js} ex: +github.orgs.update({ ... }); + */ + +/** + * @api {post} /orgs/:org/projects createOrgProject + * @apiVersion 8.2.1 + * @apiName createOrgProject + * @apiDescription Create an organization project. (In preview period. See README.) + * @apiGroup projects + * + * @apiParam {String} org + * @apiParam {String} name + * @apiParam {String} [body] + * @apiExample {js} ex: +github.projects.createOrgProject({ ... }); + */ + +/** + * @api {post} /projects/columns/:column_id/cards createProjectCard + * @apiVersion 8.2.1 + * @apiName createProjectCard + * @apiDescription Create a project card. (In preview period. See README.) + * @apiGroup projects + * + * @apiParam {String} column_id + * @apiParam {String} [note] The note of the card. + * @apiParam {String} [content_id] The id of the Issue or Pull Request to associate with this card. + * @apiParam {String} [content_type] The type of content to associate with this card. Can be either 'Issue' or 'PullRequest'. + * @apiExample {js} ex: +github.projects.createProjectCard({ ... }); + */ + +/** + * @api {post} /projects/:project_id/columns createProjectColumn + * @apiVersion 8.2.1 + * @apiName createProjectColumn + * @apiDescription Create a project column. (In preview period. See README.) + * @apiGroup projects + * + * @apiParam {String} project_id + * @apiParam {String} name + * @apiExample {js} ex: +github.projects.createProjectColumn({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/projects createRepoProject + * @apiVersion 8.2.1 + * @apiName createRepoProject + * @apiDescription Create a repository project. (In preview period. See README.) + * @apiGroup projects + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} name + * @apiParam {String} [body] + * @apiExample {js} ex: +github.projects.createRepoProject({ ... }); + */ + +/** + * @api {delete} /projects/:id deleteProject + * @apiVersion 8.2.1 + * @apiName deleteProject + * @apiDescription Delete a project. (In preview period. See README.) + * @apiGroup projects + * + * @apiParam {String} id + * @apiExample {js} ex: +github.projects.deleteProject({ ... }); + */ + +/** + * @api {delete} /projects/columns/cards/:id deleteProjectCard + * @apiVersion 8.2.1 + * @apiName deleteProjectCard + * @apiDescription Delete a project card. (In preview period. See README.) + * @apiGroup projects + * + * @apiParam {String} id + * @apiExample {js} ex: +github.projects.deleteProjectCard({ ... }); + */ + +/** + * @api {delete} /projects/columns/:id deleteProjectColumn + * @apiVersion 8.2.1 + * @apiName deleteProjectColumn + * @apiDescription Delete a project column. (In preview period. See README.) + * @apiGroup projects + * + * @apiParam {String} id + * @apiExample {js} ex: +github.projects.deleteProjectColumn({ ... }); + */ + +/** + * @api {get} /orgs/:org/projects getOrgProjects + * @apiVersion 8.2.1 + * @apiName getOrgProjects + * @apiDescription List organization projects. (In preview period. See README.) + * @apiGroup projects + * + * @apiParam {String} org + * @apiExample {js} ex: +github.projects.getOrgProjects({ ... }); + */ + +/** + * @api {get} /projects/:id getProject + * @apiVersion 8.2.1 + * @apiName getProject + * @apiDescription Get a project. (In preview period. See README.) + * @apiGroup projects + * + * @apiParam {String} id + * @apiExample {js} ex: +github.projects.getProject({ ... }); + */ + +/** + * @api {get} /projects/columns/cards/:id getProjectCard + * @apiVersion 8.2.1 + * @apiName getProjectCard + * @apiDescription Get project card. (In preview period. See README.) + * @apiGroup projects + * + * @apiParam {String} id + * @apiExample {js} ex: +github.projects.getProjectCard({ ... }); + */ + +/** + * @api {get} /projects/columns/:column_id/cards getProjectCards + * @apiVersion 8.2.1 + * @apiName getProjectCards + * @apiDescription List project cards. (In preview period. See README.) + * @apiGroup projects + * + * @apiParam {String} column_id + * @apiExample {js} ex: +github.projects.getProjectCards({ ... }); + */ + +/** + * @api {get} /projects/columns/:id getProjectColumn + * @apiVersion 8.2.1 + * @apiName getProjectColumn + * @apiDescription Get a project column. (In preview period. See README.) + * @apiGroup projects + * + * @apiParam {String} id + * @apiExample {js} ex: +github.projects.getProjectColumn({ ... }); + */ + +/** + * @api {get} /projects/:project_id/columns getProjectColumns + * @apiVersion 8.2.1 + * @apiName getProjectColumns + * @apiDescription List project columns. (In preview period. See README.) + * @apiGroup projects + * + * @apiParam {String} project_id + * @apiExample {js} ex: +github.projects.getProjectColumns({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/projects getRepoProjects + * @apiVersion 8.2.1 + * @apiName getRepoProjects + * @apiDescription List repository projects. (In preview period. See README.) + * @apiGroup projects + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiExample {js} ex: +github.projects.getRepoProjects({ ... }); + */ + +/** + * @api {post} /projects/columns/cards/:id/moves moveProjectCard + * @apiVersion 8.2.1 + * @apiName moveProjectCard + * @apiDescription Move a project card. (In preview period. See README.) + * @apiGroup projects + * + * @apiParam {String} id + * @apiParam {String} position Can be one of top, bottom, or after:, where is the id value of a column in the same project. + * @apiParam {String} [column_id] The id value of a column in the same project. + * @apiExample {js} ex: +github.projects.moveProjectCard({ ... }); + */ + +/** + * @api {post} /projects/columns/:id/moves moveProjectColumn + * @apiVersion 8.2.1 + * @apiName moveProjectColumn + * @apiDescription Move a project column. (In preview period. See README.) + * @apiGroup projects + * + * @apiParam {String} id + * @apiParam {String} position Can be one of first, last, or after:, where is the id value of a column in the same project. + * @apiExample {js} ex: +github.projects.moveProjectColumn({ ... }); + */ + +/** + * @api {patch} /projects/:id updateProject + * @apiVersion 8.2.1 + * @apiName updateProject + * @apiDescription Update a project. (In preview period. See README.) + * @apiGroup projects + * + * @apiParam {String} id + * @apiParam {String} name + * @apiParam {String} [body] + * @apiExample {js} ex: +github.projects.updateProject({ ... }); + */ + +/** + * @api {patch} /projects/columns/cards/:id updateProjectCard + * @apiVersion 8.2.1 + * @apiName updateProjectCard + * @apiDescription Update a project card. (In preview period. See README.) + * @apiGroup projects + * + * @apiParam {String} id + * @apiParam {String} [note] The note of the card. + * @apiExample {js} ex: +github.projects.updateProjectCard({ ... }); + */ + +/** + * @api {patch} /projects/columns/:id updateProjectColumn + * @apiVersion 8.2.1 + * @apiName updateProjectColumn + * @apiDescription Update a project column. (In preview period. See README.) + * @apiGroup projects + * + * @apiParam {String} id + * @apiParam {String} name + * @apiExample {js} ex: +github.projects.updateProjectColumn({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/pulls/:number/merge checkMerged + * @apiVersion 8.2.1 + * @apiName checkMerged + * @apiDescription Get if a pull request has been merged + * @apiGroup pullRequests + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.pullRequests.checkMerged({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/pulls create + * @apiVersion 8.2.1 + * @apiName create + * @apiDescription Create a pull request + * @apiGroup pullRequests + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} title The title of the pull request. + * @apiParam {String} head The branch (or git ref) where your changes are implemented. + * @apiParam {String} base The branch (or git ref) you want your changes pulled into. This should be an existing branch on the current repository. You cannot submit a pull request to one repo that requests a merge to a base of another repo. + * @apiParam {String} [body] The contents of the pull request. + * @apiParam {Boolean} [maintainer_can_modify=true] Indicates whether maintainers can modify the pull request. + * @apiExample {js} ex: +github.pullRequests.create({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/pulls/:number/comments createComment + * @apiVersion 8.2.1 + * @apiName createComment + * @apiDescription Create a comment + * @apiGroup pullRequests + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiParam {String} body + * @apiParam {String} commit_id Sha of the commit to comment on. + * @apiParam {String} path Relative path of the file to comment on. + * @apiParam {Number} position Column index in the diff to comment on. + * @apiExample {js} ex: +github.pullRequests.createComment({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/pulls/:number/comments createCommentReply + * @apiVersion 8.2.1 + * @apiName createCommentReply + * @apiDescription Reply to existing pull request comment + * @apiGroup pullRequests + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiParam {String} body + * @apiParam {Number} in_reply_to The comment id to reply to. + * @apiExample {js} ex: +github.pullRequests.createCommentReply({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/pulls createFromIssue + * @apiVersion 8.2.1 + * @apiName createFromIssue + * @apiDescription Create a pull request from an existing issue + * @apiGroup pullRequests + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} issue The issue number in this repository to turn into a Pull Request. + * @apiParam {String} head The branch (or git ref) where your changes are implemented. + * @apiParam {String} base The branch (or git ref) you want your changes pulled into. This should be an existing branch on the current repository. You cannot submit a pull request to one repo that requests a merge to a base of another repo. + * @apiExample {js} ex: +github.pullRequests.createFromIssue({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/pulls/:number/reviews createReview + * @apiVersion 8.2.1 + * @apiName createReview + * @apiDescription Create a pull request review. (In preview period. See README.) + * @apiGroup pullRequests + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiParam {String} [body] The body text of the pull request review. + * @apiParam {String=APPROVE,REQUEST_CHANGES,COMMENT,PENDING} [event=PENDING] The event to perform on the review upon submission, can be one of APPROVE, REQUEST_CHANGES, or COMMENT. If left blank, the review will be in the PENDING state. + * @apiParam {Array} [comments] An array of comments part of the review. + * @apiParam {String} [path] The path to the file being commented on. + * @apiParam {Number} [position] The position in the file to be commented on. + * @apiExample {js} ex: +github.pullRequests.createReview({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/pulls/:number/requested_reviewers createReviewRequest + * @apiVersion 8.2.1 + * @apiName createReviewRequest + * @apiDescription Create a review request. (In preview period. See README.) + * @apiGroup pullRequests + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiParam {Array} [reviewers] An array of user logins that will be requested. + * @apiExample {js} ex: +github.pullRequests.createReviewRequest({ ... }); + */ + +/** + * @api {delete} /repos/:owner/:repo/pulls/comments/:id deleteComment + * @apiVersion 8.2.1 + * @apiName deleteComment + * @apiDescription Delete a comment + * @apiGroup pullRequests + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiExample {js} ex: +github.pullRequests.deleteComment({ ... }); + */ + +/** + * @api {delete} /repos/:owner/:repo/pulls/:number/requested_reviewers deleteReviewRequest + * @apiVersion 8.2.1 + * @apiName deleteReviewRequest + * @apiDescription Delete a review request. (In preview period. See README.) + * @apiGroup pullRequests + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiParam {Array} [reviewers] An array of user logins that will be requested. + * @apiExample {js} ex: +github.pullRequests.deleteReviewRequest({ ... }); + */ + +/** + * @api {put} /repos/:owner/:repo/pulls/:number/reviews/:id/dismissals dismissReview + * @apiVersion 8.2.1 + * @apiName dismissReview + * @apiDescription Dismiss a pull request review. (In preview period. See README.) + * @apiGroup pullRequests + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiParam {String} id + * @apiParam {String} [message] The message for the pull request review dismissal. + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.pullRequests.dismissReview({ ... }); + */ + +/** + * @api {patch} /repos/:owner/:repo/pulls/comments/:id editComment + * @apiVersion 8.2.1 + * @apiName editComment + * @apiDescription Edit a comment + * @apiGroup pullRequests + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiParam {String} body + * @apiExample {js} ex: +github.pullRequests.editComment({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/pulls/:number get + * @apiVersion 8.2.1 + * @apiName get + * @apiDescription Get a single pull request + * @apiGroup pullRequests + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiExample {js} ex: +github.pullRequests.get({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/pulls getAll + * @apiVersion 8.2.1 + * @apiName getAll + * @apiDescription List pull requests + * @apiGroup pullRequests + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String=open,closed,all} [state=open] open, closed, or all + * @apiParam {String} [head] Filter pulls by head user and branch name in the format of user:ref-name. Example: github:new-script-format. + * @apiParam {String} [base] Filter pulls by base branch name. Example: gh-pages. + * @apiParam {String=created,updated,popularity,long-running} [sort=created] Possible values are: `created`, `updated`, `popularity`, `long-running`, Default: `created` + * @apiParam {String=asc,desc} [direction=desc] + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.pullRequests.getAll({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/pulls/comments/:id getComment + * @apiVersion 8.2.1 + * @apiName getComment + * @apiDescription Get a single comment + * @apiGroup pullRequests + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiExample {js} ex: +github.pullRequests.getComment({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/pulls/:number/comments getComments + * @apiVersion 8.2.1 + * @apiName getComments + * @apiDescription List comments on a pull request + * @apiGroup pullRequests + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.pullRequests.getComments({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/pulls/comments getCommentsForRepo + * @apiVersion 8.2.1 + * @apiName getCommentsForRepo + * @apiDescription List comments in a repository + * @apiGroup pullRequests + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String=created,updated} [sort=created] Possible values are: `created`, `updated`, Default: `created` + * @apiParam {String=asc,desc} [direction=desc] + * @apiParam {Date} [since] Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.pullRequests.getCommentsForRepo({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/pulls/:number/commits getCommits + * @apiVersion 8.2.1 + * @apiName getCommits + * @apiDescription List commits on a pull request + * @apiGroup pullRequests + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.pullRequests.getCommits({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/pulls/:number/files getFiles + * @apiVersion 8.2.1 + * @apiName getFiles + * @apiDescription List pull requests files + * @apiGroup pullRequests + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.pullRequests.getFiles({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/pulls/:number/reviews/:id getReview + * @apiVersion 8.2.1 + * @apiName getReview + * @apiDescription Get a single pull request review. (In preview period. See README.) + * @apiGroup pullRequests + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiParam {String} id + * @apiExample {js} ex: +github.pullRequests.getReview({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/pulls/:number/reviews/:id/comments getReviewComments + * @apiVersion 8.2.1 + * @apiName getReviewComments + * @apiDescription Get comments for a pull request review. (In preview period. See README.) + * @apiGroup pullRequests + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiParam {String} id + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.pullRequests.getReviewComments({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/pulls/:number/requested_reviewers getReviewRequests + * @apiVersion 8.2.1 + * @apiName getReviewRequests + * @apiDescription List review requests. (In preview period. See README.) + * @apiGroup pullRequests + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.pullRequests.getReviewRequests({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/pulls/:number/reviews getReviews + * @apiVersion 8.2.1 + * @apiName getReviews + * @apiDescription List reviews on a pull request. (In preview period. See README.) + * @apiGroup pullRequests + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.pullRequests.getReviews({ ... }); + */ + +/** + * @api {put} /repos/:owner/:repo/pulls/:number/merge merge + * @apiVersion 8.2.1 + * @apiName merge + * @apiDescription Merge a pull request (Merge Button) + * @apiGroup pullRequests + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiParam {String} [commit_title] Title for the automatic commit message. (In preview period. See README.) + * @apiParam {String} [commit_message] Extra detail to append to automatic commit message. + * @apiParam {String} [sha] SHA that pull request head must match to allow merge + * @apiParam {String=merge,squash,rebase} [merge_method=merge] Merge method to use. Possible values are `merge`, `squash`, or `rebase`. (In preview period. See README.) + * @apiExample {js} ex: +github.pullRequests.merge({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/pulls/:number/reviews/:id/events submitReview + * @apiVersion 8.2.1 + * @apiName submitReview + * @apiDescription Submit a pull request review. (In preview period. See README.) + * @apiGroup pullRequests + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiParam {String} id + * @apiParam {String} [body] The body text of the pull request review. + * @apiParam {String=APPROVE,REQUEST_CHANGES,COMMENT,PENDING} [event=PENDING] The event to perform on the review upon submission, can be one of APPROVE, REQUEST_CHANGES, or COMMENT. If left blank, the review will be in the PENDING state. + * @apiExample {js} ex: +github.pullRequests.submitReview({ ... }); + */ + +/** + * @api {patch} /repos/:owner/:repo/pulls/:number update + * @apiVersion 8.2.1 + * @apiName update + * @apiDescription Update a pull request + * @apiGroup pullRequests + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiParam {String} [title] The title of the pull request. + * @apiParam {String} [body] The contents of the pull request. + * @apiParam {String=open,closed,all} [state=open] + * @apiParam {String} [base] The branch (or git ref) you want your changes pulled into. This should be an existing branch on the current repository. You cannot submit a pull request to one repo that requests a merge to a base of another repo. + * @apiExample {js} ex: +github.pullRequests.update({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/comments/:id/reactions createForCommitComment + * @apiVersion 8.2.1 + * @apiName createForCommitComment + * @apiDescription Create reaction for a commit comment. (In preview period. See README.) + * @apiGroup reactions + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiParam {String=+1,-1,laugh,confused,heart,hooray} content The reaction type. + * @apiExample {js} ex: +github.reactions.createForCommitComment({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/issues/:number/reactions createForIssue + * @apiVersion 8.2.1 + * @apiName createForIssue + * @apiDescription Create reaction for an issue. (In preview period. See README.) + * @apiGroup reactions + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiParam {String=+1,-1,laugh,confused,heart,hooray} content The reaction type. + * @apiExample {js} ex: +github.reactions.createForIssue({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/issues/comments/:id/reactions createForIssueComment + * @apiVersion 8.2.1 + * @apiName createForIssueComment + * @apiDescription Create reaction for an issue comment. (In preview period. See README.) + * @apiGroup reactions + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiParam {String=+1,-1,laugh,confused,heart,hooray} content The reaction type. + * @apiExample {js} ex: +github.reactions.createForIssueComment({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/pulls/comments/:id/reactions createForPullRequestReviewComment + * @apiVersion 8.2.1 + * @apiName createForPullRequestReviewComment + * @apiDescription Create reaction for a pull request review comment. (In preview period. See README.) + * @apiGroup reactions + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiParam {String=+1,-1,laugh,confused,heart,hooray} content The reaction type. + * @apiExample {js} ex: +github.reactions.createForPullRequestReviewComment({ ... }); + */ + +/** + * @api {delete} /reactions/:id delete + * @apiVersion 8.2.1 + * @apiName delete + * @apiDescription Delete a reaction. (In preview period. See README.) + * @apiGroup reactions + * + * @apiParam {String} id + * @apiExample {js} ex: +github.reactions.delete({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/comments/:id/reactions getForCommitComment + * @apiVersion 8.2.1 + * @apiName getForCommitComment + * @apiDescription List reactions for a commit comment. (In preview period. See README.) + * @apiGroup reactions + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiParam {String=+1,-1,laugh,confused,heart,hooray} [content] Indicates which type of reaction to return. + * @apiExample {js} ex: +github.reactions.getForCommitComment({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/issues/:number/reactions getForIssue + * @apiVersion 8.2.1 + * @apiName getForIssue + * @apiDescription List reactions for an issue. (In preview period. See README.) + * @apiGroup reactions + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} number + * @apiParam {String=+1,-1,laugh,confused,heart,hooray} [content] Indicates which type of reaction to return. + * @apiExample {js} ex: +github.reactions.getForIssue({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/issues/comments/:id/reactions getForIssueComment + * @apiVersion 8.2.1 + * @apiName getForIssueComment + * @apiDescription List reactions for an issue comment. (In preview period. See README.) + * @apiGroup reactions + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiParam {String=+1,-1,laugh,confused,heart,hooray} [content] Indicates which type of reaction to return. + * @apiExample {js} ex: +github.reactions.getForIssueComment({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/pulls/comments/:id/reactions getForPullRequestReviewComment + * @apiVersion 8.2.1 + * @apiName getForPullRequestReviewComment + * @apiDescription List reactions for a pull request review comment. (In preview period. See README.) + * @apiGroup reactions + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiParam {String=+1,-1,laugh,confused,heart,hooray} [content] Indicates which type of reaction to return. + * @apiExample {js} ex: +github.reactions.getForPullRequestReviewComment({ ... }); + */ + +/** + * @api {put} /repos/:owner/:repo/collaborators/:username addCollaborator + * @apiVersion 8.2.1 + * @apiName addCollaborator + * @apiDescription Add user as a collaborator + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} username + * @apiParam {String=pull,push,admin} [permission=push] `pull` - can pull, but not push to or administer this repository, `push` - can pull and push, but not administer this repository, `admin` - can pull, push and administer this repository. + * @apiExample {js} ex: +github.repos.addCollaborator({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/branches/:branch/protection/required_status_checks/contexts addProtectedBranchRequiredStatusChecksContexts + * @apiVersion 8.2.1 + * @apiName addProtectedBranchRequiredStatusChecksContexts + * @apiDescription Add required status checks contexts of protected branch. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} branch + * @apiParam {Array} contexts An array of protected branch required status checks contexts (e.g. continuous-integration/jenkins). + * @apiExample {js} ex: +github.repos.addProtectedBranchRequiredStatusChecksContexts({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/branches/:branch/protection/restrictions/teams addProtectedBranchTeamRestrictions + * @apiVersion 8.2.1 + * @apiName addProtectedBranchTeamRestrictions + * @apiDescription Add team restrictions of protected branch. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} branch + * @apiParam {Array} teams An array of team slugs (e.g. justice-league). + * @apiExample {js} ex: +github.repos.addProtectedBranchTeamRestrictions({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/branches/:branch/protection/restrictions/users addProtectedBranchUserRestrictions + * @apiVersion 8.2.1 + * @apiName addProtectedBranchUserRestrictions + * @apiDescription Add user restrictions of protected branch. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} branch + * @apiParam {Array} users An array of team slugs (e.g. justice-league). + * @apiExample {js} ex: +github.repos.addProtectedBranchUserRestrictions({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/collaborators/:username checkCollaborator + * @apiVersion 8.2.1 + * @apiName checkCollaborator + * @apiDescription Check if user is a collaborator. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} username + * @apiExample {js} ex: +github.repos.checkCollaborator({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/compare/:base...:head compareCommits + * @apiVersion 8.2.1 + * @apiName compareCommits + * @apiDescription Compare two commits. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} base The branch (or git ref) you want your changes pulled into. This should be an existing branch on the current repository. You cannot submit a pull request to one repo that requests a merge to a base of another repo. + * @apiParam {String} head The branch (or git ref) where your changes are implemented. + * @apiExample {js} ex: +github.repos.compareCommits({ ... }); + */ + +/** + * @api {post} /user/repos create + * @apiVersion 8.2.1 + * @apiName create + * @apiDescription Create a new repository for the authenticated user. + * @apiGroup repos + * + * @apiParam {String} name + * @apiParam {Boolean} [allow_rebase_merge=true] Either true to allow rebase-merging pull requests, or false to prevent rebase-merging. Default: true. (In preview period. See README.) + * @apiParam {String} [homepage] + * @apiParam {Boolean} [private=false] True to create a private repository, false to create a public one. Creating private repositories requires a paid GitHub account. Default is false. + * @apiParam {Boolean} [has_issues=true] True to enable issues for this repository, false to disable them. Default is true. + * @apiParam {Boolean} [has_wiki=true] True to enable the wiki for this repository, false to disable it. Default is true. + * @apiParam {Boolean} [has_downloads=true] True to enable downloads for this repository, false to disable them. Default is true. + * @apiParam {String} [description] + * @apiParam {Boolean} [auto_init=false] True to create an initial commit with empty README. Default is false + * @apiParam {String} [gitignore_template] Desired language or platform .gitignore template to apply. Ignored if auto_init parameter is not provided. + * @apiParam {String} [license_template] Desired LICENSE template to apply. Use the name of the template without the extension. For example, "mit" or "mozilla". + * @apiParam {Boolean} [allow_squash_merge=true] Either true to allow squash-merging pull requests, or false to prevent squash-merging. Default: true. (In preview period. See README.) + * @apiParam {Boolean} [allow_merge_commit=true] Either true to allow merging pull requests with a merge commit, or false to prevent merging pull requests with merge commits. Default: true. (In preview period. See README.) + * @apiParam {Number} [team_id] The id of the team that will be granted access to this repository. This is only valid when creating a repository in an organization. + * @apiExample {js} ex: +github.repos.create({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/commits/:sha/comments createCommitComment + * @apiVersion 8.2.1 + * @apiName createCommitComment + * @apiDescription Create a commit comment. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} sha + * @apiParam {String} body + * @apiParam {String} [path] Relative path of the file to comment on. + * @apiParam {Number} [position] Line index in the diff to comment on. + * @apiParam {Number} [line] Deprecated. Use position parameter instead. Line number in the file to comment on. + * @apiExample {js} ex: +github.repos.createCommitComment({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/deployments createDeployment + * @apiVersion 8.2.1 + * @apiName createDeployment + * @apiDescription Create a deployment. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} ref The ref to deploy. This can be a branch, tag, or sha. + * @apiParam {String} repo + * @apiParam {String} [task=deploy] The named task to execute. e.g. deploy or deploy:migrations. Default: deploy + * @apiParam {Boolean} [auto_merge=true] Optional parameter to merge the default branch into the requested ref if it is behind the default branch. Default: true + * @apiParam {Boolean} [production_environment] Specifies if the given environment is a one that end-users directly interact with. Default: true when environment is `production` and false otherwise. (In preview period. See README.) + * @apiParam {String} [payload=""] Optional JSON payload with extra information about the deployment. Default: "" + * @apiParam {String} [environment=none] The name of the environment that was deployed to. e.g. staging or production. Default: none. + * @apiParam {String} [description=""] Optional short description. Default: "" + * @apiParam {Boolean} [transient_environment=false] Specifies if the given environment is specific to the deployment and will no longer exist at some point in the future. Default: false. (In preview period. See README.) + * @apiParam {Array} [required_contexts] Optional array of status contexts verified against commit status checks. If this parameter is omitted from the parameters then all unique contexts will be verified before a deployment is created. To bypass checking entirely pass an empty array. Defaults to all unique contexts. + * @apiExample {js} ex: +github.repos.createDeployment({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/deployments/:id/statuses createDeploymentStatus + * @apiVersion 8.2.1 + * @apiName createDeploymentStatus + * @apiDescription Create a deployment status. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiParam {String} [state] The state of the status. Can be one of pending, success, error, or failure. + * @apiParam {String} [target_url=""] The target URL to associate with this status. This URL should contain output to keep the user updated while the task is running or serve as historical information for what happened in the deployment. Default: "" + * @apiParam {String} [log_url=""] Functionally equivalent to target_url. Default: "". (In preview period. See README.) + * @apiParam {String} [description=""] A short description of the status. Default: "" + * @apiParam {String} [environment_url=""] URL for accessing the deployment environment. Default: "". (In preview period. See README.) + * @apiParam {Boolean} [auto_inactive=true] When true the new `inactive` status is added to all other non-transient, non-production environment deployments with the same repository and environment name as the created status's deployment. Default: true. (In preview period. See README.) + * @apiExample {js} ex: +github.repos.createDeploymentStatus({ ... }); + */ + +/** + * @api {put} /repos/:owner/:repo/contents/:path createFile + * @apiVersion 8.2.1 + * @apiName createFile + * @apiDescription Create a new file in the given repository. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} path The content path. + * @apiParam {String} message The commit message. + * @apiParam {String} content The new file content, Base64 encoded. + * @apiParam {String} [branch] The branch name. If not provided, uses the repository’s default branch (usually master). + * @apiParam {Json} [committer] + * @apiExample {js} ex: +github.repos.createFile({ ... }); + */ + +/** + * @api {post} /orgs/:org/repos createForOrg + * @apiVersion 8.2.1 + * @apiName createForOrg + * @apiDescription Create a new repository for an organization. + * @apiGroup repos + * + * @apiParam {String} org + * @apiParam {String} name + * @apiParam {String} [description] + * @apiParam {String} [homepage] + * @apiParam {Boolean} [private=false] True to create a private repository, false to create a public one. Creating private repositories requires a paid GitHub account. Default is false. + * @apiParam {Boolean} [has_issues=true] True to enable issues for this repository, false to disable them. Default is true. + * @apiParam {Boolean} [has_wiki=true] True to enable the wiki for this repository, false to disable it. Default is true. + * @apiParam {Boolean} [allow_rebase_merge=true] Either true to allow rebase-merging pull requests, or false to prevent rebase-merging. Default: true. (In preview period. See README.) + * @apiParam {Number} [team_id] The id of the team that will be granted access to this repository. This is only valid when creating a repo in an organization. + * @apiParam {Boolean} [auto_init=false] True to create an initial commit with empty README. Default is false + * @apiParam {String} [gitignore_template] Desired language or platform .gitignore template to apply. Ignored if auto_init parameter is not provided. + * @apiParam {String} [license_template] Desired LICENSE template to apply. Use the name of the template without the extension. For example, "mit" or "mozilla". + * @apiParam {Boolean} [allow_squash_merge=true] Either true to allow squash-merging pull requests, or false to prevent squash-merging. Default: true. (In preview period. See README.) + * @apiParam {Boolean} [allow_merge_commit=true] Either true to allow merging pull requests with a merge commit, or false to prevent merging pull requests with merge commits. Default: true. (In preview period. See README.) + * @apiParam {Boolean} [has_downloads=true] True to enable downloads for this repository, false to disable them. Default is true. + * @apiExample {js} ex: +github.repos.createForOrg({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/hooks createHook + * @apiVersion 8.2.1 + * @apiName createHook + * @apiDescription Create a hook. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} name + * @apiParam {Json} config A Hash containing key/value pairs to provide settings for this hook. These settings vary between the services and are defined in the github-services repo. Booleans are stored internally as `1` for true, and `0` for false. Any JSON true/false values will be converted automatically. + * @apiParam {Array} [events=["push"]] Determines what events the hook is triggered for. Default: `['push']`. + * @apiParam {Boolean} [active] Determines whether the hook is actually triggered on pushes. + * @apiExample {js} ex: +github.repos.createHook({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/keys createKey + * @apiVersion 8.2.1 + * @apiName createKey + * @apiDescription Add a new deploy key. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} title + * @apiParam {String} key + * @apiParam {Boolean} [read_only] If true, the key will only be able to read repository contents. Otherwise, the key will be able to read and write. + * @apiExample {js} ex: +github.repos.createKey({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/releases createRelease + * @apiVersion 8.2.1 + * @apiName createRelease + * @apiDescription Create a release. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} tag_name String of the tag + * @apiParam {String} [target_commitish] Specifies the commitish value that determines where the Git tag is created from. Can be any branch or commit SHA. Unused if the Git tag already exists. Default: the repository's default branch (usually master). + * @apiParam {String} [name] + * @apiParam {String} [body] + * @apiParam {Boolean} [draft=false] true to create a draft (unpublished) release, false to create a published one. Default: false + * @apiParam {Boolean} [prerelease=false] true to identify the release as a prerelease. false to identify the release as a full release. Default: false + * @apiExample {js} ex: +github.repos.createRelease({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/statuses/:sha createStatus + * @apiVersion 8.2.1 + * @apiName createStatus + * @apiDescription Create a status. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} sha + * @apiParam {String=pending,success,error,failure} state State of the status - can be one of pending, success, error, or failure. + * @apiParam {String} [target_url] Target url to associate with this status. This URL will be linked from the GitHub UI to allow users to easily see the ‘source’ of the Status. + * @apiParam {String} [description] Short description of the status. + * @apiParam {String} [context] A string label to differentiate this status from the status of other systems. + * @apiExample {js} ex: +github.repos.createStatus({ ... }); + */ + +/** + * @api {delete} /repos/:owner/:repo delete + * @apiVersion 8.2.1 + * @apiName delete + * @apiDescription Delete a repository. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiExample {js} ex: +github.repos.delete({ ... }); + */ + +/** + * @api {delete} /repos/:owner/:repo/releases/assets/:id deleteAsset + * @apiVersion 8.2.1 + * @apiName deleteAsset + * @apiDescription Delete a release asset. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiExample {js} ex: +github.repos.deleteAsset({ ... }); + */ + +/** + * @api {delete} /repos/:owner/:repo/comments/:id deleteCommitComment + * @apiVersion 8.2.1 + * @apiName deleteCommitComment + * @apiDescription Delete a commit comment. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiExample {js} ex: +github.repos.deleteCommitComment({ ... }); + */ + +/** + * @api {delete} /repos/:owner/:repo/downloads/:id deleteDownload + * @apiVersion 8.2.1 + * @apiName deleteDownload + * @apiDescription Delete a download. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiExample {js} ex: +github.repos.deleteDownload({ ... }); + */ + +/** + * @api {delete} /repos/:owner/:repo/contents/:path deleteFile + * @apiVersion 8.2.1 + * @apiName deleteFile + * @apiDescription Delete a file. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} path The content path. + * @apiParam {String} message The commit message. + * @apiParam {String} sha The blob SHA of the file being removed. + * @apiParam {String} [branch] The branch name. If not provided, uses the repository’s default branch (usually master). + * @apiParam {Json} [committer] + * @apiExample {js} ex: +github.repos.deleteFile({ ... }); + */ + +/** + * @api {delete} /repos/:owner/:repo/hooks/:id deleteHook + * @apiVersion 8.2.1 + * @apiName deleteHook + * @apiDescription Deleate a hook. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiExample {js} ex: +github.repos.deleteHook({ ... }); + */ + +/** + * @api {delete} /repositories/:repo_id/invitations/:invitation_id deleteInvite + * @apiVersion 8.2.1 + * @apiName deleteInvite + * @apiDescription Delete a repository invitation. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} repo_id + * @apiParam {String} invitation_id + * @apiExample {js} ex: +github.repos.deleteInvite({ ... }); + */ + +/** + * @api {delete} /repos/:owner/:repo/keys/:id deleteKey + * @apiVersion 8.2.1 + * @apiName deleteKey + * @apiDescription Remove a deploy key. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiExample {js} ex: +github.repos.deleteKey({ ... }); + */ + +/** + * @api {delete} /repos/:owner/:repo/releases/:id deleteRelease + * @apiVersion 8.2.1 + * @apiName deleteRelease + * @apiDescription Delete a release + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiExample {js} ex: +github.repos.deleteRelease({ ... }); + */ + +/** + * @api {patch} /repos/:owner/:repo edit + * @apiVersion 8.2.1 + * @apiName edit + * @apiDescription Update a repo. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} name + * @apiParam {String} repo + * @apiParam {String} [description] + * @apiParam {String} [homepage] + * @apiParam {Boolean} [private=false] True to create a private repository, false to create a public one. Creating private repositories requires a paid GitHub account. Default is false. + * @apiParam {Boolean} [allow_rebase_merge=true] Either true to allow rebase-merging pull requests, or false to prevent rebase-merging. Default: true. (In preview period. See README.) + * @apiParam {Boolean} [has_wiki=true] True to enable the wiki for this repository, false to disable it. Default is true. + * @apiParam {Boolean} [has_downloads=true] True to enable downloads for this repository, false to disable them. Default is true. + * @apiParam {String} [default_branch] Updates the default branch for this repository. + * @apiParam {Boolean} [allow_squash_merge=true] Either true to allow squash-merging pull requests, or false to prevent squash-merging. Default: true. (In preview period. See README.) + * @apiParam {Boolean} [allow_merge_commit=true] Either true to allow merging pull requests with a merge commit, or false to prevent merging pull requests with merge commits. Default: true. (In preview period. See README.) + * @apiParam {Boolean} [has_issues=true] True to enable issues for this repository, false to disable them. Default is true. + * @apiExample {js} ex: +github.repos.edit({ ... }); + */ + +/** + * @api {patch} /repos/:owner/:repo/releases/assets/:id editAsset + * @apiVersion 8.2.1 + * @apiName editAsset + * @apiDescription Edit a release asset. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiParam {String} name + * @apiParam {String} [label] An alternate short description of the asset. Used in place of the filename. + * @apiExample {js} ex: +github.repos.editAsset({ ... }); + */ + +/** + * @api {patch} /repos/:owner/:repo/hooks/:id editHook + * @apiVersion 8.2.1 + * @apiName editHook + * @apiDescription Edit a hook. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiParam {String} name + * @apiParam {Json} config A Hash containing key/value pairs to provide settings for this hook. Modifying this will replace the entire config object. These settings vary between the services and are defined in the github-services repo. Booleans are stored internally as `1` for true, and `0` for false. Any JSON true/false values will be converted automatically. + * @apiParam {Array} [events=["push"]] Determines what events the hook is triggered for. This replaces the entire array of events. Default: `['push']`. + * @apiParam {Array} [add_events] Determines a list of events to be added to the list of events that the Hook triggers for. + * @apiParam {Array} [remove_events] Determines a list of events to be removed from the list of events that the Hook triggers for. + * @apiParam {Boolean} [active] Determines whether the hook is actually triggered on pushes. + * @apiExample {js} ex: +github.repos.editHook({ ... }); + */ + +/** + * @api {patch} /repos/:owner/:repo/releases/:id editRelease + * @apiVersion 8.2.1 + * @apiName editRelease + * @apiDescription Edit a release. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiParam {String} tag_name String of the tag + * @apiParam {String} [target_commitish] Specifies the commitish value that determines where the Git tag is created from. Can be any branch or commit SHA. Unused if the Git tag already exists. Default: the repository's default branch (usually master). + * @apiParam {String} [name] + * @apiParam {String} [body] + * @apiParam {Boolean} [draft=false] true to create a draft (unpublished) release, false to create a published one. Default: false + * @apiParam {Boolean} [prerelease=false] true to identify the release as a prerelease. false to identify the release as a full release. Default: false + * @apiExample {js} ex: +github.repos.editRelease({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/forks fork + * @apiVersion 8.2.1 + * @apiName fork + * @apiDescription Create a fork. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} [organization] Optional parameter to specify the organization name if forking into an organization. + * @apiExample {js} ex: +github.repos.fork({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo get + * @apiVersion 8.2.1 + * @apiName get + * @apiDescription Get a repo for a user. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiExample {js} ex: +github.repos.get({ ... }); + */ + +/** + * @api {get} /user/repos getAll + * @apiVersion 8.2.1 + * @apiName getAll + * @apiDescription List your repositories + * @apiGroup repos + * + * @apiParam {String=all,public,private} [visibility=all] Can be one of `all`, `public`, or `private`. Default: `all`. + * @apiParam {String} [affiliation=owner,collaborator,organization_member] Comma-separated list of values. Can include: `owner`, `collaborator`, `organization_member`. + * @apiParam {String=all,owner,public,private,member} [type=all] Possible values: `all`, `owner`, `public`, `private`, `member`. Default: `all`. + * @apiParam {String=created,updated,pushed,full_name} [sort=full_name] Possible values: `created`, `updated`, `pushed`, `full_name`. Default: `full_name`. + * @apiParam {String=asc,desc} [direction=desc] + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.getAll({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/comments getAllCommitComments + * @apiVersion 8.2.1 + * @apiName getAllCommitComments + * @apiDescription List commit comments for a repository. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.getAllCommitComments({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/:archive_format/:ref getArchiveLink + * @apiVersion 8.2.1 + * @apiName getArchiveLink + * @apiDescription Get archive link. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String=tarball,zipball} archive_format=tarball Either tarball or zipball, Deafult: tarball. + * @apiParam {String} [ref] A valid Git reference. Default: the repository’s default branch (usually master). + * @apiExample {js} ex: +github.repos.getArchiveLink({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/releases/assets/:id getAsset + * @apiVersion 8.2.1 + * @apiName getAsset + * @apiDescription Get a single release asset. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiExample {js} ex: +github.repos.getAsset({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/releases/:id/assets getAssets + * @apiVersion 8.2.1 + * @apiName getAssets + * @apiDescription List assets for a release. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiExample {js} ex: +github.repos.getAssets({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/branches/:branch getBranch + * @apiVersion 8.2.1 + * @apiName getBranch + * @apiDescription Get branch. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} branch + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.getBranch({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/branches/:branch/protection getBranchProtection + * @apiVersion 8.2.1 + * @apiName getBranchProtection + * @apiDescription Get branch protection. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} branch + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.getBranchProtection({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/branches getBranches + * @apiVersion 8.2.1 + * @apiName getBranches + * @apiDescription List branches. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Boolean} [protected] Set to true to only return protected branches + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.getBranches({ ... }); + */ + +/** + * @api {get} /repositories/:id getById + * @apiVersion 8.2.1 + * @apiName getById + * @apiDescription Get a single repo by id. + * @apiGroup repos + * + * @apiParam {String} id + * @apiExample {js} ex: +github.repos.getById({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/traffic/clones getClones + * @apiVersion 8.2.1 + * @apiName getClones + * @apiDescription Get the total number of clones and breakdown per day or week for the last 14 days. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.getClones({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/collaborators getCollaborators + * @apiVersion 8.2.1 + * @apiName getCollaborators + * @apiDescription List collaborators + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String=outside,all} [affiliation=all] Filter collaborators returned by their affiliation. + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.getCollaborators({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/commits/:ref/status getCombinedStatus + * @apiVersion 8.2.1 + * @apiName getCombinedStatus + * @apiDescription Get the combined status for a specific ref. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} ref Ref to fetch the status for. It can be a SHA, a branch name, or a tag name. + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.getCombinedStatus({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/commits/:sha getCommit + * @apiVersion 8.2.1 + * @apiName getCommit + * @apiDescription Get a single commit. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} sha + * @apiExample {js} ex: +github.repos.getCommit({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/comments/:id getCommitComment + * @apiVersion 8.2.1 + * @apiName getCommitComment + * @apiDescription Get a single commit comment. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiExample {js} ex: +github.repos.getCommitComment({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/commits/:ref/comments getCommitComments + * @apiVersion 8.2.1 + * @apiName getCommitComments + * @apiDescription List comments for a single commit. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} ref + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.getCommitComments({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/commits getCommits + * @apiVersion 8.2.1 + * @apiName getCommits + * @apiDescription List commits on a repository. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} [sha] Sha or branch to start listing commits from. + * @apiParam {String} [path] Only commits containing this file path will be returned. + * @apiParam {String} [author] GitHub login or email address by which to filter by commit author. + * @apiParam {Date} [since] Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ + * @apiParam {Date} [until] Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.getCommits({ ... }); + */ + +/** + * @api {get} /repositories/:repo_id/community/profile getCommunityHealthMetrics + * @apiVersion 8.2.1 + * @apiName getCommunityHealthMetrics + * @apiDescription Retrieve community health metrics. + * @apiGroup repos + * + * @apiParam {String} repo_id + * @apiExample {js} ex: +github.repos.getCommunityHealthMetrics({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/contents/:path getContent + * @apiVersion 8.2.1 + * @apiName getContent + * @apiDescription Get the contents of a file or directory in a repository. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} path The content path. + * @apiParam {String} [ref] The String name of the Commit/Branch/Tag. Defaults to master. + * @apiExample {js} ex: +github.repos.getContent({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/contributors getContributors + * @apiVersion 8.2.1 + * @apiName getContributors + * @apiDescription Get contributors for the specified repository. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Boolean} [anon] Set to 1 or true to include anonymous contributors in results. + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.getContributors({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/deployments/:id/statuses getDeploymentStatuses + * @apiVersion 8.2.1 + * @apiName getDeploymentStatuses + * @apiDescription List deployment statuses. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiExample {js} ex: +github.repos.getDeploymentStatuses({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/deployments getDeployments + * @apiVersion 8.2.1 + * @apiName getDeployments + * @apiDescription List deployments. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} [sha=none] The short or long sha that was recorded at creation time. Default: none. + * @apiParam {String} [ref=none] The name of the ref. This can be a branch, tag, or sha. Default: none. + * @apiParam {String} [task=none] The name of the task for the deployment. e.g. deploy or deploy:migrations. Default: none. + * @apiParam {String} [environment=none] The name of the environment that was deployed to. e.g. staging or production. Default: none. + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.getDeployments({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/downloads/:id getDownload + * @apiVersion 8.2.1 + * @apiName getDownload + * @apiDescription Get a single download. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiExample {js} ex: +github.repos.getDownload({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/downloads getDownloads + * @apiVersion 8.2.1 + * @apiName getDownloads + * @apiDescription List downloads for repository. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.getDownloads({ ... }); + */ + +/** + * @api {get} /orgs/:org/repos getForOrg + * @apiVersion 8.2.1 + * @apiName getForOrg + * @apiDescription List repositories for the specified org. + * @apiGroup repos + * + * @apiParam {String} org + * @apiParam {String=all,public,private,forks,sources,member} [type=all] Possible values: `all`, `public`, `private`, `forks`, `sources`, `member`. Default: `all`. + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.getForOrg({ ... }); + */ + +/** + * @api {get} /users/:username/repos getForUser + * @apiVersion 8.2.1 + * @apiName getForUser + * @apiDescription List public repositories for the specified user. + * @apiGroup repos + * + * @apiParam {String} username + * @apiParam {String=all,owner,member} [type=owner] Possible values: `all`, `owner`, `member`. Default: `owner`. + * @apiParam {String=created,updated,pushed,full_name} [sort=full_name] Possible values: `created`, `updated`, `pushed`, `full_name`. Default: `full_name`. + * @apiParam {String=asc,desc} [direction=desc] + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.getForUser({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/forks getForks + * @apiVersion 8.2.1 + * @apiName getForks + * @apiDescription List forks. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String=newest,oldest,stargazers} [sort=newest] Possible values: `newest`, `oldest`, `stargazers`, default: `newest`. + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.getForks({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/hooks/:id getHook + * @apiVersion 8.2.1 + * @apiName getHook + * @apiDescription Get single hook. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiExample {js} ex: +github.repos.getHook({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/hooks getHooks + * @apiVersion 8.2.1 + * @apiName getHooks + * @apiDescription List hooks. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.getHooks({ ... }); + */ + +/** + * @api {get} /repositories/:repo_id/invitations getInvites + * @apiVersion 8.2.1 + * @apiName getInvites + * @apiDescription List invitations for a repository. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} repo_id + * @apiExample {js} ex: +github.repos.getInvites({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/keys/:id getKey + * @apiVersion 8.2.1 + * @apiName getKey + * @apiDescription Get a deploy key. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiExample {js} ex: +github.repos.getKey({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/keys getKeys + * @apiVersion 8.2.1 + * @apiName getKeys + * @apiDescription List deploy keys. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.getKeys({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/languages getLanguages + * @apiVersion 8.2.1 + * @apiName getLanguages + * @apiDescription Get languages for the specified repository. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.getLanguages({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/pages/builds/latest getLatestPagesBuild + * @apiVersion 8.2.1 + * @apiName getLatestPagesBuild + * @apiDescription Get latest Pages build. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiExample {js} ex: +github.repos.getLatestPagesBuild({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/releases/latest getLatestRelease + * @apiVersion 8.2.1 + * @apiName getLatestRelease + * @apiDescription Get the latest release. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiExample {js} ex: +github.repos.getLatestRelease({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/pages getPages + * @apiVersion 8.2.1 + * @apiName getPages + * @apiDescription Get information about a Pages site. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.getPages({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/pages/builds/:id getPagesBuild + * @apiVersion 8.2.1 + * @apiName getPagesBuild + * @apiDescription Get a specific Pages build. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiExample {js} ex: +github.repos.getPagesBuild({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/pages/builds getPagesBuilds + * @apiVersion 8.2.1 + * @apiName getPagesBuilds + * @apiDescription List Pages builds. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.getPagesBuilds({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/traffic/popular/paths getPaths + * @apiVersion 8.2.1 + * @apiName getPaths + * @apiDescription Get the top 10 popular contents over the last 14 days. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.getPaths({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/branches/:branch/protection/required_pull_request_reviews getProtectedBranchPullRequestReviewEnforcement + * @apiVersion 8.2.1 + * @apiName getProtectedBranchPullRequestReviewEnforcement + * @apiDescription Get pull request review enforcement of protected branch. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} branch + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.getProtectedBranchPullRequestReviewEnforcement({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/branches/:branch/protection/required_status_checks getProtectedBranchRequiredStatusChecks + * @apiVersion 8.2.1 + * @apiName getProtectedBranchRequiredStatusChecks + * @apiDescription Get required status checks of protected branch. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} branch + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.getProtectedBranchRequiredStatusChecks({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/branches/:branch/protection/required_status_checks/contexts getProtectedBranchRequiredStatusChecksContexts + * @apiVersion 8.2.1 + * @apiName getProtectedBranchRequiredStatusChecksContexts + * @apiDescription List required status checks contexts of protected branch. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} branch + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.getProtectedBranchRequiredStatusChecksContexts({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/branches/:branch/protection/restrictions getProtectedBranchRestrictions + * @apiVersion 8.2.1 + * @apiName getProtectedBranchRestrictions + * @apiDescription Get restrictions of protected branch. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} branch + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.getProtectedBranchRestrictions({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/branches/:branch/protection/restrictions/teams getProtectedBranchTeamRestrictions + * @apiVersion 8.2.1 + * @apiName getProtectedBranchTeamRestrictions + * @apiDescription List team restrictions of protected branch. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} branch + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.getProtectedBranchTeamRestrictions({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/branches/:branch/protection/restrictions/users getProtectedBranchUserRestrictions + * @apiVersion 8.2.1 + * @apiName getProtectedBranchUserRestrictions + * @apiDescription List user restrictions of protected branch. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} branch + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.getProtectedBranchUserRestrictions({ ... }); + */ + +/** + * @api {get} /repositories getPublic + * @apiVersion 8.2.1 + * @apiName getPublic + * @apiDescription List all public repositories + * @apiGroup repos + * + * @apiParam {String} [since] The integer ID of the last Repository that you've seen. + * @apiExample {js} ex: +github.repos.getPublic({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/readme getReadme + * @apiVersion 8.2.1 + * @apiName getReadme + * @apiDescription Get the README for the given repository. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} [ref] The name of the commit/branch/tag. Default: the repository’s default branch (usually master) + * @apiExample {js} ex: +github.repos.getReadme({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/traffic/popular/referrers getReferrers + * @apiVersion 8.2.1 + * @apiName getReferrers + * @apiDescription Get the top 10 referrers over the last 14 days. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.getReferrers({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/releases/:id getRelease + * @apiVersion 8.2.1 + * @apiName getRelease + * @apiDescription Get a single release. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiExample {js} ex: +github.repos.getRelease({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/releases/tags/:tag getReleaseByTag + * @apiVersion 8.2.1 + * @apiName getReleaseByTag + * @apiDescription Get a release by tag name. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} tag String of the tag + * @apiExample {js} ex: +github.repos.getReleaseByTag({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/releases getReleases + * @apiVersion 8.2.1 + * @apiName getReleases + * @apiDescription List releases for a repository. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.getReleases({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/commits/:ref getShaOfCommitRef + * @apiVersion 8.2.1 + * @apiName getShaOfCommitRef + * @apiDescription Get the SHA-1 of a commit reference. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} ref String of the name of the fully qualified reference (ie: heads/master). If it doesn’t have at least one slash, it will be rejected. + * @apiExample {js} ex: +github.repos.getShaOfCommitRef({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/stats/code_frequency getStatsCodeFrequency + * @apiVersion 8.2.1 + * @apiName getStatsCodeFrequency + * @apiDescription Get the number of additions and deletions per week. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiExample {js} ex: +github.repos.getStatsCodeFrequency({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/stats/commit_activity getStatsCommitActivity + * @apiVersion 8.2.1 + * @apiName getStatsCommitActivity + * @apiDescription Get the last year of commit activity data. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiExample {js} ex: +github.repos.getStatsCommitActivity({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/stats/contributors getStatsContributors + * @apiVersion 8.2.1 + * @apiName getStatsContributors + * @apiDescription Get contributors list with additions, deletions, and commit counts. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiExample {js} ex: +github.repos.getStatsContributors({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/stats/participation getStatsParticipation + * @apiVersion 8.2.1 + * @apiName getStatsParticipation + * @apiDescription Get the weekly commit count for the repository owner and everyone else. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiExample {js} ex: +github.repos.getStatsParticipation({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/stats/punch_card getStatsPunchCard + * @apiVersion 8.2.1 + * @apiName getStatsPunchCard + * @apiDescription Get the number of commits per hour in each day. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiExample {js} ex: +github.repos.getStatsPunchCard({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/commits/:ref/statuses getStatuses + * @apiVersion 8.2.1 + * @apiName getStatuses + * @apiDescription List statuses for a specfic ref. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} ref Ref to list the statuses from. It can be a SHA, a branch name, or a tag name. + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.getStatuses({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/tags getTags + * @apiVersion 8.2.1 + * @apiName getTags + * @apiDescription Get tags for the specified repository. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.getTags({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/teams getTeams + * @apiVersion 8.2.1 + * @apiName getTeams + * @apiDescription Get teams for the specified repository. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.getTeams({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/traffic/views getViews + * @apiVersion 8.2.1 + * @apiName getViews + * @apiDescription Get the total number of views and breakdown per day or week for the last 14 days. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.getViews({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/merges merge + * @apiVersion 8.2.1 + * @apiName merge + * @apiDescription Perform a merge. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} base The branch (or git ref) you want your changes pulled into. This should be an existing branch on the current repository. You cannot submit a pull request to one repo that requests a merge to a base of another repo. + * @apiParam {String} head The branch (or git ref) where your changes are implemented. + * @apiParam {String} [commit_message] Commit message to use for the merge commit. If omitted, a default message will be used. + * @apiExample {js} ex: +github.repos.merge({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/hooks/:id/pings pingHook + * @apiVersion 8.2.1 + * @apiName pingHook + * @apiDescription Ping a hook. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiExample {js} ex: +github.repos.pingHook({ ... }); + */ + +/** + * @api {delete} /repos/:owner/:repo/branches/:branch/protection removeBranchProtection + * @apiVersion 8.2.1 + * @apiName removeBranchProtection + * @apiDescription Remove branch protection. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} branch + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.removeBranchProtection({ ... }); + */ + +/** + * @api {delete} /repos/:owner/:repo/collaborators/:username removeCollaborator + * @apiVersion 8.2.1 + * @apiName removeCollaborator + * @apiDescription Remove user as a collaborator. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} username + * @apiExample {js} ex: +github.repos.removeCollaborator({ ... }); + */ + +/** + * @api {delete} /repos/:owner/:repo/branches/:branch/protection/required_pull_request_reviews removeProtectedBranchPullRequestReviewEnforcement + * @apiVersion 8.2.1 + * @apiName removeProtectedBranchPullRequestReviewEnforcement + * @apiDescription Remove pull request review enforcement of protected branch. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} branch + * @apiExample {js} ex: +github.repos.removeProtectedBranchPullRequestReviewEnforcement({ ... }); + */ + +/** + * @api {delete} /repos/:owner/:repo/branches/:branch/protection/required_status_checks removeProtectedBranchRequiredStatusChecks + * @apiVersion 8.2.1 + * @apiName removeProtectedBranchRequiredStatusChecks + * @apiDescription Remove required status checks of protected branch. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} branch + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.removeProtectedBranchRequiredStatusChecks({ ... }); + */ + +/** + * @api {delete} /repos/:owner/:repo/branches/:branch/protection/required_status_checks/contexts removeProtectedBranchRequiredStatusChecksContexts + * @apiVersion 8.2.1 + * @apiName removeProtectedBranchRequiredStatusChecksContexts + * @apiDescription Remove required status checks contexts of protected branch. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} branch + * @apiParam {Array} contexts An array of protected branch required status checks contexts (e.g. continuous-integration/jenkins). + * @apiExample {js} ex: +github.repos.removeProtectedBranchRequiredStatusChecksContexts({ ... }); + */ + +/** + * @api {delete} /repos/:owner/:repo/branches/:branch/protection/restrictions removeProtectedBranchRestrictions + * @apiVersion 8.2.1 + * @apiName removeProtectedBranchRestrictions + * @apiDescription Remove restrictions of protected branch. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} branch + * @apiExample {js} ex: +github.repos.removeProtectedBranchRestrictions({ ... }); + */ + +/** + * @api {delete} /repos/:owner/:repo/branches/:branch/protection/restrictions/teams removeProtectedBranchTeamRestrictions + * @apiVersion 8.2.1 + * @apiName removeProtectedBranchTeamRestrictions + * @apiDescription Remove team restrictions of protected branch. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} branch + * @apiParam {Array} teams An array of team slugs (e.g. justice-league). + * @apiExample {js} ex: +github.repos.removeProtectedBranchTeamRestrictions({ ... }); + */ + +/** + * @api {delete} /repos/:owner/:repo/branches/:branch/protection/restrictions/users removeProtectedBranchUserRestrictions + * @apiVersion 8.2.1 + * @apiName removeProtectedBranchUserRestrictions + * @apiDescription Remove user restrictions of protected branch. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} branch + * @apiParam {Array} users An array of team slugs (e.g. justice-league). + * @apiExample {js} ex: +github.repos.removeProtectedBranchUserRestrictions({ ... }); + */ + +/** + * @api {put} /repos/:owner/:repo/branches/:branch/protection/required_status_checks/contexts replaceProtectedBranchRequiredStatusChecksContexts + * @apiVersion 8.2.1 + * @apiName replaceProtectedBranchRequiredStatusChecksContexts + * @apiDescription Replace required status checks contexts of protected branch. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} branch + * @apiParam {Array} contexts An array of protected branch required status checks contexts (e.g. continuous-integration/jenkins). + * @apiExample {js} ex: +github.repos.replaceProtectedBranchRequiredStatusChecksContexts({ ... }); + */ + +/** + * @api {put} /repos/:owner/:repo/branches/:branch/protection/restrictions/teams replaceProtectedBranchTeamRestrictions + * @apiVersion 8.2.1 + * @apiName replaceProtectedBranchTeamRestrictions + * @apiDescription Replace team restrictions of protected branch. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} branch + * @apiParam {Array} teams An array of team slugs (e.g. justice-league). + * @apiExample {js} ex: +github.repos.replaceProtectedBranchTeamRestrictions({ ... }); + */ + +/** + * @api {put} /repos/:owner/:repo/branches/:branch/protection/restrictions/users replaceProtectedBranchUserRestrictions + * @apiVersion 8.2.1 + * @apiName replaceProtectedBranchUserRestrictions + * @apiDescription Replace user restrictions of protected branch. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} branch + * @apiParam {Array} users An array of team slugs (e.g. justice-league). + * @apiExample {js} ex: +github.repos.replaceProtectedBranchUserRestrictions({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/pages/builds requestPageBuild + * @apiVersion 8.2.1 + * @apiName requestPageBuild + * @apiDescription Request a page build. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiExample {js} ex: +github.repos.requestPageBuild({ ... }); + */ + +/** + * @api {get} /repos/:owner/:repo/collaborators/:username/permission reviewUserPermissionLevel + * @apiVersion 8.2.1 + * @apiName reviewUserPermissionLevel + * @apiDescription Review a user's permission level. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} username + * @apiExample {js} ex: +github.repos.reviewUserPermissionLevel({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/hooks/:id/tests testHook + * @apiVersion 8.2.1 + * @apiName testHook + * @apiDescription Test a [push] hook. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiExample {js} ex: +github.repos.testHook({ ... }); + */ + +/** + * @api {put} /repos/:owner/:repo/branches/:branch/protection updateBranchProtection + * @apiVersion 8.2.1 + * @apiName updateBranchProtection + * @apiDescription Update branch protection. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} branch + * @apiParam {Json} required_status_checks JSON object that contains the following keys: `include_admins` - Enforce required status checks for repository administrators, `strict` - Require branches to be up to date before merging, `contexts` - The list of status checks to require in order to merge into this branch. This object can have the value of `null` for disabled. + * @apiParam {Json} required_pull_request_reviews JSON object that contains the following keys: `include_admins` - Enforce required status checks for repository administrators. + * @apiParam {Json} restrictions JSON object that contains the following keys: `users` - The list of user logins with push access, `teams` - The list of team slugs with push access. This object can have the value of `null` for disabled. + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.updateBranchProtection({ ... }); + */ + +/** + * @api {patch} /repos/:owner/:repo/comments/:id updateCommitComment + * @apiVersion 8.2.1 + * @apiName updateCommitComment + * @apiDescription Update a commit comment. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiParam {String} body + * @apiExample {js} ex: +github.repos.updateCommitComment({ ... }); + */ + +/** + * @api {put} /repos/:owner/:repo/contents/:path updateFile + * @apiVersion 8.2.1 + * @apiName updateFile + * @apiDescription Update a file. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} path The content path. + * @apiParam {String} message The commit message. + * @apiParam {String} content The updated file content, Base64 encoded. + * @apiParam {String} sha The blob SHA of the file being replaced. + * @apiParam {String} [branch] The branch name. If not provided, uses the repository’s default branch (usually master). + * @apiParam {Json} [committer] + * @apiExample {js} ex: +github.repos.updateFile({ ... }); + */ + +/** + * @api {patch} /repositories/:repo_id/invitations/:invitation_id updateInvite + * @apiVersion 8.2.1 + * @apiName updateInvite + * @apiDescription Update a repository invitation. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} repo_id + * @apiParam {String} invitation_id + * @apiParam {String=read,write,admin} [permission] The permissions that the associated user will have on the repository. + * @apiExample {js} ex: +github.repos.updateInvite({ ... }); + */ + +/** + * @api {patch} /repos/:owner/:repo/branches/:branch/protection/required_pull_request_reviews updateProtectedBranchPullRequestReviewEnforcement + * @apiVersion 8.2.1 + * @apiName updateProtectedBranchPullRequestReviewEnforcement + * @apiDescription Update pull request review enforcement of protected branch. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} branch + * @apiParam {Boolean} [include_admins] Enforce required status checks for repository administrators. + * @apiExample {js} ex: +github.repos.updateProtectedBranchPullRequestReviewEnforcement({ ... }); + */ + +/** + * @api {patch} /repos/:owner/:repo/branches/:branch/protection/required_status_checks updateProtectedBranchRequiredStatusChecks + * @apiVersion 8.2.1 + * @apiName updateProtectedBranchRequiredStatusChecks + * @apiDescription Update required status checks of protected branch. (In preview period. See README.) + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} branch + * @apiParam {Boolean} [include_admins] Enforce required status checks for repository administrators. + * @apiParam {Boolean} [strict] Require branches to be up to date before merging. + * @apiParam {Array} [contexts] The list of status checks to require in order to merge into this branch. + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.repos.updateProtectedBranchRequiredStatusChecks({ ... }); + */ + +/** + * @api {post} /repos/:owner/:repo/releases/:id/assets uploadAsset + * @apiVersion 8.2.1 + * @apiName uploadAsset + * @apiDescription Upload a release asset. + * @apiGroup repos + * + * @apiParam {String} owner + * @apiParam {String} repo + * @apiParam {String} id + * @apiParam {String} filePath The file path of the asset. + * @apiParam {String} name The file name of the asset. This should be set in a URI query parameter. + * @apiParam {String} [label] An alternate short description of the asset. Used in place of the filename. This should be set in a URI query parameter. + * @apiExample {js} ex: +github.repos.uploadAsset({ ... }); + */ + +/** + * @api {get} /search/code code + * @apiVersion 8.2.1 + * @apiName code + * @apiDescription Search code. + * @apiGroup search + * + * @apiParam {String} q Search Term + * @apiParam {String=indexed} [sort] The sort field. Can only be indexed, which indicates how recently a file has been indexed by the GitHub search infrastructure. Default: results are sorted by best match. + * @apiParam {String=asc,desc} [order=desc] asc or desc + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.search.code({ ... }); + */ + +/** + * @api {get} /search/commits commits + * @apiVersion 8.2.1 + * @apiName commits + * @apiDescription Search commits. (In preview period. See README.) + * @apiGroup search + * + * @apiParam {String} q Search Term + * @apiParam {String=author-date,committer-date} [sort] The sort field. Can be author-date or committer-date. Default: best match. + * @apiParam {String=asc,desc} [order=desc] asc or desc + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.search.commits({ ... }); + */ + +/** + * @api {get} /legacy/user/email/:email email + * @apiVersion 8.2.1 + * @apiName email + * @apiDescription Search against public email addresses. + * @apiGroup search + * + * @apiParam {String} email The email address + * @apiExample {js} ex: +github.search.email({ ... }); + */ + +/** + * @api {get} /search/issues issues + * @apiVersion 8.2.1 + * @apiName issues + * @apiDescription Search issues. + * @apiGroup search + * + * @apiParam {String} q Search Term + * @apiParam {String=comments,created,updated} [sort] The sort field. Can be comments, created, or updated. Default: results are sorted by best match. + * @apiParam {String=asc,desc} [order=desc] asc or desc + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.search.issues({ ... }); + */ + +/** + * @api {get} /search/repositories repos + * @apiVersion 8.2.1 + * @apiName repos + * @apiDescription Search repositories. + * @apiGroup search + * + * @apiParam {String} q Search Term + * @apiParam {String=stars,forks,updated} [sort] stars, forks, or updated + * @apiParam {String=asc,desc} [order=desc] asc or desc + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.search.repos({ ... }); + */ + +/** + * @api {get} /search/users users + * @apiVersion 8.2.1 + * @apiName users + * @apiDescription Search users. + * @apiGroup search + * + * @apiParam {String} q Search Term + * @apiParam {String=followers,repositories,joined} [sort] The sort field. Can be followers, repositories, or joined. Default: results are sorted by best match. + * @apiParam {String=asc,desc} [order=desc] asc or desc + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.search.users({ ... }); + */ + +/** + * @api {patch} /user/repository_invitations/:invitation_id acceptRepoInvite + * @apiVersion 8.2.1 + * @apiName acceptRepoInvite + * @apiDescription Accept a repository invitation. (In preview period. See README.) + * @apiGroup users + * + * @apiParam {String} invitation_id + * @apiExample {js} ex: +github.users.acceptRepoInvite({ ... }); + */ + +/** + * @api {post} /user/emails addEmails + * @apiVersion 8.2.1 + * @apiName addEmails + * @apiDescription Add email address(es) + * @apiGroup users + * + * @apiParam {Array} emails You can post a single email address or an array of addresses. + * @apiExample {js} ex: +github.users.addEmails({ ... }); + */ + +/** + * @api {get} /user/following/:username checkFollowing + * @apiVersion 8.2.1 + * @apiName checkFollowing + * @apiDescription Check if you are following a user + * @apiGroup users + * + * @apiParam {String} username + * @apiExample {js} ex: +github.users.checkFollowing({ ... }); + */ + +/** + * @api {get} /users/:username/following/:target_user checkIfOneFollowersOther + * @apiVersion 8.2.1 + * @apiName checkIfOneFollowersOther + * @apiDescription Check if one user follows another + * @apiGroup users + * + * @apiParam {String} username + * @apiParam {String} target_user + * @apiExample {js} ex: +github.users.checkIfOneFollowersOther({ ... }); + */ + +/** + * @api {post} /user/gpg_keys createGpgKey + * @apiVersion 8.2.1 + * @apiName createGpgKey + * @apiDescription Create a GPG key. (In preview period. See README.) + * @apiGroup users + * + * @apiParam {String} armored_public_key GPG key contents + * @apiExample {js} ex: +github.users.createGpgKey({ ... }); + */ + +/** + * @api {post} /user/keys createKey + * @apiVersion 8.2.1 + * @apiName createKey + * @apiDescription Create a public key + * @apiGroup users + * + * @apiParam {String} title + * @apiParam {String} key + * @apiExample {js} ex: +github.users.createKey({ ... }); + */ + +/** + * @api {delete} /user/repository_invitations/:invitation_id declineRepoInvite + * @apiVersion 8.2.1 + * @apiName declineRepoInvite + * @apiDescription Decline a repository invitation. (In preview period. See README.) + * @apiGroup users + * + * @apiParam {String} invitation_id + * @apiExample {js} ex: +github.users.declineRepoInvite({ ... }); + */ + +/** + * @api {delete} /user/emails deleteEmails + * @apiVersion 8.2.1 + * @apiName deleteEmails + * @apiDescription Delete email address(es) + * @apiGroup users + * + * @apiParam {Array} emails You can post a single email address or an array of addresses. + * @apiExample {js} ex: +github.users.deleteEmails({ ... }); + */ + +/** + * @api {delete} /user/gpg_keys/:id deleteGpgKey + * @apiVersion 8.2.1 + * @apiName deleteGpgKey + * @apiDescription Delete a GPG key. (In preview period. See README.) + * @apiGroup users + * + * @apiParam {String} id + * @apiExample {js} ex: +github.users.deleteGpgKey({ ... }); + */ + +/** + * @api {delete} /user/keys/:id deleteKey + * @apiVersion 8.2.1 + * @apiName deleteKey + * @apiDescription Delete a public key + * @apiGroup users + * + * @apiParam {String} id + * @apiExample {js} ex: +github.users.deleteKey({ ... }); + */ + +/** + * @api {delete} /users/:username/site_admin demote + * @apiVersion 8.2.1 + * @apiName demote + * @apiDescription Demote a site administrator to an ordinary user + * @apiGroup users + * + * @apiParam {String} username + * @apiExample {js} ex: +github.users.demote({ ... }); + */ + +/** + * @api {patch} /user/memberships/orgs/:org editOrgMembership + * @apiVersion 8.2.1 + * @apiName editOrgMembership + * @apiDescription Edit your organization membership + * @apiGroup users + * + * @apiParam {String} org + * @apiParam {String=active} state The state that the membership should be in. Only "active" will be accepted. + * @apiExample {js} ex: +github.users.editOrgMembership({ ... }); + */ + +/** + * @api {put} /user/following/:username followUser + * @apiVersion 8.2.1 + * @apiName followUser + * @apiDescription Follow a user + * @apiGroup users + * + * @apiParam {String} username + * @apiExample {js} ex: +github.users.followUser({ ... }); + */ + +/** + * @api {get} /user get + * @apiVersion 8.2.1 + * @apiName get + * @apiDescription Get the authenticated user + * @apiGroup users + * + * @apiExample {js} ex: +github.users.get({ ... }); + */ + +/** + * @api {get} /users getAll + * @apiVersion 8.2.1 + * @apiName getAll + * @apiDescription Get all users + * @apiGroup users + * + * @apiParam {Number} [since] The integer ID of the last User that you’ve seen. + * @apiExample {js} ex: +github.users.getAll({ ... }); + */ + +/** + * @api {get} /user/:id getById + * @apiVersion 8.2.1 + * @apiName getById + * @apiDescription Get a single user by GitHub ID + * @apiGroup users + * + * @apiParam {String} id + * @apiExample {js} ex: +github.users.getById({ ... }); + */ + +/** + * @api {get} /user/emails getEmails + * @apiVersion 8.2.1 + * @apiName getEmails + * @apiDescription List email addresses for a user + * @apiGroup users + * + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.users.getEmails({ ... }); + */ + +/** + * @api {get} /user/followers getFollowers + * @apiVersion 8.2.1 + * @apiName getFollowers + * @apiDescription List the authenticated user's followers + * @apiGroup users + * + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.users.getFollowers({ ... }); + */ + +/** + * @api {get} /users/:username/followers getFollowersForUser + * @apiVersion 8.2.1 + * @apiName getFollowersForUser + * @apiDescription List a user's followers + * @apiGroup users + * + * @apiParam {String} username + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.users.getFollowersForUser({ ... }); + */ + +/** + * @api {get} /user/following getFollowing + * @apiVersion 8.2.1 + * @apiName getFollowing + * @apiDescription List who the authenticated user is following + * @apiGroup users + * + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.users.getFollowing({ ... }); + */ + +/** + * @api {get} /users/:username/following getFollowingForUser + * @apiVersion 8.2.1 + * @apiName getFollowingForUser + * @apiDescription List who a user is following + * @apiGroup users + * + * @apiParam {String} username + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.users.getFollowingForUser({ ... }); + */ + +/** + * @api {get} /users/:username getForUser + * @apiVersion 8.2.1 + * @apiName getForUser + * @apiDescription Get a single user + * @apiGroup users + * + * @apiParam {String} username + * @apiExample {js} ex: +github.users.getForUser({ ... }); + */ + +/** + * @api {get} /user/gpg_keys/:id getGpgKey + * @apiVersion 8.2.1 + * @apiName getGpgKey + * @apiDescription Get a single GPG key. (In preview period. See README.) + * @apiGroup users + * + * @apiParam {String} id + * @apiExample {js} ex: +github.users.getGpgKey({ ... }); + */ + +/** + * @api {get} /user/gpg_keys getGpgKeys + * @apiVersion 8.2.1 + * @apiName getGpgKeys + * @apiDescription List your GPG keys. (In preview period. See README.) + * @apiGroup users + * + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.users.getGpgKeys({ ... }); + */ + +/** + * @api {get} /user/keys/:id getKey + * @apiVersion 8.2.1 + * @apiName getKey + * @apiDescription Get a single public key + * @apiGroup users + * + * @apiParam {String} id + * @apiExample {js} ex: +github.users.getKey({ ... }); + */ + +/** + * @api {get} /user/keys getKeys + * @apiVersion 8.2.1 + * @apiName getKeys + * @apiDescription List your public keys + * @apiGroup users + * + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.users.getKeys({ ... }); + */ + +/** + * @api {get} /users/:username/keys getKeysForUser + * @apiVersion 8.2.1 + * @apiName getKeysForUser + * @apiDescription List public keys for a user + * @apiGroup users + * + * @apiParam {String} username + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.users.getKeysForUser({ ... }); + */ + +/** + * @api {get} /user/memberships/orgs/:org getOrgMembership + * @apiVersion 8.2.1 + * @apiName getOrgMembership + * @apiDescription Get your organization membership + * @apiGroup users + * + * @apiParam {String} org + * @apiExample {js} ex: +github.users.getOrgMembership({ ... }); + */ + +/** + * @api {get} /user/memberships/orgs getOrgMemberships + * @apiVersion 8.2.1 + * @apiName getOrgMemberships + * @apiDescription List your organization memberships + * @apiGroup users + * + * @apiParam {String=active,pending} [state] Indicates the state of the memberships to return. Can be either active or pending. If not specified, both active and pending memberships are returned. + * @apiExample {js} ex: +github.users.getOrgMemberships({ ... }); + */ + +/** + * @api {get} /user/orgs getOrgs + * @apiVersion 8.2.1 + * @apiName getOrgs + * @apiDescription List organizations for the authenticated user. + * @apiGroup users + * + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.users.getOrgs({ ... }); + */ + +/** + * @api {get} /user/repository_invitations getRepoInvites + * @apiVersion 8.2.1 + * @apiName getRepoInvites + * @apiDescription List a user's repository invitations. (In preview period. See README.) + * @apiGroup users + * + * @apiExample {js} ex: +github.users.getRepoInvites({ ... }); + */ + +/** + * @api {get} /user/teams getTeams + * @apiVersion 8.2.1 + * @apiName getTeams + * @apiDescription Get your teams + * @apiGroup users + * + * @apiParam {Number} [page] Page number of the results to fetch. + * @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30. + * @apiExample {js} ex: +github.users.getTeams({ ... }); + */ + +/** + * @api {put} /users/:username/site_admin promote + * @apiVersion 8.2.1 + * @apiName promote + * @apiDescription Promote an ordinary user to a site administrator + * @apiGroup users + * + * @apiParam {String} username + * @apiExample {js} ex: +github.users.promote({ ... }); + */ + +/** + * @api {put} /users/:username/suspended suspend + * @apiVersion 8.2.1 + * @apiName suspend + * @apiDescription Suspend a user + * @apiGroup users + * + * @apiParam {String} username + * @apiExample {js} ex: +github.users.suspend({ ... }); + */ + +/** + * @api {delete} /user/following/:username unfollowUser + * @apiVersion 8.2.1 + * @apiName unfollowUser + * @apiDescription Unfollow a user + * @apiGroup users + * + * @apiParam {String} username + * @apiExample {js} ex: +github.users.unfollowUser({ ... }); + */ + +/** + * @api {delete} /users/:username/suspended unsuspend + * @apiVersion 8.2.1 + * @apiName unsuspend + * @apiDescription Unsuspend a user + * @apiGroup users + * + * @apiParam {String} username + * @apiExample {js} ex: +github.users.unsuspend({ ... }); + */ + +/** + * @api {patch} /user update + * @apiVersion 8.2.1 + * @apiName update + * @apiDescription Update the authenticated user + * @apiGroup users + * + * @apiParam {String} [name] The new name of the user + * @apiParam {String} [email] Publicly visible email address. + * @apiParam {String} [blog] The new blog URL of the user. + * @apiParam {String} [company] The new company of the user. + * @apiParam {String} [location] The new location of the user. + * @apiParam {Boolean} [hireable] The new hiring availability of the user. + * @apiParam {String} [bio] The new short biography of the user. + * @apiExample {js} ex: +github.users.update({ ... }); + */ + diff --git a/examples/addCollaborator.js b/examples/addCollaborator.js new file mode 100644 index 0000000000..defecf5604 --- /dev/null +++ b/examples/addCollaborator.js @@ -0,0 +1,21 @@ +"use strict"; + +var Client = require("./../lib/index"); +var testAuth = require("./../testAuth.json"); + +var github = new Client({ + debug: true +}); + +github.authenticate({ + type: "oauth", + token: testAuth["token"] +}); + +github.repos.addCollaborator({ + owner: "brassafrax", // needs to be an org + repo: "test", + username: "first9890" +}, function(err, res) { + console.log(err, res); +}); diff --git a/examples/addLabelsToIssue.js b/examples/addLabelsToIssue.js new file mode 100644 index 0000000000..b849d4411d --- /dev/null +++ b/examples/addLabelsToIssue.js @@ -0,0 +1,22 @@ +"use strict"; + +var Client = require("./../lib/index"); +var testAuth = require("./../testAuth.json"); + +var github = new Client({ + debug: true +}); + +github.authenticate({ + type: "oauth", + token: testAuth["token"] +}); + +github.issues.addLabels({ + owner: "kaizensoze", + repo: "test2", + number: "4", + body: ["bug", "help wanted", "question"] +}, function(err, res) { + console.log(err, res); +}); diff --git a/examples/createFile.js b/examples/createFile.js new file mode 100644 index 0000000000..05eb634102 --- /dev/null +++ b/examples/createFile.js @@ -0,0 +1,23 @@ +"use strict"; + +var Client = require("./../lib/index"); +var testAuth = require("./../testAuth.json"); + +var github = new Client({ + debug: true +}); + +github.authenticate({ + type: "oauth", + token: testAuth["token"] +}); + +github.repos.createFile({ + owner: "kaizensoze", + repo: "misc-scripts", + path: "blah.txt", + message: "blah blah", + content: "YmxlZXAgYmxvb3A=" +}, function(err, res) { + console.log(err, res); +}); diff --git a/examples/createStatus.js b/examples/createStatus.js new file mode 100644 index 0000000000..c0a7415683 --- /dev/null +++ b/examples/createStatus.js @@ -0,0 +1,22 @@ +"use strict"; + +var Client = require("./../lib/index"); +var testAuth = require("./../testAuth.json"); + +var github = new Client({ + debug: true +}); + +github.authenticate({ + type: "oauth", + token: testAuth["token"] +}); + +github.repos.createStatus({ + owner: "kaizensoze", + repo: "test2", + sha: "81c559e2e8551982235bc86594cd86ffb135b053", + state: "success", +}, function(err, res) { + console.log(err, res); +}); diff --git a/examples/enterpriseUploadAsset.js b/examples/enterpriseUploadAsset.js new file mode 100644 index 0000000000..3bcb960950 --- /dev/null +++ b/examples/enterpriseUploadAsset.js @@ -0,0 +1,25 @@ +"use strict"; + +var Client = require("./../lib/index"); +var testAuth = require("./../testAuth.json"); + +var github = new Client({ + debug: true, + host: "github.my-GHE-enabled-company.com", + pathPrefix: "/api/v3" +}); + +github.authenticate({ + type: "oauth", + token: testAuth["token"] +}); + +github.repos.uploadAsset({ + owner: "kaizensoze", + repo: "test2", + id: "4801082", + filePath: "/Users/joegallo/z.sh", + name: "z.sh" +}, function(err, res) { + console.log(err, res); +}); diff --git a/examples/getContent.js b/examples/getContent.js new file mode 100644 index 0000000000..6eb64f49c6 --- /dev/null +++ b/examples/getContent.js @@ -0,0 +1,15 @@ +"use strict"; + +var Client = require("./../lib/index"); + +var github = new Client({ + debug: true +}); + +github.repos.getContent({ + owner: "mikedeboer", + repo: "node-github", + path: "" +}, function(err, res) { + console.log(err, res); +}); diff --git a/examples/getFollowers.js b/examples/getFollowers.js new file mode 100644 index 0000000000..36977dfcad --- /dev/null +++ b/examples/getFollowers.js @@ -0,0 +1,18 @@ +"use strict"; + +var Client = require("./../lib/index"); +var testAuth = require("./../testAuth.json"); + +var github = new Client({ + debug: true +}); + +github.authenticate({ + type: "oauth", + token: testAuth["token"] +}); + +github.users.getFollowers({ +}, function(err, res) { + console.log(err, res); +}); \ No newline at end of file diff --git a/examples/getFollowing.js b/examples/getFollowing.js new file mode 100644 index 0000000000..c43219a2e2 --- /dev/null +++ b/examples/getFollowing.js @@ -0,0 +1,18 @@ +"use strict"; + +var Client = require("./../lib/index"); +var testAuth = require("./../testAuth.json"); + +var github = new Client({ + debug: true +}); + +github.authenticate({ + type: "oauth", + token: testAuth["token"] +}); + +github.users.getFollowing({ +}, function(err, res) { + console.log(err, res); +}); diff --git a/examples/getIssuesForRepo.js b/examples/getIssuesForRepo.js new file mode 100644 index 0000000000..a23d28abee --- /dev/null +++ b/examples/getIssuesForRepo.js @@ -0,0 +1,24 @@ +"use strict"; + +var Client = require("./../lib/index"); +var testAuth = require("./../testAuth.json"); + +var github = new Client({ + debug: false +}); + +github.authenticate({ + type: "oauth", + token: testAuth["token"] +}); + +github.issues.getForRepo({ + owner: "mikedeboer", + repo: "node-github" +}, function(err, res) { + if (err) { + console.log(err.toJSON()); + } else { + console.log(res); + } +}); diff --git a/examples/getNextPage.js b/examples/getNextPage.js new file mode 100644 index 0000000000..9bcdbf1d40 --- /dev/null +++ b/examples/getNextPage.js @@ -0,0 +1,24 @@ +"use strict"; + +var Client = require("./../lib/index"); +var testAuth = require("./../testAuth.json"); + +var github = new Client({}); + +github.authenticate({ + type: "oauth", + token: testAuth["token"] +}); + +github.repos.getAll({ + "affiliation": "owner,organization_member" +}, function(err, res) { + if (github.hasNextPage(res)) { + console.log(res.length) + github.getNextPage(res, nextFunc) + } +}); + +function nextFunc(err, res) { + console.log(res.length); +} diff --git a/examples/getOrg.js b/examples/getOrg.js new file mode 100644 index 0000000000..641f907327 --- /dev/null +++ b/examples/getOrg.js @@ -0,0 +1,19 @@ +"use strict"; + +var Client = require("./../lib/index"); +var testAuth = require("./../testAuth.json"); + +var github = new Client({ + debug: true +}); + +github.authenticate({ + type: "oauth", + token: testAuth["token"] +}); + +github.orgs.get({ + org: "facebook" +}, function(err, res) { + console.log(err, res); +}); diff --git a/examples/getOrgPublicMembers.js b/examples/getOrgPublicMembers.js new file mode 100644 index 0000000000..bdf09458a4 --- /dev/null +++ b/examples/getOrgPublicMembers.js @@ -0,0 +1,19 @@ +"use strict"; + +var Client = require("./../lib/index"); +var testAuth = require("./../testAuth.json"); + +var github = new Client({ + debug: true +}); + +github.authenticate({ + type: "oauth", + token: testAuth["token"] +}); + +github.orgs.getPublicMembers({ + org: "square" +}, function(err, res) { + console.log(err, res); +}); diff --git a/examples/getOutsideCollaborators.js b/examples/getOutsideCollaborators.js new file mode 100644 index 0000000000..7c7f16a63d --- /dev/null +++ b/examples/getOutsideCollaborators.js @@ -0,0 +1,19 @@ +"use strict"; + +var Client = require("./../lib/index"); +var testAuth = require("./../testAuth.json"); + +var github = new Client({ + debug: true +}); + +github.authenticate({ + type: "oauth", + token: testAuth["token"] +}); + +github.orgs.getOutsideCollaborators({ + org: "facebook" +}, function(err, res) { + console.log(err, res); +}); diff --git a/examples/getPullRequestReview.js b/examples/getPullRequestReview.js new file mode 100644 index 0000000000..d645fca430 --- /dev/null +++ b/examples/getPullRequestReview.js @@ -0,0 +1,32 @@ +"use strict"; + +var Client = require("./../lib/index"); +var testAuth = require("./../testAuth.json"); + +var github = new Client({ + debug: true +}); + +github.authenticate({ + type: "oauth", + token: testAuth["token"] +}); + +github.pullRequests.getReviews({ + owner: "brassafrax", + repo: "test", + number: 1 +}, function(err, res) { + // console.log(err, res); + + var reviewId = res[0]['id']; + // console.log(reviewId); + github.pullRequests.getReview({ + owner: "brassafrax", + repo: "test", + number: 1, + id: reviewId + }, function(err, res) { + console.log(err, res); + }); +}); diff --git a/examples/getPullRequestReviews.js b/examples/getPullRequestReviews.js new file mode 100644 index 0000000000..b81e7a8263 --- /dev/null +++ b/examples/getPullRequestReviews.js @@ -0,0 +1,21 @@ +"use strict"; + +var Client = require("./../lib/index"); +var testAuth = require("./../testAuth.json"); + +var github = new Client({ + debug: true +}); + +github.authenticate({ + type: "oauth", + token: testAuth["token"] +}); + +github.pullRequests.getReviews({ + owner: "brassafrax", + repo: "test", + number: 1 +}, function(err, res) { + console.log(err, res); +}); diff --git a/examples/getRawBlob.js b/examples/getRawBlob.js new file mode 100644 index 0000000000..5ddbc27090 --- /dev/null +++ b/examples/getRawBlob.js @@ -0,0 +1,33 @@ +"use strict"; + +var Client = require("./../lib/index"); +var testAuth = require("./../testAuth.json"); + +var github = new Client({ + debug: false, + headers: { + "Accept": "application/vnd.github.v3.raw" + } +}); + +github.authenticate({ + type: "oauth", + token: testAuth["token"] +}); + +// github.repos.getContent({ +// owner: "mikedeboer", +// repo: "node-github", +// path: "README.md" +// }, function(err, res) { +// var sha = res["sha"]; +// console.log(sha); +// }); + +github.gitdata.getBlob({ + owner: "mikedeboer", + repo: "node-github", + sha: "b361f529df9b49f2a6b5748b5d71b792c8383e5e" +}, function(err, res) { + console.log(err, res['data']); +}); diff --git a/examples/getReactionsForIssue.js b/examples/getReactionsForIssue.js new file mode 100644 index 0000000000..7ee0c1ee1c --- /dev/null +++ b/examples/getReactionsForIssue.js @@ -0,0 +1,21 @@ +"use strict"; + +var Client = require("./../lib/index"); +var testAuth = require("./../testAuth.json"); + +var github = new Client({ + debug: true +}); + +github.authenticate({ + type: "oauth", + token: testAuth["token"] +}); + +github.reactions.getForIssue({ + owner: "mikedeboer", + repo: "node-github", + number: "365" +}, function(err, res) { + console.log(err, res); +}); diff --git a/examples/getReference.js b/examples/getReference.js new file mode 100644 index 0000000000..903a2048dc --- /dev/null +++ b/examples/getReference.js @@ -0,0 +1,21 @@ +"use strict"; + +var Client = require("./../lib/index"); +var testAuth = require("./../testAuth.json"); + +var github = new Client({ + debug: true +}); + +github.authenticate({ + type: "oauth", + token: testAuth["token"] +}); + +github.gitdata.getReference({ + owner: "kaizensoze", + repo: "test2", + ref: "heads/a#blah" +}, function(err, res) { + console.log(err, res); +}); diff --git a/examples/getReferences.js b/examples/getReferences.js new file mode 100644 index 0000000000..dbe73fc309 --- /dev/null +++ b/examples/getReferences.js @@ -0,0 +1,20 @@ +"use strict"; + +var Client = require("./../lib/index"); +var testAuth = require("./../testAuth.json"); + +var github = new Client({ + debug: true +}); + +github.authenticate({ + type: "oauth", + token: testAuth["token"] +}); + +github.gitdata.getReferences({ + owner: "mikedeboer", + repo: "node-github" +}, function(err, res) { + console.log(err, res); +}); diff --git a/examples/getReleaseAsset.js b/examples/getReleaseAsset.js new file mode 100644 index 0000000000..625127b452 --- /dev/null +++ b/examples/getReleaseAsset.js @@ -0,0 +1,56 @@ +"use strict"; + +var Client = require("./../lib/index"); +var testAuth = require("./../testAuth.json"); + +var github = new Client({ + debug: true +}); + +github.authenticate({ + type: "oauth", + token: testAuth["token"] +}); + +var testRepo = { + owner: "aktau", + repo: "github-release" +}; + +github.repos.getReleases({ + owner: testRepo.owner, + repo: testRepo.repo +}, function(err, res) { + var releases = res; + if (releases.length == 0) { + return; + } + var release = releases[0]; + var releaseId = release.id; + console.log(release); + + github.repos.getAssets({ + owner: testRepo.owner, + repo: testRepo.repo, + id: releaseId + }, function(err, res) { + var assets = res; + if (assets.length == 0) { + return; + } + var asset = assets[0]; + var assetId = asset.id; + console.log(asset); + + github.repos.getAsset({ + owner: testRepo.owner, + repo: testRepo.repo, + id: assetId, + // headers: { + // "Accept": "application/octet-stream" + // } + }, function(err, res) { + console.log(res); + }); + }); +}); diff --git a/examples/getRepos.js b/examples/getRepos.js new file mode 100644 index 0000000000..6195dceb00 --- /dev/null +++ b/examples/getRepos.js @@ -0,0 +1,19 @@ +"use strict"; + +var Client = require("./../lib/index"); +var testAuth = require("./../testAuth.json"); + +var github = new Client({ + debug: true +}); + +github.authenticate({ + type: "oauth", + token: testAuth["token"] +}); + +github.repos.getAll({ + "affiliation": "owner,organization_member" +}, function(err, res) { + console.log(err, res); +}); diff --git a/examples/getStarred.js b/examples/getStarred.js new file mode 100644 index 0000000000..9d05f27eff --- /dev/null +++ b/examples/getStarred.js @@ -0,0 +1,32 @@ +"use strict"; + +var Client = require("./../lib/index"); +var testAuth = require("./../testAuth.json"); + +var github = new Client({}); + +github.authenticate({ + type: "oauth", + token: testAuth["token"] +}); + +var starredRepos = []; + +var req = github.activity.getStarredRepos({ per_page: 100}, getRepos); +function getRepos(err, res) { + if (err) { + return false; + } + + starredRepos = starredRepos.concat(res); + if (github.hasNextPage(res)) { + github.getNextPage(res, getRepos) + } else { + outputStarredRepos(); + } +} + +function outputStarredRepos() { + console.log(starredRepos.map(function(repo) { return repo['full_name']; })); + console.log('starred repos: ' + starredRepos.length); +} diff --git a/examples/getTimeline.js b/examples/getTimeline.js new file mode 100644 index 0000000000..6bc3ac7599 --- /dev/null +++ b/examples/getTimeline.js @@ -0,0 +1,21 @@ +"use strict"; + +var Client = require("./../lib/index"); +var testAuth = require("./../testAuth.json"); + +var github = new Client({ + debug: true +}); + +github.authenticate({ + type: "oauth", + token: testAuth["token"] +}); + +github.issues.getEventsTimeline({ + owner: "mikedeboer", + repo: "node-github", + issue_number: "447" +}, function(err, res) { + console.log(err, res); +}); diff --git a/examples/getUser.js b/examples/getUser.js new file mode 100644 index 0000000000..191982ab73 --- /dev/null +++ b/examples/getUser.js @@ -0,0 +1,17 @@ +"use strict"; + +var Client = require("./../lib/index"); +var testAuth = require("./../testAuth.json"); + +var github = new Client({ + debug: true +}); + +github.authenticate({ + type: "oauth", + token: testAuth["token"] +}); + +github.users.get({}, function(err, res) { + console.log(err, res); +}); diff --git a/examples/getUserById.js b/examples/getUserById.js new file mode 100644 index 0000000000..3feb2b00fb --- /dev/null +++ b/examples/getUserById.js @@ -0,0 +1,17 @@ +"use strict"; + +var Client = require("./../lib/index"); +var testAuth = require("./../testAuth.json"); + +var github = new Client({ + debug: true +}); + +github.authenticate({ + type: "oauth", + token: testAuth["token"] +}); + +github.users.getById({ id: "429706" }, function(err, res) { + console.log(err, res); +}); diff --git a/examples/getUserOrgs.js b/examples/getUserOrgs.js new file mode 100644 index 0000000000..7dbfd01d1d --- /dev/null +++ b/examples/getUserOrgs.js @@ -0,0 +1,26 @@ +"use strict"; + +var Client = require("./../lib/index"); +var testAuth = require("./../testAuth.json"); + +var github = new Client({ + debug: true +}); + +// github.authenticate({ +// type: "oauth", +// token: testAuth["token"] +// }); +// +// github.users.getOrgs({ +// per_page: 100 +// }, function(err, res) { +// console.log(err, res); +// }); + +github.orgs.getForUser({ + username: "tj", + per_page: 100 +}, function(err, res) { + console.log(err, res); +}); diff --git a/examples/listOrgs.js b/examples/listOrgs.js new file mode 100644 index 0000000000..b0a6a9869d --- /dev/null +++ b/examples/listOrgs.js @@ -0,0 +1,20 @@ +"use strict"; + +var Client = require("./../lib/index"); +var testAuth = require("./../testAuth.json"); + +var github = new Client({ + debug: true +}); + +github.authenticate({ + type: "oauth", + token: testAuth["token"] +}); + +github.orgs.getAll({ + page: 5, + per_page: 100 +}, function(err, res) { + console.log(err, res); +}); diff --git a/examples/lockIssue.js b/examples/lockIssue.js new file mode 100644 index 0000000000..f7db02c590 --- /dev/null +++ b/examples/lockIssue.js @@ -0,0 +1,21 @@ +"use strict"; + +var Client = require("./../lib/index"); +var testAuth = require("./../testAuth.json"); + +var github = new Client({ + debug: true +}); + +github.authenticate({ + type: "oauth", + token: testAuth["token"] +}); + +github.issues.lock({ + owner: "kaizensoze", + repo: "test2", + number: 3 +}, function(err, res) { + console.log(err, res); +}); diff --git a/examples/netrcAuth.js b/examples/netrcAuth.js new file mode 100644 index 0000000000..6711b903ed --- /dev/null +++ b/examples/netrcAuth.js @@ -0,0 +1,29 @@ +"use strict"; + +var Client = require("./../lib/index"); +var testAuth = require("./../testAuth.json"); + +var github = new Client({ + debug: true +}); + +github.authenticate({ + type: "netrc" +}); + +// github.repos.getReleases({ +// owner: "kaizensoze", +// repo: "test2" +// }, function(err, res) { +// console.log(err, res); +// }); + +github.repos.uploadAsset({ + owner: "kaizensoze", + repo: "test2", + id: "4801082", + filePath: "/Users/joegallo/z.sh", + name: "z.sh" +}, function(err, res) { + console.log(err, res); +}); diff --git a/examples/paginationCustomHeaders.js b/examples/paginationCustomHeaders.js new file mode 100644 index 0000000000..b468f0b3b0 --- /dev/null +++ b/examples/paginationCustomHeaders.js @@ -0,0 +1,42 @@ +"use strict"; + +var Client = require("./../lib/index"); +var testAuth = require("./../testAuth.json"); + +var github = new Client({ + debug: true +}); + +github.authenticate({ + type: "oauth", + token: testAuth["token"] +}); + +var customHeaders = { + "User-Agent": "blah" +}; + +github.issues.getForRepo({ + owner: "mikedeboer", + repo: "node-github", + headers: customHeaders +}, function(err, res) { + showIssueIds(res); + console.log('END of PAGE 1'); + + if (github.hasNextPage(res)) { + github.getNextPage(res, customHeaders, function(err, res) { + showIssueIds(res); + }); + } +}); + +function showIssueIds(res) { + for (var i = 0; i <= res.length; i++) { + if (typeof res[i] !== 'undefined') { + var url = res[i].url; + var issueId = url.substr(url.lastIndexOf('/') + 1); + console.log(issueId); + } + } +} diff --git a/examples/removeAssigneesFromIssue.js b/examples/removeAssigneesFromIssue.js new file mode 100644 index 0000000000..7dbff739ec --- /dev/null +++ b/examples/removeAssigneesFromIssue.js @@ -0,0 +1,22 @@ +"use strict"; + +var Client = require("./../lib/index"); +var testAuth = require("./../testAuth.json"); + +var github = new Client({ + debug: true +}); + +github.authenticate({ + type: "oauth", + token: testAuth["token"] +}); + +github.issues.removeAssigneesFromIssue({ + owner: "kaizensoze", + repo: "test2", + number: "4", + body: { "assignees": ["first9890"] } +}, function(err, res) { + console.log(err, res); +}); diff --git a/examples/renderMarkdown.js b/examples/renderMarkdown.js new file mode 100644 index 0000000000..eee1ec3674 --- /dev/null +++ b/examples/renderMarkdown.js @@ -0,0 +1,19 @@ +"use strict"; + +var Client = require("./../lib/index"); +var testAuth = require("./../testAuth.json"); + +var github = new Client({ + debug: false +}); + +github.authenticate({ + type: "oauth", + token: testAuth["token"] +}); + +github.misc.renderMarkdown({ + "text": "Hello world github/linguist#1 **cool**, and #1!" +}, function(err, res) { + console.log(err, res["data"]); +}); diff --git a/examples/searchIssues.js b/examples/searchIssues.js new file mode 100644 index 0000000000..a054fd45da --- /dev/null +++ b/examples/searchIssues.js @@ -0,0 +1,19 @@ +"use strict"; + +var Client = require("./../lib/index"); +var testAuth = require("./../testAuth.json"); + +var github = new Client({ + debug: true +}); + +github.authenticate({ + type: "oauth", + token: testAuth["token"] +}); + +github.search.issues({ + q: "bazinga" +}, function(err, res) { + console.log(err, res); +}); diff --git a/examples/searchMostStarredRepos.js b/examples/searchMostStarredRepos.js new file mode 100644 index 0000000000..b21f6ce175 --- /dev/null +++ b/examples/searchMostStarredRepos.js @@ -0,0 +1,26 @@ +"use strict"; + +var Client = require("./../lib/index"); +var testAuth = require("./../testAuth.json"); + +var github = new Client({ + // debug: true +}); + +github.authenticate({ + type: "oauth", + token: testAuth["token"] +}); + +github.search.repos({ + q: "stars:>=20000", + sort: "stars", + order: "desc" +}, function(err, res) { + for (var itemKey in res['items']) { + var item = res['items'][itemKey]; + var url = item['html_url']; + var star_count = item['stargazers_count']; + console.log(url + " (" + star_count + ")"); + } +}); diff --git a/examples/testPromise.js b/examples/testPromise.js new file mode 100644 index 0000000000..6436c48b73 --- /dev/null +++ b/examples/testPromise.js @@ -0,0 +1,20 @@ +"use strict"; + +var Client = require("./../lib/index"); +var Promise = require("bluebird"); // npm install bluebird + +var github = new Client({ + debug: false, + Promise: Promise +}); + +github.orgs.getAll({ + page: 5, + per_page: 100 +}).then(function(res) { + console.log(res); + + github.users.getById({ id: "429706" }).then(function(res) { + console.log(res); + }); +}); diff --git a/examples/testPromiseGetNextPage.js b/examples/testPromiseGetNextPage.js new file mode 100644 index 0000000000..d6e737e0a6 --- /dev/null +++ b/examples/testPromiseGetNextPage.js @@ -0,0 +1,26 @@ +var Client = require("./../lib/index"); + +var gh = new Client({ + Promise: require('bluebird') +}); + +function getAllOrgRepos(orgName) { + var repos = []; + + function pager(res) { + repos = repos.concat(res); + if (gh.hasNextPage(res)) { + return gh.getNextPage(res) + .then(pager); + } + return repos; + } + + return gh.repos.getForOrg({ org: orgName }) + .then(pager); +} + +getAllOrgRepos('organization') + .then(function(orgRepos) { + console.log(orgRepos); + }); \ No newline at end of file diff --git a/examples/testPromiseQ.js b/examples/testPromiseQ.js new file mode 100644 index 0000000000..c4f0896c81 --- /dev/null +++ b/examples/testPromiseQ.js @@ -0,0 +1,13 @@ +"use strict"; + +var Client = require("./../lib/index"); +var Q = require("q"); // npm install q + +var github = new Client({ + debug: false, + Promise: Q.Promise +}); + +github.users.getById({ id: '5057219' }).then(function(res) { + console.log(res); +}); diff --git a/examples/updateBranchProtection.js b/examples/updateBranchProtection.js new file mode 100644 index 0000000000..a5f369c9fe --- /dev/null +++ b/examples/updateBranchProtection.js @@ -0,0 +1,23 @@ +"use strict"; + +var Client = require("./../lib/index"); +var testAuth = require("./../testAuth.json"); + +var github = new Client({ + debug: true +}); + +github.authenticate({ + type: "oauth", + token: testAuth["token"] +}); + +github.repos.updateBranchProtection({ + owner: "kaizensoze", + repo: "test2", + branch: "a", + required_status_checks: null, + restrictions: null +}, function(err, res) { + console.log(err, res); +}); diff --git a/examples/updateLabel.js b/examples/updateLabel.js new file mode 100644 index 0000000000..dbf4c21e2e --- /dev/null +++ b/examples/updateLabel.js @@ -0,0 +1,23 @@ +"use strict"; + +var Client = require("./../lib/index"); +var testAuth = require("./../testAuth.json"); + +var github = new Client({ + debug: true +}); + +github.authenticate({ + type: "oauth", + token: testAuth["token"] +}); + +github.issues.updateLabel({ + owner: "kaizensoze", + repo: "test2", + oldname: "labelA", + name: "labelB", + color: "0052cc" +}, function(err, res) { + console.log(err, res); +}); diff --git a/examples/updateReference.js b/examples/updateReference.js new file mode 100644 index 0000000000..dff271fe96 --- /dev/null +++ b/examples/updateReference.js @@ -0,0 +1,23 @@ +"use strict"; + +var Client = require("./../lib/index"); +var testAuth = require("./../testAuth.json"); + +var github = new Client({ + debug: true +}); + +github.authenticate({ + type: "oauth", + token: testAuth["token"] +}); + +github.gitdata.updateReference({ + owner: "kaizensoze", + repo: "test2", + ref: "heads/master", + sha: "81c559e2e8551982235bc86594cd86ffb135b053", + // force: true +}, function(err, res) { + console.log(err, res); +}); diff --git a/generate.js b/generate.js deleted file mode 100755 index eb1e9bad6c..0000000000 --- a/generate.js +++ /dev/null @@ -1,295 +0,0 @@ -#!/usr/bin/env node -/** section: github, internal - * class ApiGenerator - * - * Copyright 2012 Cloud9 IDE, Inc. - * - * This product includes software developed by - * Cloud9 IDE, Inc (http://c9.io). - * - * Author: Mike de Boer - **/ - -"use strict"; - -var Fs = require("fs"); -var Path = require("path"); - -var Optimist = require("optimist"); -var Util = require("./util"); - -var IndexTpl = Fs.readFileSync(__dirname + "/templates/index.js.tpl", "utf8"); -var SectionTpl = Fs.readFileSync(__dirname + "/templates/section.js.tpl", "utf8"); -var HandlerTpl = Fs.readFileSync(__dirname + "/templates/handler.js.tpl", "utf8"); -var AfterRequestTpl = Fs.readFileSync(__dirname + "/templates/after_request.js.tpl", "utf8"); -var TestSectionTpl = Fs.readFileSync(__dirname + "/templates/test_section.js.tpl", "utf8"); -var TestHandlerTpl = Fs.readFileSync(__dirname + "/templates/test_handler.js.tpl", "utf8"); - -var main = module.exports = function(versions, tests, restore) { - Util.log("Generating for versions", Object.keys(versions)); - - Object.keys(versions).forEach(function(version) { - var dir = Path.join(__dirname, "api", version); - - // If we're in restore mode, move .bak file back to their original position - // and short-circuit. - if (restore) { - var bakRE = /\.bak$/; - var files = Fs.readdirSync(dir).filter(function(file) { - return bakRE.test(file); - }).forEach(function(file) { - var from = Path.join(dir, file); - var to = Path.join(dir, file.replace(/\.bak$/, "")); - Fs.renameSync(from, to); - Util.log("Restored '" + file + "' (" + version + ")"); - }); - - return; - } - - - var routes = versions[version]; - var defines = routes.defines; - delete routes.defines; - var headers = defines["response-headers"]; - // cast header names to lowercase. - if (headers && headers.length) - headers = headers.map(function(header) { return header.toLowerCase(); }); - var sections = {}; - var testSections = {}; - - function createComment(paramsStruct, section, funcName, indent) { - var params = Object.keys(paramsStruct); - var comment = [ - indent + "/** section: github", - indent + " * " + section + "#" + funcName + "(msg, callback) -> null", - indent + " * - msg (Object): Object that contains the parameters and their values to be sent to the server.", - indent + " * - callback (Function): function to call when the request is finished " + - "with an error as first argument and result data as second argument.", - indent + " *", - indent + " * ##### Params on the `msg` object:", - indent + " *" - ]; - comment.push(indent + " * - headers (Object): Optional. Key/ value pair " - + "of request headers to pass along with the HTTP request. Valid headers are: " - + "'" + defines["request-headers"].join("', '") + "'."); - if (!params.length) - comment.push(indent + " * No other params, simply pass an empty Object literal `{}`"); - var paramName, def, line; - for (var i = 0, l = params.length; i < l; ++i) { - paramName = params[i]; - if (paramName.charAt(0) == "$") { - paramName = paramName.substr(1); - if (!defines.params[paramName]) { - Util.log("Invalid variable parameter name substitution; param '" + - paramName + "' not found in defines block", "fatal"); - process.exit(1); - } - else - def = defines.params[paramName]; - } - else - def = paramsStruct[paramName]; - - line = indent + " * - " + paramName + " (" + (def.type || "mixed") + "): " + - (def.required ? "Required. " : "Optional. "); - if (def.description) - line += def.description; - if (def.validation) - line += " Validation rule: ` " + def.validation + " `."; - - comment.push(line); - } - - return comment.join("\n") + "\n" + indent + " **/"; - } - - function getParams(paramsStruct, indent) { - var params = Object.keys(paramsStruct); - if (!params.length) - return "{}"; - var values = []; - var paramName, def; - for (var i = 0, l = params.length; i < l; ++i) { - paramName = params[i]; - if (paramName.charAt(0) == "$") { - paramName = paramName.substr(1); - if (!defines.params[paramName]) { - Util.log("Invalid variable parameter name substitution; param '" + - paramName + "' not found in defines block", "fatal"); - process.exit(1); - } - else - def = defines.params[paramName]; - } - else - def = paramsStruct[paramName]; - - values.push(indent + " " + paramName + ": \"" + def.type + "\""); - } - return "{\n" + values.join(",\n") + "\n" + indent + "}"; - } - - function prepareApi(struct, baseType) { - if (!baseType) - baseType = ""; - - Object.keys(struct).forEach(function(routePart) { - var block = struct[routePart]; - if (!block) - return; - var messageType = baseType + "/" + routePart; - if (block.url && block.params) { - // we ended up at an API definition part! - var parts = messageType.split("/"); - var section = Util.toCamelCase(parts[1].toLowerCase()); - if (!block.method) { - throw new Error("No HTTP method specified for " + messageType + - "in section " + section); - } - - parts.splice(0, 2); - var funcName = Util.toCamelCase(parts.join("-")); - var comment = createComment(block.params, section, funcName, " "); - - // add the handler to the sections - if (!sections[section]) - sections[section] = []; - - var afterRequest = ""; - if (headers && headers.length) { - afterRequest = AfterRequestTpl.replace("<%headers%>", "\"" + - headers.join("\", \"") + "\""); - } - sections[section].push(HandlerTpl - .replace("<%funcName%>", funcName) - .replace("<%comment%>", comment) - .replace("<%afterRequest%>", afterRequest) - ); - - // add test to the testSections - if (!testSections[section]) - testSections[section] = []; - testSections[section].push(TestHandlerTpl - .replace("<%name%>", block.method + " " + block.url + " (" + funcName + ")") - .replace("<%funcName%>", section + "." + funcName) - .replace("<%params%>", getParams(block.params, " ")) - ); - } - else { - // recurse into this block next: - prepareApi(block, messageType); - } - }); - } - - Util.log("Converting routes to functions"); - prepareApi(routes); - - Util.log("Writing files to version dir"); - var sectionNames = Object.keys(sections); - - Util.log("Writing index.js file for version " + version); - Fs.writeFileSync(Path.join(dir, "index.js"), - IndexTpl - .replace("<%name%>", defines.constants.name) - .replace("<%description%>", defines.constants.description) - .replace("<%scripts%>", "\"" + sectionNames.join("\", \"") + "\""), - "utf8"); - - Object.keys(sections).forEach(function(section) { - var def = sections[section]; - Util.log("Writing '" + section + ".js' file for version " + version); - Fs.writeFileSync(Path.join(dir, section + ".js"), SectionTpl - .replace(/<%sectionName%>/g, section) - .replace("<%sectionBody%>", def.join("\n")), - "utf8" - ); - - // When we don't need to generate tests, bail out here. - if (!tests) - return; - - def = testSections[section]; - // test if previous tests already contained implementations by checking - // if the difference in character count between the current test file - // and the newly generated one is more than twenty characters. - var body = TestSectionTpl - .replace("<%version%>", version.replace("v", "")) - .replace(/<%sectionName%>/g, section) - .replace("<%testBody%>", def.join("\n\n")); - var path = Path.join(dir, section + "Test.js"); - if (Fs.existsSync(path) && Math.abs(Fs.readFileSync(path, "utf8").length - body.length) >= 20) { - Util.log("Moving old test file to '" + path + ".bak' to preserve tests " + - "that were already implemented. \nPlease be sure te check this file " + - "and move all implemented tests back into the newly generated test!", "error"); - Fs.renameSync(path, path + ".bak"); - } - - Util.log("Writing test file for " + section + ", version " + version); - Fs.writeFileSync(path, body, "utf8"); - }); - }); -}; - -if (!module.parent) { - var argv = Optimist - .wrap(80) - .usage("Generate the implementation of the node-github module, including " - + "unit-test scaffolds.\nUsage: $0 [-r] [-v VERSION]") - .alias("r", "restore") - .describe("r", "Restore .bak files, generated by a previous run, to the original") - .alias("v", "version") - .describe("v", "Semantic version number of the API to generate. Example: '3.0.0'") - .alias("t", "tests") - .describe("t", "Also generate unit test scaffolds") - .alias("h", "help") - .describe("h", "Display this usage information") - .boolean(["r", "t", "h"]) - .argv; - - if (argv.help) { - Util.log(Optimist.help()); - process.exit(); - } - - var baseDir = Path.join(__dirname, "api"); - var availVersions = {}; - Fs.readdirSync(baseDir).forEach(function(version) { - var path = Path.join(baseDir, version, "routes.json"); - if (!Fs.existsSync(path)) - return; - var routes; - try { - routes = JSON.parse(Fs.readFileSync(path, "utf8")); - } - catch (ex) { - return; - } - if (!routes.defines) - return; - availVersions[version] = routes; - }); - - if (!Object.keys(availVersions).length) { - Util.log("No versions available to generate.", "fatal"); - process.exit(1); - } - var versions = {}; - if (argv.version) { - if (argv.version.charAt(0) != "v") - argv.version = argv.v = "v" + argv.version; - if (!availVersions[argv.version]) { - Util.log("Version '" + argv.version + "' is not available", "fatal"); - process.exit(1); - } - versions[argv.version] = availVersions[argv.version]; - } - if (!Object.keys(versions).length) { - Util.log("No versions specified via the command line, generating for all available versions."); - versions = availVersions; - } - - Util.log("Starting up..."); - main(versions, argv.tests, argv.restore); -} diff --git a/error.js b/lib/error.js similarity index 93% rename from error.js rename to lib/error.js index 2da83f2984..6ccc3c2969 100644 --- a/error.js +++ b/lib/error.js @@ -1,6 +1,6 @@ /** section: github * class HttpError - * + * * Copyright 2012 Cloud9 IDE, Inc. * * This product includes software developed by @@ -11,37 +11,39 @@ var Util = require("util"); -exports.HttpError = function(message, code) { +exports.HttpError = function(message, code, headers) { Error.call(this, message); //Error.captureStackTrace(this, arguments.callee); this.message = message; this.code = code; + this.status = statusCodes[code]; + this.headers = headers; }; Util.inherits(exports.HttpError, Error); (function() { /** * HttpError#toString() -> String - * + * * Returns the stringified version of the error (i.e. the message). **/ this.toString = function() { return this.message; }; - + /** * HttpError#toJSON() -> Object - * + * * Returns a JSON object representation of the error. **/ this.toJSON = function() { return { code: this.code, - status: this.defaultMessage, + status: this.status, message: this.message }; }; - + }).call(exports.HttpError.prototype); @@ -90,21 +92,22 @@ var statusCodes = { 511: "Network Authentication Required" }; +// XXX: Remove? for (var status in statusCodes) { var defaultMsg = statusCodes[status]; - + var error = (function(defaultMsg, status) { return function(msg) { this.defaultMessage = defaultMsg; exports.HttpError.call(this, msg || status + ": " + defaultMsg, status); - + if (status >= 500) Error.captureStackTrace(this, arguments.callee); }; })(defaultMsg, status); - + Util.inherits(error, exports.HttpError); - + var className = toCamelCase(defaultMsg); exports[className] = error; exports[status] = error; @@ -114,4 +117,4 @@ function toCamelCase(str) { return str.toLowerCase().replace(/(?:(^.)|(\s+.))/g, function(match) { return match.charAt(match.length-1).toUpperCase(); }); -} \ No newline at end of file +} diff --git a/lib/generate.js b/lib/generate.js new file mode 100755 index 0000000000..261f095b81 --- /dev/null +++ b/lib/generate.js @@ -0,0 +1,210 @@ +#!/usr/bin/env node +/** section: github, internal + * class ApiGenerator + * + * Copyright 2012 Cloud9 IDE, Inc. + * + * This product includes software developed by + * Cloud9 IDE, Inc (http://c9.io). + * + * Author: Mike de Boer + **/ + +"use strict"; + +var fs = require("fs"); +var Path = require("path"); +var Url = require("url"); +var Util = require("./util"); +var npmPackageJSON = require("../package.json"); + +var TestSectionTpl = fs.readFileSync(__dirname + "/../templates/test_section.js.tpl", "utf8"); +var TestHandlerTpl = fs.readFileSync(__dirname + "/../templates/test_handler.js.tpl", "utf8"); + +var main = module.exports = function() { + // check routes path + var routesPath = Path.join(__dirname, "routes.json"); + var routes = JSON.parse(fs.readFileSync(routesPath, "utf8")); + if (!routes.defines) { + Util.log("No routes defined.", "fatal"); + process.exit(1); + } + + Util.log("Generating..."); + + var defines = routes.defines; + delete routes.defines; + var sections = {}; + var testSections = {}; + var apidocs = ""; + + function prepareApi(struct, baseType) { + if (!baseType) { + baseType = ""; + } + + Object.keys(struct).sort().forEach(function(routePart) { + var block = struct[routePart]; + if (!block) { + return; + } + var messageType = baseType + "/" + routePart; + if (block.url && block.params) { + // we ended up at an API definition part! + var parts = messageType.split("/"); + var section = Util.toCamelCase(parts[1]); + if (!block.method) { + throw new Error("No HTTP method specified for " + messageType + + "in section " + section); + } + + // add the handler to the sections + if (!sections[section]) { + sections[section] = []; + } + + parts.splice(0, 2); + var funcName = Util.toCamelCase(parts.join("-")); + apidocs += createComment(section, funcName, block); + + // add test to the testSections + if (!testSections[section]) { + testSections[section] = []; + } + testSections[section].push(TestHandlerTpl + .replace("<%name%>", block.method + " " + block.url + " (" + funcName + ")") + .replace("<%funcName%>", section + "." + funcName) + .replace("<%params%>", getParams(block.params, " ")) + ); + } + else { + // recurse into this block next: + prepareApi(block, messageType); + } + }); + } + + function createComment(section, funcName, block) { + var method = block['method'].toLowerCase(); + var url = block['url']; + var funcDisplayName = funcName; + + var apiVersion = npmPackageJSON['version']; + + var commentLines = [ + "/**", + " * @api {" + method + "} " + url + " " + funcName, + " * @apiVersion " + apiVersion, + " * @apiName " + funcDisplayName, + " * @apiDescription " + block['description'], + " * @apiGroup " + section, + " *" + ]; + + var paramsObj = block['params']; + + // sort params so Required come before Optional + var paramKeys = Object.keys(paramsObj); + paramKeys.sort(function(paramA, paramB) { + var cleanParamA = paramA.replace(/^\$/, ""); + var cleanParamB = paramB.replace(/^\$/, ""); + + var paramInfoA = paramsObj[paramA] || defines['params'][cleanParamA]; + var paramInfoB = paramsObj[paramB] || defines['params'][cleanParamB]; + + var paramRequiredA = paramInfoA['required']; + var paramRequiredB = paramInfoB['required']; + + if (paramRequiredA && !paramRequiredB) return -1; + if (!paramRequiredA && paramRequiredB) return 1; + return 0; + }); + + paramKeys.forEach(function(param) { + var cleanParam = param.replace(/^\$/, ""); + var paramInfo = paramsObj[param] || defines['params'][cleanParam]; + + var paramRequired = paramInfo['required']; + var paramType = paramInfo['type']; + var paramDescription = paramInfo['description']; + var paramDefaultVal = paramInfo['default']; + + var paramLabel = cleanParam; + + // add default value if there is one + if (typeof paramDefaultVal !== "undefined") { + paramLabel += '=' + paramDefaultVal + } + + // show param as either required or optional + if (!paramRequired) { + paramLabel = "[" + paramLabel + "]"; + } + + var allowedValues = ''; + if (paramInfo['enum']) { + allowedValues = '=' + paramInfo['enum'].map(function(val) { + return val; //"\"" + val + "\""; + }).join(','); + } + + commentLines.push(" * @apiParam {" + paramType + allowedValues + "} " + paramLabel + " " + paramDescription); + }); + + commentLines.push(" * @apiExample {js} ex:\ngithub." + section + "." + funcName + "({ ... });"); + + return commentLines.join("\n") + "\n */\n\n"; + } + + function getParams(paramsStruct, indent) { + var params = Object.keys(paramsStruct); + if (!params.length) { + return "{}"; + } + var values = []; + var paramName, def; + for (var i = 0, l = params.length; i < l; ++i) { + paramName = params[i]; + if (paramName.charAt(0) == "$") { + paramName = paramName.substr(1); + if (!defines.params[paramName]) { + Util.log("Invalid variable parameter name substitution; param '" + + paramName + "' not found in defines block", "fatal"); + process.exit(1); + } else { + def = defines.params[paramName]; + } + } else { + def = paramsStruct[paramName]; + } + + values.push(indent + " " + paramName + ": \"" + def.type + "\""); + } + return "{\n" + values.join(",\n") + "\n" + indent + "}"; + } + + Util.log("Converting routes to functions"); + prepareApi(routes); + + // var apidocsPath = Path.join(__dirname, "/../doc", "apidoc.js"); + // fs.writeFileSync(apidocsPath, apidocs); + + Object.keys(sections).forEach(function(section) { + Util.log("Writing test file for " + section); + + var def = testSections[section]; + var body = TestSectionTpl + .replace("<%version%>", "3.0.0") + .replace(/<%sectionName%>/g, section) + .replace(/<%sectionAuthType%>/g, section == "installations" ? "integration" : "oauth") + .replace("<%testBody%>", def.join("\n\n")); + var path = Path.join(__dirname, "/../test", section + "Test.js"); + + fs.writeFileSync(path, body, "utf8"); + }); + + require('./generateFlowTypes.js'); + require('./generateTypeScriptTypes.js'); +}; + +main(); diff --git a/lib/generateFlowTypes.js b/lib/generateFlowTypes.js new file mode 100755 index 0000000000..1f5e5dfad3 --- /dev/null +++ b/lib/generateFlowTypes.js @@ -0,0 +1,3 @@ +#!/usr/bin/env node + +module.exports = require("./generateTypes")("Flow", "index.js.flow.tpl", "index.js.flow"); \ No newline at end of file diff --git a/lib/generateTypeScriptTypes.js b/lib/generateTypeScriptTypes.js new file mode 100644 index 0000000000..5003170240 --- /dev/null +++ b/lib/generateTypeScriptTypes.js @@ -0,0 +1,3 @@ +#!/usr/bin/env node + +module.exports = require("./generateTypes")("TypeScript", "index.d.ts.tpl", "index.d.ts"); \ No newline at end of file diff --git a/lib/generateTypes.js b/lib/generateTypes.js new file mode 100644 index 0000000000..8e6b8c66ea --- /dev/null +++ b/lib/generateTypes.js @@ -0,0 +1,165 @@ +#!/usr/bin/env node +/** section: github, internal + * class ApiGenerator + * + * Copyright 2012 Cloud9 IDE, Inc. + * + * This product includes software developed by + * Cloud9 IDE, Inc (http://c9.io). + * + * Author: Mike de Boer + **/ + +"use strict"; + +var fs = require("fs"); +var Path = require("path"); +var Util = require("./util"); +var Mustache = require("mustache"); + +var typeMap = { + Json: "string", + String: "string", + Number: "number", + Boolean: "boolean", +}; + +// XXX: maybe a better idea to update routes.json to include array value types. +function replaceArrayTypes(type, name) { + switch (name) { + case "scopes": + case "add_scopes": + case "remove_scopes": + case "parents": + case "assignees": + case "repositories": + case "repo_names": + case "events": + case "add_events": + case "remove_events": + case "contexts": + case "required_contexts": + case "maintainers": + case "reviewers": + case "comments": + case "labels": + case "teams": + case "users": + case "emails": + if (type === "Array") { + return "string[]"; + } + } + return type; +} + +function paramData(key, definition) { + if (definition === null) { + return {}; + } + + var typeName = typeMap[definition.type] || definition.type; + var type = replaceArrayTypes(typeName, key); + var enums = definition.enum ? + definition.enum.map(JSON.stringify).join("|") + : null; + + return { + name: pascalcase(key), + key: key, + required: definition.required, + type: enums ? enums : type, + }; +} + +function capitalize(string) { + return string.charAt(0).toUpperCase().concat(string.slice(1)); +} + +function camelcase(string) { + return string.replace(/(?:-|_)([a-z])/g, function (_, character) { + return capitalize(character); + }); +} + +function pascalcase(string) { + return capitalize(camelcase(string)); +} + +function isGlobalParam(name) { + return name.charAt(0) === "$"; +} + +function isLocalParam(name) { + return !isGlobalParam(name); +} + +function entries(object) { + return Object.keys(object).map(function (key) { + return [key, object[key]]; + }); +} + +function combineParamData(params, entry) { + return params.concat(paramData.apply(null, entry)); +} + +var main = module.exports = function(languageName, templateFile, outputFile) { + var templatePath = Path.join(__dirname, "..", "templates", templateFile); + var template = fs.readFileSync(templatePath, "utf8"); + + // check routes path + var routesPath = Path.join(__dirname, "routes.json"); + var routes = JSON.parse(fs.readFileSync(routesPath, "utf8")); + if (!routes.defines) { + Util.log("No routes defined.", "fatal"); + process.exit(1); + } + + var defines = routes.defines; + var requestHeaders = defines["request-headers"]; + delete routes.defines; + + Util.log("Generating " + languageName + " types..."); + + var params = entries(defines.params).reduce(combineParamData, []); + + var namespaces = Object.keys(routes).reduce(function (namespaces, namespace) { + var methods = entries(routes[namespace]).reduce(function (methods, entry) { + var unionTypeNames = Object.keys(entry[1].params) + .filter(isGlobalParam) + .reduce(function (params, name) { + return params.concat(pascalcase(name.slice(1))); + }, []); + + var ownParams = entries(entry[1].params) + .filter(function (entry) { return isLocalParam(entry[0]); }) + .reduce(combineParamData, []); + + var hasParams = unionTypeNames.length > 0 || ownParams.length > 0; + var paramTypeName = pascalcase(namespace + "-" + entry[0] + "Params"); + + return methods.concat({ + method: camelcase(entry[0]), + paramTypeName: hasParams && paramTypeName, + unionTypeNames: unionTypeNames.length > 0 && unionTypeNames, + ownParams: ownParams.length > 0 && { params: ownParams }, + }); + }, []); + + return namespaces.concat({ + namespace: camelcase(namespace), + methods: methods, + }); + }, []); + + var body = Mustache.render(template, { + requestHeaders: requestHeaders.map(JSON.stringify), + params: params, + namespaces: namespaces, + }); + + Util.log("Writing " + languageName + " declarations file"); + + fs.writeFileSync(Path.join(__dirname, outputFile), body, "utf8"); +}; diff --git a/lib/index.d.ts b/lib/index.d.ts new file mode 100644 index 0000000000..ad74ecf472 --- /dev/null +++ b/lib/index.d.ts @@ -0,0 +1,3002 @@ +/** + * This declaration file requires TypeScript 2.1 or above. + */ + +declare namespace Github { + export type WellKnownHeader = + | "Authorization" + | "If-Modified-Since" + | "If-None-Match" + | "Cookie" + | "User-Agent" + | "Accept" + | "X-GitHub-OTP" + ; + + export interface Options { + debug?: boolean; + protocol?: string; + host?: string; + pathPrefix?: string; + headers?: {[header: string]: any}; + Promise?: typeof Promise; + followRedirects?: boolean; + timeout?: number; + } + + export interface AuthBasic { + type: "basic"; + username: string; + password: string; + } + + export interface AuthOAuthToken { + type: "oauth"; + token: string; + } + + export interface AuthOAuthSecret { + type: "oauth"; + key: string; + secret: string; + } + + export interface AuthUserToken { + type: "token"; + token: string; + } + + export interface AuthJWT { + type: "integration"; + token: string; + } + + export type Auth = + | AuthBasic + | AuthOAuthToken + | AuthOAuthSecret + | AuthUserToken + | AuthJWT; + + export type Link = + | { link: string; } + | { meta: { link: string; }; } + | string; + + export interface Callback { + (error: Error | null, result: any): any; + } + + export interface Files { files: string; } + export interface Owner { owner: string; } + export interface Username { username: string; } + export interface Org { org: string; } + export interface Repo { repo: string; } + export interface Branch { branch: string; } + export interface Sha { sha: string; } + export interface Description { description?: string; } + export interface Id { id: string; } + export interface GistId { gist_id: string; } + export interface InstallationId { installation_id: string; } + export interface RepositoryId { repository_id: string; } + export interface CommitId { commit_id: string; } + export interface ClientId { client_id?: string; } + export interface ColumnId { column_id: string; } + export interface ProjectId { project_id: string; } + export interface RepoId { repo_id: string; } + export interface InvitationId { invitation_id: string; } + export interface Ref { ref: string; } + export interface Number { number: number; } + export interface IssueNumber { issue_number: number; } + export interface Name { name: string; } + export interface Direction { direction?: "asc"|"desc"; } + export interface Since { since?: Date; } + export interface Until { until?: Date; } + export interface State { state?: "open"|"closed"|"all"; } + export interface Color { color: string; } + export interface Base { base: string; } + export interface Head { head: string; } + export interface Path { path: string; } + export interface Position { position: number; } + export interface Body { body: string; } + export interface Homepage { homepage?: string; } + export interface Private { private?: boolean; } + export interface HasIssues { has_issues?: boolean; } + export interface HasWiki { has_wiki?: boolean; } + export interface HasDownloads { has_downloads?: boolean; } + export interface DefaultBranch { default_branch?: string; } + export interface Title { title: string; } + export interface Key { key: string; } + export interface Page { page?: number; } + export interface PerPage { per_page?: number; } + export interface Scopes { scopes?: string[]; } + export interface Note { note?: string; } + export interface NoteUrl { note_url?: string; } + export interface AutoInit { auto_init?: boolean; } + export interface GitignoreTemplate { gitignore_template?: string; } + export interface LicenseTemplate { license_template?: string; } + export interface Order { order?: "asc"|"desc"; } + export interface Q { q: string; } + export interface Data { data: string; } + export interface Privacy { privacy?: "secret"|"closed"; } + export interface Fingerprint { fingerprint?: string; } + export interface AccessToken { access_token: string; } + export interface Assignees { assignees?: string[]; } + + export type AuthorizationGetGrantsParams = + & Page + & PerPage + ; + export type AuthorizationGetGrantParams = + & Id + & Page + & PerPage + ; + export type AuthorizationDeleteGrantParams = + & Id + ; + export type AuthorizationGetAllParams = + & Page + & PerPage + ; + export type AuthorizationGetParams = + & Id + ; + export type AuthorizationCreateParams = + & Scopes + & Note + & NoteUrl + & ClientId + & Fingerprint + & { + client_secret?: string; + }; + export type AuthorizationGetOrCreateAuthorizationForAppParams = + & ClientId + & Scopes + & Note + & NoteUrl + & Fingerprint + & { + client_secret: string; + }; + export type AuthorizationGetOrCreateAuthorizationForAppAndFingerprintParams = + & ClientId + & Fingerprint + & Scopes + & Note + & NoteUrl + & { + client_secret: string; + }; + export type AuthorizationUpdateParams = + & Id + & Scopes + & Note + & NoteUrl + & Fingerprint + & { + add_scopes?: string[]; + remove_scopes?: string[]; + }; + export type AuthorizationDeleteParams = + & Id + ; + export type AuthorizationCheckParams = + & ClientId + & AccessToken + ; + export type AuthorizationResetParams = + & ClientId + & AccessToken + ; + export type AuthorizationRevokeParams = + & ClientId + & AccessToken + ; + export type ActivityGetEventsParams = + & Page + & PerPage + ; + export type ActivityGetEventsForRepoParams = + & Owner + & Repo + & Page + & PerPage + ; + export type ActivityGetEventsForRepoIssuesParams = + & Owner + & Repo + & Page + & PerPage + ; + export type ActivityGetEventsForRepoNetworkParams = + & Owner + & Repo + & Page + & PerPage + ; + export type ActivityGetEventsForOrgParams = + & Org + & Page + & PerPage + ; + export type ActivityGetEventsReceivedParams = + & Username + & Page + & PerPage + ; + export type ActivityGetEventsReceivedPublicParams = + & Username + & Page + & PerPage + ; + export type ActivityGetEventsForUserParams = + & Username + & Page + & PerPage + ; + export type ActivityGetEventsForUserPublicParams = + & Username + & Page + & PerPage + ; + export type ActivityGetEventsForUserOrgParams = + & Username + & Org + & Page + & PerPage + ; + export type ActivityGetNotificationsParams = + & Since + & { + all?: boolean; + participating?: boolean; + before?: string; + }; + export type ActivityGetNotificationsForUserParams = + & Owner + & Repo + & Since + & { + all?: boolean; + participating?: boolean; + before?: string; + }; + export type ActivityMarkNotificationsAsReadParams = + & { + last_read_at?: string; + }; + export type ActivityMarkNotificationsAsReadForRepoParams = + & Owner + & Repo + & { + last_read_at?: string; + }; + export type ActivityGetNotificationThreadParams = + & Id + ; + export type ActivityMarkNotificationThreadAsReadParams = + & Id + ; + export type ActivityCheckNotificationThreadSubscriptionParams = + & Id + ; + export type ActivitySetNotificationThreadSubscriptionParams = + & Id + & { + subscribed?: boolean; + ignored?: boolean; + }; + export type ActivityDeleteNotificationThreadSubscriptionParams = + & Id + ; + export type ActivityGetStargazersForRepoParams = + & Owner + & Repo + & Page + & PerPage + ; + export type ActivityGetStarredReposForUserParams = + & Username + & Direction + & Page + & PerPage + & { + sort?: "created"|"updated"; + }; + export type ActivityGetStarredReposParams = + & Direction + & Page + & PerPage + & { + sort?: "created"|"updated"; + }; + export type ActivityCheckStarringRepoParams = + & Owner + & Repo + & Page + & PerPage + ; + export type ActivityStarRepoParams = + & Owner + & Repo + ; + export type ActivityUnstarRepoParams = + & Owner + & Repo + ; + export type ActivityGetWatchersForRepoParams = + & Owner + & Repo + & Page + & PerPage + ; + export type ActivityGetWatchedReposForUserParams = + & Username + & Page + & PerPage + ; + export type ActivityGetWatchedReposParams = + & Page + & PerPage + ; + export type ActivityGetRepoSubscriptionParams = + & Owner + & Repo + & Page + & PerPage + ; + export type ActivitySetRepoSubscriptionParams = + & Owner + & Repo + & { + subscribed?: boolean; + ignored?: boolean; + }; + export type ActivityUnwatchRepoParams = + & Owner + & Repo + ; + export type GistsGetForUserParams = + & Username + & Since + & Page + & PerPage + ; + export type GistsGetAllParams = + & Since + & Page + & PerPage + ; + export type GistsGetPublicParams = + & Since + ; + export type GistsGetStarredParams = + & Since + ; + export type GistsGetParams = + & Id + ; + export type GistsGetRevisionParams = + & Id + & Sha + ; + export type GistsCreateParams = + & Files + & Description + & { + public: boolean; + }; + export type GistsEditParams = + & Id + & Description + & Files + & { + content?: string; + filename?: string; + }; + export type GistsGetCommitsParams = + & Id + ; + export type GistsStarParams = + & Id + ; + export type GistsUnstarParams = + & Id + ; + export type GistsCheckStarParams = + & Id + ; + export type GistsForkParams = + & Id + ; + export type GistsGetForksParams = + & Id + & Page + & PerPage + ; + export type GistsDeleteParams = + & Id + ; + export type GistsGetCommentsParams = + & GistId + ; + export type GistsGetCommentParams = + & GistId + & Id + ; + export type GistsCreateCommentParams = + & GistId + & Body + ; + export type GistsEditCommentParams = + & GistId + & Id + & Body + ; + export type GistsDeleteCommentParams = + & GistId + & Id + ; + export type GitdataGetBlobParams = + & Owner + & Repo + & Sha + & Page + & PerPage + ; + export type GitdataCreateBlobParams = + & Owner + & Repo + & { + content: string; + encoding: string; + }; + export type GitdataGetCommitParams = + & Owner + & Repo + & Sha + ; + export type GitdataCreateCommitParams = + & Owner + & Repo + & { + message: string; + tree: string; + parents: string[]; + author?: string; + committer?: string; + }; + export type GitdataGetCommitSignatureVerificationParams = + & Owner + & Repo + & Sha + ; + export type GitdataGetReferenceParams = + & Owner + & Repo + & Ref + ; + export type GitdataGetReferencesParams = + & Owner + & Repo + & Page + & PerPage + ; + export type GitdataGetTagsParams = + & Owner + & Repo + & Page + & PerPage + ; + export type GitdataCreateReferenceParams = + & Owner + & Repo + & Sha + & { + ref: string; + }; + export type GitdataUpdateReferenceParams = + & Owner + & Repo + & Ref + & Sha + & { + force?: boolean; + }; + export type GitdataDeleteReferenceParams = + & Owner + & Repo + & Ref + ; + export type GitdataGetTagParams = + & Owner + & Repo + & Sha + ; + export type GitdataCreateTagParams = + & Owner + & Repo + & { + tag: string; + message: string; + object: string; + type: string; + tagger: string; + }; + export type GitdataGetTagSignatureVerificationParams = + & Owner + & Repo + & Sha + ; + export type GitdataGetTreeParams = + & Owner + & Repo + & Sha + & { + recursive?: boolean; + }; + export type GitdataCreateTreeParams = + & Owner + & Repo + & { + tree: string; + base_tree?: string; + }; + export type IntegrationsGetInstallationsParams = + & Page + & PerPage + ; + export type IntegrationsCreateInstallationTokenParams = + & InstallationId + & { + user_id?: string; + }; + export type IntegrationsGetUserIdentityParams = + & { + nonce?: string; + }; + export type IntegrationsGetInstallationRepositoriesParams = + & { + user_id?: string; + }; + export type IntegrationsAddRepoToInstallationParams = + & InstallationId + & RepositoryId + ; + export type IntegrationsRemoveRepoFromInstallationParams = + & InstallationId + & RepositoryId + ; + export type IssuesGetAllParams = + & Direction + & Since + & Page + & PerPage + & { + filter?: "all"|"assigned"|"created"|"mentioned"|"subscribed"; + state?: "open"|"closed"|"all"; + labels?: string; + sort?: "created"|"updated"|"comments"; + }; + export type IssuesGetForUserParams = + & Direction + & Since + & Page + & PerPage + & { + filter?: "all"|"assigned"|"created"|"mentioned"|"subscribed"; + state?: "open"|"closed"|"all"; + labels?: string; + sort?: "created"|"updated"|"comments"; + }; + export type IssuesGetForOrgParams = + & Org + & Direction + & Since + & Page + & PerPage + & { + filter?: "all"|"assigned"|"created"|"mentioned"|"subscribed"; + state?: "open"|"closed"|"all"; + labels?: string; + sort?: "created"|"updated"|"comments"; + }; + export type IssuesGetForRepoParams = + & Owner + & Repo + & Direction + & Since + & Page + & PerPage + & { + milestone?: string; + state?: "open"|"closed"|"all"; + assignee?: string; + creator?: string; + mentioned?: string; + labels?: string; + sort?: "created"|"updated"|"comments"; + }; + export type IssuesGetParams = + & Owner + & Repo + & Number + ; + export type IssuesCreateParams = + & Owner + & Repo + & Assignees + & { + title: string; + body?: string; + assignee?: string; + milestone?: number; + labels?: string[]; + }; + export type IssuesEditParams = + & Owner + & Repo + & Number + & Assignees + & { + title?: string; + body?: string; + assignee?: string; + state?: "open"|"closed"; + milestone?: number; + labels?: string[]; + }; + export type IssuesLockParams = + & Owner + & Repo + & Number + ; + export type IssuesUnlockParams = + & Owner + & Repo + & Number + ; + export type IssuesGetAssigneesParams = + & Owner + & Repo + ; + export type IssuesCheckAssigneeParams = + & Owner + & Repo + & { + assignee: string; + }; + export type IssuesAddAssigneesToIssueParams = + & Owner + & Repo + & Number + & { + assignees: string[]; + }; + export type IssuesRemoveAssigneesFromIssueParams = + & Owner + & Repo + & Number + & Assignees + ; + export type IssuesGetCommentsParams = + & Owner + & Repo + & Number + & Page + & PerPage + ; + export type IssuesGetCommentsForRepoParams = + & Owner + & Repo + & Direction + & Since + & Page + & PerPage + & { + sort?: "created"|"updated"; + }; + export type IssuesGetCommentParams = + & Owner + & Repo + & Id + ; + export type IssuesCreateCommentParams = + & Owner + & Repo + & Number + & Body + ; + export type IssuesEditCommentParams = + & Owner + & Repo + & Id + & Body + ; + export type IssuesDeleteCommentParams = + & Owner + & Repo + & Id + ; + export type IssuesGetEventsParams = + & Owner + & Repo + & IssueNumber + & Page + & PerPage + ; + export type IssuesGetEventsForRepoParams = + & Owner + & Repo + & Page + & PerPage + ; + export type IssuesGetEventParams = + & Owner + & Repo + & Id + ; + export type IssuesGetLabelsParams = + & Owner + & Repo + & Page + & PerPage + ; + export type IssuesGetLabelParams = + & Owner + & Repo + & Name + ; + export type IssuesCreateLabelParams = + & Owner + & Repo + & Name + & Color + ; + export type IssuesUpdateLabelParams = + & Owner + & Repo + & Color + & { + oldname: string; + name: string; + }; + export type IssuesDeleteLabelParams = + & Owner + & Repo + & Name + ; + export type IssuesGetIssueLabelsParams = + & Owner + & Repo + & Number + ; + export type IssuesAddLabelsParams = + & Owner + & Repo + & Number + & { + labels: string[]; + }; + export type IssuesRemoveLabelParams = + & Owner + & Repo + & Number + & { + name: string; + }; + export type IssuesReplaceAllLabelsParams = + & Owner + & Repo + & Number + & { + labels: string[]; + }; + export type IssuesRemoveAllLabelsParams = + & Owner + & Repo + & Number + ; + export type IssuesGetMilestoneLabelsParams = + & Owner + & Repo + & Number + ; + export type IssuesGetMilestonesParams = + & Owner + & Repo + & State + & Page + & PerPage + & { + sort?: "due_on"|"completeness"; + direction?: "asc"|"desc"; + }; + export type IssuesGetMilestoneParams = + & Owner + & Repo + & Number + ; + export type IssuesCreateMilestoneParams = + & Owner + & Repo + & State + & Description + & { + title: string; + due_on?: Date; + }; + export type IssuesUpdateMilestoneParams = + & Owner + & Repo + & Number + & State + & Description + & { + title: string; + due_on?: Date; + }; + export type IssuesDeleteMilestoneParams = + & Owner + & Repo + & Number + ; + export type IssuesGetEventsTimelineParams = + & Owner + & Repo + & IssueNumber + & Page + & PerPage + ; + export type MigrationsStartMigrationParams = + & Org + & { + repositories: string[]; + lock_repositories?: boolean; + exclude_attachments?: boolean; + }; + export type MigrationsGetMigrationsParams = + & Org + & Page + & PerPage + ; + export type MigrationsGetMigrationStatusParams = + & Org + & Id + ; + export type MigrationsGetMigrationArchiveLinkParams = + & Org + & Id + ; + export type MigrationsDeleteMigrationArchiveParams = + & Org + & Id + ; + export type MigrationsUnlockRepoLockedForMigrationParams = + & Org + & Id + & { + repo_name: string; + }; + export type MigrationsStartImportParams = + & Owner + & Repo + & { + vcs_url: string; + vcs?: "subversion"|"git"|"mercurial"|"tfvc"; + vcs_username?: string; + vcs_password?: string; + tfvc_project?: string; + }; + export type MigrationsGetImportProgressParams = + & Owner + & Repo + ; + export type MigrationsUpdateImportParams = + & Owner + & Repo + ; + export type MigrationsGetImportCommitAuthorsParams = + & Owner + & Repo + & { + since?: string; + }; + export type MigrationsMapImportCommitAuthorParams = + & Owner + & Repo + & { + author_id: string; + email?: string; + name?: string; + }; + export type MigrationsSetImportLfsPreferenceParams = + & Owner + & Name + & { + use_lfs: string; + }; + export type MigrationsGetLargeImportFilesParams = + & Owner + & Name + ; + export type MigrationsCancelImportParams = + & Owner + & Repo + ; + export type MiscGetGitignoreTemplateParams = + & { + name: string; + }; + export type MiscGetLicenseParams = + & { + license: string; + }; + export type MiscGetRepoLicenseParams = + & Owner + & Repo + ; + export type MiscRenderMarkdownParams = + & { + text: string; + mode?: "markdown"|"gfm"; + context?: string; + }; + export type MiscRenderMarkdownRawParams = + & Data + ; + export type OrgsGetAllParams = + & Page + & PerPage + & { + since?: string; + }; + export type OrgsGetForUserParams = + & Username + & Page + & PerPage + ; + export type OrgsGetParams = + & Org + & Page + & PerPage + ; + export type OrgsUpdateParams = + & Org + & { + billing_email?: string; + company?: string; + email?: string; + location?: string; + name?: string; + description?: string; + default_repository_permission?: "read"|"write"|"admin"|"none"; + members_can_create_repositories?: boolean; + }; + export type OrgsGetMembersParams = + & Org + & Page + & PerPage + & { + filter?: "all"|"2fa_disabled"; + role?: "all"|"admin"|"member"; + }; + export type OrgsCheckMembershipParams = + & Org + & Username + ; + export type OrgsRemoveMemberParams = + & Org + & Username + ; + export type OrgsGetPublicMembersParams = + & Org + ; + export type OrgsCheckPublicMembershipParams = + & Org + & Username + ; + export type OrgsPublicizeMembershipParams = + & Org + & Username + ; + export type OrgsConcealMembershipParams = + & Org + & Username + ; + export type OrgsGetOrgMembershipParams = + & Org + & Username + ; + export type OrgsAddOrgMembershipParams = + & Org + & Username + & { + role: "admin"|"member"; + }; + export type OrgsRemoveOrgMembershipParams = + & Org + & Username + ; + export type OrgsGetPendingOrgInvitesParams = + & Org + ; + export type OrgsGetOutsideCollaboratorsParams = + & Org + & Page + & PerPage + ; + export type OrgsRemoveOutsideCollaboratorParams = + & Org + & Username + ; + export type OrgsConvertMemberToOutsideCollaboratorParams = + & Org + & Username + ; + export type OrgsGetTeamsParams = + & Org + & Page + & PerPage + ; + export type OrgsGetTeamParams = + & Id + ; + export type OrgsCreateTeamParams = + & Org + & Name + & Privacy + & { + description?: string; + maintainers?: string[]; + repo_names?: string[]; + }; + export type OrgsEditTeamParams = + & Id + & Name + & Privacy + & { + description?: string; + }; + export type OrgsDeleteTeamParams = + & Id + ; + export type OrgsGetTeamMembersParams = + & Id + & Page + & PerPage + & { + role?: "member"|"maintainer"|"all"; + }; + export type OrgsGetTeamMembershipParams = + & Id + & Username + ; + export type OrgsAddTeamMembershipParams = + & Id + & Username + & { + role?: "member"|"maintainer"; + }; + export type OrgsRemoveTeamMembershipParams = + & Id + & Username + ; + export type OrgsGetTeamReposParams = + & Id + & Page + & PerPage + ; + export type OrgsGetPendingTeamInvitesParams = + & Id + & Page + & PerPage + ; + export type OrgsCheckTeamRepoParams = + & Id + & Owner + & Repo + ; + export type OrgsAddTeamRepoParams = + & Id + & Org + & Repo + & { + permission?: "pull"|"push"|"admin"; + }; + export type OrgsDeleteTeamRepoParams = + & Id + & Owner + & Repo + ; + export type OrgsGetHooksParams = + & Org + & Page + & PerPage + ; + export type OrgsGetHookParams = + & Org + & Id + ; + export type OrgsCreateHookParams = + & Org + & { + name: string; + config: string; + events?: string[]; + active?: boolean; + }; + export type OrgsEditHookParams = + & Org + & Id + & { + config: string; + events?: string[]; + active?: boolean; + }; + export type OrgsPingHookParams = + & Org + & Id + ; + export type OrgsDeleteHookParams = + & Org + & Id + ; + export type ProjectsGetRepoProjectsParams = + & Owner + & Repo + ; + export type ProjectsGetOrgProjectsParams = + & Org + ; + export type ProjectsGetProjectParams = + & Id + ; + export type ProjectsCreateRepoProjectParams = + & Owner + & Repo + & Name + & { + body?: string; + }; + export type ProjectsCreateOrgProjectParams = + & Org + & Name + & { + body?: string; + }; + export type ProjectsUpdateProjectParams = + & Id + & Name + & { + body?: string; + }; + export type ProjectsDeleteProjectParams = + & Id + ; + export type ProjectsGetProjectCardsParams = + & ColumnId + ; + export type ProjectsGetProjectCardParams = + & Id + ; + export type ProjectsCreateProjectCardParams = + & ColumnId + & { + note?: string; + content_id?: string; + content_type?: string; + }; + export type ProjectsUpdateProjectCardParams = + & Id + & { + note?: string; + }; + export type ProjectsDeleteProjectCardParams = + & Id + ; + export type ProjectsMoveProjectCardParams = + & Id + & { + position: string; + column_id?: string; + }; + export type ProjectsGetProjectColumnsParams = + & ProjectId + ; + export type ProjectsGetProjectColumnParams = + & Id + ; + export type ProjectsCreateProjectColumnParams = + & ProjectId + & Name + ; + export type ProjectsUpdateProjectColumnParams = + & Id + & Name + ; + export type ProjectsDeleteProjectColumnParams = + & Id + ; + export type ProjectsMoveProjectColumnParams = + & Id + & { + position: string; + }; + export type PullRequestsGetAllParams = + & Owner + & Repo + & Direction + & Page + & PerPage + & { + state?: "open"|"closed"|"all"; + head?: string; + base?: string; + sort?: "created"|"updated"|"popularity"|"long-running"; + }; + export type PullRequestsGetParams = + & Owner + & Repo + & Number + ; + export type PullRequestsCreateParams = + & Owner + & Repo + & Head + & Base + & { + title: string; + body?: string; + maintainer_can_modify?: boolean; + }; + export type PullRequestsCreateFromIssueParams = + & Owner + & Repo + & Head + & Base + & { + issue: number; + }; + export type PullRequestsUpdateParams = + & Owner + & Repo + & Number + & State + & { + title?: string; + body?: string; + base?: string; + }; + export type PullRequestsGetCommitsParams = + & Owner + & Repo + & Number + & Page + & PerPage + ; + export type PullRequestsGetFilesParams = + & Owner + & Repo + & Number + & Page + & PerPage + ; + export type PullRequestsCheckMergedParams = + & Owner + & Repo + & Number + & Page + & PerPage + ; + export type PullRequestsMergeParams = + & Owner + & Repo + & Number + & { + commit_title?: string; + commit_message?: string; + sha?: string; + merge_method?: "merge"|"squash"|"rebase"; + }; + export type PullRequestsGetReviewsParams = + & Owner + & Repo + & Number + & Page + & PerPage + ; + export type PullRequestsGetReviewParams = + & Owner + & Repo + & Number + & Id + ; + export type PullRequestsGetReviewCommentsParams = + & Owner + & Repo + & Number + & Id + & Page + & PerPage + ; + export type PullRequestsCreateReviewParams = + & Owner + & Repo + & Number + & { + body?: string; + event?: "APPROVE"|"REQUEST_CHANGES"|"COMMENT"|"PENDING"; + comments?: string[]; + path?: string; + position?: number; + }; + export type PullRequestsSubmitReviewParams = + & Owner + & Repo + & Number + & Id + & { + body?: string; + event?: "APPROVE"|"REQUEST_CHANGES"|"COMMENT"|"PENDING"; + }; + export type PullRequestsDismissReviewParams = + & Owner + & Repo + & Number + & Id + & Page + & PerPage + & { + message?: string; + }; + export type PullRequestsGetCommentsParams = + & Owner + & Repo + & Number + & Page + & PerPage + ; + export type PullRequestsGetCommentsForRepoParams = + & Owner + & Repo + & Direction + & Since + & Page + & PerPage + & { + sort?: "created"|"updated"; + }; + export type PullRequestsGetCommentParams = + & Owner + & Repo + & Id + ; + export type PullRequestsCreateCommentParams = + & Owner + & Repo + & Number + & Body + & CommitId + & Path + & Position + ; + export type PullRequestsCreateCommentReplyParams = + & Owner + & Repo + & Number + & Body + & { + in_reply_to: number; + }; + export type PullRequestsEditCommentParams = + & Owner + & Repo + & Id + & Body + ; + export type PullRequestsDeleteCommentParams = + & Owner + & Repo + & Id + ; + export type PullRequestsGetReviewRequestsParams = + & Owner + & Repo + & Number + & Page + & PerPage + ; + export type PullRequestsCreateReviewRequestParams = + & Owner + & Repo + & Number + & { + reviewers?: string[]; + }; + export type PullRequestsDeleteReviewRequestParams = + & Owner + & Repo + & Number + & { + reviewers?: string[]; + }; + export type ReactionsGetForCommitCommentParams = + & Owner + & Repo + & Id + & { + content?: "+1"|"-1"|"laugh"|"confused"|"heart"|"hooray"; + }; + export type ReactionsCreateForCommitCommentParams = + & Owner + & Repo + & Id + & { + content: "+1"|"-1"|"laugh"|"confused"|"heart"|"hooray"; + }; + export type ReactionsGetForIssueParams = + & Owner + & Repo + & Number + & { + content?: "+1"|"-1"|"laugh"|"confused"|"heart"|"hooray"; + }; + export type ReactionsCreateForIssueParams = + & Owner + & Repo + & Number + & { + content: "+1"|"-1"|"laugh"|"confused"|"heart"|"hooray"; + }; + export type ReactionsGetForIssueCommentParams = + & Owner + & Repo + & Id + & { + content?: "+1"|"-1"|"laugh"|"confused"|"heart"|"hooray"; + }; + export type ReactionsCreateForIssueCommentParams = + & Owner + & Repo + & Id + & { + content: "+1"|"-1"|"laugh"|"confused"|"heart"|"hooray"; + }; + export type ReactionsGetForPullRequestReviewCommentParams = + & Owner + & Repo + & Id + & { + content?: "+1"|"-1"|"laugh"|"confused"|"heart"|"hooray"; + }; + export type ReactionsCreateForPullRequestReviewCommentParams = + & Owner + & Repo + & Id + & { + content: "+1"|"-1"|"laugh"|"confused"|"heart"|"hooray"; + }; + export type ReactionsDeleteParams = + & Id + ; + export type ReposGetAllParams = + & Direction + & Page + & PerPage + & { + visibility?: "all"|"public"|"private"; + affiliation?: string; + type?: "all"|"owner"|"public"|"private"|"member"; + sort?: "created"|"updated"|"pushed"|"full_name"; + }; + export type ReposGetForUserParams = + & Username + & Direction + & Page + & PerPage + & { + type?: "all"|"owner"|"member"; + sort?: "created"|"updated"|"pushed"|"full_name"; + }; + export type ReposGetForOrgParams = + & Org + & Page + & PerPage + & { + type?: "all"|"public"|"private"|"forks"|"sources"|"member"; + }; + export type ReposGetPublicParams = + & { + since?: string; + }; + export type ReposGetByIdParams = + & Id + ; + export type ReposCreateParams = + & Name + & Description + & Homepage + & Private + & HasIssues + & HasWiki + & HasDownloads + & AutoInit + & GitignoreTemplate + & LicenseTemplate + & { + team_id?: number; + allow_squash_merge?: boolean; + allow_merge_commit?: boolean; + allow_rebase_merge?: boolean; + }; + export type ReposGetParams = + & Owner + & Repo + ; + export type ReposCreateForOrgParams = + & Org + & Name + & Description + & Homepage + & Private + & HasIssues + & HasWiki + & HasDownloads + & AutoInit + & GitignoreTemplate + & LicenseTemplate + & { + team_id?: number; + allow_squash_merge?: boolean; + allow_merge_commit?: boolean; + allow_rebase_merge?: boolean; + }; + export type ReposEditParams = + & Owner + & Repo + & Name + & Description + & Homepage + & Private + & HasIssues + & HasWiki + & HasDownloads + & DefaultBranch + & { + allow_squash_merge?: boolean; + allow_merge_commit?: boolean; + allow_rebase_merge?: boolean; + }; + export type ReposGetContributorsParams = + & Owner + & Repo + & Page + & PerPage + & { + anon?: boolean; + }; + export type ReposGetLanguagesParams = + & Owner + & Repo + & Page + & PerPage + ; + export type ReposGetTeamsParams = + & Owner + & Repo + & Page + & PerPage + ; + export type ReposGetTagsParams = + & Owner + & Repo + & Page + & PerPage + ; + export type ReposDeleteParams = + & Owner + & Repo + ; + export type ReposGetBranchesParams = + & Owner + & Repo + & Page + & PerPage + & { + protected?: boolean; + }; + export type ReposGetBranchParams = + & Owner + & Repo + & Branch + & Page + & PerPage + ; + export type ReposGetBranchProtectionParams = + & Owner + & Repo + & Branch + & Page + & PerPage + ; + export type ReposUpdateBranchProtectionParams = + & Owner + & Repo + & Branch + & Page + & PerPage + & { + required_status_checks: string; + required_pull_request_reviews: string; + restrictions: string; + }; + export type ReposRemoveBranchProtectionParams = + & Owner + & Repo + & Branch + & Page + & PerPage + ; + export type ReposGetProtectedBranchRequiredStatusChecksParams = + & Owner + & Repo + & Branch + & Page + & PerPage + ; + export type ReposUpdateProtectedBranchRequiredStatusChecksParams = + & Owner + & Repo + & Branch + & Page + & PerPage + & { + include_admins?: boolean; + strict?: boolean; + contexts?: string[]; + }; + export type ReposRemoveProtectedBranchRequiredStatusChecksParams = + & Owner + & Repo + & Branch + & Page + & PerPage + ; + export type ReposGetProtectedBranchRequiredStatusChecksContextsParams = + & Owner + & Repo + & Branch + & Page + & PerPage + ; + export type ReposReplaceProtectedBranchRequiredStatusChecksContextsParams = + & Owner + & Repo + & Branch + & { + contexts: string[]; + }; + export type ReposAddProtectedBranchRequiredStatusChecksContextsParams = + & Owner + & Repo + & Branch + & { + contexts: string[]; + }; + export type ReposRemoveProtectedBranchRequiredStatusChecksContextsParams = + & Owner + & Repo + & Branch + & { + contexts: string[]; + }; + export type ReposGetProtectedBranchPullRequestReviewEnforcementParams = + & Owner + & Repo + & Branch + & Page + & PerPage + ; + export type ReposUpdateProtectedBranchPullRequestReviewEnforcementParams = + & Owner + & Repo + & Branch + & { + include_admins?: boolean; + }; + export type ReposRemoveProtectedBranchPullRequestReviewEnforcementParams = + & Owner + & Repo + & Branch + ; + export type ReposGetProtectedBranchRestrictionsParams = + & Owner + & Repo + & Branch + & Page + & PerPage + ; + export type ReposRemoveProtectedBranchRestrictionsParams = + & Owner + & Repo + & Branch + ; + export type ReposGetProtectedBranchTeamRestrictionsParams = + & Owner + & Repo + & Branch + & Page + & PerPage + ; + export type ReposReplaceProtectedBranchTeamRestrictionsParams = + & Owner + & Repo + & Branch + & { + teams: string[]; + }; + export type ReposAddProtectedBranchTeamRestrictionsParams = + & Owner + & Repo + & Branch + & { + teams: string[]; + }; + export type ReposRemoveProtectedBranchTeamRestrictionsParams = + & Owner + & Repo + & Branch + & { + teams: string[]; + }; + export type ReposGetProtectedBranchUserRestrictionsParams = + & Owner + & Repo + & Branch + & Page + & PerPage + ; + export type ReposReplaceProtectedBranchUserRestrictionsParams = + & Owner + & Repo + & Branch + & { + users: string[]; + }; + export type ReposAddProtectedBranchUserRestrictionsParams = + & Owner + & Repo + & Branch + & { + users: string[]; + }; + export type ReposRemoveProtectedBranchUserRestrictionsParams = + & Owner + & Repo + & Branch + & { + users: string[]; + }; + export type ReposGetCollaboratorsParams = + & Owner + & Repo + & Page + & PerPage + & { + affiliation?: "outside"|"all"; + }; + export type ReposCheckCollaboratorParams = + & Owner + & Repo + & Username + ; + export type ReposReviewUserPermissionLevelParams = + & Owner + & Repo + & Username + ; + export type ReposAddCollaboratorParams = + & Owner + & Repo + & Username + & { + permission?: "pull"|"push"|"admin"; + }; + export type ReposRemoveCollaboratorParams = + & Owner + & Repo + & Username + ; + export type ReposGetAllCommitCommentsParams = + & Owner + & Repo + & Page + & PerPage + ; + export type ReposGetCommitCommentsParams = + & Owner + & Repo + & Page + & PerPage + & { + ref: string; + }; + export type ReposCreateCommitCommentParams = + & Owner + & Repo + & Sha + & Body + & { + path?: string; + position?: number; + line?: number; + }; + export type ReposGetCommitCommentParams = + & Owner + & Repo + & Id + ; + export type ReposUpdateCommitCommentParams = + & Owner + & Repo + & Id + & Body + ; + export type ReposDeleteCommitCommentParams = + & Owner + & Repo + & Id + ; + export type ReposGetCommunityHealthMetricsParams = + & RepoId + ; + export type ReposGetCommitsParams = + & Owner + & Repo + & Since + & Until + & Page + & PerPage + & { + sha?: string; + path?: string; + author?: string; + }; + export type ReposGetCommitParams = + & Owner + & Repo + & Sha + ; + export type ReposGetShaOfCommitRefParams = + & Owner + & Repo + & Ref + ; + export type ReposCompareCommitsParams = + & Owner + & Repo + & Base + & Head + ; + export type ReposGetReadmeParams = + & Owner + & Repo + & { + ref?: string; + }; + export type ReposGetContentParams = + & Owner + & Repo + & { + path: string; + ref?: string; + }; + export type ReposCreateFileParams = + & Owner + & Repo + & { + path: string; + message: string; + content: string; + branch?: string; + committer?: string; + }; + export type ReposUpdateFileParams = + & Owner + & Repo + & { + path: string; + message: string; + content: string; + sha: string; + branch?: string; + committer?: string; + }; + export type ReposDeleteFileParams = + & Owner + & Repo + & { + path: string; + message: string; + sha: string; + branch?: string; + committer?: string; + }; + export type ReposGetArchiveLinkParams = + & Owner + & Repo + & { + archive_format: "tarball"|"zipball"; + ref?: string; + }; + export type ReposGetKeysParams = + & Owner + & Repo + & Page + & PerPage + ; + export type ReposGetKeyParams = + & Owner + & Repo + & Id + ; + export type ReposCreateKeyParams = + & Owner + & Repo + & Title + & Key + & { + read_only?: boolean; + }; + export type ReposDeleteKeyParams = + & Owner + & Repo + & Id + ; + export type ReposGetDeploymentsParams = + & Owner + & Repo + & Page + & PerPage + & { + sha?: string; + ref?: string; + task?: string; + environment?: string; + }; + export type ReposCreateDeploymentParams = + & Owner + & Repo + & { + ref: string; + task?: string; + auto_merge?: boolean; + required_contexts?: string[]; + payload?: string; + environment?: string; + description?: string; + transient_environment?: boolean; + production_environment?: boolean; + }; + export type ReposGetDeploymentStatusesParams = + & Owner + & Repo + & Id + ; + export type ReposCreateDeploymentStatusParams = + & Owner + & Repo + & Id + & { + state?: string; + target_url?: string; + log_url?: string; + description?: string; + environment_url?: string; + auto_inactive?: boolean; + }; + export type ReposGetDownloadsParams = + & Owner + & Repo + & Page + & PerPage + ; + export type ReposGetDownloadParams = + & Owner + & Repo + & Id + ; + export type ReposDeleteDownloadParams = + & Owner + & Repo + & Id + ; + export type ReposGetForksParams = + & Owner + & Repo + & Page + & PerPage + & { + sort?: "newest"|"oldest"|"stargazers"; + }; + export type ReposForkParams = + & Owner + & Repo + & { + organization?: string; + }; + export type ReposGetInvitesParams = + & RepoId + ; + export type ReposDeleteInviteParams = + & RepoId + & InvitationId + ; + export type ReposUpdateInviteParams = + & RepoId + & InvitationId + & { + permission?: "read"|"write"|"admin"; + }; + export type ReposMergeParams = + & Owner + & Repo + & Base + & Head + & { + commit_message?: string; + }; + export type ReposGetPagesParams = + & Owner + & Repo + & Page + & PerPage + ; + export type ReposRequestPageBuildParams = + & Owner + & Repo + ; + export type ReposGetPagesBuildsParams = + & Owner + & Repo + & Page + & PerPage + ; + export type ReposGetLatestPagesBuildParams = + & Owner + & Repo + ; + export type ReposGetPagesBuildParams = + & Owner + & Repo + & Id + ; + export type ReposGetReleasesParams = + & Owner + & Repo + & Page + & PerPage + ; + export type ReposGetReleaseParams = + & Owner + & Repo + & Id + ; + export type ReposGetLatestReleaseParams = + & Owner + & Repo + ; + export type ReposGetReleaseByTagParams = + & Owner + & Repo + & { + tag: string; + }; + export type ReposCreateReleaseParams = + & Owner + & Repo + & { + tag_name: string; + target_commitish?: string; + name?: string; + body?: string; + draft?: boolean; + prerelease?: boolean; + }; + export type ReposEditReleaseParams = + & Owner + & Repo + & Id + & { + tag_name: string; + target_commitish?: string; + name?: string; + body?: string; + draft?: boolean; + prerelease?: boolean; + }; + export type ReposDeleteReleaseParams = + & Owner + & Repo + & Id + ; + export type ReposGetAssetsParams = + & Owner + & Repo + & Id + ; + export type ReposGetAssetParams = + & Owner + & Repo + & Id + ; + export type ReposUploadAssetParams = + & Owner + & Repo + & Id + & { + filePath: string; + name: string; + label?: string; + }; + export type ReposEditAssetParams = + & Owner + & Repo + & Id + & Name + & { + label?: string; + }; + export type ReposDeleteAssetParams = + & Owner + & Repo + & Id + ; + export type ReposGetStatsContributorsParams = + & Owner + & Repo + ; + export type ReposGetStatsCommitActivityParams = + & Owner + & Repo + ; + export type ReposGetStatsCodeFrequencyParams = + & Owner + & Repo + ; + export type ReposGetStatsParticipationParams = + & Owner + & Repo + ; + export type ReposGetStatsPunchCardParams = + & Owner + & Repo + ; + export type ReposCreateStatusParams = + & Owner + & Repo + & Sha + & { + state: "pending"|"success"|"error"|"failure"; + target_url?: string; + description?: string; + context?: string; + }; + export type ReposGetStatusesParams = + & Owner + & Repo + & Page + & PerPage + & { + ref: string; + }; + export type ReposGetCombinedStatusParams = + & Owner + & Repo + & Page + & PerPage + & { + ref: string; + }; + export type ReposGetReferrersParams = + & Owner + & Repo + & Page + & PerPage + ; + export type ReposGetPathsParams = + & Owner + & Repo + & Page + & PerPage + ; + export type ReposGetViewsParams = + & Owner + & Repo + & Page + & PerPage + ; + export type ReposGetClonesParams = + & Owner + & Repo + & Page + & PerPage + ; + export type ReposGetHooksParams = + & Owner + & Repo + & Page + & PerPage + ; + export type ReposGetHookParams = + & Owner + & Repo + & Id + ; + export type ReposCreateHookParams = + & Owner + & Repo + & Name + & { + config: string; + events?: string[]; + active?: boolean; + }; + export type ReposEditHookParams = + & Owner + & Repo + & Id + & Name + & { + config: string; + events?: string[]; + add_events?: string[]; + remove_events?: string[]; + active?: boolean; + }; + export type ReposTestHookParams = + & Owner + & Repo + & Id + ; + export type ReposPingHookParams = + & Owner + & Repo + & Id + ; + export type ReposDeleteHookParams = + & Owner + & Repo + & Id + ; + export type SearchReposParams = + & Q + & Order + & Page + & PerPage + & { + sort?: "stars"|"forks"|"updated"; + }; + export type SearchCodeParams = + & Q + & Order + & Page + & PerPage + & { + sort?: "indexed"; + }; + export type SearchCommitsParams = + & Q + & Order + & Page + & PerPage + & { + sort?: "author-date"|"committer-date"; + }; + export type SearchIssuesParams = + & Q + & Order + & Page + & PerPage + & { + sort?: "comments"|"created"|"updated"; + }; + export type SearchUsersParams = + & Q + & Order + & Page + & PerPage + & { + sort?: "followers"|"repositories"|"joined"; + }; + export type SearchEmailParams = + & { + email: string; + }; + export type UsersGetForUserParams = + & Username + ; + export type UsersGetByIdParams = + & Id + ; + export type UsersUpdateParams = + & { + name?: string; + email?: string; + blog?: string; + company?: string; + location?: string; + hireable?: boolean; + bio?: string; + }; + export type UsersGetAllParams = + & { + since?: number; + }; + export type UsersGetOrgsParams = + & Page + & PerPage + ; + export type UsersGetOrgMembershipsParams = + & { + state?: "active"|"pending"; + }; + export type UsersGetOrgMembershipParams = + & Org + ; + export type UsersEditOrgMembershipParams = + & Org + & { + state: "active"; + }; + export type UsersGetTeamsParams = + & Page + & PerPage + ; + export type UsersGetEmailsParams = + & Page + & PerPage + ; + export type UsersAddEmailsParams = + & { + emails: string[]; + }; + export type UsersDeleteEmailsParams = + & { + emails: string[]; + }; + export type UsersGetFollowersForUserParams = + & Username + & Page + & PerPage + ; + export type UsersGetFollowersParams = + & Page + & PerPage + ; + export type UsersGetFollowingForUserParams = + & Username + & Page + & PerPage + ; + export type UsersGetFollowingParams = + & Page + & PerPage + ; + export type UsersCheckFollowingParams = + & Username + ; + export type UsersCheckIfOneFollowersOtherParams = + & Username + & { + target_user: string; + }; + export type UsersFollowUserParams = + & Username + ; + export type UsersUnfollowUserParams = + & Username + ; + export type UsersGetKeysForUserParams = + & Username + & Page + & PerPage + ; + export type UsersGetKeysParams = + & Page + & PerPage + ; + export type UsersGetKeyParams = + & Id + ; + export type UsersCreateKeyParams = + & Title + & Key + ; + export type UsersDeleteKeyParams = + & Id + ; + export type UsersGetGpgKeysParams = + & Page + & PerPage + ; + export type UsersGetGpgKeyParams = + & Id + ; + export type UsersCreateGpgKeyParams = + & { + armored_public_key: string; + }; + export type UsersDeleteGpgKeyParams = + & Id + ; + export type UsersPromoteParams = + & Username + ; + export type UsersDemoteParams = + & Username + ; + export type UsersSuspendParams = + & Username + ; + export type UsersUnsuspendParams = + & Username + ; + export type UsersAcceptRepoInviteParams = + & InvitationId + ; + export type UsersDeclineRepoInviteParams = + & InvitationId + ; + export type EnterpriseStatsParams = + & { + type: "issues"|"hooks"|"milestones"|"orgs"|"comments"|"pages"|"users"|"gists"|"pulls"|"repos"|"all"; + }; + export type EnterpriseUpdateLdapForUserParams = + & Username + & { + ldap_dn: string; + }; + export type EnterpriseSyncLdapForUserParams = + & Username + ; + export type EnterpriseUpdateLdapForTeamParams = + & { + team_id: number; + ldap_dn: string; + }; + export type EnterpriseSyncLdapForTeamParams = + & { + team_id: number; + }; + export type EnterpriseGetPreReceiveEnvironmentParams = + & Id + ; + export type EnterpriseCreatePreReceiveEnvironmentParams = + & { + name: string; + image_url: string; + }; + export type EnterpriseEditPreReceiveEnvironmentParams = + & Id + & { + name: string; + image_url: string; + }; + export type EnterpriseDeletePreReceiveEnvironmentParams = + & Id + ; + export type EnterpriseGetPreReceiveEnvironmentDownloadStatusParams = + & Id + ; + export type EnterpriseTriggerPreReceiveEnvironmentDownloadParams = + & Id + ; + export type EnterpriseGetPreReceiveHookParams = + & Id + ; + export type EnterpriseCreatePreReceiveHookParams = + & { + name: string; + script: string; + script_repository: string; + environment: string; + enforcement?: string; + allow_downstream_configuration?: boolean; + }; + export type EnterpriseEditPreReceiveHookParams = + & Id + & { + hook: string; + }; + export type EnterpriseDeletePreReceiveHookParams = + & Id + ; + export type EnterpriseQueueIndexingJobParams = + & { + target: string; + }; + export type EnterpriseCreateOrgParams = + & { + login: string; + admin: string; + profile_name?: string; + }; +} + +declare class Github { + constructor(options?: Github.Options); + authenticate(auth: Github.Auth): void; + hasNextPage(link: Github.Link): string | undefined; + hasPreviousPage(link: Github.Link): string | undefined; + hasLastPage(link: Github.Link): string | undefined; + hasFirstPage(link: Github.Link): string | undefined; + + getNextPage(link: Github.Link, callback?: Github.Callback): Promise; + getNextPage(link: Github.Link, headers?: {[header: string]: any}, callback?: Github.Callback): Promise; + + getPreviousPage(link: Github.Link, callback?: Github.Callback): Promise; + getPreviousPage(link: Github.Link, headers?: {[header: string]: any}, callback?: Github.Callback): Promise; + + getLastPage(link: Github.Link, callback?: Github.Callback): Promise; + getLastPage(link: Github.Link, headers?: {[header: string]: any}, callback?: Github.Callback): Promise; + + getFirstPage(link: Github.Link, callback?: Github.Callback): Promise; + getFirstPage(link: Github.Link, headers?: {[header: string]: any}, callback?: Github.Callback): Promise; + + authorization: { + getGrants(params: Github.AuthorizationGetGrantsParams, callback?: Github.Callback): Promise; + getGrant(params: Github.AuthorizationGetGrantParams, callback?: Github.Callback): Promise; + deleteGrant(params: Github.AuthorizationDeleteGrantParams, callback?: Github.Callback): Promise; + getAll(params: Github.AuthorizationGetAllParams, callback?: Github.Callback): Promise; + get(params: Github.AuthorizationGetParams, callback?: Github.Callback): Promise; + create(params: Github.AuthorizationCreateParams, callback?: Github.Callback): Promise; + getOrCreateAuthorizationForApp(params: Github.AuthorizationGetOrCreateAuthorizationForAppParams, callback?: Github.Callback): Promise; + getOrCreateAuthorizationForAppAndFingerprint(params: Github.AuthorizationGetOrCreateAuthorizationForAppAndFingerprintParams, callback?: Github.Callback): Promise; + update(params: Github.AuthorizationUpdateParams, callback?: Github.Callback): Promise; + delete(params: Github.AuthorizationDeleteParams, callback?: Github.Callback): Promise; + check(params: Github.AuthorizationCheckParams, callback?: Github.Callback): Promise; + reset(params: Github.AuthorizationResetParams, callback?: Github.Callback): Promise; + revoke(params: Github.AuthorizationRevokeParams, callback?: Github.Callback): Promise; + }; + activity: { + getEvents(params: Github.ActivityGetEventsParams, callback?: Github.Callback): Promise; + getEventsForRepo(params: Github.ActivityGetEventsForRepoParams, callback?: Github.Callback): Promise; + getEventsForRepoIssues(params: Github.ActivityGetEventsForRepoIssuesParams, callback?: Github.Callback): Promise; + getEventsForRepoNetwork(params: Github.ActivityGetEventsForRepoNetworkParams, callback?: Github.Callback): Promise; + getEventsForOrg(params: Github.ActivityGetEventsForOrgParams, callback?: Github.Callback): Promise; + getEventsReceived(params: Github.ActivityGetEventsReceivedParams, callback?: Github.Callback): Promise; + getEventsReceivedPublic(params: Github.ActivityGetEventsReceivedPublicParams, callback?: Github.Callback): Promise; + getEventsForUser(params: Github.ActivityGetEventsForUserParams, callback?: Github.Callback): Promise; + getEventsForUserPublic(params: Github.ActivityGetEventsForUserPublicParams, callback?: Github.Callback): Promise; + getEventsForUserOrg(params: Github.ActivityGetEventsForUserOrgParams, callback?: Github.Callback): Promise; + getFeeds(callback?: Github.Callback): Promise; + getNotifications(params: Github.ActivityGetNotificationsParams, callback?: Github.Callback): Promise; + getNotificationsForUser(params: Github.ActivityGetNotificationsForUserParams, callback?: Github.Callback): Promise; + markNotificationsAsRead(params: Github.ActivityMarkNotificationsAsReadParams, callback?: Github.Callback): Promise; + markNotificationsAsReadForRepo(params: Github.ActivityMarkNotificationsAsReadForRepoParams, callback?: Github.Callback): Promise; + getNotificationThread(params: Github.ActivityGetNotificationThreadParams, callback?: Github.Callback): Promise; + markNotificationThreadAsRead(params: Github.ActivityMarkNotificationThreadAsReadParams, callback?: Github.Callback): Promise; + checkNotificationThreadSubscription(params: Github.ActivityCheckNotificationThreadSubscriptionParams, callback?: Github.Callback): Promise; + setNotificationThreadSubscription(params: Github.ActivitySetNotificationThreadSubscriptionParams, callback?: Github.Callback): Promise; + deleteNotificationThreadSubscription(params: Github.ActivityDeleteNotificationThreadSubscriptionParams, callback?: Github.Callback): Promise; + getStargazersForRepo(params: Github.ActivityGetStargazersForRepoParams, callback?: Github.Callback): Promise; + getStarredReposForUser(params: Github.ActivityGetStarredReposForUserParams, callback?: Github.Callback): Promise; + getStarredRepos(params: Github.ActivityGetStarredReposParams, callback?: Github.Callback): Promise; + checkStarringRepo(params: Github.ActivityCheckStarringRepoParams, callback?: Github.Callback): Promise; + starRepo(params: Github.ActivityStarRepoParams, callback?: Github.Callback): Promise; + unstarRepo(params: Github.ActivityUnstarRepoParams, callback?: Github.Callback): Promise; + getWatchersForRepo(params: Github.ActivityGetWatchersForRepoParams, callback?: Github.Callback): Promise; + getWatchedReposForUser(params: Github.ActivityGetWatchedReposForUserParams, callback?: Github.Callback): Promise; + getWatchedRepos(params: Github.ActivityGetWatchedReposParams, callback?: Github.Callback): Promise; + getRepoSubscription(params: Github.ActivityGetRepoSubscriptionParams, callback?: Github.Callback): Promise; + setRepoSubscription(params: Github.ActivitySetRepoSubscriptionParams, callback?: Github.Callback): Promise; + unwatchRepo(params: Github.ActivityUnwatchRepoParams, callback?: Github.Callback): Promise; + }; + gists: { + getForUser(params: Github.GistsGetForUserParams, callback?: Github.Callback): Promise; + getAll(params: Github.GistsGetAllParams, callback?: Github.Callback): Promise; + getPublic(params: Github.GistsGetPublicParams, callback?: Github.Callback): Promise; + getStarred(params: Github.GistsGetStarredParams, callback?: Github.Callback): Promise; + get(params: Github.GistsGetParams, callback?: Github.Callback): Promise; + getRevision(params: Github.GistsGetRevisionParams, callback?: Github.Callback): Promise; + create(params: Github.GistsCreateParams, callback?: Github.Callback): Promise; + edit(params: Github.GistsEditParams, callback?: Github.Callback): Promise; + getCommits(params: Github.GistsGetCommitsParams, callback?: Github.Callback): Promise; + star(params: Github.GistsStarParams, callback?: Github.Callback): Promise; + unstar(params: Github.GistsUnstarParams, callback?: Github.Callback): Promise; + checkStar(params: Github.GistsCheckStarParams, callback?: Github.Callback): Promise; + fork(params: Github.GistsForkParams, callback?: Github.Callback): Promise; + getForks(params: Github.GistsGetForksParams, callback?: Github.Callback): Promise; + delete(params: Github.GistsDeleteParams, callback?: Github.Callback): Promise; + getComments(params: Github.GistsGetCommentsParams, callback?: Github.Callback): Promise; + getComment(params: Github.GistsGetCommentParams, callback?: Github.Callback): Promise; + createComment(params: Github.GistsCreateCommentParams, callback?: Github.Callback): Promise; + editComment(params: Github.GistsEditCommentParams, callback?: Github.Callback): Promise; + deleteComment(params: Github.GistsDeleteCommentParams, callback?: Github.Callback): Promise; + }; + gitdata: { + getBlob(params: Github.GitdataGetBlobParams, callback?: Github.Callback): Promise; + createBlob(params: Github.GitdataCreateBlobParams, callback?: Github.Callback): Promise; + getCommit(params: Github.GitdataGetCommitParams, callback?: Github.Callback): Promise; + createCommit(params: Github.GitdataCreateCommitParams, callback?: Github.Callback): Promise; + getCommitSignatureVerification(params: Github.GitdataGetCommitSignatureVerificationParams, callback?: Github.Callback): Promise; + getReference(params: Github.GitdataGetReferenceParams, callback?: Github.Callback): Promise; + getReferences(params: Github.GitdataGetReferencesParams, callback?: Github.Callback): Promise; + getTags(params: Github.GitdataGetTagsParams, callback?: Github.Callback): Promise; + createReference(params: Github.GitdataCreateReferenceParams, callback?: Github.Callback): Promise; + updateReference(params: Github.GitdataUpdateReferenceParams, callback?: Github.Callback): Promise; + deleteReference(params: Github.GitdataDeleteReferenceParams, callback?: Github.Callback): Promise; + getTag(params: Github.GitdataGetTagParams, callback?: Github.Callback): Promise; + createTag(params: Github.GitdataCreateTagParams, callback?: Github.Callback): Promise; + getTagSignatureVerification(params: Github.GitdataGetTagSignatureVerificationParams, callback?: Github.Callback): Promise; + getTree(params: Github.GitdataGetTreeParams, callback?: Github.Callback): Promise; + createTree(params: Github.GitdataCreateTreeParams, callback?: Github.Callback): Promise; + }; + integrations: { + getInstallations(params: Github.IntegrationsGetInstallationsParams, callback?: Github.Callback): Promise; + createInstallationToken(params: Github.IntegrationsCreateInstallationTokenParams, callback?: Github.Callback): Promise; + getUserIdentity(params: Github.IntegrationsGetUserIdentityParams, callback?: Github.Callback): Promise; + getInstallationRepositories(params: Github.IntegrationsGetInstallationRepositoriesParams, callback?: Github.Callback): Promise; + addRepoToInstallation(params: Github.IntegrationsAddRepoToInstallationParams, callback?: Github.Callback): Promise; + removeRepoFromInstallation(params: Github.IntegrationsRemoveRepoFromInstallationParams, callback?: Github.Callback): Promise; + }; + issues: { + getAll(params: Github.IssuesGetAllParams, callback?: Github.Callback): Promise; + getForUser(params: Github.IssuesGetForUserParams, callback?: Github.Callback): Promise; + getForOrg(params: Github.IssuesGetForOrgParams, callback?: Github.Callback): Promise; + getForRepo(params: Github.IssuesGetForRepoParams, callback?: Github.Callback): Promise; + get(params: Github.IssuesGetParams, callback?: Github.Callback): Promise; + create(params: Github.IssuesCreateParams, callback?: Github.Callback): Promise; + edit(params: Github.IssuesEditParams, callback?: Github.Callback): Promise; + lock(params: Github.IssuesLockParams, callback?: Github.Callback): Promise; + unlock(params: Github.IssuesUnlockParams, callback?: Github.Callback): Promise; + getAssignees(params: Github.IssuesGetAssigneesParams, callback?: Github.Callback): Promise; + checkAssignee(params: Github.IssuesCheckAssigneeParams, callback?: Github.Callback): Promise; + addAssigneesToIssue(params: Github.IssuesAddAssigneesToIssueParams, callback?: Github.Callback): Promise; + removeAssigneesFromIssue(params: Github.IssuesRemoveAssigneesFromIssueParams, callback?: Github.Callback): Promise; + getComments(params: Github.IssuesGetCommentsParams, callback?: Github.Callback): Promise; + getCommentsForRepo(params: Github.IssuesGetCommentsForRepoParams, callback?: Github.Callback): Promise; + getComment(params: Github.IssuesGetCommentParams, callback?: Github.Callback): Promise; + createComment(params: Github.IssuesCreateCommentParams, callback?: Github.Callback): Promise; + editComment(params: Github.IssuesEditCommentParams, callback?: Github.Callback): Promise; + deleteComment(params: Github.IssuesDeleteCommentParams, callback?: Github.Callback): Promise; + getEvents(params: Github.IssuesGetEventsParams, callback?: Github.Callback): Promise; + getEventsForRepo(params: Github.IssuesGetEventsForRepoParams, callback?: Github.Callback): Promise; + getEvent(params: Github.IssuesGetEventParams, callback?: Github.Callback): Promise; + getLabels(params: Github.IssuesGetLabelsParams, callback?: Github.Callback): Promise; + getLabel(params: Github.IssuesGetLabelParams, callback?: Github.Callback): Promise; + createLabel(params: Github.IssuesCreateLabelParams, callback?: Github.Callback): Promise; + updateLabel(params: Github.IssuesUpdateLabelParams, callback?: Github.Callback): Promise; + deleteLabel(params: Github.IssuesDeleteLabelParams, callback?: Github.Callback): Promise; + getIssueLabels(params: Github.IssuesGetIssueLabelsParams, callback?: Github.Callback): Promise; + addLabels(params: Github.IssuesAddLabelsParams, callback?: Github.Callback): Promise; + removeLabel(params: Github.IssuesRemoveLabelParams, callback?: Github.Callback): Promise; + replaceAllLabels(params: Github.IssuesReplaceAllLabelsParams, callback?: Github.Callback): Promise; + removeAllLabels(params: Github.IssuesRemoveAllLabelsParams, callback?: Github.Callback): Promise; + getMilestoneLabels(params: Github.IssuesGetMilestoneLabelsParams, callback?: Github.Callback): Promise; + getMilestones(params: Github.IssuesGetMilestonesParams, callback?: Github.Callback): Promise; + getMilestone(params: Github.IssuesGetMilestoneParams, callback?: Github.Callback): Promise; + createMilestone(params: Github.IssuesCreateMilestoneParams, callback?: Github.Callback): Promise; + updateMilestone(params: Github.IssuesUpdateMilestoneParams, callback?: Github.Callback): Promise; + deleteMilestone(params: Github.IssuesDeleteMilestoneParams, callback?: Github.Callback): Promise; + getEventsTimeline(params: Github.IssuesGetEventsTimelineParams, callback?: Github.Callback): Promise; + }; + migrations: { + startMigration(params: Github.MigrationsStartMigrationParams, callback?: Github.Callback): Promise; + getMigrations(params: Github.MigrationsGetMigrationsParams, callback?: Github.Callback): Promise; + getMigrationStatus(params: Github.MigrationsGetMigrationStatusParams, callback?: Github.Callback): Promise; + getMigrationArchiveLink(params: Github.MigrationsGetMigrationArchiveLinkParams, callback?: Github.Callback): Promise; + deleteMigrationArchive(params: Github.MigrationsDeleteMigrationArchiveParams, callback?: Github.Callback): Promise; + unlockRepoLockedForMigration(params: Github.MigrationsUnlockRepoLockedForMigrationParams, callback?: Github.Callback): Promise; + startImport(params: Github.MigrationsStartImportParams, callback?: Github.Callback): Promise; + getImportProgress(params: Github.MigrationsGetImportProgressParams, callback?: Github.Callback): Promise; + updateImport(params: Github.MigrationsUpdateImportParams, callback?: Github.Callback): Promise; + getImportCommitAuthors(params: Github.MigrationsGetImportCommitAuthorsParams, callback?: Github.Callback): Promise; + mapImportCommitAuthor(params: Github.MigrationsMapImportCommitAuthorParams, callback?: Github.Callback): Promise; + setImportLfsPreference(params: Github.MigrationsSetImportLfsPreferenceParams, callback?: Github.Callback): Promise; + getLargeImportFiles(params: Github.MigrationsGetLargeImportFilesParams, callback?: Github.Callback): Promise; + cancelImport(params: Github.MigrationsCancelImportParams, callback?: Github.Callback): Promise; + }; + misc: { + getEmojis(callback?: Github.Callback): Promise; + getGitignoreTemplates(callback?: Github.Callback): Promise; + getGitignoreTemplate(params: Github.MiscGetGitignoreTemplateParams, callback?: Github.Callback): Promise; + getLicenses(callback?: Github.Callback): Promise; + getLicense(params: Github.MiscGetLicenseParams, callback?: Github.Callback): Promise; + getRepoLicense(params: Github.MiscGetRepoLicenseParams, callback?: Github.Callback): Promise; + renderMarkdown(params: Github.MiscRenderMarkdownParams, callback?: Github.Callback): Promise; + renderMarkdownRaw(params: Github.MiscRenderMarkdownRawParams, callback?: Github.Callback): Promise; + getMeta(callback?: Github.Callback): Promise; + getRateLimit(callback?: Github.Callback): Promise; + }; + orgs: { + getAll(params: Github.OrgsGetAllParams, callback?: Github.Callback): Promise; + getForUser(params: Github.OrgsGetForUserParams, callback?: Github.Callback): Promise; + get(params: Github.OrgsGetParams, callback?: Github.Callback): Promise; + update(params: Github.OrgsUpdateParams, callback?: Github.Callback): Promise; + getMembers(params: Github.OrgsGetMembersParams, callback?: Github.Callback): Promise; + checkMembership(params: Github.OrgsCheckMembershipParams, callback?: Github.Callback): Promise; + removeMember(params: Github.OrgsRemoveMemberParams, callback?: Github.Callback): Promise; + getPublicMembers(params: Github.OrgsGetPublicMembersParams, callback?: Github.Callback): Promise; + checkPublicMembership(params: Github.OrgsCheckPublicMembershipParams, callback?: Github.Callback): Promise; + publicizeMembership(params: Github.OrgsPublicizeMembershipParams, callback?: Github.Callback): Promise; + concealMembership(params: Github.OrgsConcealMembershipParams, callback?: Github.Callback): Promise; + getOrgMembership(params: Github.OrgsGetOrgMembershipParams, callback?: Github.Callback): Promise; + addOrgMembership(params: Github.OrgsAddOrgMembershipParams, callback?: Github.Callback): Promise; + removeOrgMembership(params: Github.OrgsRemoveOrgMembershipParams, callback?: Github.Callback): Promise; + getPendingOrgInvites(params: Github.OrgsGetPendingOrgInvitesParams, callback?: Github.Callback): Promise; + getOutsideCollaborators(params: Github.OrgsGetOutsideCollaboratorsParams, callback?: Github.Callback): Promise; + removeOutsideCollaborator(params: Github.OrgsRemoveOutsideCollaboratorParams, callback?: Github.Callback): Promise; + convertMemberToOutsideCollaborator(params: Github.OrgsConvertMemberToOutsideCollaboratorParams, callback?: Github.Callback): Promise; + getTeams(params: Github.OrgsGetTeamsParams, callback?: Github.Callback): Promise; + getTeam(params: Github.OrgsGetTeamParams, callback?: Github.Callback): Promise; + createTeam(params: Github.OrgsCreateTeamParams, callback?: Github.Callback): Promise; + editTeam(params: Github.OrgsEditTeamParams, callback?: Github.Callback): Promise; + deleteTeam(params: Github.OrgsDeleteTeamParams, callback?: Github.Callback): Promise; + getTeamMembers(params: Github.OrgsGetTeamMembersParams, callback?: Github.Callback): Promise; + getTeamMembership(params: Github.OrgsGetTeamMembershipParams, callback?: Github.Callback): Promise; + addTeamMembership(params: Github.OrgsAddTeamMembershipParams, callback?: Github.Callback): Promise; + removeTeamMembership(params: Github.OrgsRemoveTeamMembershipParams, callback?: Github.Callback): Promise; + getTeamRepos(params: Github.OrgsGetTeamReposParams, callback?: Github.Callback): Promise; + getPendingTeamInvites(params: Github.OrgsGetPendingTeamInvitesParams, callback?: Github.Callback): Promise; + checkTeamRepo(params: Github.OrgsCheckTeamRepoParams, callback?: Github.Callback): Promise; + addTeamRepo(params: Github.OrgsAddTeamRepoParams, callback?: Github.Callback): Promise; + deleteTeamRepo(params: Github.OrgsDeleteTeamRepoParams, callback?: Github.Callback): Promise; + getHooks(params: Github.OrgsGetHooksParams, callback?: Github.Callback): Promise; + getHook(params: Github.OrgsGetHookParams, callback?: Github.Callback): Promise; + createHook(params: Github.OrgsCreateHookParams, callback?: Github.Callback): Promise; + editHook(params: Github.OrgsEditHookParams, callback?: Github.Callback): Promise; + pingHook(params: Github.OrgsPingHookParams, callback?: Github.Callback): Promise; + deleteHook(params: Github.OrgsDeleteHookParams, callback?: Github.Callback): Promise; + }; + projects: { + getRepoProjects(params: Github.ProjectsGetRepoProjectsParams, callback?: Github.Callback): Promise; + getOrgProjects(params: Github.ProjectsGetOrgProjectsParams, callback?: Github.Callback): Promise; + getProject(params: Github.ProjectsGetProjectParams, callback?: Github.Callback): Promise; + createRepoProject(params: Github.ProjectsCreateRepoProjectParams, callback?: Github.Callback): Promise; + createOrgProject(params: Github.ProjectsCreateOrgProjectParams, callback?: Github.Callback): Promise; + updateProject(params: Github.ProjectsUpdateProjectParams, callback?: Github.Callback): Promise; + deleteProject(params: Github.ProjectsDeleteProjectParams, callback?: Github.Callback): Promise; + getProjectCards(params: Github.ProjectsGetProjectCardsParams, callback?: Github.Callback): Promise; + getProjectCard(params: Github.ProjectsGetProjectCardParams, callback?: Github.Callback): Promise; + createProjectCard(params: Github.ProjectsCreateProjectCardParams, callback?: Github.Callback): Promise; + updateProjectCard(params: Github.ProjectsUpdateProjectCardParams, callback?: Github.Callback): Promise; + deleteProjectCard(params: Github.ProjectsDeleteProjectCardParams, callback?: Github.Callback): Promise; + moveProjectCard(params: Github.ProjectsMoveProjectCardParams, callback?: Github.Callback): Promise; + getProjectColumns(params: Github.ProjectsGetProjectColumnsParams, callback?: Github.Callback): Promise; + getProjectColumn(params: Github.ProjectsGetProjectColumnParams, callback?: Github.Callback): Promise; + createProjectColumn(params: Github.ProjectsCreateProjectColumnParams, callback?: Github.Callback): Promise; + updateProjectColumn(params: Github.ProjectsUpdateProjectColumnParams, callback?: Github.Callback): Promise; + deleteProjectColumn(params: Github.ProjectsDeleteProjectColumnParams, callback?: Github.Callback): Promise; + moveProjectColumn(params: Github.ProjectsMoveProjectColumnParams, callback?: Github.Callback): Promise; + }; + pullRequests: { + getAll(params: Github.PullRequestsGetAllParams, callback?: Github.Callback): Promise; + get(params: Github.PullRequestsGetParams, callback?: Github.Callback): Promise; + create(params: Github.PullRequestsCreateParams, callback?: Github.Callback): Promise; + createFromIssue(params: Github.PullRequestsCreateFromIssueParams, callback?: Github.Callback): Promise; + update(params: Github.PullRequestsUpdateParams, callback?: Github.Callback): Promise; + getCommits(params: Github.PullRequestsGetCommitsParams, callback?: Github.Callback): Promise; + getFiles(params: Github.PullRequestsGetFilesParams, callback?: Github.Callback): Promise; + checkMerged(params: Github.PullRequestsCheckMergedParams, callback?: Github.Callback): Promise; + merge(params: Github.PullRequestsMergeParams, callback?: Github.Callback): Promise; + getReviews(params: Github.PullRequestsGetReviewsParams, callback?: Github.Callback): Promise; + getReview(params: Github.PullRequestsGetReviewParams, callback?: Github.Callback): Promise; + getReviewComments(params: Github.PullRequestsGetReviewCommentsParams, callback?: Github.Callback): Promise; + createReview(params: Github.PullRequestsCreateReviewParams, callback?: Github.Callback): Promise; + submitReview(params: Github.PullRequestsSubmitReviewParams, callback?: Github.Callback): Promise; + dismissReview(params: Github.PullRequestsDismissReviewParams, callback?: Github.Callback): Promise; + getComments(params: Github.PullRequestsGetCommentsParams, callback?: Github.Callback): Promise; + getCommentsForRepo(params: Github.PullRequestsGetCommentsForRepoParams, callback?: Github.Callback): Promise; + getComment(params: Github.PullRequestsGetCommentParams, callback?: Github.Callback): Promise; + createComment(params: Github.PullRequestsCreateCommentParams, callback?: Github.Callback): Promise; + createCommentReply(params: Github.PullRequestsCreateCommentReplyParams, callback?: Github.Callback): Promise; + editComment(params: Github.PullRequestsEditCommentParams, callback?: Github.Callback): Promise; + deleteComment(params: Github.PullRequestsDeleteCommentParams, callback?: Github.Callback): Promise; + getReviewRequests(params: Github.PullRequestsGetReviewRequestsParams, callback?: Github.Callback): Promise; + createReviewRequest(params: Github.PullRequestsCreateReviewRequestParams, callback?: Github.Callback): Promise; + deleteReviewRequest(params: Github.PullRequestsDeleteReviewRequestParams, callback?: Github.Callback): Promise; + }; + reactions: { + getForCommitComment(params: Github.ReactionsGetForCommitCommentParams, callback?: Github.Callback): Promise; + createForCommitComment(params: Github.ReactionsCreateForCommitCommentParams, callback?: Github.Callback): Promise; + getForIssue(params: Github.ReactionsGetForIssueParams, callback?: Github.Callback): Promise; + createForIssue(params: Github.ReactionsCreateForIssueParams, callback?: Github.Callback): Promise; + getForIssueComment(params: Github.ReactionsGetForIssueCommentParams, callback?: Github.Callback): Promise; + createForIssueComment(params: Github.ReactionsCreateForIssueCommentParams, callback?: Github.Callback): Promise; + getForPullRequestReviewComment(params: Github.ReactionsGetForPullRequestReviewCommentParams, callback?: Github.Callback): Promise; + createForPullRequestReviewComment(params: Github.ReactionsCreateForPullRequestReviewCommentParams, callback?: Github.Callback): Promise; + delete(params: Github.ReactionsDeleteParams, callback?: Github.Callback): Promise; + }; + repos: { + getAll(params: Github.ReposGetAllParams, callback?: Github.Callback): Promise; + getForUser(params: Github.ReposGetForUserParams, callback?: Github.Callback): Promise; + getForOrg(params: Github.ReposGetForOrgParams, callback?: Github.Callback): Promise; + getPublic(params: Github.ReposGetPublicParams, callback?: Github.Callback): Promise; + getById(params: Github.ReposGetByIdParams, callback?: Github.Callback): Promise; + create(params: Github.ReposCreateParams, callback?: Github.Callback): Promise; + get(params: Github.ReposGetParams, callback?: Github.Callback): Promise; + createForOrg(params: Github.ReposCreateForOrgParams, callback?: Github.Callback): Promise; + edit(params: Github.ReposEditParams, callback?: Github.Callback): Promise; + getContributors(params: Github.ReposGetContributorsParams, callback?: Github.Callback): Promise; + getLanguages(params: Github.ReposGetLanguagesParams, callback?: Github.Callback): Promise; + getTeams(params: Github.ReposGetTeamsParams, callback?: Github.Callback): Promise; + getTags(params: Github.ReposGetTagsParams, callback?: Github.Callback): Promise; + delete(params: Github.ReposDeleteParams, callback?: Github.Callback): Promise; + getBranches(params: Github.ReposGetBranchesParams, callback?: Github.Callback): Promise; + getBranch(params: Github.ReposGetBranchParams, callback?: Github.Callback): Promise; + getBranchProtection(params: Github.ReposGetBranchProtectionParams, callback?: Github.Callback): Promise; + updateBranchProtection(params: Github.ReposUpdateBranchProtectionParams, callback?: Github.Callback): Promise; + removeBranchProtection(params: Github.ReposRemoveBranchProtectionParams, callback?: Github.Callback): Promise; + getProtectedBranchRequiredStatusChecks(params: Github.ReposGetProtectedBranchRequiredStatusChecksParams, callback?: Github.Callback): Promise; + updateProtectedBranchRequiredStatusChecks(params: Github.ReposUpdateProtectedBranchRequiredStatusChecksParams, callback?: Github.Callback): Promise; + removeProtectedBranchRequiredStatusChecks(params: Github.ReposRemoveProtectedBranchRequiredStatusChecksParams, callback?: Github.Callback): Promise; + getProtectedBranchRequiredStatusChecksContexts(params: Github.ReposGetProtectedBranchRequiredStatusChecksContextsParams, callback?: Github.Callback): Promise; + replaceProtectedBranchRequiredStatusChecksContexts(params: Github.ReposReplaceProtectedBranchRequiredStatusChecksContextsParams, callback?: Github.Callback): Promise; + addProtectedBranchRequiredStatusChecksContexts(params: Github.ReposAddProtectedBranchRequiredStatusChecksContextsParams, callback?: Github.Callback): Promise; + removeProtectedBranchRequiredStatusChecksContexts(params: Github.ReposRemoveProtectedBranchRequiredStatusChecksContextsParams, callback?: Github.Callback): Promise; + getProtectedBranchPullRequestReviewEnforcement(params: Github.ReposGetProtectedBranchPullRequestReviewEnforcementParams, callback?: Github.Callback): Promise; + updateProtectedBranchPullRequestReviewEnforcement(params: Github.ReposUpdateProtectedBranchPullRequestReviewEnforcementParams, callback?: Github.Callback): Promise; + removeProtectedBranchPullRequestReviewEnforcement(params: Github.ReposRemoveProtectedBranchPullRequestReviewEnforcementParams, callback?: Github.Callback): Promise; + getProtectedBranchRestrictions(params: Github.ReposGetProtectedBranchRestrictionsParams, callback?: Github.Callback): Promise; + removeProtectedBranchRestrictions(params: Github.ReposRemoveProtectedBranchRestrictionsParams, callback?: Github.Callback): Promise; + getProtectedBranchTeamRestrictions(params: Github.ReposGetProtectedBranchTeamRestrictionsParams, callback?: Github.Callback): Promise; + replaceProtectedBranchTeamRestrictions(params: Github.ReposReplaceProtectedBranchTeamRestrictionsParams, callback?: Github.Callback): Promise; + addProtectedBranchTeamRestrictions(params: Github.ReposAddProtectedBranchTeamRestrictionsParams, callback?: Github.Callback): Promise; + removeProtectedBranchTeamRestrictions(params: Github.ReposRemoveProtectedBranchTeamRestrictionsParams, callback?: Github.Callback): Promise; + getProtectedBranchUserRestrictions(params: Github.ReposGetProtectedBranchUserRestrictionsParams, callback?: Github.Callback): Promise; + replaceProtectedBranchUserRestrictions(params: Github.ReposReplaceProtectedBranchUserRestrictionsParams, callback?: Github.Callback): Promise; + addProtectedBranchUserRestrictions(params: Github.ReposAddProtectedBranchUserRestrictionsParams, callback?: Github.Callback): Promise; + removeProtectedBranchUserRestrictions(params: Github.ReposRemoveProtectedBranchUserRestrictionsParams, callback?: Github.Callback): Promise; + getCollaborators(params: Github.ReposGetCollaboratorsParams, callback?: Github.Callback): Promise; + checkCollaborator(params: Github.ReposCheckCollaboratorParams, callback?: Github.Callback): Promise; + reviewUserPermissionLevel(params: Github.ReposReviewUserPermissionLevelParams, callback?: Github.Callback): Promise; + addCollaborator(params: Github.ReposAddCollaboratorParams, callback?: Github.Callback): Promise; + removeCollaborator(params: Github.ReposRemoveCollaboratorParams, callback?: Github.Callback): Promise; + getAllCommitComments(params: Github.ReposGetAllCommitCommentsParams, callback?: Github.Callback): Promise; + getCommitComments(params: Github.ReposGetCommitCommentsParams, callback?: Github.Callback): Promise; + createCommitComment(params: Github.ReposCreateCommitCommentParams, callback?: Github.Callback): Promise; + getCommitComment(params: Github.ReposGetCommitCommentParams, callback?: Github.Callback): Promise; + updateCommitComment(params: Github.ReposUpdateCommitCommentParams, callback?: Github.Callback): Promise; + deleteCommitComment(params: Github.ReposDeleteCommitCommentParams, callback?: Github.Callback): Promise; + getCommunityHealthMetrics(params: Github.ReposGetCommunityHealthMetricsParams, callback?: Github.Callback): Promise; + getCommits(params: Github.ReposGetCommitsParams, callback?: Github.Callback): Promise; + getCommit(params: Github.ReposGetCommitParams, callback?: Github.Callback): Promise; + getShaOfCommitRef(params: Github.ReposGetShaOfCommitRefParams, callback?: Github.Callback): Promise; + compareCommits(params: Github.ReposCompareCommitsParams, callback?: Github.Callback): Promise; + getReadme(params: Github.ReposGetReadmeParams, callback?: Github.Callback): Promise; + getContent(params: Github.ReposGetContentParams, callback?: Github.Callback): Promise; + createFile(params: Github.ReposCreateFileParams, callback?: Github.Callback): Promise; + updateFile(params: Github.ReposUpdateFileParams, callback?: Github.Callback): Promise; + deleteFile(params: Github.ReposDeleteFileParams, callback?: Github.Callback): Promise; + getArchiveLink(params: Github.ReposGetArchiveLinkParams, callback?: Github.Callback): Promise; + getKeys(params: Github.ReposGetKeysParams, callback?: Github.Callback): Promise; + getKey(params: Github.ReposGetKeyParams, callback?: Github.Callback): Promise; + createKey(params: Github.ReposCreateKeyParams, callback?: Github.Callback): Promise; + deleteKey(params: Github.ReposDeleteKeyParams, callback?: Github.Callback): Promise; + getDeployments(params: Github.ReposGetDeploymentsParams, callback?: Github.Callback): Promise; + createDeployment(params: Github.ReposCreateDeploymentParams, callback?: Github.Callback): Promise; + getDeploymentStatuses(params: Github.ReposGetDeploymentStatusesParams, callback?: Github.Callback): Promise; + createDeploymentStatus(params: Github.ReposCreateDeploymentStatusParams, callback?: Github.Callback): Promise; + getDownloads(params: Github.ReposGetDownloadsParams, callback?: Github.Callback): Promise; + getDownload(params: Github.ReposGetDownloadParams, callback?: Github.Callback): Promise; + deleteDownload(params: Github.ReposDeleteDownloadParams, callback?: Github.Callback): Promise; + getForks(params: Github.ReposGetForksParams, callback?: Github.Callback): Promise; + fork(params: Github.ReposForkParams, callback?: Github.Callback): Promise; + getInvites(params: Github.ReposGetInvitesParams, callback?: Github.Callback): Promise; + deleteInvite(params: Github.ReposDeleteInviteParams, callback?: Github.Callback): Promise; + updateInvite(params: Github.ReposUpdateInviteParams, callback?: Github.Callback): Promise; + merge(params: Github.ReposMergeParams, callback?: Github.Callback): Promise; + getPages(params: Github.ReposGetPagesParams, callback?: Github.Callback): Promise; + requestPageBuild(params: Github.ReposRequestPageBuildParams, callback?: Github.Callback): Promise; + getPagesBuilds(params: Github.ReposGetPagesBuildsParams, callback?: Github.Callback): Promise; + getLatestPagesBuild(params: Github.ReposGetLatestPagesBuildParams, callback?: Github.Callback): Promise; + getPagesBuild(params: Github.ReposGetPagesBuildParams, callback?: Github.Callback): Promise; + getReleases(params: Github.ReposGetReleasesParams, callback?: Github.Callback): Promise; + getRelease(params: Github.ReposGetReleaseParams, callback?: Github.Callback): Promise; + getLatestRelease(params: Github.ReposGetLatestReleaseParams, callback?: Github.Callback): Promise; + getReleaseByTag(params: Github.ReposGetReleaseByTagParams, callback?: Github.Callback): Promise; + createRelease(params: Github.ReposCreateReleaseParams, callback?: Github.Callback): Promise; + editRelease(params: Github.ReposEditReleaseParams, callback?: Github.Callback): Promise; + deleteRelease(params: Github.ReposDeleteReleaseParams, callback?: Github.Callback): Promise; + getAssets(params: Github.ReposGetAssetsParams, callback?: Github.Callback): Promise; + getAsset(params: Github.ReposGetAssetParams, callback?: Github.Callback): Promise; + uploadAsset(params: Github.ReposUploadAssetParams, callback?: Github.Callback): Promise; + editAsset(params: Github.ReposEditAssetParams, callback?: Github.Callback): Promise; + deleteAsset(params: Github.ReposDeleteAssetParams, callback?: Github.Callback): Promise; + getStatsContributors(params: Github.ReposGetStatsContributorsParams, callback?: Github.Callback): Promise; + getStatsCommitActivity(params: Github.ReposGetStatsCommitActivityParams, callback?: Github.Callback): Promise; + getStatsCodeFrequency(params: Github.ReposGetStatsCodeFrequencyParams, callback?: Github.Callback): Promise; + getStatsParticipation(params: Github.ReposGetStatsParticipationParams, callback?: Github.Callback): Promise; + getStatsPunchCard(params: Github.ReposGetStatsPunchCardParams, callback?: Github.Callback): Promise; + createStatus(params: Github.ReposCreateStatusParams, callback?: Github.Callback): Promise; + getStatuses(params: Github.ReposGetStatusesParams, callback?: Github.Callback): Promise; + getCombinedStatus(params: Github.ReposGetCombinedStatusParams, callback?: Github.Callback): Promise; + getReferrers(params: Github.ReposGetReferrersParams, callback?: Github.Callback): Promise; + getPaths(params: Github.ReposGetPathsParams, callback?: Github.Callback): Promise; + getViews(params: Github.ReposGetViewsParams, callback?: Github.Callback): Promise; + getClones(params: Github.ReposGetClonesParams, callback?: Github.Callback): Promise; + getHooks(params: Github.ReposGetHooksParams, callback?: Github.Callback): Promise; + getHook(params: Github.ReposGetHookParams, callback?: Github.Callback): Promise; + createHook(params: Github.ReposCreateHookParams, callback?: Github.Callback): Promise; + editHook(params: Github.ReposEditHookParams, callback?: Github.Callback): Promise; + testHook(params: Github.ReposTestHookParams, callback?: Github.Callback): Promise; + pingHook(params: Github.ReposPingHookParams, callback?: Github.Callback): Promise; + deleteHook(params: Github.ReposDeleteHookParams, callback?: Github.Callback): Promise; + }; + search: { + repos(params: Github.SearchReposParams, callback?: Github.Callback): Promise; + code(params: Github.SearchCodeParams, callback?: Github.Callback): Promise; + commits(params: Github.SearchCommitsParams, callback?: Github.Callback): Promise; + issues(params: Github.SearchIssuesParams, callback?: Github.Callback): Promise; + users(params: Github.SearchUsersParams, callback?: Github.Callback): Promise; + email(params: Github.SearchEmailParams, callback?: Github.Callback): Promise; + }; + users: { + getForUser(params: Github.UsersGetForUserParams, callback?: Github.Callback): Promise; + getById(params: Github.UsersGetByIdParams, callback?: Github.Callback): Promise; + get(callback?: Github.Callback): Promise; + update(params: Github.UsersUpdateParams, callback?: Github.Callback): Promise; + getAll(params: Github.UsersGetAllParams, callback?: Github.Callback): Promise; + getOrgs(params: Github.UsersGetOrgsParams, callback?: Github.Callback): Promise; + getOrgMemberships(params: Github.UsersGetOrgMembershipsParams, callback?: Github.Callback): Promise; + getOrgMembership(params: Github.UsersGetOrgMembershipParams, callback?: Github.Callback): Promise; + editOrgMembership(params: Github.UsersEditOrgMembershipParams, callback?: Github.Callback): Promise; + getTeams(params: Github.UsersGetTeamsParams, callback?: Github.Callback): Promise; + getEmails(params: Github.UsersGetEmailsParams, callback?: Github.Callback): Promise; + addEmails(params: Github.UsersAddEmailsParams, callback?: Github.Callback): Promise; + deleteEmails(params: Github.UsersDeleteEmailsParams, callback?: Github.Callback): Promise; + getFollowersForUser(params: Github.UsersGetFollowersForUserParams, callback?: Github.Callback): Promise; + getFollowers(params: Github.UsersGetFollowersParams, callback?: Github.Callback): Promise; + getFollowingForUser(params: Github.UsersGetFollowingForUserParams, callback?: Github.Callback): Promise; + getFollowing(params: Github.UsersGetFollowingParams, callback?: Github.Callback): Promise; + checkFollowing(params: Github.UsersCheckFollowingParams, callback?: Github.Callback): Promise; + checkIfOneFollowersOther(params: Github.UsersCheckIfOneFollowersOtherParams, callback?: Github.Callback): Promise; + followUser(params: Github.UsersFollowUserParams, callback?: Github.Callback): Promise; + unfollowUser(params: Github.UsersUnfollowUserParams, callback?: Github.Callback): Promise; + getKeysForUser(params: Github.UsersGetKeysForUserParams, callback?: Github.Callback): Promise; + getKeys(params: Github.UsersGetKeysParams, callback?: Github.Callback): Promise; + getKey(params: Github.UsersGetKeyParams, callback?: Github.Callback): Promise; + createKey(params: Github.UsersCreateKeyParams, callback?: Github.Callback): Promise; + deleteKey(params: Github.UsersDeleteKeyParams, callback?: Github.Callback): Promise; + getGpgKeys(params: Github.UsersGetGpgKeysParams, callback?: Github.Callback): Promise; + getGpgKey(params: Github.UsersGetGpgKeyParams, callback?: Github.Callback): Promise; + createGpgKey(params: Github.UsersCreateGpgKeyParams, callback?: Github.Callback): Promise; + deleteGpgKey(params: Github.UsersDeleteGpgKeyParams, callback?: Github.Callback): Promise; + promote(params: Github.UsersPromoteParams, callback?: Github.Callback): Promise; + demote(params: Github.UsersDemoteParams, callback?: Github.Callback): Promise; + suspend(params: Github.UsersSuspendParams, callback?: Github.Callback): Promise; + unsuspend(params: Github.UsersUnsuspendParams, callback?: Github.Callback): Promise; + getRepoInvites(callback?: Github.Callback): Promise; + acceptRepoInvite(params: Github.UsersAcceptRepoInviteParams, callback?: Github.Callback): Promise; + declineRepoInvite(params: Github.UsersDeclineRepoInviteParams, callback?: Github.Callback): Promise; + }; + enterprise: { + stats(params: Github.EnterpriseStatsParams, callback?: Github.Callback): Promise; + updateLdapForUser(params: Github.EnterpriseUpdateLdapForUserParams, callback?: Github.Callback): Promise; + syncLdapForUser(params: Github.EnterpriseSyncLdapForUserParams, callback?: Github.Callback): Promise; + updateLdapForTeam(params: Github.EnterpriseUpdateLdapForTeamParams, callback?: Github.Callback): Promise; + syncLdapForTeam(params: Github.EnterpriseSyncLdapForTeamParams, callback?: Github.Callback): Promise; + getLicense(callback?: Github.Callback): Promise; + getPreReceiveEnvironment(params: Github.EnterpriseGetPreReceiveEnvironmentParams, callback?: Github.Callback): Promise; + getPreReceiveEnvironments(callback?: Github.Callback): Promise; + createPreReceiveEnvironment(params: Github.EnterpriseCreatePreReceiveEnvironmentParams, callback?: Github.Callback): Promise; + editPreReceiveEnvironment(params: Github.EnterpriseEditPreReceiveEnvironmentParams, callback?: Github.Callback): Promise; + deletePreReceiveEnvironment(params: Github.EnterpriseDeletePreReceiveEnvironmentParams, callback?: Github.Callback): Promise; + getPreReceiveEnvironmentDownloadStatus(params: Github.EnterpriseGetPreReceiveEnvironmentDownloadStatusParams, callback?: Github.Callback): Promise; + triggerPreReceiveEnvironmentDownload(params: Github.EnterpriseTriggerPreReceiveEnvironmentDownloadParams, callback?: Github.Callback): Promise; + getPreReceiveHook(params: Github.EnterpriseGetPreReceiveHookParams, callback?: Github.Callback): Promise; + getPreReceiveHooks(callback?: Github.Callback): Promise; + createPreReceiveHook(params: Github.EnterpriseCreatePreReceiveHookParams, callback?: Github.Callback): Promise; + editPreReceiveHook(params: Github.EnterpriseEditPreReceiveHookParams, callback?: Github.Callback): Promise; + deletePreReceiveHook(params: Github.EnterpriseDeletePreReceiveHookParams, callback?: Github.Callback): Promise; + queueIndexingJob(params: Github.EnterpriseQueueIndexingJobParams, callback?: Github.Callback): Promise; + createOrg(params: Github.EnterpriseCreateOrgParams, callback?: Github.Callback): Promise; + }; +} + +export = Github; \ No newline at end of file diff --git a/index.js b/lib/index.js similarity index 57% rename from index.js rename to lib/index.js index c8c202e59c..b8dc48539b 100644 --- a/index.js +++ b/lib/index.js @@ -1,8 +1,13 @@ "use strict"; var error = require("./error"); +var fs = require("fs"); +var HttpsProxyAgent = require('https-proxy-agent'); +var mime = require("mime"); +var netrc = require("netrc"); var Util = require("./util"); var Url = require("url"); +var Promise = require("./promise"); /** section: github * class Client @@ -14,126 +19,20 @@ var Url = require("url"); * * Author: Mike de Boer * - * [[Client]] can load any version of the [[github]] client API, with the - * requirement that a valid routes.json definition file is present in the - * `api/[VERSION]` directory and that the routes found in this file are - * implemented as well. - * * Upon instantiation of the [[Client]] class, the routes.json file is loaded - * from the API version specified in the configuration and, parsed and from it - * the routes for HTTP requests are extracted. For each HTTP endpoint to the + * and parsed for the API HTTP endpoints. For each HTTP endpoint to the * HTTP server, a method is generated which accepts a Javascript Object * with parameters and an optional callback to be invoked when the API request * returns from the server or when the parameters could not be validated. * * When an HTTP endpoint is processed and a method is generated as described * above, [[Client]] also sets up parameter validation with the rules as - * defined in the routes.json. A full example that illustrates how this works - * is shown below: - * - * ##### Example - * - * First, we look at a listing of a sample routes.json routes definition file: - * - * { - * "defines": { - * "constants": { - * "name": "Github", - * "description": "A Node.JS module, which provides an object oriented wrapper for the GitHub v3 API.", - * "protocol": "https", - * "host": "api.github.com", - * "port": 443, - * "dateFormat": "YYYY-MM-DDTHH:MM:SSZ", - * "requestFormat": "json" - * }, - * "response-headers": [ - * "X-RateLimit-Limit", - * "X-RateLimit-Remaining", - * "Link" - * ], - * "params": { - * "files": { - * "type": "Json", - * "required": true, - * "validation": "", - * "invalidmsg": "", - * "description": "Files that make up this gist. The key of which should be a required string filename and the value another required hash with parameters: 'content'" - * }, - * "user": { - * "type": "String", - * "required": true, - * "validation": "", - * "invalidmsg": "", - * "description": "" - * }, - * "description": { - * "type": "String", - * "required": false, - * "validation": "", - * "invalidmsg": "", - * "description": "" - * }, - * "page": { - * "type": "Number", - * "required": false, - * "validation": "^[0-9]+$", - * "invalidmsg": "", - * "description": "Page number of the results to fetch." - * }, - * "per_page": { - * "type": "Number", - * "required": false, - * "validation": "^[0-9]+$", - * "invalidmsg": "", - * "description": "A custom page size up to 100. Default is 30." - * } - * } - * }, - * - * "gists": { - * "get-from-user": { - * "url": ":user/gists", - * "method": "GET", - * "params": { - * "$user": null, - * "$page": null, - * "$per_page": null - * } - * }, - * - * "create": { - * "url": "/gists", - * "method": "POST", - * "params": { - * "$description": null, - * "public": { - * "type": "Boolean", - * "required": true, - * "validation": "", - * "invalidmsg": "", - * "description": "" - * }, - * "$files": null - * } - * } - * } - * } + * defined in the routes.json. * - * You probably noticed that the definition is quite verbose and the decision - * for its design was made to be verbose whilst still allowing for basic variable - * definitions and substitions for request parameters. - * - * There are two sections; 'defines' and 'gists' in this example. - * - * The `defines` section contains a list of `constants` that will be used by the - * [[Client]] to make requests to the right URL that hosts the API. - * The `gists` section defines the endpoints for calls to the API server, for - * gists specifically in this example, but the other API sections are defined in - * the exact same way. * These definitions are parsed and methods are created that the client can call * to make an HTTP request to the server. - * there is one endpoint defined: . - * In this example, the endpoint `gists/get-from-user` will be exposed as a member + * + * For example, the endpoint `gists/get-from-user` will be exposed as a member * on the [[Client]] object and may be invoked with * * client.getFromUser({ @@ -167,18 +66,23 @@ var Url = require("url"); * The `url` parameter also supports denoting parameters inside it as follows: * * "get-from-user": { - * "url": ":user/gists", + * "url": "/users/:owner/gists", * "method": "GET" * ... * } **/ var Client = module.exports = function(config) { + if (!(this instanceof Client)) { + return new Client(config); + } + + config = config || {} + config.headers = config.headers || {}; this.config = config; this.debug = Util.isTrue(config.debug); + this.Promise = config.Promise || config.promise || Promise; - this.version = config.version; - var cls = require("./api/v" + this.version); - this[this.version] = new cls(this); + this.routes = JSON.parse(fs.readFileSync(__dirname + "/routes.json", "utf8")); var pathPrefix = ""; // Check if a prefix is passed in the config and strip any leading or trailing slashes from it. @@ -187,6 +91,18 @@ var Client = module.exports = function(config) { this.config.pathPrefix = pathPrefix; } + // store mapping of accept header to preview api endpoints + var mediaHash = this.routes.defines.acceptTree; + var mediaTypes = {}; + + for (var accept in mediaHash) { + for (var route in mediaHash[accept]) { + mediaTypes[mediaHash[accept][route]] = accept; + } + } + + this.acceptUrls = mediaTypes; + this.setupRoutes(); }; @@ -194,7 +110,7 @@ var Client = module.exports = function(config) { /** * Client#setupRoutes() -> null * - * Configures the routes as defined in a routes.json file of an API version + * Configures the routes as defined in routes.json. * * [[Client#setupRoutes]] is invoked by the constructor, takes the * contents of the JSON document that contains the definitions of all the @@ -220,18 +136,21 @@ var Client = module.exports = function(config) { **/ this.setupRoutes = function() { var self = this; - var api = this[this.version]; - var routes = api.routes; + var routes = this.routes; var defines = routes.defines; this.constants = defines.constants; this.requestHeaders = defines["request-headers"].map(function(header) { return header.toLowerCase(); }); + this.responseHeaders = defines["response-headers"].map(function(header) { + return header.toLowerCase(); + }); delete routes.defines; function trim(s) { - if (typeof s != "string") + if (typeof s != "string") { return s; + } return s.replace(/^[\s\t\r\n]+/, "").replace(/[\s\t\r\n]+$/, ""); } @@ -245,21 +164,23 @@ var Client = module.exports = function(config) { if (!defines.params[paramName]) { throw new error.BadRequest("Invalid variable parameter name substitution; param '" + paramName + "' not found in defines block", "fatal"); - } - else { + } else { def = paramsStruct[paramName] = defines.params[paramName]; delete paramsStruct["$" + paramName]; } - } - else + } else { def = paramsStruct[paramName]; + } - value = trim(msg[paramName]); + value = msg[paramName]; if (typeof value != "boolean" && !value) { - // we don't need to validation for undefined parameter values + // we don't need validation for undefined parameter values // that are not required. - if (!def.required) + if (!def.required || + (def["allow-empty"] && value === "") || + (def["allow-null"] && value === null)) { continue; + } throw new error.BadRequest("Empty value for parameter '" + paramName + "': " + value); } @@ -280,26 +201,22 @@ var Client = module.exports = function(config) { throw new error.BadRequest("Invalid value for parameter '" + paramName + "': " + msg[paramName] + " is NaN"); } - } - else if (type == "float") { + } else if (type == "float") { value = parseFloat(value); if (isNaN(value)) { throw new error.BadRequest("Invalid value for parameter '" + paramName + "': " + msg[paramName] + " is NaN"); } - } - else if (type == "json") { + } else if (type == "json") { if (typeof value == "string") { try { value = JSON.parse(value); - } - catch(ex) { + } catch(ex) { throw new error.BadRequest("JSON parse error of value for parameter '" + paramName + "': " + value); } } - } - else if (type == "date") { + } else if (type == "date") { value = new Date(value); } } @@ -308,12 +225,14 @@ var Client = module.exports = function(config) { } function prepareApi(struct, baseType) { - if (!baseType) + if (!baseType) { baseType = ""; + } Object.keys(struct).forEach(function(routePart) { var block = struct[routePart]; - if (!block) + if (!block) { return; + } var messageType = baseType + "/" + routePart; if (block.url && block.params) { // we ended up at an API definition part! @@ -323,20 +242,6 @@ var Client = module.exports = function(config) { parts.splice(0, 2); var funcName = Util.toCamelCase(parts.join("-")); - if (!api[section]) { - throw new Error("Unsupported route section, not implemented in version " + - self.version + " for route '" + endPoint + "' and block: " + - JSON.stringify(block)); - } - - if (!api[section][funcName]) { - if (self.debug) - Util.log("Tried to call " + funcName); - throw new Error("Unsupported route, not implemented in version " + - self.version + " for route '" + endPoint + "' and block: " + - JSON.stringify(block)); - } - if (!self[section]) { self[section] = {}; // add a utility function 'getFooApi()', which returns the @@ -349,21 +254,42 @@ var Client = module.exports = function(config) { self[section][funcName] = function(msg, callback) { try { parseParams(msg, block.params); - } - catch (ex) { + } catch (ex) { // when the message was sent to the client, we can // reply with the error directly. - api.sendError(ex, block, msg, callback); - if (self.debug) + self.sendError(ex, block, msg, callback); + if (self.debug) { Util.log(ex.message, "fatal"); + } + + if (self.Promise && typeof callback !== 'function') { + return self.Promise.reject(ex) + } + // on error, there's no need to continue. return; } - api[section][funcName].call(api, msg, block, callback); + if (!callback) { + if (self.Promise) { + return new self.Promise(function(resolve,reject) { + var cb = function(err, obj) { + if (err) { + reject(err); + } else { + resolve(obj); + } + }; + self.handler(msg, JSON.parse(JSON.stringify(block)), cb); + }); + } else { + throw new Error('neither a callback or global promise implementation was provided'); + } + } else { + self.handler(msg, JSON.parse(JSON.stringify(block)), callback); + } }; - } - else { + } else { // recurse into this block next: prepareApi(block, messageType); } @@ -376,10 +302,10 @@ var Client = module.exports = function(config) { /** * Client#authenticate(options) -> null * - options (Object): Object containing the authentication type and credentials - * - type (String): One of the following: `basic` or `oauth` + * - type (String): One of the following: `basic`, `oauth`, `token`, or `integration` * - username (String): Github username * - password (String): Password to your account - * - token (String): OAuth2 token + * - token (String): oauth/jwt token * * Set an authentication method to have access to protected resources. * @@ -392,43 +318,63 @@ var Client = module.exports = function(config) { * password: "test1324" * }); * - * // or oauth + * // oauth * github.authenticate({ * type: "oauth", * token: "e5a4a27487c26e571892846366de023349321a73" * }); * - * // or oauth key/ secret + * // oauth key/secret * github.authenticate({ * type: "oauth", * key: "clientID", * secret: "clientSecret" * }); + * + * // user token + * github.authenticate({ + * type: "token", + * token: "userToken", + * }); + * + * // integration (jwt) + * github.authenticate({ + * type: "integration", + * token: "jwt", + * }); **/ this.authenticate = function(options) { if (!options) { this.auth = false; return; } - if (!options.type || "basic|oauth|client".indexOf(options.type) === -1) - throw new Error("Invalid authentication type, must be 'basic', 'oauth' or 'client'"); - if (options.type == "basic" && (!options.username || !options.password)) + if (!options.type || "basic|oauth|client|token|integration|netrc".indexOf(options.type) === -1) { + throw new Error("Invalid authentication type, must be 'basic', 'integration', 'oauth', 'client' or 'netrc'"); + } + if (options.type == "basic" && (!options.username || !options.password)) { throw new Error("Basic authentication requires both a username and password to be set"); + } if (options.type == "oauth") { - if (!options.token && !(options.key && options.secret)) + if (!options.token && !(options.key && options.secret)) { throw new Error("OAuth2 authentication requires a token or key & secret to be set"); + } + } + if ((options.type == "token" || options.type == "integration") && !options.token) { + throw new Error("Token authentication requires a token to be set"); } this.auth = options; }; function getPageLinks(link) { - if (typeof link == "object" && (link.link || link.meta.link)) + if (typeof link == "object" && (link.link || link.meta.link)) { link = link.link || link.meta.link; + } var links = {}; - if (typeof link != "string") + if (typeof link != "string") { return links; + } // link format: // '; rel="next", ; rel="last"' @@ -478,97 +424,125 @@ var Client = module.exports = function(config) { return getPageLinks(link).first; }; - function getPage(link, which, callback) { + function getPage(link, which, headers, callback) { + var self = this; var url = getPageLinks(link)[which]; - if (!url) - return callback(new error.NotFound("No " + which + " page found")); + if (!url) { + var urlErr = new error.NotFound("No " + which + " page found"); + return self.Promise && !callback ? self.Promise.reject(urlErr) : callback(urlErr); + } - var api = this[this.version]; var parsedUrl = Url.parse(url, true); + + var msg = Object.create(parsedUrl.query); + if (headers != null) { + msg.headers = headers; + } + var block = { url: parsedUrl.pathname, method: "GET", params: parsedUrl.query }; - this.httpSend(parsedUrl.query, block, function(err, res) { - if (err) - return api.sendError(err, null, parsedUrl.query, callback); - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; + if (!callback) { + if (self.Promise) { + return new self.Promise(function(resolve,reject) { + var cb = function(err, obj) { + if (err) { + reject(err); + } else { + resolve(obj); + } + }; + self.handler(msg, JSON.parse(JSON.stringify(block)), cb); + }); + } else { + throw new Error('neither a callback or global promise implementation was provided'); } - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - ["x-ratelimit-limit", "x-ratelimit-remaining", "link"].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); - - if (callback) - callback(null, ret); - }); + } else { + self.handler(msg, JSON.parse(JSON.stringify(block)), callback); + } } /** * Client#getNextPage(link, callback) -> null * - link (mixed): response of a request or the contents of the Link header + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. * * Get the next page, based on the contents of the `Link` header **/ - this.getNextPage = function(link, callback) { - getPage.call(this, link, "next", callback); + this.getNextPage = function(link, headers, callback) { + if (typeof headers == 'function') { + callback = headers; + headers = null; + } + return getPage.call(this, link, "next", headers, callback); }; /** * Client#getPreviousPage(link, callback) -> null * - link (mixed): response of a request or the contents of the Link header + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. * * Get the previous page, based on the contents of the `Link` header **/ - this.getPreviousPage = function(link, callback) { - getPage.call(this, link, "prev", callback); + this.getPreviousPage = function(link, headers, callback) { + if (typeof headers == 'function') { + callback = headers; + headers = null; + } + return getPage.call(this, link, "prev", headers, callback); }; /** * Client#getLastPage(link, callback) -> null * - link (mixed): response of a request or the contents of the Link header + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. * * Get the last page, based on the contents of the `Link` header **/ - this.getLastPage = function(link, callback) { - getPage.call(this, link, "last", callback); + this.getLastPage = function(link, headers, callback) { + if (typeof headers == 'function') { + callback = headers; + headers = null; + } + return getPage.call(this, link, "last", headers, callback); }; /** * Client#getFirstPage(link, callback) -> null * - link (mixed): response of a request or the contents of the Link header + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. * * Get the first page, based on the contents of the `Link` header **/ - this.getFirstPage = function(link, callback) { - getPage.call(this, link, "first", callback); + this.getFirstPage = function(link, headers, callback) { + if (typeof headers == 'function') { + callback = headers; + headers = null; + } + return getPage.call(this, link, "first", headers, callback); }; + function getRequestFormat(hasBody, block) { + if (hasBody) { + return block.requestFormat || this.constants.requestFormat; + } + return "query"; + } + function getQueryAndUrl(msg, def, format, config) { var url = def.url; - if (config.pathPrefix) { + if (config.pathPrefix && url.indexOf(config.pathPrefix) !== 0) { url = config.pathPrefix + def.url; } var ret = { - query: format == "json" ? {} : [] + query: format == "json" ? {} : format == "raw" ? msg.data : [] }; if (!def || !def.params) { ret.url = url; @@ -577,8 +551,9 @@ var Client = module.exports = function(config) { Object.keys(def.params).forEach(function(paramName) { paramName = paramName.replace(/^[$]+/, ""); - if (!(paramName in msg)) + if (!(paramName in msg)) { return; + } var isUrlParam = url.indexOf(":" + paramName) !== -1; var valFormat = isUrlParam || format != "json" ? "query" : format; @@ -588,34 +563,40 @@ var Client = module.exports = function(config) { try { msg[paramName] = JSON.stringify(msg[paramName]); val = encodeURIComponent(msg[paramName]); - } - catch (ex) { + } catch (ex) { return Util.log("httpSend: Error while converting object to JSON: " + (ex.message || ex), "error"); } - } - else if (def.params[paramName] && def.params[paramName].combined) { + } else if (def.params[paramName] && def.params[paramName].combined) { // Check if this is a combined (search) string. val = msg[paramName].split(/[\s\t\r\n]*\+[\s\t\r\n]*/) .map(function(part) { return encodeURIComponent(part); }) .join("+"); + } else { + // the ref param is a path so we don't want to [fully] encode it but we do want to encode the # if there is one + // (see https://github.com/mikedeboer/node-github/issues/499#issuecomment-280093040) + if (paramName === 'ref') { + val = msg[paramName].replace(/#/g, '%23'); + } else { + val = encodeURIComponent(msg[paramName]); + } } - else - val = encodeURIComponent(msg[paramName]); - } - else + } else { val = msg[paramName]; + } if (isUrlParam) { url = url.replace(":" + paramName, val); - } - else { - if (format == "json") + } else { + if (format == "json" && def.params[paramName].sendValueAsBody) { + ret.query = val; + } else if (format == "json") { ret.query[paramName] = val; - else + } else if (format != "raw") { ret.query.push(paramName + "=" + val); + } } }); ret.url = url; @@ -636,57 +617,59 @@ var Client = module.exports = function(config) { this.httpSend = function(msg, block, callback) { var self = this; var method = block.method.toLowerCase(); - var hasBody = ("head|get|delete".indexOf(method) === -1); - var format = hasBody && this.constants.requestFormat - ? this.constants.requestFormat - : "query"; + var hasFileBody = block.hasFileBody; + var hasBody = !hasFileBody && (typeof(msg.body) !== "undefined" || "head|get|delete".indexOf(method) === -1); + var format = getRequestFormat.call(this, hasBody, block); + var protocol = this.config.protocol || this.constants.protocol || "http"; + var port = this.config.port || (protocol == "https" ? 443 : 80); + var host = block.host || this.config.host || this.constants.host; + + // Edge case for github enterprise uploadAsset: + // 1) In public api, host changes to uploads.github.com. In enterprise, the host remains the same. + // 2) In enterprise, the pathPrefix changes from: /api/v3 to /api/uploads. + if ((this.config.host && this.config.host !== this.constants.host) + && (block.host && block.host === "uploads.github.com")) { // enterprise uploadAsset + host = this.config.host; + this.config.pathPrefix = "/api/uploads"; + } + var obj = getQueryAndUrl(msg, block, format, self.config); var query = obj.query; var url = this.config.url ? this.config.url + obj.url : obj.url; - var path = url; - var protocol = this.config.protocol || this.constants.protocol || "http"; - var host = this.config.host || this.constants.host; - var port = this.config.port || this.constants.port || (protocol == "https" ? 443 : 80); - + if (!hasBody && query.length) { + path += "?" + query.join("&"); + } + var proxyUrl; + var agent = undefined; if (this.config.proxy !== undefined) { proxyUrl = this.config.proxy; } else { proxyUrl = process.env.HTTPS_PROXY || process.env.HTTP_PROXY; } if (proxyUrl) { - path = Url.format({ - protocol: protocol, - hostname: host, - port: port, - pathname: path - }); - - if (!/^(http|https):\/\//.test(proxyUrl)) - proxyUrl = "https://" + proxyUrl; - - var parsedUrl = Url.parse(proxyUrl); - protocol = parsedUrl.protocol.replace(":", ""); - host = parsedUrl.hostname; - port = parsedUrl.port || (protocol == "https" ? 443 : 80); + agent = new HttpsProxyAgent(proxyUrl); } - if (!hasBody && query.length) - path += "?" + query.join("&"); + + var ca = this.config.ca; var headers = { "host": host, "content-length": "0" }; if (hasBody) { - if (format == "json") + if (format == "json") { query = JSON.stringify(query); - else + } else if (format != "raw") { query = query.join("&"); + } headers["content-length"] = Buffer.byteLength(query, "utf8"); headers["content-type"] = format == "json" ? "application/json; charset=utf-8" - : "application/x-www-form-urlencoded; charset=utf-8"; + : format == "raw" + ? "text/plain; charset=utf-8" + : "application/x-www-form-urlencoded; charset=utf-8"; } if (this.auth) { var basic; @@ -702,106 +685,200 @@ var Client = module.exports = function(config) { } break; case "token": - basic = new Buffer(this.auth.username + "/token:" + this.auth.token, "ascii").toString("base64"); - headers.authorization = "Basic " + basic; + headers["Authorization"] = "token " + this.auth.token; + break; + case "integration": + headers["Authorization"] = "Bearer " + this.auth.token; + headers["accept"] = "application/vnd.github.machine-man-preview+json" break; case "basic": basic = new Buffer(this.auth.username + ":" + this.auth.password, "ascii").toString("base64"); - headers.authorization = "Basic " + basic; + headers["Authorization"] = "Basic " + basic; break; + case "netrc": + var auth = netrc()[host]; + if (!auth) { + throw new Error("~/.netrc authentication type chosen but no credentials found for '" + host + "'"); + } + basic = new Buffer(auth.login + ":" + auth.password, "ascii").toString("base64"); + headers["Authorization"] = "Basic " + basic; default: break; } } - if (!msg.headers) - msg.headers = {}; - Object.keys(msg.headers).forEach(function(header) { - var headerLC = header.toLowerCase(); - if (self.requestHeaders.indexOf(headerLC) == -1) - return; - headers[headerLC] = msg.headers[header]; - }); - if (!headers["user-agent"]) - headers["user-agent"] = "NodeJS HTTP Client"; + function callCallback(err, result) { + if (callback) { + var cb = callback; + callback = undefined; + cb(err, result); + } + } - if (!headers["accept"]) - headers["accept"] = this.config.requestMedia || this.constants.requestMedia; + function addCustomHeaders(customHeaders) { + Object.keys(customHeaders).forEach(function(header) { + var headerLC = header.toLowerCase(); + if (self.requestHeaders.indexOf(headerLC) == -1) { + return; + } + headers[headerLC] = customHeaders[header]; + }); + } + addCustomHeaders(Util.extend(msg.headers || {}, this.config.headers)); + + if (!headers["user-agent"]) { + headers["user-agent"] = "NodeJS HTTP Client"; + } + if (!("accept" in headers)) { + headers["accept"] = this.acceptUrls[block.url] || this.config.requestMedia || this.constants.requestMedia; + } + var options = { host: host, port: port, path: path, method: method, - headers: headers + headers: headers, + ca: ca }; - if (this.config.rejectUnauthorized !== undefined) + if (agent) { + options.agent = agent; + } + + if (this.config.rejectUnauthorized !== undefined) { options.rejectUnauthorized = this.config.rejectUnauthorized; + } - if (this.debug) + if (this.debug) { console.log("REQUEST: ", options); + } - var callbackCalled = false + function httpSendRequest() { + var reqModule = self.config.followRedirects === false ? protocol : 'follow-redirects/' + protocol; + var req = require(reqModule).request(options, function(res) { + if (self.debug) { + console.log("STATUS: " + res.statusCode); + console.log("HEADERS: " + JSON.stringify(res.headers)); + } + res.setEncoding("utf8"); + var data = ""; + res.on("data", function(chunk) { + data += chunk; + }); + res.on("error", function(err) { + callCallback(err); + }); + res.on("end", function() { + if (res.statusCode >= 400 && res.statusCode < 600 || res.statusCode < 10) { + callCallback(new error.HttpError(data, res.statusCode, res.headers)); + } else { + res.data = data; + callCallback(null, res); + } + }); + }); - var req = require(protocol).request(options, function(res) { - if (self.debug) { - console.log("STATUS: " + res.statusCode); - console.log("HEADERS: " + JSON.stringify(res.headers)); + var timeout = (block.timeout !== undefined) ? block.timeout : self.config.timeout; + if (timeout) { + req.setTimeout(timeout); } - res.setEncoding("utf8"); - var data = ""; - res.on("data", function(chunk) { - data += chunk; + + req.on("error", function(e) { + if (self.debug) { + console.log("problem with request: " + e.message); + } + callCallback(e.message); }); - res.on("error", function(err) { - if (!callbackCalled) { - callbackCalled = true; - callback(err); + + req.on("timeout", function() { + if (self.debug) { + console.log("problem with request: timed out"); } + req.abort(); + callCallback(new error.GatewayTimeout()); }); - res.on("end", function() { - if (callbackCalled) - return; - callbackCalled = true; - if (res.statusCode >= 400 && res.statusCode < 600 || res.statusCode < 10) { - callback(new error.HttpError(data, res.statusCode)); + // write data to request body + if (hasBody && query.length) { + if (self.debug) { + console.log("REQUEST BODY: " + query + "\n"); + } + req.write(query + "\n"); + } + + if (block.hasFileBody) { + var stream = fs.createReadStream(msg.filePath); + stream.pipe(req); + } else { + req.end(); + } + }; + + if (hasFileBody) { + fs.stat(msg.filePath, function(err, stat) { + if (err) { + callCallback(err); } else { - res.data = data; - callback(null, res); + headers["content-length"] = stat.size; + headers["content-type"] = mime.lookup(msg.name); + httpSendRequest(); } }); - }); + } else { + httpSendRequest(); + } + }; - if (this.config.timeout) { - req.setTimeout(this.config.timeout); + this.sendError = function(err, block, msg, callback) { + if (this.debug) { + Util.log(err, block, msg, "error"); + } + if (typeof err == "string") { + err = new error.InternalServerError(err); } + if (callback && typeof(callback) === "function") { + callback(err); + } + }; - req.on("error", function(e) { - if (self.debug) - console.log("problem with request: " + e.message); - if (!callbackCalled) { - callbackCalled = true; - callback(e.message); + this.handler = function(msg, block, callback) { + var self = this; + this.httpSend(msg, block, function(err, res) { + if (err) { + return self.sendError(err, msg, null, callback); } - }); - req.on("timeout", function() { - if (self.debug) - console.log("problem with request: timed out"); - if (!callbackCalled) { - callbackCalled = true; - callback(new error.GatewayTimeout()); + var ret; + try { + var data = res.data; + + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) { + data = res.data && JSON.parse(res.data); + } + ret = {data: data}; + } catch (ex) { + if (callback) { + callback(new error.InternalServerError(ex.message), res); + } + return; } - }); - // write data to request body - if (hasBody && query.length) { - if (self.debug) - console.log("REQUEST BODY: " + query + "\n"); - req.write(query + "\n"); - } - req.end(); - }; + if (!ret) { + ret = {}; + } + ret.meta = {}; + self.responseHeaders.forEach(function(header) { + if (res.headers[header]) { + ret.meta[header] = res.headers[header]; + } + }); + + if (callback) { + callback(null, ret); + } + }); + } }).call(Client.prototype); diff --git a/lib/index.js.flow b/lib/index.js.flow new file mode 100644 index 0000000000..93e13c0e99 --- /dev/null +++ b/lib/index.js.flow @@ -0,0 +1,2988 @@ +declare module "github" { + declare type Header = + | "Authorization" + | "If-Modified-Since" + | "If-None-Match" + | "Cookie" + | "User-Agent" + | "Accept" + | "X-GitHub-OTP" + | string; + + declare type Options = { + debug?: boolean; + protocol?: string; + host?: string; + pathPrefix?: string; + headers?: {[header: Header]: any}; + Promise?: typeof Promise; + followRedirects?: boolean; + timeout?: number; + }; + + declare type AuthBasic = { + type: "basic"; + username: string; + password: string; + }; + + declare type AuthOAuthToken = { + type: "oauth"; + token: string; + }; + + declare type AuthOAuthSecret = { + type: "oauth"; + key: string; + secret: string; + }; + + declare type AuthUserToken = { + type: "token"; + token: string; + }; + + declare type AuthJWT = { + type: "integration"; + token: string; + }; + + declare type Auth = + | AuthBasic + | AuthOAuthToken + | AuthOAuthSecret + | AuthUserToken + | AuthJWT; + + declare type Link = + | { link: string; } + | { meta: { link: string; }; } + | string + | any; + + declare type Callback = (error: ?Error, result: ?any) => any; + + declare type Files = { files: string; }; + declare type Owner = { owner: string; }; + declare type Username = { username: string; }; + declare type Org = { org: string; }; + declare type Repo = { repo: string; }; + declare type Branch = { branch: string; }; + declare type Sha = { sha: string; }; + declare type Description = { description?: string; }; + declare type Id = { id: string; }; + declare type GistId = { gist_id: string; }; + declare type InstallationId = { installation_id: string; }; + declare type RepositoryId = { repository_id: string; }; + declare type CommitId = { commit_id: string; }; + declare type ClientId = { client_id?: string; }; + declare type ColumnId = { column_id: string; }; + declare type ProjectId = { project_id: string; }; + declare type RepoId = { repo_id: string; }; + declare type InvitationId = { invitation_id: string; }; + declare type Ref = { ref: string; }; + declare type Number = { number: number; }; + declare type IssueNumber = { issue_number: number; }; + declare type Name = { name: string; }; + declare type Direction = { direction?: "asc"|"desc"; }; + declare type Since = { since?: Date; }; + declare type Until = { until?: Date; }; + declare type State = { state?: "open"|"closed"|"all"; }; + declare type Color = { color: string; }; + declare type Base = { base: string; }; + declare type Head = { head: string; }; + declare type Path = { path: string; }; + declare type Position = { position: number; }; + declare type Body = { body: string; }; + declare type Homepage = { homepage?: string; }; + declare type Private = { private?: boolean; }; + declare type HasIssues = { has_issues?: boolean; }; + declare type HasWiki = { has_wiki?: boolean; }; + declare type HasDownloads = { has_downloads?: boolean; }; + declare type DefaultBranch = { default_branch?: string; }; + declare type Title = { title: string; }; + declare type Key = { key: string; }; + declare type Page = { page?: number; }; + declare type PerPage = { per_page?: number; }; + declare type Scopes = { scopes?: string[]; }; + declare type Note = { note?: string; }; + declare type NoteUrl = { note_url?: string; }; + declare type AutoInit = { auto_init?: boolean; }; + declare type GitignoreTemplate = { gitignore_template?: string; }; + declare type LicenseTemplate = { license_template?: string; }; + declare type Order = { order?: "asc"|"desc"; }; + declare type Q = { q: string; }; + declare type Data = { data: string; }; + declare type Privacy = { privacy?: "secret"|"closed"; }; + declare type Fingerprint = { fingerprint?: string; }; + declare type AccessToken = { access_token: string; }; + declare type Assignees = { assignees?: string[]; }; + + declare type AuthorizationGetGrantsParams = + & Page + & PerPage + ; + declare type AuthorizationGetGrantParams = + & Id + & Page + & PerPage + ; + declare type AuthorizationDeleteGrantParams = + & Id + ; + declare type AuthorizationGetAllParams = + & Page + & PerPage + ; + declare type AuthorizationGetParams = + & Id + ; + declare type AuthorizationCreateParams = + & Scopes + & Note + & NoteUrl + & ClientId + & Fingerprint + & { + client_secret?: string; + }; + declare type AuthorizationGetOrCreateAuthorizationForAppParams = + & ClientId + & Scopes + & Note + & NoteUrl + & Fingerprint + & { + client_secret: string; + }; + declare type AuthorizationGetOrCreateAuthorizationForAppAndFingerprintParams = + & ClientId + & Fingerprint + & Scopes + & Note + & NoteUrl + & { + client_secret: string; + }; + declare type AuthorizationUpdateParams = + & Id + & Scopes + & Note + & NoteUrl + & Fingerprint + & { + add_scopes?: string[]; + remove_scopes?: string[]; + }; + declare type AuthorizationDeleteParams = + & Id + ; + declare type AuthorizationCheckParams = + & ClientId + & AccessToken + ; + declare type AuthorizationResetParams = + & ClientId + & AccessToken + ; + declare type AuthorizationRevokeParams = + & ClientId + & AccessToken + ; + declare type ActivityGetEventsParams = + & Page + & PerPage + ; + declare type ActivityGetEventsForRepoParams = + & Owner + & Repo + & Page + & PerPage + ; + declare type ActivityGetEventsForRepoIssuesParams = + & Owner + & Repo + & Page + & PerPage + ; + declare type ActivityGetEventsForRepoNetworkParams = + & Owner + & Repo + & Page + & PerPage + ; + declare type ActivityGetEventsForOrgParams = + & Org + & Page + & PerPage + ; + declare type ActivityGetEventsReceivedParams = + & Username + & Page + & PerPage + ; + declare type ActivityGetEventsReceivedPublicParams = + & Username + & Page + & PerPage + ; + declare type ActivityGetEventsForUserParams = + & Username + & Page + & PerPage + ; + declare type ActivityGetEventsForUserPublicParams = + & Username + & Page + & PerPage + ; + declare type ActivityGetEventsForUserOrgParams = + & Username + & Org + & Page + & PerPage + ; + declare type ActivityGetNotificationsParams = + & Since + & { + all?: boolean; + participating?: boolean; + before?: string; + }; + declare type ActivityGetNotificationsForUserParams = + & Owner + & Repo + & Since + & { + all?: boolean; + participating?: boolean; + before?: string; + }; + declare type ActivityMarkNotificationsAsReadParams = + & { + last_read_at?: string; + }; + declare type ActivityMarkNotificationsAsReadForRepoParams = + & Owner + & Repo + & { + last_read_at?: string; + }; + declare type ActivityGetNotificationThreadParams = + & Id + ; + declare type ActivityMarkNotificationThreadAsReadParams = + & Id + ; + declare type ActivityCheckNotificationThreadSubscriptionParams = + & Id + ; + declare type ActivitySetNotificationThreadSubscriptionParams = + & Id + & { + subscribed?: boolean; + ignored?: boolean; + }; + declare type ActivityDeleteNotificationThreadSubscriptionParams = + & Id + ; + declare type ActivityGetStargazersForRepoParams = + & Owner + & Repo + & Page + & PerPage + ; + declare type ActivityGetStarredReposForUserParams = + & Username + & Direction + & Page + & PerPage + & { + sort?: "created"|"updated"; + }; + declare type ActivityGetStarredReposParams = + & Direction + & Page + & PerPage + & { + sort?: "created"|"updated"; + }; + declare type ActivityCheckStarringRepoParams = + & Owner + & Repo + & Page + & PerPage + ; + declare type ActivityStarRepoParams = + & Owner + & Repo + ; + declare type ActivityUnstarRepoParams = + & Owner + & Repo + ; + declare type ActivityGetWatchersForRepoParams = + & Owner + & Repo + & Page + & PerPage + ; + declare type ActivityGetWatchedReposForUserParams = + & Username + & Page + & PerPage + ; + declare type ActivityGetWatchedReposParams = + & Page + & PerPage + ; + declare type ActivityGetRepoSubscriptionParams = + & Owner + & Repo + & Page + & PerPage + ; + declare type ActivitySetRepoSubscriptionParams = + & Owner + & Repo + & { + subscribed?: boolean; + ignored?: boolean; + }; + declare type ActivityUnwatchRepoParams = + & Owner + & Repo + ; + declare type GistsGetForUserParams = + & Username + & Since + & Page + & PerPage + ; + declare type GistsGetAllParams = + & Since + & Page + & PerPage + ; + declare type GistsGetPublicParams = + & Since + ; + declare type GistsGetStarredParams = + & Since + ; + declare type GistsGetParams = + & Id + ; + declare type GistsGetRevisionParams = + & Id + & Sha + ; + declare type GistsCreateParams = + & Files + & Description + & { + public: boolean; + }; + declare type GistsEditParams = + & Id + & Description + & Files + & { + content?: string; + filename?: string; + }; + declare type GistsGetCommitsParams = + & Id + ; + declare type GistsStarParams = + & Id + ; + declare type GistsUnstarParams = + & Id + ; + declare type GistsCheckStarParams = + & Id + ; + declare type GistsForkParams = + & Id + ; + declare type GistsGetForksParams = + & Id + & Page + & PerPage + ; + declare type GistsDeleteParams = + & Id + ; + declare type GistsGetCommentsParams = + & GistId + ; + declare type GistsGetCommentParams = + & GistId + & Id + ; + declare type GistsCreateCommentParams = + & GistId + & Body + ; + declare type GistsEditCommentParams = + & GistId + & Id + & Body + ; + declare type GistsDeleteCommentParams = + & GistId + & Id + ; + declare type GitdataGetBlobParams = + & Owner + & Repo + & Sha + & Page + & PerPage + ; + declare type GitdataCreateBlobParams = + & Owner + & Repo + & { + content: string; + encoding: string; + }; + declare type GitdataGetCommitParams = + & Owner + & Repo + & Sha + ; + declare type GitdataCreateCommitParams = + & Owner + & Repo + & { + message: string; + tree: string; + parents: string[]; + author?: string; + committer?: string; + }; + declare type GitdataGetCommitSignatureVerificationParams = + & Owner + & Repo + & Sha + ; + declare type GitdataGetReferenceParams = + & Owner + & Repo + & Ref + ; + declare type GitdataGetReferencesParams = + & Owner + & Repo + & Page + & PerPage + ; + declare type GitdataGetTagsParams = + & Owner + & Repo + & Page + & PerPage + ; + declare type GitdataCreateReferenceParams = + & Owner + & Repo + & Sha + & { + ref: string; + }; + declare type GitdataUpdateReferenceParams = + & Owner + & Repo + & Ref + & Sha + & { + force?: boolean; + }; + declare type GitdataDeleteReferenceParams = + & Owner + & Repo + & Ref + ; + declare type GitdataGetTagParams = + & Owner + & Repo + & Sha + ; + declare type GitdataCreateTagParams = + & Owner + & Repo + & { + tag: string; + message: string; + object: string; + type: string; + tagger: string; + }; + declare type GitdataGetTagSignatureVerificationParams = + & Owner + & Repo + & Sha + ; + declare type GitdataGetTreeParams = + & Owner + & Repo + & Sha + & { + recursive?: boolean; + }; + declare type GitdataCreateTreeParams = + & Owner + & Repo + & { + tree: string; + base_tree?: string; + }; + declare type IntegrationsGetInstallationsParams = + & Page + & PerPage + ; + declare type IntegrationsCreateInstallationTokenParams = + & InstallationId + & { + user_id?: string; + }; + declare type IntegrationsGetUserIdentityParams = + & { + nonce?: string; + }; + declare type IntegrationsGetInstallationRepositoriesParams = + & { + user_id?: string; + }; + declare type IntegrationsAddRepoToInstallationParams = + & InstallationId + & RepositoryId + ; + declare type IntegrationsRemoveRepoFromInstallationParams = + & InstallationId + & RepositoryId + ; + declare type IssuesGetAllParams = + & Direction + & Since + & Page + & PerPage + & { + filter?: "all"|"assigned"|"created"|"mentioned"|"subscribed"; + state?: "open"|"closed"|"all"; + labels?: string; + sort?: "created"|"updated"|"comments"; + }; + declare type IssuesGetForUserParams = + & Direction + & Since + & Page + & PerPage + & { + filter?: "all"|"assigned"|"created"|"mentioned"|"subscribed"; + state?: "open"|"closed"|"all"; + labels?: string; + sort?: "created"|"updated"|"comments"; + }; + declare type IssuesGetForOrgParams = + & Org + & Direction + & Since + & Page + & PerPage + & { + filter?: "all"|"assigned"|"created"|"mentioned"|"subscribed"; + state?: "open"|"closed"|"all"; + labels?: string; + sort?: "created"|"updated"|"comments"; + }; + declare type IssuesGetForRepoParams = + & Owner + & Repo + & Direction + & Since + & Page + & PerPage + & { + milestone?: string; + state?: "open"|"closed"|"all"; + assignee?: string; + creator?: string; + mentioned?: string; + labels?: string; + sort?: "created"|"updated"|"comments"; + }; + declare type IssuesGetParams = + & Owner + & Repo + & Number + ; + declare type IssuesCreateParams = + & Owner + & Repo + & Assignees + & { + title: string; + body?: string; + assignee?: string; + milestone?: number; + labels?: string[]; + }; + declare type IssuesEditParams = + & Owner + & Repo + & Number + & Assignees + & { + title?: string; + body?: string; + assignee?: string; + state?: "open"|"closed"; + milestone?: number; + labels?: string[]; + }; + declare type IssuesLockParams = + & Owner + & Repo + & Number + ; + declare type IssuesUnlockParams = + & Owner + & Repo + & Number + ; + declare type IssuesGetAssigneesParams = + & Owner + & Repo + ; + declare type IssuesCheckAssigneeParams = + & Owner + & Repo + & { + assignee: string; + }; + declare type IssuesAddAssigneesToIssueParams = + & Owner + & Repo + & Number + & { + assignees: string[]; + }; + declare type IssuesRemoveAssigneesFromIssueParams = + & Owner + & Repo + & Number + & Assignees + ; + declare type IssuesGetCommentsParams = + & Owner + & Repo + & Number + & Page + & PerPage + ; + declare type IssuesGetCommentsForRepoParams = + & Owner + & Repo + & Direction + & Since + & Page + & PerPage + & { + sort?: "created"|"updated"; + }; + declare type IssuesGetCommentParams = + & Owner + & Repo + & Id + ; + declare type IssuesCreateCommentParams = + & Owner + & Repo + & Number + & Body + ; + declare type IssuesEditCommentParams = + & Owner + & Repo + & Id + & Body + ; + declare type IssuesDeleteCommentParams = + & Owner + & Repo + & Id + ; + declare type IssuesGetEventsParams = + & Owner + & Repo + & IssueNumber + & Page + & PerPage + ; + declare type IssuesGetEventsForRepoParams = + & Owner + & Repo + & Page + & PerPage + ; + declare type IssuesGetEventParams = + & Owner + & Repo + & Id + ; + declare type IssuesGetLabelsParams = + & Owner + & Repo + & Page + & PerPage + ; + declare type IssuesGetLabelParams = + & Owner + & Repo + & Name + ; + declare type IssuesCreateLabelParams = + & Owner + & Repo + & Name + & Color + ; + declare type IssuesUpdateLabelParams = + & Owner + & Repo + & Color + & { + oldname: string; + name: string; + }; + declare type IssuesDeleteLabelParams = + & Owner + & Repo + & Name + ; + declare type IssuesGetIssueLabelsParams = + & Owner + & Repo + & Number + ; + declare type IssuesAddLabelsParams = + & Owner + & Repo + & Number + & { + labels: string[]; + }; + declare type IssuesRemoveLabelParams = + & Owner + & Repo + & Number + & { + name: string; + }; + declare type IssuesReplaceAllLabelsParams = + & Owner + & Repo + & Number + & { + labels: string[]; + }; + declare type IssuesRemoveAllLabelsParams = + & Owner + & Repo + & Number + ; + declare type IssuesGetMilestoneLabelsParams = + & Owner + & Repo + & Number + ; + declare type IssuesGetMilestonesParams = + & Owner + & Repo + & State + & Page + & PerPage + & { + sort?: "due_on"|"completeness"; + direction?: "asc"|"desc"; + }; + declare type IssuesGetMilestoneParams = + & Owner + & Repo + & Number + ; + declare type IssuesCreateMilestoneParams = + & Owner + & Repo + & State + & Description + & { + title: string; + due_on?: Date; + }; + declare type IssuesUpdateMilestoneParams = + & Owner + & Repo + & Number + & State + & Description + & { + title: string; + due_on?: Date; + }; + declare type IssuesDeleteMilestoneParams = + & Owner + & Repo + & Number + ; + declare type IssuesGetEventsTimelineParams = + & Owner + & Repo + & IssueNumber + & Page + & PerPage + ; + declare type MigrationsStartMigrationParams = + & Org + & { + repositories: string[]; + lock_repositories?: boolean; + exclude_attachments?: boolean; + }; + declare type MigrationsGetMigrationsParams = + & Org + & Page + & PerPage + ; + declare type MigrationsGetMigrationStatusParams = + & Org + & Id + ; + declare type MigrationsGetMigrationArchiveLinkParams = + & Org + & Id + ; + declare type MigrationsDeleteMigrationArchiveParams = + & Org + & Id + ; + declare type MigrationsUnlockRepoLockedForMigrationParams = + & Org + & Id + & { + repo_name: string; + }; + declare type MigrationsStartImportParams = + & Owner + & Repo + & { + vcs_url: string; + vcs?: "subversion"|"git"|"mercurial"|"tfvc"; + vcs_username?: string; + vcs_password?: string; + tfvc_project?: string; + }; + declare type MigrationsGetImportProgressParams = + & Owner + & Repo + ; + declare type MigrationsUpdateImportParams = + & Owner + & Repo + ; + declare type MigrationsGetImportCommitAuthorsParams = + & Owner + & Repo + & { + since?: string; + }; + declare type MigrationsMapImportCommitAuthorParams = + & Owner + & Repo + & { + author_id: string; + email?: string; + name?: string; + }; + declare type MigrationsSetImportLfsPreferenceParams = + & Owner + & Name + & { + use_lfs: string; + }; + declare type MigrationsGetLargeImportFilesParams = + & Owner + & Name + ; + declare type MigrationsCancelImportParams = + & Owner + & Repo + ; + declare type MiscGetGitignoreTemplateParams = + & { + name: string; + }; + declare type MiscGetLicenseParams = + & { + license: string; + }; + declare type MiscGetRepoLicenseParams = + & Owner + & Repo + ; + declare type MiscRenderMarkdownParams = + & { + text: string; + mode?: "markdown"|"gfm"; + context?: string; + }; + declare type MiscRenderMarkdownRawParams = + & Data + ; + declare type OrgsGetAllParams = + & Page + & PerPage + & { + since?: string; + }; + declare type OrgsGetForUserParams = + & Username + & Page + & PerPage + ; + declare type OrgsGetParams = + & Org + & Page + & PerPage + ; + declare type OrgsUpdateParams = + & Org + & { + billing_email?: string; + company?: string; + email?: string; + location?: string; + name?: string; + description?: string; + default_repository_permission?: "read"|"write"|"admin"|"none"; + members_can_create_repositories?: boolean; + }; + declare type OrgsGetMembersParams = + & Org + & Page + & PerPage + & { + filter?: "all"|"2fa_disabled"; + role?: "all"|"admin"|"member"; + }; + declare type OrgsCheckMembershipParams = + & Org + & Username + ; + declare type OrgsRemoveMemberParams = + & Org + & Username + ; + declare type OrgsGetPublicMembersParams = + & Org + ; + declare type OrgsCheckPublicMembershipParams = + & Org + & Username + ; + declare type OrgsPublicizeMembershipParams = + & Org + & Username + ; + declare type OrgsConcealMembershipParams = + & Org + & Username + ; + declare type OrgsGetOrgMembershipParams = + & Org + & Username + ; + declare type OrgsAddOrgMembershipParams = + & Org + & Username + & { + role: "admin"|"member"; + }; + declare type OrgsRemoveOrgMembershipParams = + & Org + & Username + ; + declare type OrgsGetPendingOrgInvitesParams = + & Org + ; + declare type OrgsGetOutsideCollaboratorsParams = + & Org + & Page + & PerPage + ; + declare type OrgsRemoveOutsideCollaboratorParams = + & Org + & Username + ; + declare type OrgsConvertMemberToOutsideCollaboratorParams = + & Org + & Username + ; + declare type OrgsGetTeamsParams = + & Org + & Page + & PerPage + ; + declare type OrgsGetTeamParams = + & Id + ; + declare type OrgsCreateTeamParams = + & Org + & Name + & Privacy + & { + description?: string; + maintainers?: string[]; + repo_names?: string[]; + }; + declare type OrgsEditTeamParams = + & Id + & Name + & Privacy + & { + description?: string; + }; + declare type OrgsDeleteTeamParams = + & Id + ; + declare type OrgsGetTeamMembersParams = + & Id + & Page + & PerPage + & { + role?: "member"|"maintainer"|"all"; + }; + declare type OrgsGetTeamMembershipParams = + & Id + & Username + ; + declare type OrgsAddTeamMembershipParams = + & Id + & Username + & { + role?: "member"|"maintainer"; + }; + declare type OrgsRemoveTeamMembershipParams = + & Id + & Username + ; + declare type OrgsGetTeamReposParams = + & Id + & Page + & PerPage + ; + declare type OrgsGetPendingTeamInvitesParams = + & Id + & Page + & PerPage + ; + declare type OrgsCheckTeamRepoParams = + & Id + & Owner + & Repo + ; + declare type OrgsAddTeamRepoParams = + & Id + & Org + & Repo + & { + permission?: "pull"|"push"|"admin"; + }; + declare type OrgsDeleteTeamRepoParams = + & Id + & Owner + & Repo + ; + declare type OrgsGetHooksParams = + & Org + & Page + & PerPage + ; + declare type OrgsGetHookParams = + & Org + & Id + ; + declare type OrgsCreateHookParams = + & Org + & { + name: string; + config: string; + events?: string[]; + active?: boolean; + }; + declare type OrgsEditHookParams = + & Org + & Id + & { + config: string; + events?: string[]; + active?: boolean; + }; + declare type OrgsPingHookParams = + & Org + & Id + ; + declare type OrgsDeleteHookParams = + & Org + & Id + ; + declare type ProjectsGetRepoProjectsParams = + & Owner + & Repo + ; + declare type ProjectsGetOrgProjectsParams = + & Org + ; + declare type ProjectsGetProjectParams = + & Id + ; + declare type ProjectsCreateRepoProjectParams = + & Owner + & Repo + & Name + & { + body?: string; + }; + declare type ProjectsCreateOrgProjectParams = + & Org + & Name + & { + body?: string; + }; + declare type ProjectsUpdateProjectParams = + & Id + & Name + & { + body?: string; + }; + declare type ProjectsDeleteProjectParams = + & Id + ; + declare type ProjectsGetProjectCardsParams = + & ColumnId + ; + declare type ProjectsGetProjectCardParams = + & Id + ; + declare type ProjectsCreateProjectCardParams = + & ColumnId + & { + note?: string; + content_id?: string; + content_type?: string; + }; + declare type ProjectsUpdateProjectCardParams = + & Id + & { + note?: string; + }; + declare type ProjectsDeleteProjectCardParams = + & Id + ; + declare type ProjectsMoveProjectCardParams = + & Id + & { + position: string; + column_id?: string; + }; + declare type ProjectsGetProjectColumnsParams = + & ProjectId + ; + declare type ProjectsGetProjectColumnParams = + & Id + ; + declare type ProjectsCreateProjectColumnParams = + & ProjectId + & Name + ; + declare type ProjectsUpdateProjectColumnParams = + & Id + & Name + ; + declare type ProjectsDeleteProjectColumnParams = + & Id + ; + declare type ProjectsMoveProjectColumnParams = + & Id + & { + position: string; + }; + declare type PullRequestsGetAllParams = + & Owner + & Repo + & Direction + & Page + & PerPage + & { + state?: "open"|"closed"|"all"; + head?: string; + base?: string; + sort?: "created"|"updated"|"popularity"|"long-running"; + }; + declare type PullRequestsGetParams = + & Owner + & Repo + & Number + ; + declare type PullRequestsCreateParams = + & Owner + & Repo + & Head + & Base + & { + title: string; + body?: string; + maintainer_can_modify?: boolean; + }; + declare type PullRequestsCreateFromIssueParams = + & Owner + & Repo + & Head + & Base + & { + issue: number; + }; + declare type PullRequestsUpdateParams = + & Owner + & Repo + & Number + & State + & { + title?: string; + body?: string; + base?: string; + }; + declare type PullRequestsGetCommitsParams = + & Owner + & Repo + & Number + & Page + & PerPage + ; + declare type PullRequestsGetFilesParams = + & Owner + & Repo + & Number + & Page + & PerPage + ; + declare type PullRequestsCheckMergedParams = + & Owner + & Repo + & Number + & Page + & PerPage + ; + declare type PullRequestsMergeParams = + & Owner + & Repo + & Number + & { + commit_title?: string; + commit_message?: string; + sha?: string; + merge_method?: "merge"|"squash"|"rebase"; + }; + declare type PullRequestsGetReviewsParams = + & Owner + & Repo + & Number + & Page + & PerPage + ; + declare type PullRequestsGetReviewParams = + & Owner + & Repo + & Number + & Id + ; + declare type PullRequestsGetReviewCommentsParams = + & Owner + & Repo + & Number + & Id + & Page + & PerPage + ; + declare type PullRequestsCreateReviewParams = + & Owner + & Repo + & Number + & { + body?: string; + event?: "APPROVE"|"REQUEST_CHANGES"|"COMMENT"|"PENDING"; + comments?: string[]; + path?: string; + position?: number; + }; + declare type PullRequestsSubmitReviewParams = + & Owner + & Repo + & Number + & Id + & { + body?: string; + event?: "APPROVE"|"REQUEST_CHANGES"|"COMMENT"|"PENDING"; + }; + declare type PullRequestsDismissReviewParams = + & Owner + & Repo + & Number + & Id + & Page + & PerPage + & { + message?: string; + }; + declare type PullRequestsGetCommentsParams = + & Owner + & Repo + & Number + & Page + & PerPage + ; + declare type PullRequestsGetCommentsForRepoParams = + & Owner + & Repo + & Direction + & Since + & Page + & PerPage + & { + sort?: "created"|"updated"; + }; + declare type PullRequestsGetCommentParams = + & Owner + & Repo + & Id + ; + declare type PullRequestsCreateCommentParams = + & Owner + & Repo + & Number + & Body + & CommitId + & Path + & Position + ; + declare type PullRequestsCreateCommentReplyParams = + & Owner + & Repo + & Number + & Body + & { + in_reply_to: number; + }; + declare type PullRequestsEditCommentParams = + & Owner + & Repo + & Id + & Body + ; + declare type PullRequestsDeleteCommentParams = + & Owner + & Repo + & Id + ; + declare type PullRequestsGetReviewRequestsParams = + & Owner + & Repo + & Number + & Page + & PerPage + ; + declare type PullRequestsCreateReviewRequestParams = + & Owner + & Repo + & Number + & { + reviewers?: string[]; + }; + declare type PullRequestsDeleteReviewRequestParams = + & Owner + & Repo + & Number + & { + reviewers?: string[]; + }; + declare type ReactionsGetForCommitCommentParams = + & Owner + & Repo + & Id + & { + content?: "+1"|"-1"|"laugh"|"confused"|"heart"|"hooray"; + }; + declare type ReactionsCreateForCommitCommentParams = + & Owner + & Repo + & Id + & { + content: "+1"|"-1"|"laugh"|"confused"|"heart"|"hooray"; + }; + declare type ReactionsGetForIssueParams = + & Owner + & Repo + & Number + & { + content?: "+1"|"-1"|"laugh"|"confused"|"heart"|"hooray"; + }; + declare type ReactionsCreateForIssueParams = + & Owner + & Repo + & Number + & { + content: "+1"|"-1"|"laugh"|"confused"|"heart"|"hooray"; + }; + declare type ReactionsGetForIssueCommentParams = + & Owner + & Repo + & Id + & { + content?: "+1"|"-1"|"laugh"|"confused"|"heart"|"hooray"; + }; + declare type ReactionsCreateForIssueCommentParams = + & Owner + & Repo + & Id + & { + content: "+1"|"-1"|"laugh"|"confused"|"heart"|"hooray"; + }; + declare type ReactionsGetForPullRequestReviewCommentParams = + & Owner + & Repo + & Id + & { + content?: "+1"|"-1"|"laugh"|"confused"|"heart"|"hooray"; + }; + declare type ReactionsCreateForPullRequestReviewCommentParams = + & Owner + & Repo + & Id + & { + content: "+1"|"-1"|"laugh"|"confused"|"heart"|"hooray"; + }; + declare type ReactionsDeleteParams = + & Id + ; + declare type ReposGetAllParams = + & Direction + & Page + & PerPage + & { + visibility?: "all"|"public"|"private"; + affiliation?: string; + type?: "all"|"owner"|"public"|"private"|"member"; + sort?: "created"|"updated"|"pushed"|"full_name"; + }; + declare type ReposGetForUserParams = + & Username + & Direction + & Page + & PerPage + & { + type?: "all"|"owner"|"member"; + sort?: "created"|"updated"|"pushed"|"full_name"; + }; + declare type ReposGetForOrgParams = + & Org + & Page + & PerPage + & { + type?: "all"|"public"|"private"|"forks"|"sources"|"member"; + }; + declare type ReposGetPublicParams = + & { + since?: string; + }; + declare type ReposGetByIdParams = + & Id + ; + declare type ReposCreateParams = + & Name + & Description + & Homepage + & Private + & HasIssues + & HasWiki + & HasDownloads + & AutoInit + & GitignoreTemplate + & LicenseTemplate + & { + team_id?: number; + allow_squash_merge?: boolean; + allow_merge_commit?: boolean; + allow_rebase_merge?: boolean; + }; + declare type ReposGetParams = + & Owner + & Repo + ; + declare type ReposCreateForOrgParams = + & Org + & Name + & Description + & Homepage + & Private + & HasIssues + & HasWiki + & HasDownloads + & AutoInit + & GitignoreTemplate + & LicenseTemplate + & { + team_id?: number; + allow_squash_merge?: boolean; + allow_merge_commit?: boolean; + allow_rebase_merge?: boolean; + }; + declare type ReposEditParams = + & Owner + & Repo + & Name + & Description + & Homepage + & Private + & HasIssues + & HasWiki + & HasDownloads + & DefaultBranch + & { + allow_squash_merge?: boolean; + allow_merge_commit?: boolean; + allow_rebase_merge?: boolean; + }; + declare type ReposGetContributorsParams = + & Owner + & Repo + & Page + & PerPage + & { + anon?: boolean; + }; + declare type ReposGetLanguagesParams = + & Owner + & Repo + & Page + & PerPage + ; + declare type ReposGetTeamsParams = + & Owner + & Repo + & Page + & PerPage + ; + declare type ReposGetTagsParams = + & Owner + & Repo + & Page + & PerPage + ; + declare type ReposDeleteParams = + & Owner + & Repo + ; + declare type ReposGetBranchesParams = + & Owner + & Repo + & Page + & PerPage + & { + protected?: boolean; + }; + declare type ReposGetBranchParams = + & Owner + & Repo + & Branch + & Page + & PerPage + ; + declare type ReposGetBranchProtectionParams = + & Owner + & Repo + & Branch + & Page + & PerPage + ; + declare type ReposUpdateBranchProtectionParams = + & Owner + & Repo + & Branch + & Page + & PerPage + & { + required_status_checks: string; + required_pull_request_reviews: string; + restrictions: string; + }; + declare type ReposRemoveBranchProtectionParams = + & Owner + & Repo + & Branch + & Page + & PerPage + ; + declare type ReposGetProtectedBranchRequiredStatusChecksParams = + & Owner + & Repo + & Branch + & Page + & PerPage + ; + declare type ReposUpdateProtectedBranchRequiredStatusChecksParams = + & Owner + & Repo + & Branch + & Page + & PerPage + & { + include_admins?: boolean; + strict?: boolean; + contexts?: string[]; + }; + declare type ReposRemoveProtectedBranchRequiredStatusChecksParams = + & Owner + & Repo + & Branch + & Page + & PerPage + ; + declare type ReposGetProtectedBranchRequiredStatusChecksContextsParams = + & Owner + & Repo + & Branch + & Page + & PerPage + ; + declare type ReposReplaceProtectedBranchRequiredStatusChecksContextsParams = + & Owner + & Repo + & Branch + & { + contexts: string[]; + }; + declare type ReposAddProtectedBranchRequiredStatusChecksContextsParams = + & Owner + & Repo + & Branch + & { + contexts: string[]; + }; + declare type ReposRemoveProtectedBranchRequiredStatusChecksContextsParams = + & Owner + & Repo + & Branch + & { + contexts: string[]; + }; + declare type ReposGetProtectedBranchPullRequestReviewEnforcementParams = + & Owner + & Repo + & Branch + & Page + & PerPage + ; + declare type ReposUpdateProtectedBranchPullRequestReviewEnforcementParams = + & Owner + & Repo + & Branch + & { + include_admins?: boolean; + }; + declare type ReposRemoveProtectedBranchPullRequestReviewEnforcementParams = + & Owner + & Repo + & Branch + ; + declare type ReposGetProtectedBranchRestrictionsParams = + & Owner + & Repo + & Branch + & Page + & PerPage + ; + declare type ReposRemoveProtectedBranchRestrictionsParams = + & Owner + & Repo + & Branch + ; + declare type ReposGetProtectedBranchTeamRestrictionsParams = + & Owner + & Repo + & Branch + & Page + & PerPage + ; + declare type ReposReplaceProtectedBranchTeamRestrictionsParams = + & Owner + & Repo + & Branch + & { + teams: string[]; + }; + declare type ReposAddProtectedBranchTeamRestrictionsParams = + & Owner + & Repo + & Branch + & { + teams: string[]; + }; + declare type ReposRemoveProtectedBranchTeamRestrictionsParams = + & Owner + & Repo + & Branch + & { + teams: string[]; + }; + declare type ReposGetProtectedBranchUserRestrictionsParams = + & Owner + & Repo + & Branch + & Page + & PerPage + ; + declare type ReposReplaceProtectedBranchUserRestrictionsParams = + & Owner + & Repo + & Branch + & { + users: string[]; + }; + declare type ReposAddProtectedBranchUserRestrictionsParams = + & Owner + & Repo + & Branch + & { + users: string[]; + }; + declare type ReposRemoveProtectedBranchUserRestrictionsParams = + & Owner + & Repo + & Branch + & { + users: string[]; + }; + declare type ReposGetCollaboratorsParams = + & Owner + & Repo + & Page + & PerPage + & { + affiliation?: "outside"|"all"; + }; + declare type ReposCheckCollaboratorParams = + & Owner + & Repo + & Username + ; + declare type ReposReviewUserPermissionLevelParams = + & Owner + & Repo + & Username + ; + declare type ReposAddCollaboratorParams = + & Owner + & Repo + & Username + & { + permission?: "pull"|"push"|"admin"; + }; + declare type ReposRemoveCollaboratorParams = + & Owner + & Repo + & Username + ; + declare type ReposGetAllCommitCommentsParams = + & Owner + & Repo + & Page + & PerPage + ; + declare type ReposGetCommitCommentsParams = + & Owner + & Repo + & Page + & PerPage + & { + ref: string; + }; + declare type ReposCreateCommitCommentParams = + & Owner + & Repo + & Sha + & Body + & { + path?: string; + position?: number; + line?: number; + }; + declare type ReposGetCommitCommentParams = + & Owner + & Repo + & Id + ; + declare type ReposUpdateCommitCommentParams = + & Owner + & Repo + & Id + & Body + ; + declare type ReposDeleteCommitCommentParams = + & Owner + & Repo + & Id + ; + declare type ReposGetCommunityHealthMetricsParams = + & RepoId + ; + declare type ReposGetCommitsParams = + & Owner + & Repo + & Since + & Until + & Page + & PerPage + & { + sha?: string; + path?: string; + author?: string; + }; + declare type ReposGetCommitParams = + & Owner + & Repo + & Sha + ; + declare type ReposGetShaOfCommitRefParams = + & Owner + & Repo + & Ref + ; + declare type ReposCompareCommitsParams = + & Owner + & Repo + & Base + & Head + ; + declare type ReposGetReadmeParams = + & Owner + & Repo + & { + ref?: string; + }; + declare type ReposGetContentParams = + & Owner + & Repo + & { + path: string; + ref?: string; + }; + declare type ReposCreateFileParams = + & Owner + & Repo + & { + path: string; + message: string; + content: string; + branch?: string; + committer?: string; + }; + declare type ReposUpdateFileParams = + & Owner + & Repo + & { + path: string; + message: string; + content: string; + sha: string; + branch?: string; + committer?: string; + }; + declare type ReposDeleteFileParams = + & Owner + & Repo + & { + path: string; + message: string; + sha: string; + branch?: string; + committer?: string; + }; + declare type ReposGetArchiveLinkParams = + & Owner + & Repo + & { + archive_format: "tarball"|"zipball"; + ref?: string; + }; + declare type ReposGetKeysParams = + & Owner + & Repo + & Page + & PerPage + ; + declare type ReposGetKeyParams = + & Owner + & Repo + & Id + ; + declare type ReposCreateKeyParams = + & Owner + & Repo + & Title + & Key + & { + read_only?: boolean; + }; + declare type ReposDeleteKeyParams = + & Owner + & Repo + & Id + ; + declare type ReposGetDeploymentsParams = + & Owner + & Repo + & Page + & PerPage + & { + sha?: string; + ref?: string; + task?: string; + environment?: string; + }; + declare type ReposCreateDeploymentParams = + & Owner + & Repo + & { + ref: string; + task?: string; + auto_merge?: boolean; + required_contexts?: string[]; + payload?: string; + environment?: string; + description?: string; + transient_environment?: boolean; + production_environment?: boolean; + }; + declare type ReposGetDeploymentStatusesParams = + & Owner + & Repo + & Id + ; + declare type ReposCreateDeploymentStatusParams = + & Owner + & Repo + & Id + & { + state?: string; + target_url?: string; + log_url?: string; + description?: string; + environment_url?: string; + auto_inactive?: boolean; + }; + declare type ReposGetDownloadsParams = + & Owner + & Repo + & Page + & PerPage + ; + declare type ReposGetDownloadParams = + & Owner + & Repo + & Id + ; + declare type ReposDeleteDownloadParams = + & Owner + & Repo + & Id + ; + declare type ReposGetForksParams = + & Owner + & Repo + & Page + & PerPage + & { + sort?: "newest"|"oldest"|"stargazers"; + }; + declare type ReposForkParams = + & Owner + & Repo + & { + organization?: string; + }; + declare type ReposGetInvitesParams = + & RepoId + ; + declare type ReposDeleteInviteParams = + & RepoId + & InvitationId + ; + declare type ReposUpdateInviteParams = + & RepoId + & InvitationId + & { + permission?: "read"|"write"|"admin"; + }; + declare type ReposMergeParams = + & Owner + & Repo + & Base + & Head + & { + commit_message?: string; + }; + declare type ReposGetPagesParams = + & Owner + & Repo + & Page + & PerPage + ; + declare type ReposRequestPageBuildParams = + & Owner + & Repo + ; + declare type ReposGetPagesBuildsParams = + & Owner + & Repo + & Page + & PerPage + ; + declare type ReposGetLatestPagesBuildParams = + & Owner + & Repo + ; + declare type ReposGetPagesBuildParams = + & Owner + & Repo + & Id + ; + declare type ReposGetReleasesParams = + & Owner + & Repo + & Page + & PerPage + ; + declare type ReposGetReleaseParams = + & Owner + & Repo + & Id + ; + declare type ReposGetLatestReleaseParams = + & Owner + & Repo + ; + declare type ReposGetReleaseByTagParams = + & Owner + & Repo + & { + tag: string; + }; + declare type ReposCreateReleaseParams = + & Owner + & Repo + & { + tag_name: string; + target_commitish?: string; + name?: string; + body?: string; + draft?: boolean; + prerelease?: boolean; + }; + declare type ReposEditReleaseParams = + & Owner + & Repo + & Id + & { + tag_name: string; + target_commitish?: string; + name?: string; + body?: string; + draft?: boolean; + prerelease?: boolean; + }; + declare type ReposDeleteReleaseParams = + & Owner + & Repo + & Id + ; + declare type ReposGetAssetsParams = + & Owner + & Repo + & Id + ; + declare type ReposGetAssetParams = + & Owner + & Repo + & Id + ; + declare type ReposUploadAssetParams = + & Owner + & Repo + & Id + & { + filePath: string; + name: string; + label?: string; + }; + declare type ReposEditAssetParams = + & Owner + & Repo + & Id + & Name + & { + label?: string; + }; + declare type ReposDeleteAssetParams = + & Owner + & Repo + & Id + ; + declare type ReposGetStatsContributorsParams = + & Owner + & Repo + ; + declare type ReposGetStatsCommitActivityParams = + & Owner + & Repo + ; + declare type ReposGetStatsCodeFrequencyParams = + & Owner + & Repo + ; + declare type ReposGetStatsParticipationParams = + & Owner + & Repo + ; + declare type ReposGetStatsPunchCardParams = + & Owner + & Repo + ; + declare type ReposCreateStatusParams = + & Owner + & Repo + & Sha + & { + state: "pending"|"success"|"error"|"failure"; + target_url?: string; + description?: string; + context?: string; + }; + declare type ReposGetStatusesParams = + & Owner + & Repo + & Page + & PerPage + & { + ref: string; + }; + declare type ReposGetCombinedStatusParams = + & Owner + & Repo + & Page + & PerPage + & { + ref: string; + }; + declare type ReposGetReferrersParams = + & Owner + & Repo + & Page + & PerPage + ; + declare type ReposGetPathsParams = + & Owner + & Repo + & Page + & PerPage + ; + declare type ReposGetViewsParams = + & Owner + & Repo + & Page + & PerPage + ; + declare type ReposGetClonesParams = + & Owner + & Repo + & Page + & PerPage + ; + declare type ReposGetHooksParams = + & Owner + & Repo + & Page + & PerPage + ; + declare type ReposGetHookParams = + & Owner + & Repo + & Id + ; + declare type ReposCreateHookParams = + & Owner + & Repo + & Name + & { + config: string; + events?: string[]; + active?: boolean; + }; + declare type ReposEditHookParams = + & Owner + & Repo + & Id + & Name + & { + config: string; + events?: string[]; + add_events?: string[]; + remove_events?: string[]; + active?: boolean; + }; + declare type ReposTestHookParams = + & Owner + & Repo + & Id + ; + declare type ReposPingHookParams = + & Owner + & Repo + & Id + ; + declare type ReposDeleteHookParams = + & Owner + & Repo + & Id + ; + declare type SearchReposParams = + & Q + & Order + & Page + & PerPage + & { + sort?: "stars"|"forks"|"updated"; + }; + declare type SearchCodeParams = + & Q + & Order + & Page + & PerPage + & { + sort?: "indexed"; + }; + declare type SearchCommitsParams = + & Q + & Order + & Page + & PerPage + & { + sort?: "author-date"|"committer-date"; + }; + declare type SearchIssuesParams = + & Q + & Order + & Page + & PerPage + & { + sort?: "comments"|"created"|"updated"; + }; + declare type SearchUsersParams = + & Q + & Order + & Page + & PerPage + & { + sort?: "followers"|"repositories"|"joined"; + }; + declare type SearchEmailParams = + & { + email: string; + }; + declare type UsersGetForUserParams = + & Username + ; + declare type UsersGetByIdParams = + & Id + ; + declare type UsersUpdateParams = + & { + name?: string; + email?: string; + blog?: string; + company?: string; + location?: string; + hireable?: boolean; + bio?: string; + }; + declare type UsersGetAllParams = + & { + since?: number; + }; + declare type UsersGetOrgsParams = + & Page + & PerPage + ; + declare type UsersGetOrgMembershipsParams = + & { + state?: "active"|"pending"; + }; + declare type UsersGetOrgMembershipParams = + & Org + ; + declare type UsersEditOrgMembershipParams = + & Org + & { + state: "active"; + }; + declare type UsersGetTeamsParams = + & Page + & PerPage + ; + declare type UsersGetEmailsParams = + & Page + & PerPage + ; + declare type UsersAddEmailsParams = + & { + emails: string[]; + }; + declare type UsersDeleteEmailsParams = + & { + emails: string[]; + }; + declare type UsersGetFollowersForUserParams = + & Username + & Page + & PerPage + ; + declare type UsersGetFollowersParams = + & Page + & PerPage + ; + declare type UsersGetFollowingForUserParams = + & Username + & Page + & PerPage + ; + declare type UsersGetFollowingParams = + & Page + & PerPage + ; + declare type UsersCheckFollowingParams = + & Username + ; + declare type UsersCheckIfOneFollowersOtherParams = + & Username + & { + target_user: string; + }; + declare type UsersFollowUserParams = + & Username + ; + declare type UsersUnfollowUserParams = + & Username + ; + declare type UsersGetKeysForUserParams = + & Username + & Page + & PerPage + ; + declare type UsersGetKeysParams = + & Page + & PerPage + ; + declare type UsersGetKeyParams = + & Id + ; + declare type UsersCreateKeyParams = + & Title + & Key + ; + declare type UsersDeleteKeyParams = + & Id + ; + declare type UsersGetGpgKeysParams = + & Page + & PerPage + ; + declare type UsersGetGpgKeyParams = + & Id + ; + declare type UsersCreateGpgKeyParams = + & { + armored_public_key: string; + }; + declare type UsersDeleteGpgKeyParams = + & Id + ; + declare type UsersPromoteParams = + & Username + ; + declare type UsersDemoteParams = + & Username + ; + declare type UsersSuspendParams = + & Username + ; + declare type UsersUnsuspendParams = + & Username + ; + declare type UsersAcceptRepoInviteParams = + & InvitationId + ; + declare type UsersDeclineRepoInviteParams = + & InvitationId + ; + declare type EnterpriseStatsParams = + & { + type: "issues"|"hooks"|"milestones"|"orgs"|"comments"|"pages"|"users"|"gists"|"pulls"|"repos"|"all"; + }; + declare type EnterpriseUpdateLdapForUserParams = + & Username + & { + ldap_dn: string; + }; + declare type EnterpriseSyncLdapForUserParams = + & Username + ; + declare type EnterpriseUpdateLdapForTeamParams = + & { + team_id: number; + ldap_dn: string; + }; + declare type EnterpriseSyncLdapForTeamParams = + & { + team_id: number; + }; + declare type EnterpriseGetPreReceiveEnvironmentParams = + & Id + ; + declare type EnterpriseCreatePreReceiveEnvironmentParams = + & { + name: string; + image_url: string; + }; + declare type EnterpriseEditPreReceiveEnvironmentParams = + & Id + & { + name: string; + image_url: string; + }; + declare type EnterpriseDeletePreReceiveEnvironmentParams = + & Id + ; + declare type EnterpriseGetPreReceiveEnvironmentDownloadStatusParams = + & Id + ; + declare type EnterpriseTriggerPreReceiveEnvironmentDownloadParams = + & Id + ; + declare type EnterpriseGetPreReceiveHookParams = + & Id + ; + declare type EnterpriseCreatePreReceiveHookParams = + & { + name: string; + script: string; + script_repository: string; + environment: string; + enforcement?: string; + allow_downstream_configuration?: boolean; + }; + declare type EnterpriseEditPreReceiveHookParams = + & Id + & { + hook: string; + }; + declare type EnterpriseDeletePreReceiveHookParams = + & Id + ; + declare type EnterpriseQueueIndexingJobParams = + & { + target: string; + }; + declare type EnterpriseCreateOrgParams = + & { + login: string; + admin: string; + profile_name?: string; + }; + + declare class Github { + constructor(options?: Options): Github; + authenticate(auth: Auth): void; + hasNextPage(link: Link): ?string; + hasPreviousPage(link: Link): ?string; + hasLastPage(link: Link): ?string; + hasFirstPage(link: Link): ?string; + getNextPage(link: Link, headers?: {[header: Header]: any}, callback?: Callback): Promise; + getPreviousPage(link: Link, headers?: {[header: Header]: any}, callback?: Callback): Promise; + getLastPage(link: Link, headers?: {[header: Header]: any}, callback?: Callback): Promise; + getFirstPage(link: Link, headers?: {[header: Header]: any}, callback?: Callback): Promise; + authorization: { + getGrants(params: AuthorizationGetGrantsParams, callback?: Callback): Promise; + getGrant(params: AuthorizationGetGrantParams, callback?: Callback): Promise; + deleteGrant(params: AuthorizationDeleteGrantParams, callback?: Callback): Promise; + getAll(params: AuthorizationGetAllParams, callback?: Callback): Promise; + get(params: AuthorizationGetParams, callback?: Callback): Promise; + create(params: AuthorizationCreateParams, callback?: Callback): Promise; + getOrCreateAuthorizationForApp(params: AuthorizationGetOrCreateAuthorizationForAppParams, callback?: Callback): Promise; + getOrCreateAuthorizationForAppAndFingerprint(params: AuthorizationGetOrCreateAuthorizationForAppAndFingerprintParams, callback?: Callback): Promise; + update(params: AuthorizationUpdateParams, callback?: Callback): Promise; + delete(params: AuthorizationDeleteParams, callback?: Callback): Promise; + check(params: AuthorizationCheckParams, callback?: Callback): Promise; + reset(params: AuthorizationResetParams, callback?: Callback): Promise; + revoke(params: AuthorizationRevokeParams, callback?: Callback): Promise; + }; + activity: { + getEvents(params: ActivityGetEventsParams, callback?: Callback): Promise; + getEventsForRepo(params: ActivityGetEventsForRepoParams, callback?: Callback): Promise; + getEventsForRepoIssues(params: ActivityGetEventsForRepoIssuesParams, callback?: Callback): Promise; + getEventsForRepoNetwork(params: ActivityGetEventsForRepoNetworkParams, callback?: Callback): Promise; + getEventsForOrg(params: ActivityGetEventsForOrgParams, callback?: Callback): Promise; + getEventsReceived(params: ActivityGetEventsReceivedParams, callback?: Callback): Promise; + getEventsReceivedPublic(params: ActivityGetEventsReceivedPublicParams, callback?: Callback): Promise; + getEventsForUser(params: ActivityGetEventsForUserParams, callback?: Callback): Promise; + getEventsForUserPublic(params: ActivityGetEventsForUserPublicParams, callback?: Callback): Promise; + getEventsForUserOrg(params: ActivityGetEventsForUserOrgParams, callback?: Callback): Promise; + getFeeds(callback?: Callback): Promise; + getNotifications(params: ActivityGetNotificationsParams, callback?: Callback): Promise; + getNotificationsForUser(params: ActivityGetNotificationsForUserParams, callback?: Callback): Promise; + markNotificationsAsRead(params: ActivityMarkNotificationsAsReadParams, callback?: Callback): Promise; + markNotificationsAsReadForRepo(params: ActivityMarkNotificationsAsReadForRepoParams, callback?: Callback): Promise; + getNotificationThread(params: ActivityGetNotificationThreadParams, callback?: Callback): Promise; + markNotificationThreadAsRead(params: ActivityMarkNotificationThreadAsReadParams, callback?: Callback): Promise; + checkNotificationThreadSubscription(params: ActivityCheckNotificationThreadSubscriptionParams, callback?: Callback): Promise; + setNotificationThreadSubscription(params: ActivitySetNotificationThreadSubscriptionParams, callback?: Callback): Promise; + deleteNotificationThreadSubscription(params: ActivityDeleteNotificationThreadSubscriptionParams, callback?: Callback): Promise; + getStargazersForRepo(params: ActivityGetStargazersForRepoParams, callback?: Callback): Promise; + getStarredReposForUser(params: ActivityGetStarredReposForUserParams, callback?: Callback): Promise; + getStarredRepos(params: ActivityGetStarredReposParams, callback?: Callback): Promise; + checkStarringRepo(params: ActivityCheckStarringRepoParams, callback?: Callback): Promise; + starRepo(params: ActivityStarRepoParams, callback?: Callback): Promise; + unstarRepo(params: ActivityUnstarRepoParams, callback?: Callback): Promise; + getWatchersForRepo(params: ActivityGetWatchersForRepoParams, callback?: Callback): Promise; + getWatchedReposForUser(params: ActivityGetWatchedReposForUserParams, callback?: Callback): Promise; + getWatchedRepos(params: ActivityGetWatchedReposParams, callback?: Callback): Promise; + getRepoSubscription(params: ActivityGetRepoSubscriptionParams, callback?: Callback): Promise; + setRepoSubscription(params: ActivitySetRepoSubscriptionParams, callback?: Callback): Promise; + unwatchRepo(params: ActivityUnwatchRepoParams, callback?: Callback): Promise; + }; + gists: { + getForUser(params: GistsGetForUserParams, callback?: Callback): Promise; + getAll(params: GistsGetAllParams, callback?: Callback): Promise; + getPublic(params: GistsGetPublicParams, callback?: Callback): Promise; + getStarred(params: GistsGetStarredParams, callback?: Callback): Promise; + get(params: GistsGetParams, callback?: Callback): Promise; + getRevision(params: GistsGetRevisionParams, callback?: Callback): Promise; + create(params: GistsCreateParams, callback?: Callback): Promise; + edit(params: GistsEditParams, callback?: Callback): Promise; + getCommits(params: GistsGetCommitsParams, callback?: Callback): Promise; + star(params: GistsStarParams, callback?: Callback): Promise; + unstar(params: GistsUnstarParams, callback?: Callback): Promise; + checkStar(params: GistsCheckStarParams, callback?: Callback): Promise; + fork(params: GistsForkParams, callback?: Callback): Promise; + getForks(params: GistsGetForksParams, callback?: Callback): Promise; + delete(params: GistsDeleteParams, callback?: Callback): Promise; + getComments(params: GistsGetCommentsParams, callback?: Callback): Promise; + getComment(params: GistsGetCommentParams, callback?: Callback): Promise; + createComment(params: GistsCreateCommentParams, callback?: Callback): Promise; + editComment(params: GistsEditCommentParams, callback?: Callback): Promise; + deleteComment(params: GistsDeleteCommentParams, callback?: Callback): Promise; + }; + gitdata: { + getBlob(params: GitdataGetBlobParams, callback?: Callback): Promise; + createBlob(params: GitdataCreateBlobParams, callback?: Callback): Promise; + getCommit(params: GitdataGetCommitParams, callback?: Callback): Promise; + createCommit(params: GitdataCreateCommitParams, callback?: Callback): Promise; + getCommitSignatureVerification(params: GitdataGetCommitSignatureVerificationParams, callback?: Callback): Promise; + getReference(params: GitdataGetReferenceParams, callback?: Callback): Promise; + getReferences(params: GitdataGetReferencesParams, callback?: Callback): Promise; + getTags(params: GitdataGetTagsParams, callback?: Callback): Promise; + createReference(params: GitdataCreateReferenceParams, callback?: Callback): Promise; + updateReference(params: GitdataUpdateReferenceParams, callback?: Callback): Promise; + deleteReference(params: GitdataDeleteReferenceParams, callback?: Callback): Promise; + getTag(params: GitdataGetTagParams, callback?: Callback): Promise; + createTag(params: GitdataCreateTagParams, callback?: Callback): Promise; + getTagSignatureVerification(params: GitdataGetTagSignatureVerificationParams, callback?: Callback): Promise; + getTree(params: GitdataGetTreeParams, callback?: Callback): Promise; + createTree(params: GitdataCreateTreeParams, callback?: Callback): Promise; + }; + integrations: { + getInstallations(params: IntegrationsGetInstallationsParams, callback?: Callback): Promise; + createInstallationToken(params: IntegrationsCreateInstallationTokenParams, callback?: Callback): Promise; + getUserIdentity(params: IntegrationsGetUserIdentityParams, callback?: Callback): Promise; + getInstallationRepositories(params: IntegrationsGetInstallationRepositoriesParams, callback?: Callback): Promise; + addRepoToInstallation(params: IntegrationsAddRepoToInstallationParams, callback?: Callback): Promise; + removeRepoFromInstallation(params: IntegrationsRemoveRepoFromInstallationParams, callback?: Callback): Promise; + }; + issues: { + getAll(params: IssuesGetAllParams, callback?: Callback): Promise; + getForUser(params: IssuesGetForUserParams, callback?: Callback): Promise; + getForOrg(params: IssuesGetForOrgParams, callback?: Callback): Promise; + getForRepo(params: IssuesGetForRepoParams, callback?: Callback): Promise; + get(params: IssuesGetParams, callback?: Callback): Promise; + create(params: IssuesCreateParams, callback?: Callback): Promise; + edit(params: IssuesEditParams, callback?: Callback): Promise; + lock(params: IssuesLockParams, callback?: Callback): Promise; + unlock(params: IssuesUnlockParams, callback?: Callback): Promise; + getAssignees(params: IssuesGetAssigneesParams, callback?: Callback): Promise; + checkAssignee(params: IssuesCheckAssigneeParams, callback?: Callback): Promise; + addAssigneesToIssue(params: IssuesAddAssigneesToIssueParams, callback?: Callback): Promise; + removeAssigneesFromIssue(params: IssuesRemoveAssigneesFromIssueParams, callback?: Callback): Promise; + getComments(params: IssuesGetCommentsParams, callback?: Callback): Promise; + getCommentsForRepo(params: IssuesGetCommentsForRepoParams, callback?: Callback): Promise; + getComment(params: IssuesGetCommentParams, callback?: Callback): Promise; + createComment(params: IssuesCreateCommentParams, callback?: Callback): Promise; + editComment(params: IssuesEditCommentParams, callback?: Callback): Promise; + deleteComment(params: IssuesDeleteCommentParams, callback?: Callback): Promise; + getEvents(params: IssuesGetEventsParams, callback?: Callback): Promise; + getEventsForRepo(params: IssuesGetEventsForRepoParams, callback?: Callback): Promise; + getEvent(params: IssuesGetEventParams, callback?: Callback): Promise; + getLabels(params: IssuesGetLabelsParams, callback?: Callback): Promise; + getLabel(params: IssuesGetLabelParams, callback?: Callback): Promise; + createLabel(params: IssuesCreateLabelParams, callback?: Callback): Promise; + updateLabel(params: IssuesUpdateLabelParams, callback?: Callback): Promise; + deleteLabel(params: IssuesDeleteLabelParams, callback?: Callback): Promise; + getIssueLabels(params: IssuesGetIssueLabelsParams, callback?: Callback): Promise; + addLabels(params: IssuesAddLabelsParams, callback?: Callback): Promise; + removeLabel(params: IssuesRemoveLabelParams, callback?: Callback): Promise; + replaceAllLabels(params: IssuesReplaceAllLabelsParams, callback?: Callback): Promise; + removeAllLabels(params: IssuesRemoveAllLabelsParams, callback?: Callback): Promise; + getMilestoneLabels(params: IssuesGetMilestoneLabelsParams, callback?: Callback): Promise; + getMilestones(params: IssuesGetMilestonesParams, callback?: Callback): Promise; + getMilestone(params: IssuesGetMilestoneParams, callback?: Callback): Promise; + createMilestone(params: IssuesCreateMilestoneParams, callback?: Callback): Promise; + updateMilestone(params: IssuesUpdateMilestoneParams, callback?: Callback): Promise; + deleteMilestone(params: IssuesDeleteMilestoneParams, callback?: Callback): Promise; + getEventsTimeline(params: IssuesGetEventsTimelineParams, callback?: Callback): Promise; + }; + migrations: { + startMigration(params: MigrationsStartMigrationParams, callback?: Callback): Promise; + getMigrations(params: MigrationsGetMigrationsParams, callback?: Callback): Promise; + getMigrationStatus(params: MigrationsGetMigrationStatusParams, callback?: Callback): Promise; + getMigrationArchiveLink(params: MigrationsGetMigrationArchiveLinkParams, callback?: Callback): Promise; + deleteMigrationArchive(params: MigrationsDeleteMigrationArchiveParams, callback?: Callback): Promise; + unlockRepoLockedForMigration(params: MigrationsUnlockRepoLockedForMigrationParams, callback?: Callback): Promise; + startImport(params: MigrationsStartImportParams, callback?: Callback): Promise; + getImportProgress(params: MigrationsGetImportProgressParams, callback?: Callback): Promise; + updateImport(params: MigrationsUpdateImportParams, callback?: Callback): Promise; + getImportCommitAuthors(params: MigrationsGetImportCommitAuthorsParams, callback?: Callback): Promise; + mapImportCommitAuthor(params: MigrationsMapImportCommitAuthorParams, callback?: Callback): Promise; + setImportLfsPreference(params: MigrationsSetImportLfsPreferenceParams, callback?: Callback): Promise; + getLargeImportFiles(params: MigrationsGetLargeImportFilesParams, callback?: Callback): Promise; + cancelImport(params: MigrationsCancelImportParams, callback?: Callback): Promise; + }; + misc: { + getEmojis(callback?: Callback): Promise; + getGitignoreTemplates(callback?: Callback): Promise; + getGitignoreTemplate(params: MiscGetGitignoreTemplateParams, callback?: Callback): Promise; + getLicenses(callback?: Callback): Promise; + getLicense(params: MiscGetLicenseParams, callback?: Callback): Promise; + getRepoLicense(params: MiscGetRepoLicenseParams, callback?: Callback): Promise; + renderMarkdown(params: MiscRenderMarkdownParams, callback?: Callback): Promise; + renderMarkdownRaw(params: MiscRenderMarkdownRawParams, callback?: Callback): Promise; + getMeta(callback?: Callback): Promise; + getRateLimit(callback?: Callback): Promise; + }; + orgs: { + getAll(params: OrgsGetAllParams, callback?: Callback): Promise; + getForUser(params: OrgsGetForUserParams, callback?: Callback): Promise; + get(params: OrgsGetParams, callback?: Callback): Promise; + update(params: OrgsUpdateParams, callback?: Callback): Promise; + getMembers(params: OrgsGetMembersParams, callback?: Callback): Promise; + checkMembership(params: OrgsCheckMembershipParams, callback?: Callback): Promise; + removeMember(params: OrgsRemoveMemberParams, callback?: Callback): Promise; + getPublicMembers(params: OrgsGetPublicMembersParams, callback?: Callback): Promise; + checkPublicMembership(params: OrgsCheckPublicMembershipParams, callback?: Callback): Promise; + publicizeMembership(params: OrgsPublicizeMembershipParams, callback?: Callback): Promise; + concealMembership(params: OrgsConcealMembershipParams, callback?: Callback): Promise; + getOrgMembership(params: OrgsGetOrgMembershipParams, callback?: Callback): Promise; + addOrgMembership(params: OrgsAddOrgMembershipParams, callback?: Callback): Promise; + removeOrgMembership(params: OrgsRemoveOrgMembershipParams, callback?: Callback): Promise; + getPendingOrgInvites(params: OrgsGetPendingOrgInvitesParams, callback?: Callback): Promise; + getOutsideCollaborators(params: OrgsGetOutsideCollaboratorsParams, callback?: Callback): Promise; + removeOutsideCollaborator(params: OrgsRemoveOutsideCollaboratorParams, callback?: Callback): Promise; + convertMemberToOutsideCollaborator(params: OrgsConvertMemberToOutsideCollaboratorParams, callback?: Callback): Promise; + getTeams(params: OrgsGetTeamsParams, callback?: Callback): Promise; + getTeam(params: OrgsGetTeamParams, callback?: Callback): Promise; + createTeam(params: OrgsCreateTeamParams, callback?: Callback): Promise; + editTeam(params: OrgsEditTeamParams, callback?: Callback): Promise; + deleteTeam(params: OrgsDeleteTeamParams, callback?: Callback): Promise; + getTeamMembers(params: OrgsGetTeamMembersParams, callback?: Callback): Promise; + getTeamMembership(params: OrgsGetTeamMembershipParams, callback?: Callback): Promise; + addTeamMembership(params: OrgsAddTeamMembershipParams, callback?: Callback): Promise; + removeTeamMembership(params: OrgsRemoveTeamMembershipParams, callback?: Callback): Promise; + getTeamRepos(params: OrgsGetTeamReposParams, callback?: Callback): Promise; + getPendingTeamInvites(params: OrgsGetPendingTeamInvitesParams, callback?: Callback): Promise; + checkTeamRepo(params: OrgsCheckTeamRepoParams, callback?: Callback): Promise; + addTeamRepo(params: OrgsAddTeamRepoParams, callback?: Callback): Promise; + deleteTeamRepo(params: OrgsDeleteTeamRepoParams, callback?: Callback): Promise; + getHooks(params: OrgsGetHooksParams, callback?: Callback): Promise; + getHook(params: OrgsGetHookParams, callback?: Callback): Promise; + createHook(params: OrgsCreateHookParams, callback?: Callback): Promise; + editHook(params: OrgsEditHookParams, callback?: Callback): Promise; + pingHook(params: OrgsPingHookParams, callback?: Callback): Promise; + deleteHook(params: OrgsDeleteHookParams, callback?: Callback): Promise; + }; + projects: { + getRepoProjects(params: ProjectsGetRepoProjectsParams, callback?: Callback): Promise; + getOrgProjects(params: ProjectsGetOrgProjectsParams, callback?: Callback): Promise; + getProject(params: ProjectsGetProjectParams, callback?: Callback): Promise; + createRepoProject(params: ProjectsCreateRepoProjectParams, callback?: Callback): Promise; + createOrgProject(params: ProjectsCreateOrgProjectParams, callback?: Callback): Promise; + updateProject(params: ProjectsUpdateProjectParams, callback?: Callback): Promise; + deleteProject(params: ProjectsDeleteProjectParams, callback?: Callback): Promise; + getProjectCards(params: ProjectsGetProjectCardsParams, callback?: Callback): Promise; + getProjectCard(params: ProjectsGetProjectCardParams, callback?: Callback): Promise; + createProjectCard(params: ProjectsCreateProjectCardParams, callback?: Callback): Promise; + updateProjectCard(params: ProjectsUpdateProjectCardParams, callback?: Callback): Promise; + deleteProjectCard(params: ProjectsDeleteProjectCardParams, callback?: Callback): Promise; + moveProjectCard(params: ProjectsMoveProjectCardParams, callback?: Callback): Promise; + getProjectColumns(params: ProjectsGetProjectColumnsParams, callback?: Callback): Promise; + getProjectColumn(params: ProjectsGetProjectColumnParams, callback?: Callback): Promise; + createProjectColumn(params: ProjectsCreateProjectColumnParams, callback?: Callback): Promise; + updateProjectColumn(params: ProjectsUpdateProjectColumnParams, callback?: Callback): Promise; + deleteProjectColumn(params: ProjectsDeleteProjectColumnParams, callback?: Callback): Promise; + moveProjectColumn(params: ProjectsMoveProjectColumnParams, callback?: Callback): Promise; + }; + pullRequests: { + getAll(params: PullRequestsGetAllParams, callback?: Callback): Promise; + get(params: PullRequestsGetParams, callback?: Callback): Promise; + create(params: PullRequestsCreateParams, callback?: Callback): Promise; + createFromIssue(params: PullRequestsCreateFromIssueParams, callback?: Callback): Promise; + update(params: PullRequestsUpdateParams, callback?: Callback): Promise; + getCommits(params: PullRequestsGetCommitsParams, callback?: Callback): Promise; + getFiles(params: PullRequestsGetFilesParams, callback?: Callback): Promise; + checkMerged(params: PullRequestsCheckMergedParams, callback?: Callback): Promise; + merge(params: PullRequestsMergeParams, callback?: Callback): Promise; + getReviews(params: PullRequestsGetReviewsParams, callback?: Callback): Promise; + getReview(params: PullRequestsGetReviewParams, callback?: Callback): Promise; + getReviewComments(params: PullRequestsGetReviewCommentsParams, callback?: Callback): Promise; + createReview(params: PullRequestsCreateReviewParams, callback?: Callback): Promise; + submitReview(params: PullRequestsSubmitReviewParams, callback?: Callback): Promise; + dismissReview(params: PullRequestsDismissReviewParams, callback?: Callback): Promise; + getComments(params: PullRequestsGetCommentsParams, callback?: Callback): Promise; + getCommentsForRepo(params: PullRequestsGetCommentsForRepoParams, callback?: Callback): Promise; + getComment(params: PullRequestsGetCommentParams, callback?: Callback): Promise; + createComment(params: PullRequestsCreateCommentParams, callback?: Callback): Promise; + createCommentReply(params: PullRequestsCreateCommentReplyParams, callback?: Callback): Promise; + editComment(params: PullRequestsEditCommentParams, callback?: Callback): Promise; + deleteComment(params: PullRequestsDeleteCommentParams, callback?: Callback): Promise; + getReviewRequests(params: PullRequestsGetReviewRequestsParams, callback?: Callback): Promise; + createReviewRequest(params: PullRequestsCreateReviewRequestParams, callback?: Callback): Promise; + deleteReviewRequest(params: PullRequestsDeleteReviewRequestParams, callback?: Callback): Promise; + }; + reactions: { + getForCommitComment(params: ReactionsGetForCommitCommentParams, callback?: Callback): Promise; + createForCommitComment(params: ReactionsCreateForCommitCommentParams, callback?: Callback): Promise; + getForIssue(params: ReactionsGetForIssueParams, callback?: Callback): Promise; + createForIssue(params: ReactionsCreateForIssueParams, callback?: Callback): Promise; + getForIssueComment(params: ReactionsGetForIssueCommentParams, callback?: Callback): Promise; + createForIssueComment(params: ReactionsCreateForIssueCommentParams, callback?: Callback): Promise; + getForPullRequestReviewComment(params: ReactionsGetForPullRequestReviewCommentParams, callback?: Callback): Promise; + createForPullRequestReviewComment(params: ReactionsCreateForPullRequestReviewCommentParams, callback?: Callback): Promise; + delete(params: ReactionsDeleteParams, callback?: Callback): Promise; + }; + repos: { + getAll(params: ReposGetAllParams, callback?: Callback): Promise; + getForUser(params: ReposGetForUserParams, callback?: Callback): Promise; + getForOrg(params: ReposGetForOrgParams, callback?: Callback): Promise; + getPublic(params: ReposGetPublicParams, callback?: Callback): Promise; + getById(params: ReposGetByIdParams, callback?: Callback): Promise; + create(params: ReposCreateParams, callback?: Callback): Promise; + get(params: ReposGetParams, callback?: Callback): Promise; + createForOrg(params: ReposCreateForOrgParams, callback?: Callback): Promise; + edit(params: ReposEditParams, callback?: Callback): Promise; + getContributors(params: ReposGetContributorsParams, callback?: Callback): Promise; + getLanguages(params: ReposGetLanguagesParams, callback?: Callback): Promise; + getTeams(params: ReposGetTeamsParams, callback?: Callback): Promise; + getTags(params: ReposGetTagsParams, callback?: Callback): Promise; + delete(params: ReposDeleteParams, callback?: Callback): Promise; + getBranches(params: ReposGetBranchesParams, callback?: Callback): Promise; + getBranch(params: ReposGetBranchParams, callback?: Callback): Promise; + getBranchProtection(params: ReposGetBranchProtectionParams, callback?: Callback): Promise; + updateBranchProtection(params: ReposUpdateBranchProtectionParams, callback?: Callback): Promise; + removeBranchProtection(params: ReposRemoveBranchProtectionParams, callback?: Callback): Promise; + getProtectedBranchRequiredStatusChecks(params: ReposGetProtectedBranchRequiredStatusChecksParams, callback?: Callback): Promise; + updateProtectedBranchRequiredStatusChecks(params: ReposUpdateProtectedBranchRequiredStatusChecksParams, callback?: Callback): Promise; + removeProtectedBranchRequiredStatusChecks(params: ReposRemoveProtectedBranchRequiredStatusChecksParams, callback?: Callback): Promise; + getProtectedBranchRequiredStatusChecksContexts(params: ReposGetProtectedBranchRequiredStatusChecksContextsParams, callback?: Callback): Promise; + replaceProtectedBranchRequiredStatusChecksContexts(params: ReposReplaceProtectedBranchRequiredStatusChecksContextsParams, callback?: Callback): Promise; + addProtectedBranchRequiredStatusChecksContexts(params: ReposAddProtectedBranchRequiredStatusChecksContextsParams, callback?: Callback): Promise; + removeProtectedBranchRequiredStatusChecksContexts(params: ReposRemoveProtectedBranchRequiredStatusChecksContextsParams, callback?: Callback): Promise; + getProtectedBranchPullRequestReviewEnforcement(params: ReposGetProtectedBranchPullRequestReviewEnforcementParams, callback?: Callback): Promise; + updateProtectedBranchPullRequestReviewEnforcement(params: ReposUpdateProtectedBranchPullRequestReviewEnforcementParams, callback?: Callback): Promise; + removeProtectedBranchPullRequestReviewEnforcement(params: ReposRemoveProtectedBranchPullRequestReviewEnforcementParams, callback?: Callback): Promise; + getProtectedBranchRestrictions(params: ReposGetProtectedBranchRestrictionsParams, callback?: Callback): Promise; + removeProtectedBranchRestrictions(params: ReposRemoveProtectedBranchRestrictionsParams, callback?: Callback): Promise; + getProtectedBranchTeamRestrictions(params: ReposGetProtectedBranchTeamRestrictionsParams, callback?: Callback): Promise; + replaceProtectedBranchTeamRestrictions(params: ReposReplaceProtectedBranchTeamRestrictionsParams, callback?: Callback): Promise; + addProtectedBranchTeamRestrictions(params: ReposAddProtectedBranchTeamRestrictionsParams, callback?: Callback): Promise; + removeProtectedBranchTeamRestrictions(params: ReposRemoveProtectedBranchTeamRestrictionsParams, callback?: Callback): Promise; + getProtectedBranchUserRestrictions(params: ReposGetProtectedBranchUserRestrictionsParams, callback?: Callback): Promise; + replaceProtectedBranchUserRestrictions(params: ReposReplaceProtectedBranchUserRestrictionsParams, callback?: Callback): Promise; + addProtectedBranchUserRestrictions(params: ReposAddProtectedBranchUserRestrictionsParams, callback?: Callback): Promise; + removeProtectedBranchUserRestrictions(params: ReposRemoveProtectedBranchUserRestrictionsParams, callback?: Callback): Promise; + getCollaborators(params: ReposGetCollaboratorsParams, callback?: Callback): Promise; + checkCollaborator(params: ReposCheckCollaboratorParams, callback?: Callback): Promise; + reviewUserPermissionLevel(params: ReposReviewUserPermissionLevelParams, callback?: Callback): Promise; + addCollaborator(params: ReposAddCollaboratorParams, callback?: Callback): Promise; + removeCollaborator(params: ReposRemoveCollaboratorParams, callback?: Callback): Promise; + getAllCommitComments(params: ReposGetAllCommitCommentsParams, callback?: Callback): Promise; + getCommitComments(params: ReposGetCommitCommentsParams, callback?: Callback): Promise; + createCommitComment(params: ReposCreateCommitCommentParams, callback?: Callback): Promise; + getCommitComment(params: ReposGetCommitCommentParams, callback?: Callback): Promise; + updateCommitComment(params: ReposUpdateCommitCommentParams, callback?: Callback): Promise; + deleteCommitComment(params: ReposDeleteCommitCommentParams, callback?: Callback): Promise; + getCommunityHealthMetrics(params: ReposGetCommunityHealthMetricsParams, callback?: Callback): Promise; + getCommits(params: ReposGetCommitsParams, callback?: Callback): Promise; + getCommit(params: ReposGetCommitParams, callback?: Callback): Promise; + getShaOfCommitRef(params: ReposGetShaOfCommitRefParams, callback?: Callback): Promise; + compareCommits(params: ReposCompareCommitsParams, callback?: Callback): Promise; + getReadme(params: ReposGetReadmeParams, callback?: Callback): Promise; + getContent(params: ReposGetContentParams, callback?: Callback): Promise; + createFile(params: ReposCreateFileParams, callback?: Callback): Promise; + updateFile(params: ReposUpdateFileParams, callback?: Callback): Promise; + deleteFile(params: ReposDeleteFileParams, callback?: Callback): Promise; + getArchiveLink(params: ReposGetArchiveLinkParams, callback?: Callback): Promise; + getKeys(params: ReposGetKeysParams, callback?: Callback): Promise; + getKey(params: ReposGetKeyParams, callback?: Callback): Promise; + createKey(params: ReposCreateKeyParams, callback?: Callback): Promise; + deleteKey(params: ReposDeleteKeyParams, callback?: Callback): Promise; + getDeployments(params: ReposGetDeploymentsParams, callback?: Callback): Promise; + createDeployment(params: ReposCreateDeploymentParams, callback?: Callback): Promise; + getDeploymentStatuses(params: ReposGetDeploymentStatusesParams, callback?: Callback): Promise; + createDeploymentStatus(params: ReposCreateDeploymentStatusParams, callback?: Callback): Promise; + getDownloads(params: ReposGetDownloadsParams, callback?: Callback): Promise; + getDownload(params: ReposGetDownloadParams, callback?: Callback): Promise; + deleteDownload(params: ReposDeleteDownloadParams, callback?: Callback): Promise; + getForks(params: ReposGetForksParams, callback?: Callback): Promise; + fork(params: ReposForkParams, callback?: Callback): Promise; + getInvites(params: ReposGetInvitesParams, callback?: Callback): Promise; + deleteInvite(params: ReposDeleteInviteParams, callback?: Callback): Promise; + updateInvite(params: ReposUpdateInviteParams, callback?: Callback): Promise; + merge(params: ReposMergeParams, callback?: Callback): Promise; + getPages(params: ReposGetPagesParams, callback?: Callback): Promise; + requestPageBuild(params: ReposRequestPageBuildParams, callback?: Callback): Promise; + getPagesBuilds(params: ReposGetPagesBuildsParams, callback?: Callback): Promise; + getLatestPagesBuild(params: ReposGetLatestPagesBuildParams, callback?: Callback): Promise; + getPagesBuild(params: ReposGetPagesBuildParams, callback?: Callback): Promise; + getReleases(params: ReposGetReleasesParams, callback?: Callback): Promise; + getRelease(params: ReposGetReleaseParams, callback?: Callback): Promise; + getLatestRelease(params: ReposGetLatestReleaseParams, callback?: Callback): Promise; + getReleaseByTag(params: ReposGetReleaseByTagParams, callback?: Callback): Promise; + createRelease(params: ReposCreateReleaseParams, callback?: Callback): Promise; + editRelease(params: ReposEditReleaseParams, callback?: Callback): Promise; + deleteRelease(params: ReposDeleteReleaseParams, callback?: Callback): Promise; + getAssets(params: ReposGetAssetsParams, callback?: Callback): Promise; + getAsset(params: ReposGetAssetParams, callback?: Callback): Promise; + uploadAsset(params: ReposUploadAssetParams, callback?: Callback): Promise; + editAsset(params: ReposEditAssetParams, callback?: Callback): Promise; + deleteAsset(params: ReposDeleteAssetParams, callback?: Callback): Promise; + getStatsContributors(params: ReposGetStatsContributorsParams, callback?: Callback): Promise; + getStatsCommitActivity(params: ReposGetStatsCommitActivityParams, callback?: Callback): Promise; + getStatsCodeFrequency(params: ReposGetStatsCodeFrequencyParams, callback?: Callback): Promise; + getStatsParticipation(params: ReposGetStatsParticipationParams, callback?: Callback): Promise; + getStatsPunchCard(params: ReposGetStatsPunchCardParams, callback?: Callback): Promise; + createStatus(params: ReposCreateStatusParams, callback?: Callback): Promise; + getStatuses(params: ReposGetStatusesParams, callback?: Callback): Promise; + getCombinedStatus(params: ReposGetCombinedStatusParams, callback?: Callback): Promise; + getReferrers(params: ReposGetReferrersParams, callback?: Callback): Promise; + getPaths(params: ReposGetPathsParams, callback?: Callback): Promise; + getViews(params: ReposGetViewsParams, callback?: Callback): Promise; + getClones(params: ReposGetClonesParams, callback?: Callback): Promise; + getHooks(params: ReposGetHooksParams, callback?: Callback): Promise; + getHook(params: ReposGetHookParams, callback?: Callback): Promise; + createHook(params: ReposCreateHookParams, callback?: Callback): Promise; + editHook(params: ReposEditHookParams, callback?: Callback): Promise; + testHook(params: ReposTestHookParams, callback?: Callback): Promise; + pingHook(params: ReposPingHookParams, callback?: Callback): Promise; + deleteHook(params: ReposDeleteHookParams, callback?: Callback): Promise; + }; + search: { + repos(params: SearchReposParams, callback?: Callback): Promise; + code(params: SearchCodeParams, callback?: Callback): Promise; + commits(params: SearchCommitsParams, callback?: Callback): Promise; + issues(params: SearchIssuesParams, callback?: Callback): Promise; + users(params: SearchUsersParams, callback?: Callback): Promise; + email(params: SearchEmailParams, callback?: Callback): Promise; + }; + users: { + getForUser(params: UsersGetForUserParams, callback?: Callback): Promise; + getById(params: UsersGetByIdParams, callback?: Callback): Promise; + get(callback?: Callback): Promise; + update(params: UsersUpdateParams, callback?: Callback): Promise; + getAll(params: UsersGetAllParams, callback?: Callback): Promise; + getOrgs(params: UsersGetOrgsParams, callback?: Callback): Promise; + getOrgMemberships(params: UsersGetOrgMembershipsParams, callback?: Callback): Promise; + getOrgMembership(params: UsersGetOrgMembershipParams, callback?: Callback): Promise; + editOrgMembership(params: UsersEditOrgMembershipParams, callback?: Callback): Promise; + getTeams(params: UsersGetTeamsParams, callback?: Callback): Promise; + getEmails(params: UsersGetEmailsParams, callback?: Callback): Promise; + addEmails(params: UsersAddEmailsParams, callback?: Callback): Promise; + deleteEmails(params: UsersDeleteEmailsParams, callback?: Callback): Promise; + getFollowersForUser(params: UsersGetFollowersForUserParams, callback?: Callback): Promise; + getFollowers(params: UsersGetFollowersParams, callback?: Callback): Promise; + getFollowingForUser(params: UsersGetFollowingForUserParams, callback?: Callback): Promise; + getFollowing(params: UsersGetFollowingParams, callback?: Callback): Promise; + checkFollowing(params: UsersCheckFollowingParams, callback?: Callback): Promise; + checkIfOneFollowersOther(params: UsersCheckIfOneFollowersOtherParams, callback?: Callback): Promise; + followUser(params: UsersFollowUserParams, callback?: Callback): Promise; + unfollowUser(params: UsersUnfollowUserParams, callback?: Callback): Promise; + getKeysForUser(params: UsersGetKeysForUserParams, callback?: Callback): Promise; + getKeys(params: UsersGetKeysParams, callback?: Callback): Promise; + getKey(params: UsersGetKeyParams, callback?: Callback): Promise; + createKey(params: UsersCreateKeyParams, callback?: Callback): Promise; + deleteKey(params: UsersDeleteKeyParams, callback?: Callback): Promise; + getGpgKeys(params: UsersGetGpgKeysParams, callback?: Callback): Promise; + getGpgKey(params: UsersGetGpgKeyParams, callback?: Callback): Promise; + createGpgKey(params: UsersCreateGpgKeyParams, callback?: Callback): Promise; + deleteGpgKey(params: UsersDeleteGpgKeyParams, callback?: Callback): Promise; + promote(params: UsersPromoteParams, callback?: Callback): Promise; + demote(params: UsersDemoteParams, callback?: Callback): Promise; + suspend(params: UsersSuspendParams, callback?: Callback): Promise; + unsuspend(params: UsersUnsuspendParams, callback?: Callback): Promise; + getRepoInvites(callback?: Callback): Promise; + acceptRepoInvite(params: UsersAcceptRepoInviteParams, callback?: Callback): Promise; + declineRepoInvite(params: UsersDeclineRepoInviteParams, callback?: Callback): Promise; + }; + enterprise: { + stats(params: EnterpriseStatsParams, callback?: Callback): Promise; + updateLdapForUser(params: EnterpriseUpdateLdapForUserParams, callback?: Callback): Promise; + syncLdapForUser(params: EnterpriseSyncLdapForUserParams, callback?: Callback): Promise; + updateLdapForTeam(params: EnterpriseUpdateLdapForTeamParams, callback?: Callback): Promise; + syncLdapForTeam(params: EnterpriseSyncLdapForTeamParams, callback?: Callback): Promise; + getLicense(callback?: Callback): Promise; + getPreReceiveEnvironment(params: EnterpriseGetPreReceiveEnvironmentParams, callback?: Callback): Promise; + getPreReceiveEnvironments(callback?: Callback): Promise; + createPreReceiveEnvironment(params: EnterpriseCreatePreReceiveEnvironmentParams, callback?: Callback): Promise; + editPreReceiveEnvironment(params: EnterpriseEditPreReceiveEnvironmentParams, callback?: Callback): Promise; + deletePreReceiveEnvironment(params: EnterpriseDeletePreReceiveEnvironmentParams, callback?: Callback): Promise; + getPreReceiveEnvironmentDownloadStatus(params: EnterpriseGetPreReceiveEnvironmentDownloadStatusParams, callback?: Callback): Promise; + triggerPreReceiveEnvironmentDownload(params: EnterpriseTriggerPreReceiveEnvironmentDownloadParams, callback?: Callback): Promise; + getPreReceiveHook(params: EnterpriseGetPreReceiveHookParams, callback?: Callback): Promise; + getPreReceiveHooks(callback?: Callback): Promise; + createPreReceiveHook(params: EnterpriseCreatePreReceiveHookParams, callback?: Callback): Promise; + editPreReceiveHook(params: EnterpriseEditPreReceiveHookParams, callback?: Callback): Promise; + deletePreReceiveHook(params: EnterpriseDeletePreReceiveHookParams, callback?: Callback): Promise; + queueIndexingJob(params: EnterpriseQueueIndexingJobParams, callback?: Callback): Promise; + createOrg(params: EnterpriseCreateOrgParams, callback?: Callback): Promise; + }; + } + + declare var exports: Class; +} diff --git a/lib/promise.js b/lib/promise.js new file mode 100644 index 0000000000..cd0dc60ad7 --- /dev/null +++ b/lib/promise.js @@ -0,0 +1,17 @@ +"use strict"; + +var Promise = global.Promise || null; + +if (isFunction(Promise)) { + new Promise(function(resolver) { + if (!isFunction(resolver)) { + Promise = null; + } + }); +} + +module.exports = Promise; + +function isFunction(x) { + return typeof x === "function"; +} diff --git a/lib/routes.json b/lib/routes.json new file mode 100644 index 0000000000..b4f7f13249 --- /dev/null +++ b/lib/routes.json @@ -0,0 +1,7413 @@ +{ + "defines": { + "constants": { + "name": "Github", + "description": "A Node.JS module, which provides an object oriented wrapper for the GitHub v3 API.", + "protocol": "https", + "host": "api.github.com", + "port": 443, + "documentation": "https://developer.github.com/v3", + "dateFormat": "YYYY-MM-DDTHH:MM:SSZ", + "requestFormat": "json", + "requestMedia": "application/vnd.github.v3+json" + }, + "response-headers": [ + "X-RateLimit-Limit", + "X-RateLimit-Remaining", + "X-RateLimit-Reset", + "X-Oauth-Scopes", + "X-Poll-Interval", + "X-GitHub-Request-Id", + "Retry-After", + "Link", + "Location", + "Last-Modified", + "Etag", + "Status" + ], + "request-headers": [ + "Authorization", + "If-Modified-Since", + "If-None-Match", + "Cookie", + "User-Agent", + "Accept", + "X-GitHub-OTP" + ], + "params": { + "files": { + "type": "Json", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "Files that make up this gist. The key of which should be a required string filename and the value another required hash with parameters: 'content'" + }, + "owner": { + "type": "String", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "" + }, + "username": { + "type": "String", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "" + }, + "org": { + "type": "String", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "" + }, + "repo": { + "type": "String", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "" + }, + "branch": { + "type": "String", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "" + }, + "sha": { + "type": "String", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "" + }, + "description": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "" + }, + "id": { + "type": "String", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "" + }, + "gist_id": { + "type": "String", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "Id (SHA1 hash) of the gist." + }, + "installation_id": { + "type": "String", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "" + }, + "repository_id": { + "type": "String", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "" + }, + "commit_id": { + "type": "String", + "required": true, + "validation": "", + "invalidmsg": "Sha of the commit to comment on.", + "description": "Sha of the commit to comment on." + }, + "client_id": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "The 20 character OAuth app client key for which to create the token." + }, + "column_id": { + "type": "String", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "" + }, + "project_id": { + "type": "String", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "" + }, + "repo_id": { + "type": "String", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "" + }, + "invitation_id": { + "type": "String", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "" + }, + "ref": { + "type": "String", + "required": true, + "allow-empty": true, + "validation": "", + "invalidmsg": "", + "description": "String of the name of the fully qualified reference (ie: heads/master). If it doesn’t have at least one slash, it will be rejected." + }, + "number": { + "type": "Number", + "required": true, + "validation": "^[0-9]+$", + "invalidmsg": "", + "description": "" + }, + "issue_number": { + "type": "Number", + "required": true, + "validation": "^[0-9]+$", + "invalidmsg": "", + "description": "" + }, + "name": { + "type": "String", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "" + }, + "direction": { + "type": "String", + "required": false, + "validation": "^(asc|desc)$", + "invalidmsg": "asc or desc, default: desc.", + "description": "", + "enum": [ + "asc", + "desc" + ], + "default": "desc" + }, + "since": { + "type": "Date", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ" + }, + "until": { + "type": "Date", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ" + }, + "state": { + "type": "String", + "required": false, + "validation": "^(open|closed|all)$", + "invalidmsg": "open, closed, all, default: open", + "description": "", + "enum": [ + "open", + "closed", + "all" + ], + "default": "open" + }, + "color": { + "type": "String", + "required": true, + "validation": "", + "invalidmsg": "6 character hex code, without a leading #.", + "description": "6 character hex code, without a leading #." + }, + "base": { + "type": "String", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "The branch (or git ref) you want your changes pulled into. This should be an existing branch on the current repository. You cannot submit a pull request to one repo that requests a merge to a base of another repo." + }, + "head": { + "type": "String", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "The branch (or git ref) where your changes are implemented." + }, + "path": { + "type": "String", + "required": true, + "validation": "", + "invalidmsg": "Relative path of the file to comment on.", + "description": "Relative path of the file to comment on." + }, + "position": { + "type": "Number", + "required": true, + "validation": "", + "invalidmsg": "Column index in the diff to comment on.", + "description": "Column index in the diff to comment on." + }, + "body": { + "type": "String", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "" + }, + "homepage": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "" + }, + "private": { + "type": "Boolean", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "True to create a private repository, false to create a public one. Creating private repositories requires a paid GitHub account. Default is false.", + "default": "false" + }, + "has_issues": { + "type": "Boolean", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "True to enable issues for this repository, false to disable them. Default is true.", + "default": "true" + }, + "has_wiki": { + "type": "Boolean", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "True to enable the wiki for this repository, false to disable it. Default is true.", + "default": "true" + }, + "has_downloads": { + "type": "Boolean", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "True to enable downloads for this repository, false to disable them. Default is true.", + "default": "true" + }, + "default_branch": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "Updates the default branch for this repository." + }, + "title": { + "type": "String", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "" + }, + "key": { + "type": "String", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "" + }, + "page": { + "type": "Number", + "required": false, + "validation": "^[0-9]+$", + "invalidmsg": "", + "description": "Page number of the results to fetch." + }, + "per_page": { + "type": "Number", + "required": false, + "validation": "^[0-9]+$", + "invalidmsg": "", + "description": "A custom page size up to 100. Default is 30.", + "default": "30" + }, + "scopes": { + "type": "Array", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "A list of scopes that this authorization is in." + }, + "note": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "A note to remind you what the OAuth token is for." + }, + "note_url": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "A URL to remind you what app the OAuth token is for." + }, + "auto_init": { + "type": "Boolean", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "True to create an initial commit with empty README. Default is false", + "default": "false" + }, + "gitignore_template": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "Desired language or platform .gitignore template to apply. Ignored if auto_init parameter is not provided." + }, + "license_template": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "Desired LICENSE template to apply. Use the name of the template without the extension. For example, \"mit\" or \"mozilla\"." + }, + "order": { + "type": "String", + "required": false, + "validation": "^(asc|desc)$", + "invalidmsg": "The sort order if sort parameter is provided. One of asc or desc. Default: desc", + "description": "asc or desc", + "enum": [ + "asc", + "desc" + ], + "default": "desc" + }, + "q": { + "type": "String", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "Search Term", + "combined": true + }, + "data": { + "type": "String", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "Raw data to send as the body of the request" + }, + "privacy": { + "type": "String", + "required": false, + "validation": "^(secret|closed)$", + "invalidmsg": "secret, closed, default: secret", + "description": "The level of privacy this team should have.", + "enum": [ + "secret", + "closed" + ], + "default": "secret" + }, + "fingerprint": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "A unique string to distinguish an authorization from others created for the same client ID and user." + }, + "access_token": { + "type": "String", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "OAuth token" + }, + "assignees": { + "type": "Array", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "Logins for Users to assign to this issue. NOTE: Only users with push access can set assignees for new issues. Assignees are silently dropped otherwise." + } + }, + "acceptTree": { + "application/vnd.github.cloak-preview+json": [ + "/search/commits" + ], + "application/vnd.github.black-panther-preview+json": [ + "/repositories/:repo_id/community/profile" + ], + "application/vnd.github.ant-man-preview+json": [ + "/repos/:owner/:repo/deployments", + "/repos/:owner/:repo/deployments/:id/statuses" + ], + "application/vnd.github.cryptographer-preview": [ + "/user/gpg_keys", + "/user/gpg_keys/:id" + ], + "application/vnd.github.barred-rock-preview": [ + "/repos/:owner/:repo/import/authors", + "/repos/:owner/:repo/import/authors/:author_id", + "/:owner/:name/import/lfs", + "/:owner/:name/import/large_files", + "/repos/:owner/:repo/import" + ], + "application/vnd.github.machine-man-preview": [ + "/integration/installations", + "/installations/:installation_id/access_tokens", + "/integration/identity/user", + "/installation/repositories", + "/installations/:installation_id/repositories/:repository_id" + ], + "application/vnd.github.drax-preview+json": [ + "/licenses", + "/licenses/:license", + "/repos/:owner/:repo", + "/repos/:owner/:repo/license" + ], + "application/vnd.github.wyandotte-preview+json": [ + "/orgs/:org/migrations", + "/orgs/:org/migrations/:id", + "/orgs/:org/migrations/:id/archive", + "/orgs/:org/migrations/:id/repos/:repo_name/lock" + ], + "application/vnd.github.korra-preview+json": [ + "/orgs/:org", + "/orgs/:org/invitations", + "/orgs/:org/outside_collaborators", + "/orgs/:org/outside_collaborator/:username", + "/orgs/:org/teams", + "/repos/:owner/:repo/collaborators", + "/repos/:owner/:repo/collaborators/:username/permission", + "/teams/:id/invitations" + ], + "application/vnd.github.mister-fantastic-preview+json": [ + "/repos/:owner/:repo/pages", + "/repos/:owner/:repo/pages/builds", + "/repos/:owner/:repo/pages/builds/latest", + "/repos/:owner/:repo/pages/builds/:id" + ], + "application/vnd.github.eye-scream-preview": [ + "/admin/pre-receive-environments/:id", + "/admin/pre_receive_environments", + "/admin/pre-receive-environments/:id/downloads/latest", + "/admin/pre_receive_environments/:id/downloads", + "/admin/pre-receive-hooks/:id", + "/admin/pre-receive-hooks" + ], + "application/vnd.github.inertia-preview+json": [ + "/repos/:owner/:repo/projects", + "/orgs/:org/projects", + "/projects/:id", + "/projects/columns/:column_id/cards", + "/projects/columns/cards/:id", + "/projects/columns/cards/:id/moves", + "/projects/:project_id/columns", + "/projects/columns/:id", + "/projects/columns/:id/moves" + ], + "application/vnd.github.loki-preview+json": [ + "/repos/:owner/:repo/branches", + "/repos/:owner/:repo/branches/:branch", + "/repos/:owner/:repo/branches/:branch/protection", + "/repos/:owner/:repo/branches/:branch/protection/required_status_checks", + "/repos/:owner/:repo/branches/:branch/protection/required_status_checks/contexts", + "/repos/:owner/:repo/branches/:branch/protection/restrictions", + "/repos/:owner/:repo/branches/:branch/protection/restrictions/teams", + "/repos/:owner/:repo/branches/:branch/protection/restrictions/users" + ], + "application/vnd.github.polaris-preview": [ + "/repos/:owner/:repo/pulls/:number/merge" + ], + "application/vnd.github.squirrel-girl-preview": [ + "/repos/:owner/:repo/comments/:id/reactions", + "/repos/:owner/:repo/issues/:number/reactions", + "/repos/:owner/:repo/issues/comments/:id/reactions", + "/repos/:owner/:repo/pulls/comments/:id/reactions", + "/reactions/:id", + "/repos/:owner/:repo/pulls/:number/comments", + "/repos/:owner/:repo/pulls/comments", + "/repos/:owner/:repo/pulls/comments/:id" + ], + "application/vnd.github.mockingbird-preview": [ + "/repos/:owner/:repo/issues/:issue_number/timeline" + ], + "application/vnd.github.black-cat-preview+json": [ + "/repos/:owner/:repo/pulls/:number/reviews", + "/repos/:owner/:repo/pulls/:number/reviews/:id", + "/repos/:owner/:repo/pulls/:number/reviews/:id/comments", + "/repos/:owner/:repo/pulls/:number/reviews/:id/events", + "/repos/:owner/:repo/pulls/:number/reviews/:id/dismissals", + "/repos/:owner/:repo/pulls/:number/requested_reviewers" + ] + } + }, + "authorization": { + "get-grants": { + "url": "/applications/grants", + "method": "GET", + "params": { + "$page": null, + "$per_page": null + }, + "description": "List your grants." + }, + "get-grant": { + "url": "/applications/grants/:id", + "method": "GET", + "params": { + "$id": null, + "$page": null, + "$per_page": null + }, + "description": "Get a single grant." + }, + "delete-grant": { + "url": "/applications/grants/:id", + "method": "DELETE", + "params": { + "$id": null + }, + "description": "Delete a grant." + }, + "get-all": { + "url": "/authorizations", + "method": "GET", + "params": { + "$page": null, + "$per_page": null + }, + "description": "List your authorizations." + }, + "get": { + "url": "/authorizations/:id", + "method": "GET", + "params": { + "$id": null + }, + "description": "Get a single authorization." + }, + "create": { + "url": "/authorizations", + "method": "POST", + "params": { + "$scopes": null, + "$note": null, + "$note_url": null, + "$client_id": null, + "client_secret": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "The 40 character OAuth app client secret for which to create the token." + }, + "$fingerprint": null + }, + "description": "Create a new authorization." + }, + "get-or-create-authorization-for-app": { + "url": "/authorizations/clients/:client_id", + "method": "PUT", + "params": { + "$client_id": null, + "client_secret": { + "type": "String", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "The 40 character OAuth app client secret associated with the client ID specified in the URL." + }, + "$scopes": null, + "$note": null, + "$note_url": null, + "$fingerprint": null + }, + "description": "Get or create an authorization for a specific app." + }, + "get-or-create-authorization-for-app-and-fingerprint": { + "url": "/authorizations/clients/:client_id/:fingerprint", + "method": "PUT", + "params": { + "$client_id": null, + "$fingerprint": null, + "client_secret": { + "type": "String", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "The 40 character OAuth app client secret associated with the client ID specified in the URL." + }, + "$scopes": null, + "$note": null, + "$note_url": null + }, + "description": "Get or create an authorization for a specific app and fingerprint." + }, + "update": { + "url": "/authorizations/:id", + "method": "PATCH", + "params": { + "$id": null, + "$scopes": null, + "add_scopes": { + "type": "Array", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "A list of scopes to add to this authorization." + }, + "remove_scopes": { + "type": "Array", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "A list of scopes to remove from this authorization." + }, + "$note": null, + "$note_url": null, + "$fingerprint": null + }, + "description": "Update an existing authorization." + }, + "delete": { + "url": "/authorizations/:id", + "method": "DELETE", + "params": { + "$id": null + }, + "description": "Delete an authorization." + }, + "check": { + "url": "/applications/:client_id/tokens/:access_token", + "method": "GET", + "params": { + "$client_id": null, + "$access_token": null + }, + "description": "Check an authorization" + }, + "reset": { + "url": "/applications/:client_id/tokens/:access_token", + "method": "POST", + "params": { + "$client_id": null, + "$access_token": null + }, + "description": "Reset an authorization" + }, + "revoke": { + "url": "/applications/:client_id/tokens/:access_token", + "method": "DELETE", + "params": { + "$client_id": null, + "$access_token": null + }, + "description": "Revoke an authorization for an application" + } + }, + "activity": { + "get-events": { + "url": "/events", + "method": "GET", + "params": { + "$page": null, + "$per_page": null + }, + "description": "List public events" + }, + "get-events-for-repo": { + "url": "/repos/:owner/:repo/events", + "method": "GET", + "params": { + "$owner": null, + "$repo": null, + "$page": null, + "$per_page": null + }, + "description": "List repository events" + }, + "get-events-for-repo-issues": { + "url": "/repos/:owner/:repo/issues/events", + "method": "GET", + "params": { + "$owner": null, + "$repo": null, + "$page": null, + "$per_page": null + }, + "description": "List issue events for a repository" + }, + "get-events-for-repo-network": { + "url": "/networks/:owner/:repo/events", + "method": "GET", + "params": { + "$owner": null, + "$repo": null, + "$page": null, + "$per_page": null + }, + "description": "List public events for a network of repositories" + }, + "get-events-for-org": { + "url": "/orgs/:org/events", + "method": "GET", + "params": { + "$org": null, + "$page": null, + "$per_page": null + }, + "description": "List public events for an organization" + }, + "get-events-received": { + "url": "/users/:username/received_events", + "method": "GET", + "params": { + "$username": null, + "$page": null, + "$per_page": null + }, + "description": "List events that a user has received" + }, + "get-events-received-public": { + "url": "/users/:username/received_events/public", + "method": "GET", + "params": { + "$username": null, + "$page": null, + "$per_page": null + }, + "description": "List public events that a user has received" + }, + "get-events-for-user": { + "url": "/users/:username/events", + "method": "GET", + "params": { + "$username": null, + "$page": null, + "$per_page": null + }, + "description": "List events performed by a user" + }, + "get-events-for-user-public": { + "url": "/users/:username/events/public", + "method": "GET", + "params": { + "$username": null, + "$page": null, + "$per_page": null + }, + "description": "List public events performed by a user" + }, + "get-events-for-user-org": { + "url": "/users/:username/events/orgs/:org", + "method": "GET", + "params": { + "$username": null, + "$org": null, + "$page": null, + "$per_page": null + }, + "description": "List events for a user's organization" + }, + "get-feeds": { + "url": "/feeds", + "method": "GET", + "params": {}, + "description": "Get all feeds available for the authenticated user." + }, + "get-notifications": { + "url": "/notifications", + "method": "GET", + "params": { + "all": { + "type": "Boolean", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "If true, show notifications marked as read. Default: false", + "default": "false" + }, + "participating": { + "type": "Boolean", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "If true, only shows notifications in which the user is directly participating or mentioned. Default: false", + "default": "false" + }, + "$since": null, + "before": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "Only show notifications updated before the given time. This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ." + } + }, + "description": "Get all notifications for the current user, grouped by repository." + }, + "get-notifications-for-user": { + "url": "/repos/:owner/:repo/notifications", + "method": "GET", + "params": { + "$owner": null, + "$repo": null, + "all": { + "type": "Boolean", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "If true, show notifications marked as read. Default: false", + "default": "false" + }, + "participating": { + "type": "Boolean", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "If true, only shows notifications in which the user is directly participating or mentioned. Default: false", + "default": "false" + }, + "$since": null, + "before": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "Only show notifications updated before the given time. This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ." + } + }, + "description": "Get all notifications for the given user." + }, + "mark-notifications-as-read": { + "url": "/notifications", + "method": "PUT", + "params": { + "last_read_at": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "Describes the last point that notifications were checked. Anything updated since this time will not be updated. This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ. Default: Time.now", + "default": "Time.now" + } + }, + "description": "Mark notifications as read for authenticated user." + }, + "mark-notifications-as-read-for-repo": { + "url": "/repos/:owner/:repo/notifications", + "method": "PUT", + "params": { + "$owner": null, + "$repo": null, + "last_read_at": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "Describes the last point that notifications were checked. Anything updated since this time will not be updated. This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ. Default: Time.now", + "default": "Time.now" + } + }, + "description": "Mark notifications in a repo as read." + }, + "get-notification-thread": { + "url": "/notifications/threads/:id", + "method": "GET", + "params": { + "$id": null + }, + "description": "View a single notification thread." + }, + "mark-notification-thread-as-read": { + "url": "/notifications/threads/:id", + "method": "PATCH", + "params": { + "$id": null + }, + "description": "Mark a notification thread as read." + }, + "check-notification-thread-subscription": { + "url": "/notifications/threads/:id/subscription", + "method": "GET", + "params": { + "$id": null + }, + "description": "Check to see if the current user is subscribed to a thread." + }, + "set-notification-thread-subscription": { + "url": "/notifications/threads/:id/subscription", + "method": "PUT", + "params": { + "$id": null, + "subscribed": { + "type": "Boolean", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "Determines if notifications should be received from this thread" + }, + "ignored": { + "type": "Boolean", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "Determines if all notifications should be blocked from this thread" + } + }, + "description": "This lets you subscribe or unsubscribe from a conversation. Unsubscribing from a conversation mutes all future notifications (until you comment or get @mentioned once more)." + }, + "delete-notification-thread-subscription": { + "url": "/notifications/threads/:id/subscription", + "method": "DELETE", + "params": { + "$id": null + }, + "description": "Delete a notification thread subscription." + }, + "get-stargazers-for-repo": { + "url": "/repos/:owner/:repo/stargazers", + "method": "GET", + "params": { + "$owner": null, + "$repo": null, + "$page": null, + "$per_page": null + }, + "description": "List Stargazers" + }, + "get-starred-repos-for-user": { + "url": "/users/:username/starred", + "method": "GET", + "params": { + "$username": null, + "sort": { + "type": "String", + "required": false, + "validation": "^(created|updated)$", + "invalidmsg": "created or updated (when it was last pushed to); default: created.", + "description": "", + "enum": [ + "created", + "updated" + ], + "default": "created" + }, + "$direction": null, + "$page": null, + "$per_page": null + }, + "description": "List repositories being starred by a user" + }, + "get-starred-repos": { + "url": "/user/starred", + "method": "GET", + "params": { + "sort": { + "type": "String", + "required": false, + "validation": "^(created|updated)$", + "invalidmsg": "created or updated (when it was last pushed to); default: created.", + "description": "", + "enum": [ + "created", + "updated" + ], + "default": "created" + }, + "$direction": null, + "$page": null, + "$per_page": null + }, + "description": "List repositories being starred by the authenticated user" + }, + "check-starring-repo": { + "url": "/user/starred/:owner/:repo", + "method": "GET", + "params": { + "$owner": null, + "$repo": null, + "$page": null, + "$per_page": null + }, + "description": "Check if you are starring a repository" + }, + "star-repo": { + "url": "/user/starred/:owner/:repo", + "method": "PUT", + "params": { + "$owner": null, + "$repo": null + }, + "description": "Star a repository" + }, + "unstar-repo": { + "url": "/user/starred/:owner/:repo", + "method": "DELETE", + "params": { + "$owner": null, + "$repo": null + }, + "description": "Unstar a repository" + }, + "get-watchers-for-repo": { + "url": "/repos/:owner/:repo/subscribers", + "method": "GET", + "params": { + "$owner": null, + "$repo": null, + "$page": null, + "$per_page": null + }, + "description": "Get watchers for repository." + }, + "get-watched-repos-for-user": { + "url": "/users/:username/subscriptions", + "method": "GET", + "params": { + "$username": null, + "$page": null, + "$per_page": null + }, + "description": "List repositories being watched by a user." + }, + "get-watched-repos": { + "url": "/user/subscriptions", + "method": "GET", + "params": { + "$page": null, + "$per_page": null + }, + "description": "List repositories being watched by the authenticated user." + }, + "get-repo-subscription": { + "url": "/repos/:owner/:repo/subscription", + "method": "GET", + "params": { + "$owner": null, + "$repo": null, + "$page": null, + "$per_page": null + }, + "description": "Get a Repository Subscription." + }, + "set-repo-subscription": { + "url": "/repos/:owner/:repo/subscription", + "method": "PUT", + "params": { + "$owner": null, + "$repo": null, + "subscribed": { + "type": "Boolean", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "Determines if notifications should be received from this repository." + }, + "ignored": { + "type": "Boolean", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "Determines if all notifications should be blocked from this repository." + } + }, + "description": "Set a Repository Subscription" + }, + "unwatch-repo": { + "url": "/repos/:owner/:repo/subscription", + "method": "DELETE", + "params": { + "$owner": null, + "$repo": null + }, + "description": "Unwatch a repository." + } + }, + "gists": { + "get-for-user": { + "url": "/users/:username/gists", + "method": "GET", + "params": { + "$username": null, + "$since": null, + "$page": null, + "$per_page": null + }, + "description": "List a user's gists" + }, + "get-all": { + "url": "/gists", + "method": "GET", + "params": { + "$since": null, + "$page": null, + "$per_page": null + }, + "description": "List the authenticated user's gists or if called anonymously, this will return all public gists" + }, + "get-public": { + "url": "/gists/public", + "method": "GET", + "params": { + "$since": null + }, + "description": "List all public gists" + }, + "get-starred": { + "url": "/gists/starred", + "method": "GET", + "params": { + "$since": null + }, + "description": "List the authenticated user's starred gists" + }, + "get": { + "url": "/gists/:id", + "method": "GET", + "params": { + "$id": null + }, + "description": "Get a single gist" + }, + "get-revision": { + "url": "/gists/:id/:sha", + "method": "GET", + "params": { + "$id": null, + "$sha": null + }, + "description": "Get a specific revision of a gist" + }, + "create": { + "url": "/gists", + "method": "POST", + "params": { + "$files": null, + "$description": null, + "public": { + "type": "Boolean", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "" + } + }, + "description": "Create a gist" + }, + "edit": { + "url": "/gists/:id", + "method": "PATCH", + "params": { + "$id": null, + "$description": null, + "$files": null, + "content": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "Updated file contents." + }, + "filename": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "New name for this file." + } + }, + "description": "Edit a gist" + }, + "get-commits": { + "url": "/gists/:id/commits", + "method": "GET", + "params": { + "$id": null + }, + "description": "List gist commits" + }, + "star": { + "url": "/gists/:id/star", + "method": "PUT", + "params": { + "$id": null + }, + "description": "Star a gist" + }, + "unstar": { + "url": "/gists/:id/star", + "method": "DELETE", + "params": { + "$id": null + }, + "description": "Unstar a gist" + }, + "check-star": { + "url": "/gists/:id/star", + "method": "GET", + "params": { + "$id": null + }, + "description": "Check if a gist is starred" + }, + "fork": { + "url": "/gists/:id/forks", + "method": "POST", + "params": { + "$id": null + }, + "description": "Fork a gist" + }, + "get-forks": { + "url": "/gists/:id/forks", + "method": "GET", + "params": { + "$id": null, + "$page": null, + "$per_page": null + }, + "description": "List gist forks" + }, + "delete": { + "url": "/gists/:id", + "method": "DELETE", + "params": { + "$id": null + }, + "description": "Delete a gist" + }, + "get-comments": { + "url": "/gists/:gist_id/comments", + "method": "GET", + "params": { + "$gist_id": null + }, + "description": "List comments on a gist" + }, + "get-comment": { + "url": "/gists/:gist_id/comments/:id", + "method": "GET", + "params": { + "$gist_id": null, + "$id": null + }, + "description": "Get a single comment" + }, + "create-comment": { + "url": "/gists/:gist_id/comments", + "method": "POST", + "params": { + "$gist_id": null, + "$body": null + }, + "description": "Create a comment" + }, + "edit-comment": { + "url": "/gists/:gist_id/comments/:id", + "method": "PATCH", + "params": { + "$gist_id": null, + "$id": null, + "$body": null + }, + "description": "Edit a comment" + }, + "delete-comment": { + "url": "/gists/:gist_id/comments/:id", + "method": "DELETE", + "params": { + "$gist_id": null, + "$id": null + }, + "description": "Delete a comment" + } + }, + "gitdata": { + "get-blob": { + "url": "/repos/:owner/:repo/git/blobs/:sha", + "method": "GET", + "params": { + "$owner": null, + "$repo": null, + "$sha": null, + "$page": null, + "$per_page": null + }, + "description": "Get a Blob" + }, + "create-blob": { + "url": "/repos/:owner/:repo/git/blobs", + "method": "POST", + "params": { + "$owner": null, + "$repo": null, + "content": { + "type": "String", + "required": true, + "allow-empty": true, + "validation": "", + "invalidmsg": "", + "description": "" + }, + "encoding": { + "type": "String", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "" + } + }, + "description": "Create a Blob" + }, + "get-commit": { + "url": "/repos/:owner/:repo/git/commits/:sha", + "method": "GET", + "params": { + "$owner": null, + "$repo": null, + "$sha": null + }, + "description": "Get a Commit" + }, + "create-commit": { + "url": "/repos/:owner/:repo/git/commits", + "method": "POST", + "params": { + "$owner": null, + "$repo": null, + "message": { + "type": "String", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "String of the commit message" + }, + "tree": { + "type": "String", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "String of the SHA of the tree object this commit points to" + }, + "parents": { + "type": "Array", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "Array of the SHAs of the commits that were the parents of this commit. If omitted or empty, the commit will be written as a root commit. For a single parent, an array of one SHA should be provided, for a merge commit, an array of more than one should be provided." + }, + "author": { + "type": "Json", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "" + }, + "committer": { + "type": "Json", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "" + } + }, + "description": "Create a Commit" + }, + "get-commit-signature-verification": { + "url": "/repos/:owner/:repo/git/commits/:sha", + "method": "GET", + "params": { + "$owner": null, + "$repo": null, + "$sha": null + }, + "description": "Get a Commit Signature Verification. (In preview period. See README.)" + }, + "get-reference": { + "url": "/repos/:owner/:repo/git/refs/:ref", + "method": "GET", + "params": { + "$owner": null, + "$repo": null, + "$ref": null + }, + "description": "Get a Reference" + }, + "get-references": { + "url": "/repos/:owner/:repo/git/refs/", + "method": "GET", + "params": { + "$owner": null, + "$repo": null, + "$page": null, + "$per_page": null + }, + "description": "Get all References" + }, + "get-tags": { + "url": "/repos/:owner/:repo/git/refs/tags", + "method": "GET", + "params": { + "$owner": null, + "$repo": null, + "$page": null, + "$per_page": null + }, + "description": "Get all tag References" + }, + "create-reference": { + "url": "/repos/:owner/:repo/git/refs", + "method": "POST", + "params": { + "$owner": null, + "$repo": null, + "ref": { + "type": "String", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "The name of the fully qualified reference (ie: refs/heads/master). If it doesn't start with 'refs' and have at least two slashes, it will be rejected. NOTE: After creating the reference, on calling (get|update|delete)Reference, drop the leading 'refs/' when providing the 'ref' param." + }, + "$sha": null + }, + "description": "Create a Reference" + }, + "update-reference": { + "url": "/repos/:owner/:repo/git/refs/:ref", + "method": "PATCH", + "params": { + "$owner": null, + "$repo": null, + "$ref": null, + "$sha": null, + "force": { + "type": "Boolean", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "Boolean indicating whether to force the update or to make sure the update is a fast-forward update. The default is false, so leaving this out or setting it to false will make sure you’re not overwriting work.", + "default": "false" + } + }, + "description": "Update a Reference" + }, + "delete-reference": { + "url": "/repos/:owner/:repo/git/refs/:ref", + "method": "DELETE", + "params": { + "$owner": null, + "$repo": null, + "$ref": null + }, + "description": "Delete a Reference" + }, + "get-tag": { + "url": "/repos/:owner/:repo/git/tags/:sha", + "method": "GET", + "params": { + "$owner": null, + "$repo": null, + "$sha": null + }, + "description": "Get a Tag" + }, + "create-tag": { + "url": "/repos/:owner/:repo/git/tags", + "method": "POST", + "params": { + "$owner": null, + "$repo": null, + "tag": { + "type": "String", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "String of the tag" + }, + "message": { + "type": "String", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "String of the tag message" + }, + "object": { + "type": "String", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "String of the SHA of the git object this is tagging" + }, + "type": { + "type": "String", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "String of the type of the object we’re tagging. Normally this is a commit but it can also be a tree or a blob." + }, + "tagger": { + "type": "Json", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "JSON object that contains the following keys: `name` - String of the name of the author of the tag, `email` - String of the email of the author of the tag, `date` - Timestamp of when this object was tagged" + } + }, + "description": "Create a Tag Object" + }, + "get-tag-signature-verification": { + "url": "/repos/:owner/:repo/git/tags/:sha", + "method": "GET", + "params": { + "$owner": null, + "$repo": null, + "$sha": null + }, + "description": "Get a Tag Signature Verification. (In preview period. See README.)" + }, + "get-tree": { + "url": "/repos/:owner/:repo/git/trees/:sha", + "method": "GET", + "params": { + "$owner": null, + "$repo": null, + "$sha": null, + "recursive": { + "type": "Boolean", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "" + } + }, + "description": "Get a Tree" + }, + "create-tree": { + "url": "/repos/:owner/:repo/git/trees", + "method": "POST", + "params": { + "$owner": null, + "$repo": null, + "tree": { + "type": "Json", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "Array of Hash objects (of path, mode, type and sha) specifying a tree structure" + }, + "base_tree": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "String of the SHA1 of the tree you want to update with new data" + } + }, + "description": "Create a Tree" + } + }, + "integrations": { + "get-installations": { + "url": "/integration/installations", + "method": "GET", + "params": { + "$page": null, + "$per_page": null + }, + "description": "List the integration's installations. (In preview period. See README.)" + }, + "create-installation-token": { + "url": "/installations/:installation_id/access_tokens", + "method": "POST", + "params": { + "$installation_id": null, + "user_id": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "The id of the user for whom the integration is acting on behalf of." + } + }, + "description": "Create a new installation token. (In preview period. See README.)" + }, + "get-user-identity": { + "url": "/integration/identity/user", + "method": "POST", + "params": { + "nonce": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "" + } + }, + "description": "Request identity of user. (In preview period. See README.)" + }, + "get-installation-repositories": { + "url": "/installation/repositories", + "method": "GET", + "params": { + "user_id": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "The integer ID of a user, to filter results to repositories that are visible to both the installation and the given user." + } + }, + "description": "List repositories that are accessible to the authenticated installation. (In preview period. See README.)" + }, + "add-repo-to-installation": { + "url": "/installations/:installation_id/repositories/:repository_id", + "method": "POST", + "params": { + "$installation_id": null, + "$repository_id": null + }, + "description": "Add a single repository to an installation. (In preview period. See README.)" + }, + "remove-repo-from-installation": { + "url": "/installations/:installation_id/repositories/:repository_id", + "method": "POST", + "params": { + "$installation_id": null, + "$repository_id": null + }, + "description": "Remove a single repository from an installation. (In preview period. See README.)" + } + }, + "issues": { + "get-all": { + "url": "/issues", + "method": "GET", + "params": { + "filter": { + "type": "String", + "required": false, + "validation": "^(all|assigned|created|mentioned|subscribed)$", + "invalidmsg": "", + "description": "", + "enum": [ + "all", + "assigned", + "created", + "mentioned", + "subscribed" + ] + }, + "state": { + "type": "String", + "required": false, + "validation": "^(open|closed|all)$", + "invalidmsg": "open, closed, all, default: open", + "description": "open, closed, or all", + "enum": [ + "open", + "closed", + "all" + ], + "default": "open" + }, + "labels": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "String list of comma separated Label names. Example: bug,ui,@high" + }, + "sort": { + "type": "String", + "required": false, + "validation": "^(created|updated|comments)$", + "invalidmsg": "created, updated, comments, default: created.", + "description": "", + "enum": [ + "created", + "updated", + "comments" + ], + "default": "created" + }, + "$direction": null, + "$since": null, + "$page": null, + "$per_page": null + }, + "description": "List all issues across all the authenticated user's visible repositories including owned repositories, member repositories, and organization repositories" + }, + "get-for-user": { + "url": "/user/issues", + "method": "GET", + "params": { + "filter": { + "type": "String", + "required": false, + "validation": "^(all|assigned|created|mentioned|subscribed)$", + "invalidmsg": "", + "description": "", + "enum": [ + "all", + "assigned", + "created", + "mentioned", + "subscribed" + ] + }, + "state": { + "type": "String", + "required": false, + "validation": "^(open|closed|all)$", + "invalidmsg": "open, closed, all, default: open", + "description": "open, closed, or all", + "enum": [ + "open", + "closed", + "all" + ], + "default": "open" + }, + "labels": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "String list of comma separated Label names. Example: bug,ui,@high" + }, + "sort": { + "type": "String", + "required": false, + "validation": "^(created|updated|comments)$", + "invalidmsg": "created, updated, comments, default: created.", + "description": "", + "enum": [ + "created", + "updated", + "comments" + ], + "default": "created" + }, + "$direction": null, + "$since": null, + "$page": null, + "$per_page": null + }, + "description": "List all issues across owned and member repositories for the authenticated user" + }, + "get-for-org": { + "url": "/orgs/:org/issues", + "method": "GET", + "params": { + "$org": null, + "filter": { + "type": "String", + "required": false, + "validation": "^(all|assigned|created|mentioned|subscribed)$", + "invalidmsg": "", + "description": "", + "enum": [ + "all", + "assigned", + "created", + "mentioned", + "subscribed" + ] + }, + "state": { + "type": "String", + "required": false, + "validation": "^(open|closed|all)$", + "invalidmsg": "open, closed, all, default: open", + "description": "open, closed, or all", + "enum": [ + "open", + "closed", + "all" + ], + "default": "open" + }, + "labels": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "String list of comma separated Label names. Example: bug,ui,@high" + }, + "sort": { + "type": "String", + "required": false, + "validation": "^(created|updated|comments)$", + "invalidmsg": "created, updated, comments, default: created.", + "description": "", + "enum": [ + "created", + "updated", + "comments" + ], + "default": "created" + }, + "$direction": null, + "$since": null, + "$page": null, + "$per_page": null + }, + "description": "List all issues for a given organization for the authenticated user" + }, + "get-for-repo": { + "url": "/repos/:owner/:repo/issues", + "method": "GET", + "params": { + "$owner": null, + "$repo": null, + "milestone": { + "type": "String", + "required": false, + "validation": "^([0-9]+|none|\\*)$", + "invalidmsg": "", + "description": "" + }, + "state": { + "type": "String", + "required": false, + "validation": "^(open|closed|all)$", + "invalidmsg": "open, closed, all, default: open", + "description": "open, closed, or all", + "enum": [ + "open", + "closed", + "all" + ], + "default": "open" + }, + "assignee": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "String User login, `none` for Issues with no assigned User. `*` for Issues with any assigned User." + }, + "creator": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "The user that created the issue." + }, + "mentioned": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "String User login." + }, + "labels": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "String list of comma separated Label names. Example: bug,ui,@high" + }, + "sort": { + "type": "String", + "required": false, + "validation": "^(created|updated|comments)$", + "invalidmsg": "created, updated, comments, default: created.", + "description": "", + "enum": [ + "created", + "updated", + "comments" + ], + "default": "created" + }, + "$direction": null, + "$since": null, + "$page": null, + "$per_page": null + }, + "description": "List issues for a repository" + }, + "get": { + "url": "/repos/:owner/:repo/issues/:number", + "method": "GET", + "params": { + "$owner": null, + "$repo": null, + "$number": null + }, + "description": "Get a single issue" + }, + "create": { + "url": "/repos/:owner/:repo/issues", + "method": "POST", + "params": { + "$owner": null, + "$repo": null, + "title": { + "type": "String", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "" + }, + "body": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "" + }, + "assignee": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "Login for the user that this issue should be assigned to." + }, + "milestone": { + "type": "Number", + "required": false, + "validation": "^[0-9]+$", + "invalidmsg": "", + "description": "Milestone to associate this issue with." + }, + "labels": { + "type": "Array", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "Array of strings - Labels to associate with this issue." + }, + "$assignees": null + }, + "description": "Create an issue" + }, + "edit": { + "url": "/repos/:owner/:repo/issues/:number", + "method": "PATCH", + "params": { + "$owner": null, + "$repo": null, + "$number": null, + "title": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "" + }, + "body": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "" + }, + "assignee": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "Login for the user that this issue should be assigned to." + }, + "state": { + "type": "String", + "required": false, + "validation": "^(open|closed)$", + "invalidmsg": "open, closed, default: open", + "description": "open or closed", + "enum": [ + "open", + "closed" + ], + "default": "open" + }, + "milestone": { + "type": "Number", + "required": false, + "validation": "^[0-9]+$", + "invalidmsg": "", + "description": "Milestone to associate this issue with." + }, + "labels": { + "type": "Array", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "Array of strings - Labels to associate with this issue." + }, + "$assignees": null + }, + "description": "Edit an issue" + }, + "lock": { + "url": "/repos/:owner/:repo/issues/:number/lock", + "method": "PUT", + "params": { + "$owner": null, + "$repo": null, + "$number": null + }, + "description": "Users with push access can lock an issue's conversation." + }, + "unlock": { + "url": "/repos/:owner/:repo/issues/:number/lock", + "method": "DELETE", + "params": { + "$owner": null, + "$repo": null, + "$number": null + }, + "description": "Users with push access can unlock an issue's conversation." + }, + "get-assignees": { + "url": "/repos/:owner/:repo/assignees", + "method": "GET", + "params": { + "$owner": null, + "$repo": null + }, + "description": "List assignees" + }, + "check-assignee": { + "url": "/repos/:owner/:repo/assignees/:assignee", + "method": "GET", + "params": { + "$owner": null, + "$repo": null, + "assignee": { + "type": "String", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "Login for the user that this issue should be assigned to." + } + }, + "description": "Check assignee" + }, + "add-assignees-to-issue": { + "url": "/repos/:owner/:repo/issues/:number/assignees", + "method": "POST", + "params": { + "$owner": null, + "$repo": null, + "$number": null, + "assignees": { + "type": "Array", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "Logins for the users that should be added to the issue." + } + }, + "description": "Add assignees to an issue." + }, + "remove-assignees-from-issue": { + "url": "/repos/:owner/:repo/issues/:number/assignees", + "method": "DELETE", + "params": { + "$owner": null, + "$repo": null, + "$number": null, + "$assignees": null + }, + "description": "Remove assignees from an issue." + }, + "get-comments": { + "url": "/repos/:owner/:repo/issues/:number/comments", + "method": "GET", + "params": { + "$owner": null, + "$repo": null, + "$number": null, + "$page": null, + "$per_page": null + }, + "description": "List comments on an issue" + }, + "get-comments-for-repo": { + "url": "/repos/:owner/:repo/issues/comments", + "method": "GET", + "params": { + "$owner": null, + "$repo": null, + "sort": { + "type": "String", + "required": false, + "validation": "^(created|updated)$", + "invalidmsg": "created, updated, default: created.", + "description": "", + "enum": [ + "created", + "updated" + ], + "default": "created" + }, + "$direction": null, + "$since": null, + "$page": null, + "$per_page": null + }, + "description": "List comments in a repository" + }, + "get-comment": { + "url": "/repos/:owner/:repo/issues/comments/:id", + "method": "GET", + "params": { + "$owner": null, + "$repo": null, + "$id": null + }, + "description": "Get a single comment" + }, + "create-comment": { + "url": "/repos/:owner/:repo/issues/:number/comments", + "method": "POST", + "params": { + "$owner": null, + "$repo": null, + "$number": null, + "$body": null + }, + "description": "Create a comment" + }, + "edit-comment": { + "url": "/repos/:owner/:repo/issues/comments/:id", + "method": "PATCH", + "params": { + "$owner": null, + "$repo": null, + "$id": null, + "$body": null + }, + "description": "Edit a comment" + }, + "delete-comment": { + "url": "/repos/:owner/:repo/issues/comments/:id", + "method": "DELETE", + "params": { + "$owner": null, + "$repo": null, + "$id": null + }, + "description": "Delete a comment" + }, + "get-events": { + "url": "/repos/:owner/:repo/issues/:issue_number/events", + "method": "GET", + "params": { + "$owner": null, + "$repo": null, + "$issue_number": null, + "$page": null, + "$per_page": null + }, + "description": "List events for an issue" + }, + "get-events-for-repo": { + "url": "/repos/:owner/:repo/issues/events", + "method": "GET", + "params": { + "$owner": null, + "$repo": null, + "$page": null, + "$per_page": null + }, + "description": "List events for a repository" + }, + "get-event": { + "url": "/repos/:owner/:repo/issues/events/:id", + "method": "GET", + "params": { + "$owner": null, + "$repo": null, + "$id": null + }, + "description": "Get a single event" + }, + "get-labels": { + "url": "/repos/:owner/:repo/labels", + "method": "GET", + "params": { + "$owner": null, + "$repo": null, + "$page": null, + "$per_page": null + }, + "description": "List all labels for this repository" + }, + "get-label": { + "url": "/repos/:owner/:repo/labels/:name", + "method": "GET", + "params": { + "$owner": null, + "$repo": null, + "$name": null + }, + "description": "Get a single label" + }, + "create-label": { + "url": "/repos/:owner/:repo/labels", + "method": "POST", + "params": { + "$owner": null, + "$repo": null, + "$name": null, + "$color": null + }, + "description": "Create a label" + }, + "update-label": { + "url": "/repos/:owner/:repo/labels/:oldname", + "method": "PATCH", + "params": { + "$owner": null, + "$repo": null, + "oldname": { + "type": "String", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "The old name of the label." + }, + "name": { + "type": "String", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "The new name of the label." + }, + "$color": null + }, + "description": "Update a label" + }, + "delete-label": { + "url": "/repos/:owner/:repo/labels/:name", + "method": "DELETE", + "params": { + "$owner": null, + "$repo": null, + "$name": null + }, + "description": "Delete a label" + }, + "get-issue-labels": { + "url": "/repos/:owner/:repo/issues/:number/labels", + "method": "GET", + "params": { + "$owner": null, + "$repo": null, + "$number": null + }, + "description": "List labels on an issue" + }, + "add-labels": { + "url": "/repos/:owner/:repo/issues/:number/labels", + "method": "POST", + "params": { + "$owner": null, + "$repo": null, + "$number": null, + "labels": { + "type": "Array", + "sendValueAsBody": true, + "required": true, + "validation": "", + "invalidmsg": "", + "description": "" + } + }, + "description": "Add labels to an issue" + }, + "remove-label": { + "url": "/repos/:owner/:repo/issues/:number/labels/:name", + "method": "DELETE", + "params": { + "$owner": null, + "$repo": null, + "$number": null, + "name": { + "type": "String", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "" + } + }, + "description": "Remove a label from an issue" + }, + "replace-all-labels": { + "url": "/repos/:owner/:repo/issues/:number/labels", + "method": "PUT", + "params": { + "$owner": null, + "$repo": null, + "$number": null, + "labels": { + "type": "Array", + "sendValueAsBody": true, + "required": true, + "validation": "", + "invalidmsg": "", + "description": "Sending an empty array ([]) will remove all Labels from the Issue." + } + }, + "description": "Replace all labels for an issue" + }, + "remove-all-labels": { + "url": "/repos/:owner/:repo/issues/:number/labels", + "method": "DELETE", + "params": { + "$owner": null, + "$repo": null, + "$number": null + }, + "description": "Remove all labels from an issue" + }, + "get-milestone-labels": { + "url": "/repos/:owner/:repo/milestones/:number/labels", + "method": "GET", + "params": { + "$owner": null, + "$repo": null, + "$number": null + }, + "description": "Get labels for every issue in a milestone" + }, + "get-milestones": { + "url": "/repos/:owner/:repo/milestones", + "method": "GET", + "params": { + "$owner": null, + "$repo": null, + "$state": null, + "sort": { + "type": "String", + "required": false, + "validation": "^(due_on|completeness)$", + "invalidmsg": "due_on, completeness, default: due_on", + "description": "due_on, completeness, default: due_on", + "enum": [ + "due_on", + "completeness" + ], + "default": "due_on" + }, + "direction": { + "type": "String", + "required": false, + "validation": "^(asc|desc)$", + "invalidmsg": "asc or desc, default: asc.", + "description": "", + "enum": [ + "asc", + "desc" + ], + "default": "asc" + }, + "$page": null, + "$per_page": null + }, + "description": "List milestones for a repository" + }, + "get-milestone": { + "url": "/repos/:owner/:repo/milestones/:number", + "method": "GET", + "params": { + "$owner": null, + "$repo": null, + "$number": null + }, + "description": "Get a single milestone" + }, + "create-milestone": { + "url": "/repos/:owner/:repo/milestones", + "method": "POST", + "params": { + "$owner": null, + "$repo": null, + "title": { + "type": "String", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "" + }, + "$state": null, + "$description": null, + "due_on": { + "type": "Date", + "required": false, + "validation": "", + "invalidmsg": "Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ", + "description": "Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ" + } + }, + "description": "Create a milestone" + }, + "update-milestone": { + "url": "/repos/:owner/:repo/milestones/:number", + "method": "PATCH", + "params": { + "$owner": null, + "$repo": null, + "$number": null, + "title": { + "type": "String", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "" + }, + "$state": null, + "$description": null, + "due_on": { + "type": "Date", + "required": false, + "validation": "", + "invalidmsg": "Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ", + "description": "Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ" + } + }, + "description": "Update a milestone" + }, + "delete-milestone": { + "url": "/repos/:owner/:repo/milestones/:number", + "method": "DELETE", + "params": { + "$owner": null, + "$repo": null, + "$number": null + }, + "description": "Delete a milestone" + }, + "get-events-timeline": { + "url": "/repos/:owner/:repo/issues/:issue_number/timeline", + "method": "GET", + "params": { + "$owner": null, + "$repo": null, + "$issue_number": null, + "$page": null, + "$per_page": null + }, + "description": "List events for an issue. (In preview period. See README.)" + } + }, + "migrations": { + "start-migration": { + "url": "/orgs/:org/migrations", + "method": "POST", + "params": { + "$org": null, + "repositories": { + "type": "Array", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "A list of arrays indicating which repositories should be migrated." + }, + "lock_repositories": { + "type": "Boolean", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "Indicates whether repositories should be locked (to prevent manipulation) while migrating data. Default: false.", + "default": "false" + }, + "exclude_attachments": { + "type": "Boolean", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "Indicates whether attachments should be excluded from the migration (to reduce migration archive file size). Default: false.", + "default": "false" + } + }, + "description": "Start a migration. (In preview period. See README.)" + }, + "get-migrations": { + "url": "/orgs/:org/migrations", + "method": "GET", + "params": { + "$org": null, + "$page": null, + "$per_page": null + }, + "description": "Get a list of migrations. (In preview period. See README.)" + }, + "get-migration-status": { + "url": "/orgs/:org/migrations/:id", + "method": "GET", + "params": { + "$org": null, + "$id": null + }, + "description": "Get the status of a migration. (In preview period. See README.)" + }, + "get-migration-archive-link": { + "url": "/orgs/:org/migrations/:id/archive", + "method": "GET", + "params": { + "$org": null, + "$id": null + }, + "description": "Get the URL to a migration archive. (In preview period. See README.)" + }, + "delete-migration-archive": { + "url": "/orgs/:org/migrations/:id/archive", + "method": "DELETE", + "params": { + "$org": null, + "$id": null + }, + "description": "Delete a migration archive. (In preview period. See README.)" + }, + "unlock-repo-locked-for-migration": { + "url": "/orgs/:org/migrations/:id/repos/:repo_name/lock", + "method": "DELETE", + "params": { + "$org": null, + "$id": null, + "repo_name": { + "type": "String", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "" + } + }, + "description": "Unlock a repository that was locked for migration. (In preview period. See README.)" + }, + "start-import": { + "url": "/repos/:owner/:repo/import", + "method": "PUT", + "params": { + "$owner": null, + "$repo": null, + "vcs_url": { + "type": "String", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "The URL of the originating repository." + }, + "vcs": { + "type": "String", + "required": false, + "validation": "^(subversion|git|mercurial|tfvc)$", + "invalidmsg": "subversion, git, mercurial, tfvc", + "description": "The originating VCS type. Please be aware that without this parameter, the import job will take additional time to detect the VCS type before beginning the import. This detection step will be reflected in the response.", + "enum": [ + "subversion", + "git", + "mercurial", + "tfvc" + ] + }, + "vcs_username": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "If authentication is required, the username to provide to vcs_url." + }, + "vcs_password": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "If authentication is required, the password to provide to vcs_url." + }, + "tfvc_project": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "For a tfvc import, the name of the project that is being imported." + } + }, + "description": "Start an import. (In preview period. See README.)" + }, + "get-import-progress": { + "url": "/repos/:owner/:repo/import", + "method": "GET", + "params": { + "$owner": null, + "$repo": null + }, + "description": "Get import progress. (In preview period. See README.)" + }, + "update-import": { + "url": "/repos/:owner/:repo/import", + "method": "PATCH", + "params": { + "$owner": null, + "$repo": null + }, + "vcs_username": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "The username to provide to the originating repository." + }, + "vcs_password": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "The password to provide to the originating repository." + }, + "description": "Update existing import. (In preview period. See README.)" + }, + "get-import-commit-authors": { + "url": "/repos/:owner/:repo/import/authors", + "method": "GET", + "params": { + "$owner": null, + "$repo": null, + "since": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "Only authors found after this id are returned. Provide the highest author ID you've seen so far. New authors may be added to the list at any point while the importer is performing the raw step." + } + }, + "description": "Get import commit authors. (In preview period. See README.)" + }, + "map-import-commit-author": { + "url": "/repos/:owner/:repo/import/authors/:author_id", + "method": "PATCH", + "params": { + "$owner": null, + "$repo": null, + "author_id": { + "type": "String", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "The commit author id." + }, + "email": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "The new Git author email." + }, + "name": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "The new Git author name." + } + }, + "description": "Map a commit author. (In preview period. See README.)" + }, + "set-import-lfs-preference": { + "url": "/:owner/:name/import/lfs", + "method": "PATCH", + "params": { + "$owner": null, + "$name": null, + "use_lfs": { + "type": "String", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "Can be one of `opt_in` (large files will be stored using Git LFS) or `opt_out` (large files will be removed during the import)." + } + }, + "description": "Set import LFS preference. (In preview period. See README.)" + }, + "get-large-import-files": { + "url": "/:owner/:name/import/large_files", + "method": "GET", + "params": { + "$owner": null, + "$name": null + }, + "description": "List files larger than 100MB found during the import. (In preview period. See README.)" + }, + "cancel-import": { + "url": "/repos/:owner/:repo/import", + "method": "DELETE", + "params": { + "$owner": null, + "$repo": null + }, + "description": "Cancel an import. (In preview period. See README.)" + } + }, + "misc": { + "get-emojis": { + "url": "/emojis", + "method": "GET", + "params": {}, + "description": "Lists all the emojis available to use on GitHub." + }, + "get-gitignore-templates": { + "url": "/gitignore/templates", + "method": "GET", + "params": {}, + "description": "Lists available gitignore templates" + }, + "get-gitignore-template": { + "url": "/gitignore/templates/:name", + "method": "GET", + "params": { + "name": { + "type": "String", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "The name of the .gitignore template to get e.g. 'C'" + } + }, + "description": "Get a single gitignore template" + }, + "get-licenses": { + "url": "/licenses", + "method": "GET", + "params": {}, + "description": "List all licenses. (In preview period. See README.)" + }, + "get-license": { + "url": "/licenses/:license", + "method": "GET", + "params": { + "license": { + "type": "String", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "Ex: /licenses/mit" + } + }, + "description": "Get an individual license. (In preview period. See README.)" + }, + "get-repo-license": { + "url": "/repos/:owner/:repo/license", + "method": "GET", + "params": { + "$owner": null, + "$repo": null + }, + "description": "Get the contents of a repository's license. (In preview period. See README.)" + }, + "render-markdown": { + "url": "/markdown", + "method": "POST", + "params": { + "text": { + "type": "String", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "The Markdown text to render" + }, + "mode": { + "type": "String", + "required": false, + "validation": "^(markdown|gfm)$", + "invalidmsg": "", + "description": "The rendering mode, `markdown` to render a document as plain Markdown, just like README files are rendered. `gfm` to render a document as user-content, e.g. like user comments or issues are rendered. In GFM mode, hard line breaks are always taken into account, and issue and user mentions are linked accordingly.", + "enum": [ + "markdown", + "gfm" + ], + "default": "markdown" + }, + "context": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "The repository context. Only taken into account when rendering as `gfm`" + } + }, + "description": "Render an arbitrary Markdown document" + }, + "render-markdown-raw": { + "url": "/markdown/raw", + "method": "POST", + "requestFormat": "raw", + "params": { + "$data": null + }, + "description": "Render a Markdown document in raw mode" + }, + "get-meta": { + "url": "/meta", + "method": "GET", + "params": {}, + "description": "This endpoint provides information about GitHub.com, the service. Or, if you access this endpoint on your organization's GitHub Enterprise installation, this endpoint provides information about that installation." + }, + "get-rate-limit": { + "url": "/rate_limit", + "method": "GET", + "params": {}, + "description": "Get your current rate limit status" + } + }, + "orgs": { + "get-all": { + "url": "/organizations", + "method": "GET", + "params": { + "since": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "The integer ID of the last Organization that you've seen." + }, + "$page": null, + "$per_page": null + }, + "description": "List all organizations" + }, + "get-for-user": { + "url": "/users/:username/orgs", + "method": "GET", + "params": { + "$username": null, + "$page": null, + "$per_page": null + }, + "description": "List public organization memberships for the specified user." + }, + "get": { + "url": "/orgs/:org", + "method": "GET", + "params": { + "$org": null, + "$page": null, + "$per_page": null + }, + "description": "Get an organization" + }, + "update": { + "url": "/orgs/:org", + "method": "PATCH", + "params": { + "$org": null, + "billing_email": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "Billing email address. This address is not publicized." + }, + "company": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "The company name." + }, + "email": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "The publicly visible email address." + }, + "location": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "The location." + }, + "name": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "The shorthand name of the company." + }, + "description": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "The description of the company." + }, + "default_repository_permission": { + "type": "String", + "required": false, + "validation": "^(read|write|admin|none)$", + "invalidmsg": "read, write, admin, none, default: read", + "description": "Default permission level members have for organization repositories.", + "enum": [ + "read", + "write", + "admin", + "none" + ], + "default": "read" + }, + "members_can_create_repositories": { + "type": "Boolean", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "Toggles ability of non-admin organization members to create repositories.", + "default": true + } + }, + "description": "Edit an organization" + }, + "get-members": { + "url": "/orgs/:org/members", + "method": "GET", + "params": { + "$org": null, + "filter": { + "type": "String", + "required": false, + "validation": "^(all|2fa_disabled)$", + "invalidmsg": "all, 2fa_disabled, default: all", + "description": "Filter members returned in the list.", + "enum": [ + "all", + "2fa_disabled" + ], + "default": "all" + }, + "role": { + "type": "String", + "required": false, + "validation": "^(all|admin|member)$", + "invalidmsg": "all, admin, member, default: all", + "description": "Filter members returned by their role.", + "enum": [ + "all", + "admin", + "member" + ], + "default": "all" + }, + "$page": null, + "$per_page": null + }, + "description": "Members list" + }, + "check-membership": { + "url": "/orgs/:org/members/:username", + "method": "GET", + "params": { + "$org": null, + "$username": null + }, + "description": "Check membership" + }, + "remove-member": { + "url": "/orgs/:org/members/:username", + "method": "DELETE", + "params": { + "$org": null, + "$username": null + }, + "description": "Remove a member" + }, + "get-public-members": { + "url": "/orgs/:org/public_members", + "method": "GET", + "params": { + "$org": null + }, + "description": "Public members list" + }, + "check-public-membership": { + "url": "/orgs/:org/public_members/:username", + "method": "GET", + "params": { + "$org": null, + "$username": null + }, + "description": "Check public membership" + }, + "publicize-membership": { + "url": "/orgs/:org/public_members/:username", + "method": "PUT", + "params": { + "$org": null, + "$username": null + }, + "description": "Publicize a user's membership" + }, + "conceal-membership": { + "url": "/orgs/:org/public_members/:username", + "method": "DELETE", + "params": { + "$org": null, + "$username": null + }, + "description": "Conceal a user's membership" + }, + "get-org-membership": { + "url": "/orgs/:org/memberships/:username", + "method": "GET", + "params": { + "$org": null, + "$username": null + }, + "description": "Get organization membership" + }, + "add-org-membership": { + "url": "/orgs/:org/memberships/:username", + "method": "PUT", + "params": { + "$org": null, + "$username": null, + "role": { + "type": "String", + "required": true, + "validation": "^(admin|member)$", + "invalidmsg": "admin, member", + "description": "The role to give the user in the organization.", + "enum": [ + "admin", + "member" + ] + } + }, + "description": "Add or update organization membership" + }, + "remove-org-membership": { + "url": "/orgs/:org/memberships/:username", + "method": "DELETE", + "params": { + "$org": null, + "$username": null + }, + "description": "Remove organization membership" + }, + "get-pending-org-invites": { + "url": "/orgs/:org/invitations", + "method": "GET", + "params": { + "$org": null + }, + "description": "List pending organization invites." + }, + "get-outside-collaborators": { + "url": "/orgs/:org/outside_collaborators", + "method": "GET", + "params": { + "$org": null, + "$page": null, + "$per_page": null + }, + "description": "List all users who are outside collaborators of an organization." + }, + "remove-outside-collaborator": { + "url": "/orgs/:org/outside_collaborator/:username", + "method": "DELETE", + "params": { + "$org": null, + "$username": null + }, + "description": "Remove outside collaborator." + }, + "convert-member-to-outside-collaborator": { + "url": "/orgs/:org/outside_collaborator/:username", + "method": "PUT", + "params": { + "$org": null, + "$username": null + }, + "description": "Convert member to outside collaborator." + }, + "get-teams": { + "url": "/orgs/:org/teams", + "method": "GET", + "params": { + "$org": null, + "$page": null, + "$per_page": null + }, + "description": "List teams" + }, + "get-team": { + "url": "/teams/:id", + "method": "GET", + "params": { + "$id": null + }, + "description": "Get team" + }, + "create-team": { + "url": "/orgs/:org/teams", + "method": "POST", + "params": { + "$org": null, + "$name": null, + "description": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "The description of the team." + }, + "maintainers": { + "type": "Array", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "The logins of organization members to add as maintainers of the team." + }, + "repo_names": { + "type": "Array", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "The full name (e.g., \"organization-name/repository-name\") of repositories to add the team to." + }, + "$privacy": null + }, + "description": "Create team" + }, + "edit-team": { + "url": "/teams/:id", + "method": "PATCH", + "params": { + "$id": null, + "$name": null, + "description": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "The description of the team." + }, + "$privacy": null + }, + "description": "Edit team" + }, + "delete-team": { + "url": "/teams/:id", + "method": "DELETE", + "params": { + "$id": null + }, + "description": "Delete team" + }, + "get-team-members": { + "url": "/teams/:id/members", + "method": "GET", + "params": { + "$id": null, + "role": { + "type": "String", + "required": false, + "validation": "^(member|maintainer|all)$", + "invalidmsg": "member, maintainer, all, default: all", + "description": "Filters members returned by their role in the team.", + "enum": [ + "member", + "maintainer", + "all" + ], + "default": "all" + }, + "$page": null, + "$per_page": null + }, + "description": "List team members" + }, + "get-team-membership": { + "url": "/teams/:id/memberships/:username", + "method": "GET", + "params": { + "$id": null, + "$username": null + }, + "description": "Get team membership" + }, + "add-team-membership": { + "url": "/teams/:id/memberships/:username", + "method": "PUT", + "params": { + "$id": null, + "$username": null, + "role": { + "type": "String", + "required": false, + "validation": "^(member|maintainer)$", + "invalidmsg": "member, maintainer, default: member", + "description": "The role that this user should have in the team.", + "enum": [ + "member", + "maintainer" + ], + "default": "member" + } + }, + "description": "Add team membership" + }, + "remove-team-membership": { + "url": "/teams/:id/memberships/:username", + "method": "DELETE", + "params": { + "$id": null, + "$username": null + }, + "description": "Remove team membership" + }, + "get-team-repos": { + "url": "/teams/:id/repos", + "method": "GET", + "params": { + "$id": null, + "$page": null, + "$per_page": null + }, + "description": "Get team repos" + }, + "get-pending-team-invites": { + "url": "/teams/:id/invitations", + "method": "GET", + "params": { + "$id": null, + "$page": null, + "$per_page": null + }, + "description": "List pending team invitations." + }, + "check-team-repo": { + "url": "/teams/:id/repos/:owner/:repo", + "method": "GET", + "params": { + "$id": null, + "$owner": null, + "$repo": null + }, + "description": "Check if a team manages a repository" + }, + "add-team-repo": { + "url": "/teams/:id/repos/:org/:repo", + "method": "PUT", + "params": { + "$id": null, + "$org": null, + "$repo": null, + "permission": { + "type": "String", + "required": false, + "validation": "^(pull|push|admin)$", + "invalidmsg": "", + "description": "`pull` - team members can pull, but not push or administer this repository, `push` - team members can pull and push, but not administer this repository, `admin` - team members can pull, push and administer this repository.", + "enum": [ + "pull", + "push", + "admin" + ] + } + }, + "description": "Add team repository" + }, + "delete-team-repo": { + "url": "/teams/:id/repos/:owner/:repo", + "method": "DELETE", + "params": { + "$id": null, + "$owner": null, + "$repo": null + }, + "description": "Remove team repository" + }, + "get-hooks": { + "url": "/orgs/:org/hooks", + "method": "GET", + "params": { + "$org": null, + "$page": null, + "$per_page": null + }, + "description": "List hooks" + }, + "get-hook": { + "url": "/orgs/:org/hooks/:id", + "method": "GET", + "params": { + "$org": null, + "$id": null + }, + "description": "Get single hook" + }, + "create-hook": { + "url": "/orgs/:org/hooks", + "method": "POST", + "params": { + "$org": null, + "name": { + "type": "String", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "Must be passed as \"web\"." + }, + "config": { + "type": "Json", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "Key/value pairs to provide settings for this webhook" + }, + "events": { + "type": "Array", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "Determines what events the hook is triggered for. Default: [\"push\"].", + "default": "[\"push\"]" + }, + "active": { + "type": "Boolean", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "Determines whether the hook is actually triggered on pushes." + } + }, + "description": "Create a hook" + }, + "edit-hook": { + "url": "/orgs/:org/hooks/:id", + "method": "PATCH", + "params": { + "$org": null, + "$id": null, + "config": { + "type": "Json", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "Key/value pairs to provide settings for this webhook" + }, + "events": { + "type": "Array", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "Determines what events the hook is triggered for. Default: [\"push\"].", + "default": "[\"push\"]" + }, + "active": { + "type": "Boolean", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "Determines whether the hook is actually triggered on pushes." + } + }, + "description": "Edit a hook" + }, + "ping-hook": { + "url": "/orgs/:org/hooks/:id/pings", + "method": "POST", + "params": { + "$org": null, + "$id": null + }, + "description": "Ping a hook" + }, + "delete-hook": { + "url": "/orgs/:org/hooks/:id", + "method": "DELETE", + "params": { + "$org": null, + "$id": null + }, + "description": "Delete a hook" + } + }, + "projects": { + "get-repo-projects": { + "url": "/repos/:owner/:repo/projects", + "method": "GET", + "params": { + "$owner": null, + "$repo": null + }, + "description": "List repository projects. (In preview period. See README.)" + }, + "get-org-projects": { + "url": "/orgs/:org/projects", + "method": "GET", + "params": { + "$org": null + }, + "description": "List organization projects. (In preview period. See README.)" + }, + "get-project": { + "url": "/projects/:id", + "method": "GET", + "params": { + "$id": null + }, + "description": "Get a project. (In preview period. See README.)" + }, + "create-repo-project": { + "url": "/repos/:owner/:repo/projects", + "method": "POST", + "params": { + "$owner": null, + "$repo": null, + "$name": null, + "body": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "" + } + }, + "description": "Create a repository project. (In preview period. See README.)" + }, + "create-org-project": { + "url": "/orgs/:org/projects", + "method": "POST", + "params": { + "$org": null, + "$name": null, + "body": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "" + } + }, + "description": "Create an organization project. (In preview period. See README.)" + }, + "update-project": { + "url": "/projects/:id", + "method": "PATCH", + "params": { + "$id": null, + "$name": null, + "body": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "" + } + }, + "description": "Update a project. (In preview period. See README.)" + }, + "delete-project": { + "url": "/projects/:id", + "method": "DELETE", + "params": { + "$id": null + }, + "description": "Delete a project. (In preview period. See README.)" + }, + "get-project-cards": { + "url": "/projects/columns/:column_id/cards", + "method": "GET", + "params": { + "$column_id": null + }, + "description": "List project cards. (In preview period. See README.)" + }, + "get-project-card": { + "url": "/projects/columns/cards/:id", + "method": "GET", + "params": { + "$id": null + }, + "description": "Get project card. (In preview period. See README.)" + }, + "create-project-card": { + "url": "/projects/columns/:column_id/cards", + "method": "POST", + "params": { + "$column_id": null, + "note": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "The note of the card." + }, + "content_id": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "The id of the Issue or Pull Request to associate with this card." + }, + "content_type": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "The type of content to associate with this card. Can be either 'Issue' or 'PullRequest'." + } + }, + "description": "Create a project card. (In preview period. See README.)" + }, + "update-project-card": { + "url": "/projects/columns/cards/:id", + "method": "PATCH", + "params": { + "$id": null, + "note": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "The note of the card." + } + }, + "description": "Update a project card. (In preview period. See README.)" + }, + "delete-project-card": { + "url": "/projects/columns/cards/:id", + "method": "DELETE", + "params": { + "$id": null + }, + "description": "Delete a project card. (In preview period. See README.)" + }, + "move-project-card": { + "url": "/projects/columns/cards/:id/moves", + "method": "POST", + "params": { + "$id": null, + "position": { + "type": "String", + "required": true, + "validation": "^(top|bottom|after:\\d)$", + "invalidmsg": "", + "description": "Can be one of top, bottom, or after:, where is the id value of a column in the same project." + }, + "column_id": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "The id value of a column in the same project." + } + }, + "description": "Move a project card. (In preview period. See README.)" + }, + "get-project-columns": { + "url": "/projects/:project_id/columns", + "method": "GET", + "params": { + "$project_id": null + }, + "description": "List project columns. (In preview period. See README.)" + }, + "get-project-column": { + "url": "/projects/columns/:id", + "method": "GET", + "params": { + "$id": null + }, + "description": "Get a project column. (In preview period. See README.)" + }, + "create-project-column": { + "url": "/projects/:project_id/columns", + "method": "POST", + "params": { + "$project_id": null, + "$name": null + }, + "description": "Create a project column. (In preview period. See README.)" + }, + "update-project-column": { + "url": "/projects/columns/:id", + "method": "PATCH", + "params": { + "$id": null, + "$name": null + }, + "description": "Update a project column. (In preview period. See README.)" + }, + "delete-project-column": { + "url": "/projects/columns/:id", + "method": "DELETE", + "params": { + "$id": null + }, + "description": "Delete a project column. (In preview period. See README.)" + }, + "move-project-column": { + "url": "/projects/columns/:id/moves", + "method": "POST", + "params": { + "$id": null, + "position": { + "type": "String", + "required": true, + "validation": "^(first|last|after:\\d)$", + "invalidmsg": "", + "description": "Can be one of first, last, or after:, where is the id value of a column in the same project." + } + }, + "description": "Move a project column. (In preview period. See README.)" + } + }, + "pull-requests": { + "get-all": { + "url": "/repos/:owner/:repo/pulls", + "method": "GET", + "params": { + "$owner": null, + "$repo": null, + "state": { + "type": "String", + "required": false, + "validation": "^(open|closed|all)$", + "invalidmsg": "open, closed, all, default: open", + "description": "open, closed, or all", + "enum": [ + "open", + "closed", + "all" + ], + "default": "open" + }, + "head": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "Filter pulls by head user and branch name in the format of user:ref-name. Example: github:new-script-format." + }, + "base": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "Filter pulls by base branch name. Example: gh-pages." + }, + "sort": { + "type": "String", + "required": false, + "validation": "^(created|updated|popularity|long-running)$", + "invalidmsg": "Possible values are: `created`, `updated`, `popularity`, `long-running`, Default: `created`", + "description": "Possible values are: `created`, `updated`, `popularity`, `long-running`, Default: `created`", + "enum": [ + "created", + "updated", + "popularity", + "long-running" + ], + "default": "created" + }, + "$direction": null, + "$page": null, + "$per_page": null + }, + "description": "List pull requests" + }, + "get": { + "url": "/repos/:owner/:repo/pulls/:number", + "method": "GET", + "params": { + "$owner": null, + "$repo": null, + "$number": null + }, + "description": "Get a single pull request" + }, + "create": { + "url": "/repos/:owner/:repo/pulls", + "method": "POST", + "params": { + "$owner": null, + "$repo": null, + "title": { + "type": "String", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "The title of the pull request." + }, + "$head": null, + "$base": null, + "body": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "The contents of the pull request." + }, + "maintainer_can_modify": { + "type": "Boolean", + "required": false, + "default": "true", + "description": "Indicates whether maintainers can modify the pull request." + } + }, + "description": "Create a pull request" + }, + "create-from-issue": { + "url": "/repos/:owner/:repo/pulls", + "method": "POST", + "params": { + "$owner": null, + "$repo": null, + "issue": { + "type": "Number", + "required": true, + "validation": "^[0-9]+$", + "invalidmsg": "", + "description": "The issue number in this repository to turn into a Pull Request." + }, + "$head": null, + "$base": null + }, + "description": "Create a pull request from an existing issue" + }, + "update": { + "url": "/repos/:owner/:repo/pulls/:number", + "method": "PATCH", + "params": { + "$owner": null, + "$repo": null, + "$number": null, + "title": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "The title of the pull request." + }, + "body": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "The contents of the pull request." + }, + "$state": null, + "base": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "The branch (or git ref) you want your changes pulled into. This should be an existing branch on the current repository. You cannot submit a pull request to one repo that requests a merge to a base of another repo." + } + }, + "description": "Update a pull request" + }, + "get-commits": { + "url": "/repos/:owner/:repo/pulls/:number/commits", + "method": "GET", + "params": { + "$owner": null, + "$repo": null, + "$number": null, + "$page": null, + "$per_page": null + }, + "description": "List commits on a pull request" + }, + "get-files": { + "url": "/repos/:owner/:repo/pulls/:number/files", + "method": "GET", + "params": { + "$owner": null, + "$repo": null, + "$number": null, + "$page": null, + "$per_page": null + }, + "description": "List pull requests files" + }, + "check-merged": { + "url": "/repos/:owner/:repo/pulls/:number/merge", + "method": "GET", + "params": { + "$owner": null, + "$repo": null, + "$number": null, + "$page": null, + "$per_page": null + }, + "description": "Get if a pull request has been merged" + }, + "merge": { + "url": "/repos/:owner/:repo/pulls/:number/merge", + "method": "PUT", + "params": { + "$owner": null, + "$repo": null, + "$number": null, + "commit_title": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "Title for the automatic commit message. (In preview period. See README.)" + }, + "commit_message": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "Extra detail to append to automatic commit message." + }, + "sha": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "SHA that pull request head must match to allow merge" + }, + "merge_method": { + "type": "String", + "required": false, + "validation": "^(merge|squash|rebase)$", + "invalidmsg": "Possible values are: `merge`, `squash`, `rebase` Default: `merge`", + "description": "Merge method to use. Possible values are `merge`, `squash`, or `rebase`. (In preview period. See README.)", + "enum": [ + "merge", + "squash", + "rebase" + ], + "default": "merge" + } + }, + "description": "Merge a pull request (Merge Button)" + }, + "get-reviews": { + "url": "/repos/:owner/:repo/pulls/:number/reviews", + "method": "GET", + "params": { + "$owner": null, + "$repo": null, + "$number": null, + "$page": null, + "$per_page": null + }, + "description": "List reviews on a pull request. (In preview period. See README.)" + }, + "get-review": { + "url": "/repos/:owner/:repo/pulls/:number/reviews/:id", + "method": "GET", + "params": { + "$owner": null, + "$repo": null, + "$number": null, + "$id": null + }, + "description": "Get a single pull request review. (In preview period. See README.)" + }, + "get-review-comments": { + "url": "/repos/:owner/:repo/pulls/:number/reviews/:id/comments", + "method": "GET", + "params": { + "$owner": null, + "$repo": null, + "$number": null, + "$id": null, + "$page": null, + "$per_page": null + }, + "description": "Get comments for a pull request review. (In preview period. See README.)" + }, + "create-review": { + "url": "/repos/:owner/:repo/pulls/:number/reviews", + "method": "POST", + "params": { + "$owner": null, + "$repo": null, + "$number": null, + "body": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "The body text of the pull request review." + }, + "event": { + "type": "String", + "required": false, + "validation": "^(APPROVE|REQUEST_CHANGES|COMMENT|PENDING)$", + "invalidmsg": "Possible values are: `APPROVE`, `REQUEST_CHANGES`, `COMMENT`, `PENDING`. Default: `PENDING`", + "description": "The event to perform on the review upon submission, can be one of APPROVE, REQUEST_CHANGES, or COMMENT. If left blank, the review will be in the PENDING state.", + "enum": [ + "APPROVE", + "REQUEST_CHANGES", + "COMMENT", + "PENDING" + ], + "default": "PENDING" + }, + "comments": { + "type": "Array", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "An array of comments part of the review." + }, + "path": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "The path to the file being commented on." + }, + "position": { + "type": "Number", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "The position in the file to be commented on." + } + }, + "description": "Create a pull request review. (In preview period. See README.)" + }, + "submit-review": { + "url": "/repos/:owner/:repo/pulls/:number/reviews/:id/events", + "method": "POST", + "params": { + "$owner": null, + "$repo": null, + "$number": null, + "$id": null, + "body": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "The body text of the pull request review." + }, + "event": { + "type": "String", + "required": false, + "validation": "^(APPROVE|REQUEST_CHANGES|COMMENT|PENDING)$", + "invalidmsg": "Possible values are: `APPROVE`, `REQUEST_CHANGES`, `COMMENT`, `PENDING`. Default: `PENDING`", + "description": "The event to perform on the review upon submission, can be one of APPROVE, REQUEST_CHANGES, or COMMENT. If left blank, the review will be in the PENDING state.", + "enum": [ + "APPROVE", + "REQUEST_CHANGES", + "COMMENT", + "PENDING" + ], + "default": "PENDING" + } + }, + "description": "Submit a pull request review. (In preview period. See README.)" + }, + "dismiss-review": { + "url": "/repos/:owner/:repo/pulls/:number/reviews/:id/dismissals", + "method": "PUT", + "params": { + "$owner": null, + "$repo": null, + "$number": null, + "$id": null, + "message": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "The message for the pull request review dismissal." + }, + "$page": null, + "$per_page": null + }, + "description": "Dismiss a pull request review. (In preview period. See README.)" + }, + "get-comments": { + "url": "/repos/:owner/:repo/pulls/:number/comments", + "method": "GET", + "params": { + "$owner": null, + "$repo": null, + "$number": null, + "$page": null, + "$per_page": null + }, + "description": "List comments on a pull request" + }, + "get-comments-for-repo": { + "url": "/repos/:owner/:repo/pulls/comments", + "method": "GET", + "params": { + "$owner": null, + "$repo": null, + "sort": { + "type": "String", + "required": false, + "validation": "^(created|updated)$", + "invalidmsg": "Possible values are: `created`, `updated`, Default: `created`", + "description": "Possible values are: `created`, `updated`, Default: `created`", + "enum": [ + "created", + "updated" + ], + "default": "created" + }, + "$direction": null, + "$since": null, + "$page": null, + "$per_page": null + }, + "description": "List comments in a repository" + }, + "get-comment": { + "url": "/repos/:owner/:repo/pulls/comments/:id", + "method": "GET", + "params": { + "$owner": null, + "$repo": null, + "$id": null + }, + "description": "Get a single comment" + }, + "create-comment": { + "url": "/repos/:owner/:repo/pulls/:number/comments", + "method": "POST", + "params": { + "$owner": null, + "$repo": null, + "$number": null, + "$body": null, + "$commit_id": null, + "$path": null, + "$position": null + }, + "description": "Create a comment" + }, + "create-comment-reply": { + "url": "/repos/:owner/:repo/pulls/:number/comments", + "method": "POST", + "params": { + "$owner": null, + "$repo": null, + "$number": null, + "$body": null, + "in_reply_to": { + "type": "Number", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "The comment id to reply to." + } + }, + "description": "Reply to existing pull request comment" + }, + "edit-comment": { + "url": "/repos/:owner/:repo/pulls/comments/:id", + "method": "PATCH", + "params": { + "$owner": null, + "$repo": null, + "$id": null, + "$body": null + }, + "description": "Edit a comment" + }, + "delete-comment": { + "url": "/repos/:owner/:repo/pulls/comments/:id", + "method": "DELETE", + "params": { + "$owner": null, + "$repo": null, + "$id": null + }, + "description": "Delete a comment" + }, + "get-review-requests": { + "url": "/repos/:owner/:repo/pulls/:number/requested_reviewers", + "method": "GET", + "params": { + "$owner": null, + "$repo": null, + "$number": null, + "$page": null, + "$per_page": null + }, + "description": "List review requests. (In preview period. See README.)" + }, + "create-review-request": { + "url": "/repos/:owner/:repo/pulls/:number/requested_reviewers", + "method": "POST", + "params": { + "$owner": null, + "$repo": null, + "$number": null, + "reviewers": { + "type": "Array", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "An array of user logins that will be requested." + } + }, + "description": "Create a review request. (In preview period. See README.)" + }, + "delete-review-request": { + "url": "/repos/:owner/:repo/pulls/:number/requested_reviewers", + "method": "DELETE", + "params": { + "$owner": null, + "$repo": null, + "$number": null, + "reviewers": { + "type": "Array", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "An array of user logins that will be requested." + } + }, + "description": "Delete a review request. (In preview period. See README.)" + } + }, + "reactions": { + "get-for-commit-comment": { + "url": "/repos/:owner/:repo/comments/:id/reactions", + "method": "GET", + "params": { + "$owner": null, + "$repo": null, + "$id": null, + "content": { + "type": "String", + "required": false, + "validation": "^(\\+1|-1|laugh|confused|heart|hooray)$", + "invalidmsg": "Possible values: `+1`, `-1`, `laugh`, `confused`, `heart`, `hooray`.", + "description": "Indicates which type of reaction to return.", + "enum": [ + "+1", + "-1", + "laugh", + "confused", + "heart", + "hooray" + ] + } + }, + "description": "List reactions for a commit comment. (In preview period. See README.)" + }, + "create-for-commit-comment": { + "url": "/repos/:owner/:repo/comments/:id/reactions", + "method": "POST", + "params": { + "$owner": null, + "$repo": null, + "$id": null, + "content": { + "type": "String", + "required": true, + "validation": "^(\\+1|-1|laugh|confused|heart|hooray)$", + "invalidmsg": "Possible values: `+1`, `-1`, `laugh`, `confused`, `heart`, `hooray`.", + "description": "The reaction type.", + "enum": [ + "+1", + "-1", + "laugh", + "confused", + "heart", + "hooray" + ] + } + }, + "description": "Create reaction for a commit comment. (In preview period. See README.)" + }, + "get-for-issue": { + "url": "/repos/:owner/:repo/issues/:number/reactions", + "method": "GET", + "params": { + "$owner": null, + "$repo": null, + "$number": null, + "content": { + "type": "String", + "required": false, + "validation": "^(\\+1|-1|laugh|confused|heart|hooray)$", + "invalidmsg": "Possible values: `+1`, `-1`, `laugh`, `confused`, `heart`, `hooray`.", + "description": "Indicates which type of reaction to return.", + "enum": [ + "+1", + "-1", + "laugh", + "confused", + "heart", + "hooray" + ] + } + }, + "description": "List reactions for an issue. (In preview period. See README.)" + }, + "create-for-issue": { + "url": "/repos/:owner/:repo/issues/:number/reactions", + "method": "POST", + "params": { + "$owner": null, + "$repo": null, + "$number": null, + "content": { + "type": "String", + "required": true, + "validation": "^(\\+1|-1|laugh|confused|heart|hooray)$", + "invalidmsg": "Possible values: `+1`, `-1`, `laugh`, `confused`, `heart`, `hooray`.", + "description": "The reaction type.", + "enum": [ + "+1", + "-1", + "laugh", + "confused", + "heart", + "hooray" + ] + } + }, + "description": "Create reaction for an issue. (In preview period. See README.)" + }, + "get-for-issue-comment": { + "url": "/repos/:owner/:repo/issues/comments/:id/reactions", + "method": "GET", + "params": { + "$owner": null, + "$repo": null, + "$id": null, + "content": { + "type": "String", + "required": false, + "validation": "^(\\+1|-1|laugh|confused|heart|hooray)$", + "invalidmsg": "Possible values: `+1`, `-1`, `laugh`, `confused`, `heart`, `hooray`.", + "description": "Indicates which type of reaction to return.", + "enum": [ + "+1", + "-1", + "laugh", + "confused", + "heart", + "hooray" + ] + } + }, + "description": "List reactions for an issue comment. (In preview period. See README.)" + }, + "create-for-issue-comment": { + "url": "/repos/:owner/:repo/issues/comments/:id/reactions", + "method": "POST", + "params": { + "$owner": null, + "$repo": null, + "$id": null, + "content": { + "type": "String", + "required": true, + "validation": "^(\\+1|-1|laugh|confused|heart|hooray)$", + "invalidmsg": "Possible values: `+1`, `-1`, `laugh`, `confused`, `heart`, `hooray`.", + "description": "The reaction type.", + "enum": [ + "+1", + "-1", + "laugh", + "confused", + "heart", + "hooray" + ] + } + }, + "description": "Create reaction for an issue comment. (In preview period. See README.)" + }, + "get-for-pull-request-review-comment": { + "url": "/repos/:owner/:repo/pulls/comments/:id/reactions", + "method": "GET", + "params": { + "$owner": null, + "$repo": null, + "$id": null, + "content": { + "type": "String", + "required": false, + "validation": "^(\\+1|-1|laugh|confused|heart|hooray)$", + "invalidmsg": "Possible values: `+1`, `-1`, `laugh`, `confused`, `heart`, `hooray`.", + "description": "Indicates which type of reaction to return.", + "enum": [ + "+1", + "-1", + "laugh", + "confused", + "heart", + "hooray" + ] + } + }, + "description": "List reactions for a pull request review comment. (In preview period. See README.)" + }, + "create-for-pull-request-review-comment": { + "url": "/repos/:owner/:repo/pulls/comments/:id/reactions", + "method": "POST", + "params": { + "$owner": null, + "$repo": null, + "$id": null, + "content": { + "type": "String", + "required": true, + "validation": "^(\\+1|-1|laugh|confused|heart|hooray)$", + "invalidmsg": "Possible values: `+1`, `-1`, `laugh`, `confused`, `heart`, `hooray`.", + "description": "The reaction type.", + "enum": [ + "+1", + "-1", + "laugh", + "confused", + "heart", + "hooray" + ] + } + }, + "description": "Create reaction for a pull request review comment. (In preview period. See README.)" + }, + "delete": { + "url": "/reactions/:id", + "method": "DELETE", + "params": { + "$id": null + }, + "description": "Delete a reaction. (In preview period. See README.)" + } + }, + "repos": { + "get-all": { + "url": "/user/repos", + "method": "GET", + "params": { + "visibility": { + "type": "String", + "required": false, + "validation": "^(all|public|private)$", + "invalidmsg": "Possible values: `all`, `public`, `private`, Default: `all`.", + "description": "Can be one of `all`, `public`, or `private`. Default: `all`.", + "enum": [ + "all", + "public", + "private" + ], + "default": "all" + }, + "affiliation": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "Possible values: `owner`, `collaborator`, `organization_member`, Default: `owner,collaborator,organization_member`.", + "description": "Comma-separated list of values. Can include: `owner`, `collaborator`, `organization_member`.", + "default": "owner,collaborator,organization_member" + }, + "type": { + "type": "String", + "required": false, + "validation": "^(all|owner|public|private|member)$", + "invalidmsg": "Possible values: `all`, `owner`, `public`, `private`, `member`. Default: `all`.", + "description": "Possible values: `all`, `owner`, `public`, `private`, `member`. Default: `all`.", + "enum": [ + "all", + "owner", + "public", + "private", + "member" + ], + "default": "all" + }, + "sort": { + "type": "String", + "required": false, + "validation": "^(created|updated|pushed|full_name)$", + "invalidmsg": "Possible values: `created`, `updated`, `pushed`, `full_name`. Default: `full_name`.", + "description": "Possible values: `created`, `updated`, `pushed`, `full_name`. Default: `full_name`.", + "enum": [ + "created", + "updated", + "pushed", + "full_name" + ], + "default": "full_name" + }, + "$direction": null, + "$page": null, + "$per_page": null + }, + "description": "List your repositories" + }, + "get-for-user": { + "url": "/users/:username/repos", + "method": "GET", + "params": { + "$username": null, + "type": { + "type": "String", + "required": false, + "validation": "^(all|owner|member)$", + "invalidmsg": "Possible values: `all`, `owner`, `member`. Default: `owner`.", + "description": "Possible values: `all`, `owner`, `member`. Default: `owner`.", + "enum": [ + "all", + "owner", + "member" + ], + "default": "owner" + }, + "sort": { + "type": "String", + "required": false, + "validation": "^(created|updated|pushed|full_name)$", + "invalidmsg": "Possible values: `created`, `updated`, `pushed`, `full_name`. Default: `full_name`.", + "description": "Possible values: `created`, `updated`, `pushed`, `full_name`. Default: `full_name`.", + "enum": [ + "created", + "updated", + "pushed", + "full_name" + ], + "default": "full_name" + }, + "$direction": null, + "$page": null, + "$per_page": null + }, + "description": "List public repositories for the specified user." + }, + "get-for-org": { + "url": "/orgs/:org/repos", + "method": "GET", + "params": { + "$org": null, + "type": { + "type": "String", + "required": false, + "validation": "^(all|public|private|forks|sources|member)$", + "invalidmsg": "Possible values: `all`, `public`, `private`, `forks`, `sources`, `member`. Default: `all`.", + "description": "Possible values: `all`, `public`, `private`, `forks`, `sources`, `member`. Default: `all`.", + "enum": [ + "all", + "public", + "private", + "forks", + "sources", + "member" + ], + "default": "all" + }, + "$page": null, + "$per_page": null + }, + "description": "List repositories for the specified org." + }, + "get-public": { + "url": "/repositories", + "method": "GET", + "params": { + "since": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "The integer ID of the last Repository that you've seen." + } + }, + "description": "List all public repositories" + }, + "get-by-id": { + "url": "/repositories/:id", + "method": "GET", + "params": { + "$id": null + }, + "description": "Get a single repo by id." + }, + "create": { + "url": "/user/repos", + "method": "POST", + "params": { + "$name": null, + "$description": null, + "$homepage": null, + "$private": null, + "$has_issues": null, + "$has_wiki": null, + "$has_downloads": null, + "team_id": { + "type": "Number", + "required": false, + "validation": "^[0-9]+$", + "invalidmsg": "", + "description": "The id of the team that will be granted access to this repository. This is only valid when creating a repository in an organization." + }, + "$auto_init": null, + "$gitignore_template": null, + "$license_template": null, + "allow_squash_merge": { + "type": "Boolean", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "Either true to allow squash-merging pull requests, or false to prevent squash-merging. Default: true. (In preview period. See README.)", + "default": "true" + }, + "allow_merge_commit": { + "type": "Boolean", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "Either true to allow merging pull requests with a merge commit, or false to prevent merging pull requests with merge commits. Default: true. (In preview period. See README.)", + "default": "true" + }, + "allow_rebase_merge": { + "type": "Boolean", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "Either true to allow rebase-merging pull requests, or false to prevent rebase-merging. Default: true. (In preview period. See README.)", + "default": "true" + } + }, + "description": "Create a new repository for the authenticated user." + }, + "get": { + "url": "/repos/:owner/:repo", + "method": "GET", + "params": { + "$owner": null, + "$repo": null + }, + "description": "Get a repo for a user." + }, + "create-for-org": { + "url": "/orgs/:org/repos", + "method": "POST", + "params": { + "$org": null, + "$name": null, + "$description": null, + "$homepage": null, + "$private": null, + "$has_issues": null, + "$has_wiki": null, + "$has_downloads": null, + "team_id": { + "type": "Number", + "required": false, + "validation": "^[0-9]+$", + "invalidmsg": "", + "description": "The id of the team that will be granted access to this repository. This is only valid when creating a repo in an organization." + }, + "$auto_init": null, + "$gitignore_template": null, + "$license_template": null, + "allow_squash_merge": { + "type": "Boolean", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "Either true to allow squash-merging pull requests, or false to prevent squash-merging. Default: true. (In preview period. See README.)", + "default": "true" + }, + "allow_merge_commit": { + "type": "Boolean", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "Either true to allow merging pull requests with a merge commit, or false to prevent merging pull requests with merge commits. Default: true. (In preview period. See README.)", + "default": "true" + }, + "allow_rebase_merge": { + "type": "Boolean", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "Either true to allow rebase-merging pull requests, or false to prevent rebase-merging. Default: true. (In preview period. See README.)", + "default": "true" + } + }, + "description": "Create a new repository for an organization." + }, + "edit": { + "url": "/repos/:owner/:repo", + "method": "PATCH", + "params": { + "$owner": null, + "$repo": null, + "$name": null, + "$description": null, + "$homepage": null, + "$private": null, + "$has_issues": null, + "$has_wiki": null, + "$has_downloads": null, + "$default_branch": null, + "allow_squash_merge": { + "type": "Boolean", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "Either true to allow squash-merging pull requests, or false to prevent squash-merging. Default: true. (In preview period. See README.)", + "default": "true" + }, + "allow_merge_commit": { + "type": "Boolean", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "Either true to allow merging pull requests with a merge commit, or false to prevent merging pull requests with merge commits. Default: true. (In preview period. See README.)", + "default": "true" + }, + "allow_rebase_merge": { + "type": "Boolean", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "Either true to allow rebase-merging pull requests, or false to prevent rebase-merging. Default: true. (In preview period. See README.)", + "default": "true" + } + }, + "description": "Update a repo." + }, + "get-contributors": { + "url": "/repos/:owner/:repo/contributors", + "method": "GET", + "params": { + "$owner": null, + "$repo": null, + "anon": { + "type": "Boolean", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "Set to 1 or true to include anonymous contributors in results." + }, + "$page": null, + "$per_page": null + }, + "description": "Get contributors for the specified repository." + }, + "get-languages": { + "url": "/repos/:owner/:repo/languages", + "method": "GET", + "params": { + "$owner": null, + "$repo": null, + "$page": null, + "$per_page": null + }, + "description": "Get languages for the specified repository." + }, + "get-teams": { + "url": "/repos/:owner/:repo/teams", + "method": "GET", + "params": { + "$owner": null, + "$repo": null, + "$page": null, + "$per_page": null + }, + "description": "Get teams for the specified repository." + }, + "get-tags": { + "url": "/repos/:owner/:repo/tags", + "method": "GET", + "params": { + "$owner": null, + "$repo": null, + "$page": null, + "$per_page": null + }, + "description": "Get tags for the specified repository." + }, + "delete": { + "url": "/repos/:owner/:repo", + "method": "DELETE", + "params": { + "$owner": null, + "$repo": null + }, + "description": "Delete a repository." + }, + "get-branches": { + "url": "/repos/:owner/:repo/branches", + "method": "GET", + "params": { + "$owner": null, + "$repo": null, + "protected": { + "type": "Boolean", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "Set to true to only return protected branches" + }, + "$page": null, + "$per_page": null + }, + "description": "List branches. (In preview period. See README.)" + }, + "get-branch": { + "url": "/repos/:owner/:repo/branches/:branch", + "method": "GET", + "params": { + "$owner": null, + "$repo": null, + "$branch": null, + "$page": null, + "$per_page": null + }, + "description": "Get branch. (In preview period. See README.)" + }, + "get-branch-protection": { + "url": "/repos/:owner/:repo/branches/:branch/protection", + "method": "GET", + "params": { + "$owner": null, + "$repo": null, + "$branch": null, + "$page": null, + "$per_page": null + }, + "description": "Get branch protection. (In preview period. See README.)" + }, + "update-branch-protection": { + "url": "/repos/:owner/:repo/branches/:branch/protection", + "method": "PUT", + "params": { + "$owner": null, + "$repo": null, + "$branch": null, + "required_status_checks": { + "type": "Json", + "required": true, + "allow-null": true, + "validation": "", + "invalidmsg": "", + "description": "JSON object that contains the following keys: `include_admins` - Enforce required status checks for repository administrators, `strict` - Require branches to be up to date before merging, `contexts` - The list of status checks to require in order to merge into this branch. This object can have the value of `null` for disabled." + }, + "required_pull_request_reviews": { + "type": "Json", + "required": true, + "allow-null": true, + "validation": "", + "invalidmsg": "", + "description": "JSON object that contains the following keys: `include_admins` - Enforce required status checks for repository administrators." + }, + "restrictions": { + "type": "Json", + "required": true, + "allow-null": true, + "validation": "", + "invalidmsg": "", + "description": "JSON object that contains the following keys: `users` - The list of user logins with push access, `teams` - The list of team slugs with push access. This object can have the value of `null` for disabled." + }, + "$page": null, + "$per_page": null + }, + "description": "Update branch protection. (In preview period. See README.)" + }, + "remove-branch-protection": { + "url": "/repos/:owner/:repo/branches/:branch/protection", + "method": "DELETE", + "params": { + "$owner": null, + "$repo": null, + "$branch": null, + "$page": null, + "$per_page": null + }, + "description": "Remove branch protection. (In preview period. See README.)" + }, + "get-protected-branch-required-status-checks": { + "url": "/repos/:owner/:repo/branches/:branch/protection/required_status_checks", + "method": "GET", + "params": { + "$owner": null, + "$repo": null, + "$branch": null, + "$page": null, + "$per_page": null + }, + "description": "Get required status checks of protected branch. (In preview period. See README.)" + }, + "update-protected-branch-required-status-checks": { + "url": "/repos/:owner/:repo/branches/:branch/protection/required_status_checks", + "method": "PATCH", + "params": { + "$owner": null, + "$repo": null, + "$branch": null, + "include_admins": { + "type": "Boolean", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "Enforce required status checks for repository administrators." + }, + "strict": { + "type": "Boolean", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "Require branches to be up to date before merging." + }, + "contexts": { + "type": "Array", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "The list of status checks to require in order to merge into this branch." + }, + "$page": null, + "$per_page": null + }, + "description": "Update required status checks of protected branch. (In preview period. See README.)" + }, + "remove-protected-branch-required-status-checks": { + "url": "/repos/:owner/:repo/branches/:branch/protection/required_status_checks", + "method": "DELETE", + "params": { + "$owner": null, + "$repo": null, + "$branch": null, + "$page": null, + "$per_page": null + }, + "description": "Remove required status checks of protected branch. (In preview period. See README.)" + }, + "get-protected-branch-required-status-checks-contexts": { + "url": "/repos/:owner/:repo/branches/:branch/protection/required_status_checks/contexts", + "method": "GET", + "params": { + "$owner": null, + "$repo": null, + "$branch": null, + "$page": null, + "$per_page": null + }, + "description": "List required status checks contexts of protected branch. (In preview period. See README.)" + }, + "replace-protected-branch-required-status-checks-contexts": { + "url": "/repos/:owner/:repo/branches/:branch/protection/required_status_checks/contexts", + "method": "PUT", + "params": { + "$owner": null, + "$repo": null, + "$branch": null, + "contexts": { + "type": "Array", + "sendValueAsBody": true, + "required": true, + "validation": "", + "invalidmsg": "", + "description": "An array of protected branch required status checks contexts (e.g. continuous-integration/jenkins)." + } + }, + "description": "Replace required status checks contexts of protected branch. (In preview period. See README.)" + }, + "add-protected-branch-required-status-checks-contexts": { + "url": "/repos/:owner/:repo/branches/:branch/protection/required_status_checks/contexts", + "method": "POST", + "params": { + "$owner": null, + "$repo": null, + "$branch": null, + "contexts": { + "type": "Array", + "sendValueAsBody": true, + "required": true, + "validation": "", + "invalidmsg": "", + "description": "An array of protected branch required status checks contexts (e.g. continuous-integration/jenkins)." + } + }, + "description": "Add required status checks contexts of protected branch. (In preview period. See README.)" + }, + "remove-protected-branch-required-status-checks-contexts": { + "url": "/repos/:owner/:repo/branches/:branch/protection/required_status_checks/contexts", + "method": "DELETE", + "params": { + "$owner": null, + "$repo": null, + "$branch": null, + "contexts": { + "type": "Array", + "sendValueAsBody": true, + "required": true, + "validation": "", + "invalidmsg": "", + "description": "An array of protected branch required status checks contexts (e.g. continuous-integration/jenkins)." + } + }, + "description": "Remove required status checks contexts of protected branch. (In preview period. See README.)" + }, + "get-protected-branch-pull-request-review-enforcement": { + "url": "/repos/:owner/:repo/branches/:branch/protection/required_pull_request_reviews", + "method": "GET", + "params": { + "$owner": null, + "$repo": null, + "$branch": null, + "$page": null, + "$per_page": null + }, + "description": "Get pull request review enforcement of protected branch. (In preview period. See README.)" + }, + "update-protected-branch-pull-request-review-enforcement": { + "url": "/repos/:owner/:repo/branches/:branch/protection/required_pull_request_reviews", + "method": "PATCH", + "params": { + "$owner": null, + "$repo": null, + "$branch": null, + "include_admins": { + "type": "Boolean", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "Enforce required status checks for repository administrators." + } + }, + "description": "Update pull request review enforcement of protected branch. (In preview period. See README.)" + }, + "remove-protected-branch-pull-request-review-enforcement": { + "url": "/repos/:owner/:repo/branches/:branch/protection/required_pull_request_reviews", + "method": "DELETE", + "params": { + "$owner": null, + "$repo": null, + "$branch": null + }, + "description": "Remove pull request review enforcement of protected branch. (In preview period. See README.)" + }, + "get-protected-branch-restrictions": { + "url": "/repos/:owner/:repo/branches/:branch/protection/restrictions", + "method": "GET", + "params": { + "$owner": null, + "$repo": null, + "$branch": null, + "$page": null, + "$per_page": null + }, + "description": "Get restrictions of protected branch. (In preview period. See README.)" + }, + "remove-protected-branch-restrictions": { + "url": "/repos/:owner/:repo/branches/:branch/protection/restrictions", + "method": "DELETE", + "params": { + "$owner": null, + "$repo": null, + "$branch": null + }, + "description": "Remove restrictions of protected branch. (In preview period. See README.)" + }, + "get-protected-branch-team-restrictions": { + "url": "/repos/:owner/:repo/branches/:branch/protection/restrictions/teams", + "method": "GET", + "params": { + "$owner": null, + "$repo": null, + "$branch": null, + "$page": null, + "$per_page": null + }, + "description": "List team restrictions of protected branch. (In preview period. See README.)" + }, + "replace-protected-branch-team-restrictions": { + "url": "/repos/:owner/:repo/branches/:branch/protection/restrictions/teams", + "method": "PUT", + "params": { + "$owner": null, + "$repo": null, + "$branch": null, + "teams": { + "type": "Array", + "sendValueAsBody": true, + "required": true, + "validation": "", + "invalidmsg": "", + "description": "An array of team slugs (e.g. justice-league)." + } + }, + "description": "Replace team restrictions of protected branch. (In preview period. See README.)" + }, + "add-protected-branch-team-restrictions": { + "url": "/repos/:owner/:repo/branches/:branch/protection/restrictions/teams", + "method": "POST", + "params": { + "$owner": null, + "$repo": null, + "$branch": null, + "teams": { + "type": "Array", + "sendValueAsBody": true, + "required": true, + "validation": "", + "invalidmsg": "", + "description": "An array of team slugs (e.g. justice-league)." + } + }, + "description": "Add team restrictions of protected branch. (In preview period. See README.)" + }, + "remove-protected-branch-team-restrictions": { + "url": "/repos/:owner/:repo/branches/:branch/protection/restrictions/teams", + "method": "DELETE", + "params": { + "$owner": null, + "$repo": null, + "$branch": null, + "teams": { + "type": "Array", + "sendValueAsBody": true, + "required": true, + "validation": "", + "invalidmsg": "", + "description": "An array of team slugs (e.g. justice-league)." + } + }, + "description": "Remove team restrictions of protected branch. (In preview period. See README.)" + }, + "get-protected-branch-user-restrictions": { + "url": "/repos/:owner/:repo/branches/:branch/protection/restrictions/users", + "method": "GET", + "params": { + "$owner": null, + "$repo": null, + "$branch": null, + "$page": null, + "$per_page": null + }, + "description": "List user restrictions of protected branch. (In preview period. See README.)" + }, + "replace-protected-branch-user-restrictions": { + "url": "/repos/:owner/:repo/branches/:branch/protection/restrictions/users", + "method": "PUT", + "params": { + "$owner": null, + "$repo": null, + "$branch": null, + "users": { + "type": "Array", + "sendValueAsBody": true, + "required": true, + "validation": "", + "invalidmsg": "", + "description": "An array of team slugs (e.g. justice-league)." + } + }, + "description": "Replace user restrictions of protected branch. (In preview period. See README.)" + }, + "add-protected-branch-user-restrictions": { + "url": "/repos/:owner/:repo/branches/:branch/protection/restrictions/users", + "method": "POST", + "params": { + "$owner": null, + "$repo": null, + "$branch": null, + "users": { + "type": "Array", + "sendValueAsBody": true, + "required": true, + "validation": "", + "invalidmsg": "", + "description": "An array of team slugs (e.g. justice-league)." + } + }, + "description": "Add user restrictions of protected branch. (In preview period. See README.)" + }, + "remove-protected-branch-user-restrictions": { + "url": "/repos/:owner/:repo/branches/:branch/protection/restrictions/users", + "method": "DELETE", + "params": { + "$owner": null, + "$repo": null, + "$branch": null, + "users": { + "type": "Array", + "sendValueAsBody": true, + "required": true, + "validation": "", + "invalidmsg": "", + "description": "An array of team slugs (e.g. justice-league)." + } + }, + "description": "Remove user restrictions of protected branch. (In preview period. See README.)" + }, + "get-collaborators": { + "url": "/repos/:owner/:repo/collaborators", + "method": "GET", + "params": { + "$owner": null, + "$repo": null, + "affiliation": { + "type": "String", + "required": false, + "validation": "^(outside|all)$", + "invalidmsg": "outside, all, default: all", + "description": "Filter collaborators returned by their affiliation.", + "enum": [ + "outside", + "all" + ], + "default": "all" + }, + "$page": null, + "$per_page": null + }, + "description": "List collaborators" + }, + "check-collaborator": { + "url": "/repos/:owner/:repo/collaborators/:username", + "method": "GET", + "params": { + "$owner": null, + "$repo": null, + "$username": null + }, + "description": "Check if user is a collaborator." + }, + "review-user-permission-level": { + "url": "/repos/:owner/:repo/collaborators/:username/permission", + "method": "GET", + "params": { + "$owner": null, + "$repo": null, + "$username": null + }, + "description": "Review a user's permission level." + }, + "add-collaborator": { + "url": "/repos/:owner/:repo/collaborators/:username", + "method": "PUT", + "params": { + "$owner": null, + "$repo": null, + "$username": null, + "permission": { + "type": "String", + "required": false, + "validation": "^(pull|push|admin)$", + "invalidmsg": "", + "description": "`pull` - can pull, but not push to or administer this repository, `push` - can pull and push, but not administer this repository, `admin` - can pull, push and administer this repository.", + "enum": [ + "pull", + "push", + "admin" + ], + "default": "push" + } + }, + "description": "Add user as a collaborator" + }, + "remove-collaborator": { + "url": "/repos/:owner/:repo/collaborators/:username", + "method": "DELETE", + "params": { + "$owner": null, + "$repo": null, + "$username": null + }, + "description": "Remove user as a collaborator." + }, + "get-all-commit-comments": { + "url": "/repos/:owner/:repo/comments", + "method": "GET", + "params": { + "$owner": null, + "$repo": null, + "$page": null, + "$per_page": null + }, + "description": "List commit comments for a repository." + }, + "get-commit-comments": { + "url": "/repos/:owner/:repo/commits/:ref/comments", + "method": "GET", + "params": { + "$owner": null, + "$repo": null, + "ref": { + "type": "String", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "" + }, + "$page": null, + "$per_page": null + }, + "description": "List comments for a single commit." + }, + "create-commit-comment": { + "url": "/repos/:owner/:repo/commits/:sha/comments", + "method": "POST", + "params": { + "$owner": null, + "$repo": null, + "$sha": null, + "$body": null, + "path": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "Relative path of the file to comment on." + }, + "position": { + "type": "Number", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "Line index in the diff to comment on." + }, + "line": { + "type": "Number", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "Deprecated. Use position parameter instead. Line number in the file to comment on." + } + }, + "description": "Create a commit comment." + }, + "get-commit-comment": { + "url": "/repos/:owner/:repo/comments/:id", + "method": "GET", + "params": { + "$owner": null, + "$repo": null, + "$id": null + }, + "description": "Get a single commit comment." + }, + "update-commit-comment": { + "url": "/repos/:owner/:repo/comments/:id", + "method": "PATCH", + "params": { + "$owner": null, + "$repo": null, + "$id": null, + "$body": null + }, + "description": "Update a commit comment." + }, + "delete-commit-comment": { + "url": "/repos/:owner/:repo/comments/:id", + "method": "DELETE", + "params": { + "$owner": null, + "$repo": null, + "$id": null + }, + "description": "Delete a commit comment." + }, + "get-community-health-metrics": { + "url": "/repositories/:repo_id/community/profile", + "method": "GET", + "params": { + "$repo_id": null + }, + "description": "Retrieve community health metrics." + }, + "get-commits": { + "url": "/repos/:owner/:repo/commits", + "method": "GET", + "params": { + "$owner": null, + "$repo": null, + "sha": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "Sha or branch to start listing commits from." + }, + "path": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "Only commits containing this file path will be returned." + }, + "author": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "GitHub login or email address by which to filter by commit author." + }, + "$since": null, + "$until": null, + "$page": null, + "$per_page": null + }, + "description": "List commits on a repository." + }, + "get-commit": { + "url": "/repos/:owner/:repo/commits/:sha", + "method": "GET", + "params": { + "$owner": null, + "$repo": null, + "$sha": null + }, + "description": "Get a single commit." + }, + "get-sha-of-commit-ref": { + "url": "/repos/:owner/:repo/commits/:ref", + "method": "GET", + "params": { + "$owner": null, + "$repo": null, + "$ref": null + }, + "description": "Get the SHA-1 of a commit reference." + }, + "compare-commits": { + "url": "/repos/:owner/:repo/compare/:base...:head", + "method": "GET", + "params": { + "$owner": null, + "$repo": null, + "$base": null, + "$head": null + }, + "description": "Compare two commits." + }, + "get-readme": { + "url": "/repos/:owner/:repo/readme", + "method": "GET", + "params": { + "$owner": null, + "$repo": null, + "ref": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "The name of the commit/branch/tag. Default: the repository’s default branch (usually master)" + } + }, + "description": "Get the README for the given repository." + }, + "get-content": { + "url": "/repos/:owner/:repo/contents/:path", + "method": "GET", + "params": { + "$owner": null, + "$repo": null, + "path": { + "type": "String", + "required": true, + "allow-empty": true, + "validation": "", + "invalidmsg": "", + "description": "The content path." + }, + "ref": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "The String name of the Commit/Branch/Tag. Defaults to master." + } + }, + "description": "Get the contents of a file or directory in a repository." + }, + "create-file": { + "url": "/repos/:owner/:repo/contents/:path", + "method": "PUT", + "params": { + "$owner": null, + "$repo": null, + "path": { + "type": "String", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "The content path." + }, + "message": { + "type": "String", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "The commit message." + }, + "content": { + "type": "String", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "The new file content, Base64 encoded." + }, + "branch": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "The branch name. If not provided, uses the repository’s default branch (usually master)." + }, + "committer": { + "type": "Json", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "" + } + }, + "description": "Create a new file in the given repository." + }, + "update-file": { + "url": "/repos/:owner/:repo/contents/:path", + "method": "PUT", + "params": { + "$owner": null, + "$repo": null, + "path": { + "type": "String", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "The content path." + }, + "message": { + "type": "String", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "The commit message." + }, + "content": { + "type": "String", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "The updated file content, Base64 encoded." + }, + "sha": { + "type": "String", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "The blob SHA of the file being replaced." + }, + "branch": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "The branch name. If not provided, uses the repository’s default branch (usually master)." + }, + "committer": { + "type": "Json", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "" + } + }, + "description": "Update a file." + }, + "delete-file": { + "url": "/repos/:owner/:repo/contents/:path", + "method": "DELETE", + "params": { + "$owner": null, + "$repo": null, + "path": { + "type": "String", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "The content path." + }, + "message": { + "type": "String", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "The commit message." + }, + "sha": { + "type": "String", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "The blob SHA of the file being removed." + }, + "branch": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "The branch name. If not provided, uses the repository’s default branch (usually master)." + }, + "committer": { + "type": "Json", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "" + } + }, + "description": "Delete a file." + }, + "get-archive-link": { + "url": "/repos/:owner/:repo/:archive_format/:ref", + "method": "GET", + "params": { + "$owner": null, + "$repo": null, + "archive_format": { + "type": "String", + "required": true, + "validation": "^(tarball|zipball)$", + "invalidmsg": "Either tarball or zipball, Default: tarball.", + "description": "Either tarball or zipball, Deafult: tarball.", + "enum": [ + "tarball", + "zipball" + ], + "default": "tarball" + }, + "ref": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "A valid Git reference. Default: the repository’s default branch (usually master)." + } + }, + "description": "Get archive link." + }, + "get-keys": { + "url": "/repos/:owner/:repo/keys", + "method": "GET", + "params": { + "$owner": null, + "$repo": null, + "$page": null, + "$per_page": null + }, + "description": "List deploy keys." + }, + "get-key": { + "url": "/repos/:owner/:repo/keys/:id", + "method": "GET", + "params": { + "$owner": null, + "$repo": null, + "$id": null + }, + "description": "Get a deploy key." + }, + "create-key": { + "url": "/repos/:owner/:repo/keys", + "method": "POST", + "params": { + "$owner": null, + "$repo": null, + "$title": null, + "$key": null, + "read_only": { + "type": "Boolean", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "If true, the key will only be able to read repository contents. Otherwise, the key will be able to read and write." + } + }, + "description": "Add a new deploy key." + }, + "delete-key": { + "url": "/repos/:owner/:repo/keys/:id", + "method": "DELETE", + "params": { + "$owner": null, + "$repo": null, + "$id": null + }, + "description": "Remove a deploy key." + }, + "get-deployments": { + "url": "/repos/:owner/:repo/deployments", + "method": "GET", + "params": { + "$owner": null, + "$repo": null, + "sha": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "The short or long sha that was recorded at creation time. Default: none.", + "default": "none" + }, + "ref": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "The name of the ref. This can be a branch, tag, or sha. Default: none.", + "default": "none" + }, + "task": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "The name of the task for the deployment. e.g. deploy or deploy:migrations. Default: none.", + "default": "none" + }, + "environment": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "The name of the environment that was deployed to. e.g. staging or production. Default: none.", + "default": "none" + }, + "$page": null, + "$per_page": null + }, + "description": "List deployments. (In preview period. See README.)" + }, + "create-deployment": { + "url": "/repos/:owner/:repo/deployments", + "method": "POST", + "params": { + "$owner": null, + "$repo": null, + "ref": { + "type": "String", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "The ref to deploy. This can be a branch, tag, or sha." + }, + "task": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "The named task to execute. e.g. deploy or deploy:migrations. Default: deploy", + "default": "deploy" + }, + "auto_merge": { + "type": "Boolean", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "Optional parameter to merge the default branch into the requested ref if it is behind the default branch. Default: true", + "default": "true" + }, + "required_contexts": { + "type": "Array", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "Optional array of status contexts verified against commit status checks. If this parameter is omitted from the parameters then all unique contexts will be verified before a deployment is created. To bypass checking entirely pass an empty array. Defaults to all unique contexts." + }, + "payload": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "Optional JSON payload with extra information about the deployment. Default: \"\"", + "default": "\"\"" + }, + "environment": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "The name of the environment that was deployed to. e.g. staging or production. Default: none.", + "default": "none" + }, + "description": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "Optional short description. Default: \"\"", + "default": "\"\"" + }, + "transient_environment": { + "type": "Boolean", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "Specifies if the given environment is specific to the deployment and will no longer exist at some point in the future. Default: false. (In preview period. See README.)", + "default": false + }, + "production_environment": { + "type": "Boolean", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "Specifies if the given environment is a one that end-users directly interact with. Default: true when environment is `production` and false otherwise. (In preview period. See README.)" + } + }, + "description": "Create a deployment. (In preview period. See README.)" + }, + "get-deployment-statuses": { + "url": "/repos/:owner/:repo/deployments/:id/statuses", + "method": "GET", + "params": { + "$owner": null, + "$repo": null, + "$id": null + }, + "description": "List deployment statuses. (In preview period. See README.)" + }, + "create-deployment-status": { + "url": "/repos/:owner/:repo/deployments/:id/statuses", + "method": "POST", + "params": { + "$owner": null, + "$repo": null, + "$id": null, + "state": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "The state of the status. Can be one of pending, success, error, or failure." + }, + "target_url": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "The target URL to associate with this status. This URL should contain output to keep the user updated while the task is running or serve as historical information for what happened in the deployment. Default: \"\"", + "default": "\"\"" + }, + "log_url": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "Functionally equivalent to target_url. Default: \"\". (In preview period. See README.)", + "default": "\"\"" + }, + "description": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "A short description of the status. Default: \"\"", + "default": "\"\"" + }, + "environment_url": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "URL for accessing the deployment environment. Default: \"\". (In preview period. See README.)", + "default": "\"\"" + }, + "auto_inactive": { + "type": "Boolean", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "When true the new `inactive` status is added to all other non-transient, non-production environment deployments with the same repository and environment name as the created status's deployment. Default: true. (In preview period. See README.)", + "default": true + } + }, + "description": "Create a deployment status. (In preview period. See README.)" + }, + "get-downloads": { + "url": "/repos/:owner/:repo/downloads", + "method": "GET", + "params": { + "$owner": null, + "$repo": null, + "$page": null, + "$per_page": null + }, + "description": "List downloads for repository." + }, + "get-download": { + "url": "/repos/:owner/:repo/downloads/:id", + "method": "GET", + "params": { + "$owner": null, + "$repo": null, + "$id": null + }, + "description": "Get a single download." + }, + "delete-download": { + "url": "/repos/:owner/:repo/downloads/:id", + "method": "DELETE", + "params": { + "$owner": null, + "$repo": null, + "$id": null + }, + "description": "Delete a download." + }, + "get-forks": { + "url": "/repos/:owner/:repo/forks", + "method": "GET", + "params": { + "$owner": null, + "$repo": null, + "sort": { + "type": "String", + "required": false, + "validation": "^(newest|oldest|stargazers)$", + "invalidmsg": "Possible values: `newest`, `oldest`, `stargazers`, default: `newest`.", + "description": "Possible values: `newest`, `oldest`, `stargazers`, default: `newest`.", + "enum": [ + "newest", + "oldest", + "stargazers" + ], + "default": "newest" + }, + "$page": null, + "$per_page": null + }, + "description": "List forks." + }, + "fork": { + "url": "/repos/:owner/:repo/forks", + "method": "POST", + "params": { + "$owner": null, + "$repo": null, + "organization": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "Optional parameter to specify the organization name if forking into an organization." + } + }, + "description": "Create a fork." + }, + "get-invites": { + "url": "/repositories/:repo_id/invitations", + "method": "GET", + "params": { + "$repo_id": null + }, + "description": "List invitations for a repository. (In preview period. See README.)" + }, + "delete-invite": { + "url": "/repositories/:repo_id/invitations/:invitation_id", + "method": "DELETE", + "params": { + "$repo_id": null, + "$invitation_id": null + }, + "description": "Delete a repository invitation. (In preview period. See README.)" + }, + "update-invite": { + "url": "/repositories/:repo_id/invitations/:invitation_id", + "method": "PATCH", + "params": { + "$repo_id": null, + "$invitation_id": null, + "permission": { + "type": "String", + "required": false, + "validation": "^(read|write|admin)$", + "invalidmsg": "Read, write, or admin.", + "description": "The permissions that the associated user will have on the repository.", + "enum": [ + "read", + "write", + "admin" + ] + } + }, + "description": "Update a repository invitation. (In preview period. See README.)" + }, + "merge": { + "url": "/repos/:owner/:repo/merges", + "method": "POST", + "params": { + "$owner": null, + "$repo": null, + "$base": null, + "$head": null, + "commit_message": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "Commit message to use for the merge commit. If omitted, a default message will be used." + } + }, + "description": "Perform a merge." + }, + "get-pages": { + "url": "/repos/:owner/:repo/pages", + "method": "GET", + "params": { + "$owner": null, + "$repo": null, + "$page": null, + "$per_page": null + }, + "description": "Get information about a Pages site. (In preview period. See README.)" + }, + "request-page-build": { + "url": "/repos/:owner/:repo/pages/builds", + "method": "POST", + "params": { + "$owner": null, + "$repo": null + }, + "description": "Request a page build. (In preview period. See README.)" + }, + "get-pages-builds": { + "url": "/repos/:owner/:repo/pages/builds", + "method": "GET", + "params": { + "$owner": null, + "$repo": null, + "$page": null, + "$per_page": null + }, + "description": "List Pages builds. (In preview period. See README.)" + }, + "get-latest-pages-build": { + "url": "/repos/:owner/:repo/pages/builds/latest", + "method": "GET", + "params": { + "$owner": null, + "$repo": null + }, + "description": "Get latest Pages build. (In preview period. See README.)" + }, + "get-pages-build": { + "url": "/repos/:owner/:repo/pages/builds/:id", + "method": "GET", + "params": { + "$owner": null, + "$repo": null, + "$id": null + }, + "description": "Get a specific Pages build. (In preview period. See README.)" + }, + "get-releases": { + "url": "/repos/:owner/:repo/releases", + "method": "GET", + "params": { + "$owner": null, + "$repo": null, + "$page": null, + "$per_page": null + }, + "description": "List releases for a repository." + }, + "get-release": { + "url": "/repos/:owner/:repo/releases/:id", + "method": "GET", + "params": { + "$owner": null, + "$repo": null, + "$id": null + }, + "description": "Get a single release." + }, + "get-latest-release": { + "url": "/repos/:owner/:repo/releases/latest", + "method": "GET", + "params": { + "$owner": null, + "$repo": null + }, + "description": "Get the latest release." + }, + "get-release-by-tag": { + "url": "/repos/:owner/:repo/releases/tags/:tag", + "method": "GET", + "params": { + "$owner": null, + "$repo": null, + "tag": { + "type": "String", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "String of the tag" + } + }, + "description": "Get a release by tag name." + }, + "create-release": { + "url": "/repos/:owner/:repo/releases", + "method": "POST", + "params": { + "$owner": null, + "$repo": null, + "tag_name": { + "type": "String", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "String of the tag" + }, + "target_commitish": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "Specifies the commitish value that determines where the Git tag is created from. Can be any branch or commit SHA. Unused if the Git tag already exists. Default: the repository's default branch (usually master)." + }, + "name": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "" + }, + "body": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "" + }, + "draft": { + "type": "Boolean", + "validation": "", + "invalidmsg": "", + "description": "true to create a draft (unpublished) release, false to create a published one. Default: false", + "default": "false" + }, + "prerelease": { + "type": "Boolean", + "validation": "", + "invalidmsg": "", + "description": "true to identify the release as a prerelease. false to identify the release as a full release. Default: false", + "default": "false" + } + }, + "description": "Create a release." + }, + "edit-release": { + "url": "/repos/:owner/:repo/releases/:id", + "method": "PATCH", + "params": { + "$owner": null, + "$repo": null, + "$id": null, + "tag_name": { + "type": "String", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "String of the tag" + }, + "target_commitish": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "Specifies the commitish value that determines where the Git tag is created from. Can be any branch or commit SHA. Unused if the Git tag already exists. Default: the repository's default branch (usually master)." + }, + "name": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "" + }, + "body": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "" + }, + "draft": { + "type": "Boolean", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "true to create a draft (unpublished) release, false to create a published one. Default: false", + "default": "false" + }, + "prerelease": { + "type": "Boolean", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "true to identify the release as a prerelease. false to identify the release as a full release. Default: false", + "default": "false" + } + }, + "description": "Edit a release." + }, + "delete-release": { + "url": "/repos/:owner/:repo/releases/:id", + "method": "DELETE", + "params": { + "$owner": null, + "$repo": null, + "$id": null + }, + "description": "Delete a release" + }, + "get-assets": { + "url": "/repos/:owner/:repo/releases/:id/assets", + "method": "GET", + "params": { + "$owner": null, + "$repo": null, + "$id": null + }, + "description": "List assets for a release." + }, + "get-asset": { + "url": "/repos/:owner/:repo/releases/assets/:id", + "method": "GET", + "params": { + "$owner": null, + "$repo": null, + "$id": null + }, + "description": "Get a single release asset." + }, + "upload-asset": { + "url": "/repos/:owner/:repo/releases/:id/assets", + "method": "POST", + "host": "uploads.github.com", + "hasFileBody": true, + "timeout": 0, + "params": { + "$owner": null, + "$repo": null, + "$id": null, + "filePath": { + "type": "String", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "The file path of the asset." + }, + "name": { + "type": "String", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "The file name of the asset. This should be set in a URI query parameter." + }, + "label": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "An alternate short description of the asset. Used in place of the filename. This should be set in a URI query parameter." + } + }, + "description": "Upload a release asset." + }, + "edit-asset": { + "url": "/repos/:owner/:repo/releases/assets/:id", + "method": "PATCH", + "params": { + "$owner": null, + "$repo": null, + "$id": null, + "$name": null, + "label": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "An alternate short description of the asset. Used in place of the filename." + } + }, + "description": "Edit a release asset." + }, + "delete-asset": { + "url": "/repos/:owner/:repo/releases/assets/:id", + "method": "DELETE", + "params": { + "$owner": null, + "$repo": null, + "$id": null + }, + "description": "Delete a release asset." + }, + "get-stats-contributors": { + "url": "/repos/:owner/:repo/stats/contributors", + "method": "GET", + "params": { + "$owner": null, + "$repo": null + }, + "description": "Get contributors list with additions, deletions, and commit counts." + }, + "get-stats-commit-activity": { + "url": "/repos/:owner/:repo/stats/commit_activity", + "method": "GET", + "params": { + "$owner": null, + "$repo": null + }, + "description": "Get the last year of commit activity data." + }, + "get-stats-code-frequency": { + "url": "/repos/:owner/:repo/stats/code_frequency", + "method": "GET", + "params": { + "$owner": null, + "$repo": null + }, + "description": "Get the number of additions and deletions per week." + }, + "get-stats-participation": { + "url": "/repos/:owner/:repo/stats/participation", + "method": "GET", + "params": { + "$owner": null, + "$repo": null + }, + "description": "Get the weekly commit count for the repository owner and everyone else." + }, + "get-stats-punch-card": { + "url": "/repos/:owner/:repo/stats/punch_card", + "method": "GET", + "params": { + "$owner": null, + "$repo": null + }, + "description": "Get the number of commits per hour in each day." + }, + "create-status": { + "url": "/repos/:owner/:repo/statuses/:sha", + "method": "POST", + "params": { + "$owner": null, + "$repo": null, + "$sha": null, + "state": { + "type": "String", + "required": true, + "validation": "^(pending|success|error|failure)$", + "invalidmsg": "", + "description": "State of the status - can be one of pending, success, error, or failure.", + "enum": [ + "pending", + "success", + "error", + "failure" + ] + }, + "target_url": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "Target url to associate with this status. This URL will be linked from the GitHub UI to allow users to easily see the ‘source’ of the Status." + }, + "description": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "Short description of the status." + }, + "context": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "A string label to differentiate this status from the status of other systems." + } + }, + "description": "Create a status." + }, + "get-statuses": { + "url": "/repos/:owner/:repo/commits/:ref/statuses", + "method": "GET", + "params": { + "$owner": null, + "$repo": null, + "ref": { + "type": "String", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "Ref to list the statuses from. It can be a SHA, a branch name, or a tag name." + }, + "$page": null, + "$per_page": null + }, + "description": "List statuses for a specfic ref." + }, + "get-combined-status": { + "url": "/repos/:owner/:repo/commits/:ref/status", + "method": "GET", + "params": { + "$owner": null, + "$repo": null, + "ref": { + "type": "String", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "Ref to fetch the status for. It can be a SHA, a branch name, or a tag name." + }, + "$page": null, + "$per_page": null + }, + "description": "Get the combined status for a specific ref." + }, + "get-referrers": { + "url": "/repos/:owner/:repo/traffic/popular/referrers", + "method": "GET", + "params": { + "$owner": null, + "$repo": null, + "$page": null, + "$per_page": null + }, + "description": "Get the top 10 referrers over the last 14 days." + }, + "get-paths": { + "url": "/repos/:owner/:repo/traffic/popular/paths", + "method": "GET", + "params": { + "$owner": null, + "$repo": null, + "$page": null, + "$per_page": null + }, + "description": "Get the top 10 popular contents over the last 14 days." + }, + "get-views": { + "url": "/repos/:owner/:repo/traffic/views", + "method": "GET", + "params": { + "$owner": null, + "$repo": null, + "$page": null, + "$per_page": null + }, + "description": "Get the total number of views and breakdown per day or week for the last 14 days." + }, + "get-clones": { + "url": "/repos/:owner/:repo/traffic/clones", + "method": "GET", + "params": { + "$owner": null, + "$repo": null, + "$page": null, + "$per_page": null + }, + "description": "Get the total number of clones and breakdown per day or week for the last 14 days." + }, + "get-hooks": { + "url": "/repos/:owner/:repo/hooks", + "method": "GET", + "params": { + "$owner": null, + "$repo": null, + "$page": null, + "$per_page": null + }, + "description": "List hooks." + }, + "get-hook": { + "url": "/repos/:owner/:repo/hooks/:id", + "method": "GET", + "params": { + "$owner": null, + "$repo": null, + "$id": null + }, + "description": "Get single hook." + }, + "create-hook": { + "url": "/repos/:owner/:repo/hooks", + "method": "POST", + "params": { + "$owner": null, + "$repo": null, + "$name": null, + "config": { + "type": "Json", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "A Hash containing key/value pairs to provide settings for this hook. These settings vary between the services and are defined in the github-services repo. Booleans are stored internally as `1` for true, and `0` for false. Any JSON true/false values will be converted automatically." + }, + "events": { + "type": "Array", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "Determines what events the hook is triggered for. Default: `['push']`.", + "default": "[\"push\"]" + }, + "active": { + "type": "Boolean", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "Determines whether the hook is actually triggered on pushes." + } + }, + "description": "Create a hook." + }, + "edit-hook": { + "url": "/repos/:owner/:repo/hooks/:id", + "method": "PATCH", + "params": { + "$owner": null, + "$repo": null, + "$id": null, + "$name": null, + "config": { + "type": "Json", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "A Hash containing key/value pairs to provide settings for this hook. Modifying this will replace the entire config object. These settings vary between the services and are defined in the github-services repo. Booleans are stored internally as `1` for true, and `0` for false. Any JSON true/false values will be converted automatically." + }, + "events": { + "type": "Array", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "Determines what events the hook is triggered for. This replaces the entire array of events. Default: `['push']`.", + "default": "[\"push\"]" + }, + "add_events": { + "type": "Array", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "Determines a list of events to be added to the list of events that the Hook triggers for." + }, + "remove_events": { + "type": "Array", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "Determines a list of events to be removed from the list of events that the Hook triggers for." + }, + "active": { + "type": "Boolean", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "Determines whether the hook is actually triggered on pushes." + } + }, + "description": "Edit a hook." + }, + "test-hook": { + "url": "/repos/:owner/:repo/hooks/:id/tests", + "method": "POST", + "params": { + "$owner": null, + "$repo": null, + "$id": null + }, + "description": "Test a [push] hook." + }, + "ping-hook": { + "url": "/repos/:owner/:repo/hooks/:id/pings", + "method": "POST", + "params": { + "$owner": null, + "$repo": null, + "$id": null + }, + "description": "Ping a hook." + }, + "delete-hook": { + "url": "/repos/:owner/:repo/hooks/:id", + "method": "DELETE", + "params": { + "$owner": null, + "$repo": null, + "$id": null + }, + "description": "Deleate a hook." + } + }, + "search": { + "repos": { + "url": "/search/repositories", + "method": "GET", + "params": { + "$q": null, + "sort": { + "type": "String", + "required": false, + "validation": "^(stars|forks|updated)$", + "invalidmsg": "One of stars, forks, or updated. Default: results are sorted by best match.", + "description": "stars, forks, or updated", + "enum": [ + "stars", + "forks", + "updated" + ] + }, + "$order": null, + "$page": null, + "$per_page": null + }, + "description": "Search repositories." + }, + "code": { + "url": "/search/code", + "method": "GET", + "params": { + "$q": null, + "sort": { + "type": "String", + "required": false, + "validation": "^indexed$", + "invalidmsg": "indexed only", + "description": "The sort field. Can only be indexed, which indicates how recently a file has been indexed by the GitHub search infrastructure. Default: results are sorted by best match.", + "enum": [ + "indexed" + ] + }, + "$order": null, + "$page": null, + "$per_page": null + }, + "description": "Search code." + }, + "commits": { + "url": "/search/commits", + "method": "GET", + "params": { + "$q": null, + "sort": { + "type": "String", + "required": false, + "validation": "^(author-date|committer-date)$", + "invalidmsg": "author-date or committer-date", + "description": "The sort field. Can be author-date or committer-date. Default: best match.", + "enum": [ + "author-date", + "committer-date" + ] + }, + "$order": null, + "$page": null, + "$per_page": null + }, + "description": "Search commits. (In preview period. See README.)" + }, + "issues": { + "url": "/search/issues", + "method": "GET", + "params": { + "$q": null, + "sort": { + "type": "String", + "required": false, + "validation": "^(comments|created|updated)$", + "invalidmsg": "comments, created, or updated", + "description": "The sort field. Can be comments, created, or updated. Default: results are sorted by best match.", + "enum": [ + "comments", + "created", + "updated" + ] + }, + "$order": null, + "$page": null, + "$per_page": null + }, + "description": "Search issues." + }, + "users": { + "url": "/search/users", + "method": "GET", + "params": { + "$q": null, + "sort": { + "type": "String", + "required": false, + "validation": "^(followers|repositories|joined)$", + "invalidmsg": "Can be followers, repositories, or joined. Default: results are sorted by best match.", + "description": "The sort field. Can be followers, repositories, or joined. Default: results are sorted by best match.", + "enum": [ + "followers", + "repositories", + "joined" + ] + }, + "$order": null, + "$page": null, + "$per_page": null + }, + "description": "Search users." + }, + "email": { + "url": "/legacy/user/email/:email", + "method": "GET", + "params": { + "email": { + "type": "String", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "The email address" + } + }, + "description": "Search against public email addresses." + } + }, + "users": { + "get-for-user": { + "url": "/users/:username", + "method": "GET", + "params": { + "$username": null + }, + "description": "Get a single user" + }, + "get-by-id": { + "url": "/user/:id", + "method": "GET", + "params": { + "$id": null + }, + "description": "Get a single user by GitHub ID" + }, + "get": { + "url": "/user", + "method": "GET", + "params": {}, + "description": "Get the authenticated user" + }, + "update": { + "url": "/user", + "method": "PATCH", + "params": { + "name": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "The new name of the user" + }, + "email": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "Publicly visible email address." + }, + "blog": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "The new blog URL of the user." + }, + "company": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "The new company of the user." + }, + "location": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "The new location of the user." + }, + "hireable": { + "type": "Boolean", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "The new hiring availability of the user." + }, + "bio": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "The new short biography of the user." + } + }, + "description": "Update the authenticated user" + }, + "get-all": { + "url": "/users", + "method": "GET", + "params": { + "since": { + "type": "Number", + "required": false, + "validation": "", + "description": "The integer ID of the last User that you’ve seen." + } + }, + "description": "Get all users" + }, + "get-orgs": { + "url": "/user/orgs", + "method": "GET", + "params": { + "$page": null, + "$per_page": null + }, + "description": "List organizations for the authenticated user." + }, + "get-org-memberships": { + "url": "/user/memberships/orgs", + "method": "GET", + "params": { + "state": { + "type": "String", + "required": false, + "validation": "^(active|pending)$", + "invalidmsg": "active, pending", + "description": "Indicates the state of the memberships to return. Can be either active or pending. If not specified, both active and pending memberships are returned.", + "enum": [ + "active", + "pending" + ] + } + }, + "description": "List your organization memberships" + }, + "get-org-membership": { + "url": "/user/memberships/orgs/:org", + "method": "GET", + "params": { + "$org": null + }, + "description": "Get your organization membership" + }, + "edit-org-membership": { + "url": "/user/memberships/orgs/:org", + "method": "PATCH", + "params": { + "$org": null, + "state": { + "type": "String", + "required": true, + "validation": "^(active)$", + "invalidmsg": "active", + "description": "The state that the membership should be in. Only \"active\" will be accepted.", + "enum": [ + "active" + ] + } + }, + "description": "Edit your organization membership" + }, + "get-teams": { + "url": "/user/teams", + "method": "GET", + "params": { + "$page": null, + "$per_page": null + }, + "description": "Get your teams" + }, + "get-emails": { + "url": "/user/emails", + "method": "GET", + "params": { + "$page": null, + "$per_page": null + }, + "description": "List email addresses for a user" + }, + "add-emails": { + "url": "/user/emails", + "method": "POST", + "params": { + "emails": { + "type": "Array", + "sendValueAsBody": true, + "required": true, + "validation": "", + "invalidmsg": "", + "description": "You can post a single email address or an array of addresses." + } + }, + "description": "Add email address(es)" + }, + "delete-emails": { + "url": "/user/emails", + "method": "DELETE", + "params": { + "emails": { + "type": "Array", + "sendValueAsBody": true, + "required": true, + "validation": "", + "invalidmsg": "", + "description": "You can post a single email address or an array of addresses." + } + }, + "description": "Delete email address(es)" + }, + "get-followers-for-user": { + "url": "/users/:username/followers", + "method": "GET", + "params": { + "$username": null, + "$page": null, + "$per_page": null + }, + "description": "List a user's followers" + }, + "get-followers": { + "url": "/user/followers", + "method": "GET", + "params": { + "$page": null, + "$per_page": null + }, + "description": "List the authenticated user's followers" + }, + "get-following-for-user": { + "url": "/users/:username/following", + "method": "GET", + "params": { + "$username": null, + "$page": null, + "$per_page": null + }, + "description": "List who a user is following" + }, + "get-following": { + "url": "/user/following", + "method": "GET", + "params": { + "$page": null, + "$per_page": null + }, + "description": "List who the authenticated user is following" + }, + "check-following": { + "url": "/user/following/:username", + "method": "GET", + "params": { + "$username": null + }, + "description": "Check if you are following a user" + }, + "check-if-one-followers-other": { + "url": "/users/:username/following/:target_user", + "method": "GET", + "params": { + "$username": null, + "target_user": { + "type": "String", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "" + } + }, + "description": "Check if one user follows another" + }, + "follow-user": { + "url": "/user/following/:username", + "method": "PUT", + "params": { + "$username": null + }, + "description": "Follow a user" + }, + "unfollow-user": { + "url": "/user/following/:username", + "method": "DELETE", + "params": { + "$username": null + }, + "description": "Unfollow a user" + }, + "get-keys-for-user": { + "url": "/users/:username/keys", + "method": "GET", + "params": { + "$username": null, + "$page": null, + "$per_page": null + }, + "description": "List public keys for a user" + }, + "get-keys": { + "url": "/user/keys", + "method": "GET", + "params": { + "$page": null, + "$per_page": null + }, + "description": "List your public keys" + }, + "get-key": { + "url": "/user/keys/:id", + "method": "GET", + "params": { + "$id": null + }, + "description": "Get a single public key" + }, + "create-key": { + "url": "/user/keys", + "method": "POST", + "params": { + "$title": null, + "$key": null + }, + "description": "Create a public key" + }, + "delete-key": { + "url": "/user/keys/:id", + "method": "DELETE", + "params": { + "$id": null + }, + "description": "Delete a public key" + }, + "get-gpg-keys": { + "url": "/user/gpg_keys", + "method": "GET", + "params": { + "$page": null, + "$per_page": null + }, + "description": "List your GPG keys. (In preview period. See README.)" + }, + "get-gpg-key": { + "url": "/user/gpg_keys/:id", + "method": "GET", + "params": { + "$id": null + }, + "description": "Get a single GPG key. (In preview period. See README.)" + }, + "create-gpg-key": { + "url": "/user/gpg_keys", + "method": "POST", + "params": { + "armored_public_key": { + "type": "String", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "GPG key contents" + } + }, + "description": "Create a GPG key. (In preview period. See README.)" + }, + "delete-gpg-key": { + "url": "/user/gpg_keys/:id", + "method": "DELETE", + "params": { + "$id": null + }, + "description": "Delete a GPG key. (In preview period. See README.)" + }, + "promote": { + "url": "/users/:username/site_admin", + "method": "PUT", + "params": { + "$username": null + }, + "description": "Promote an ordinary user to a site administrator" + }, + "demote": { + "url": "/users/:username/site_admin", + "method": "DELETE", + "params": { + "$username": null + }, + "description": "Demote a site administrator to an ordinary user" + }, + "suspend": { + "url": "/users/:username/suspended", + "method": "PUT", + "params": { + "$username": null + }, + "description": "Suspend a user" + }, + "unsuspend": { + "url": "/users/:username/suspended", + "method": "DELETE", + "params": { + "$username": null + }, + "description": "Unsuspend a user" + }, + "get-repo-invites": { + "url": "/user/repository_invitations", + "method": "GET", + "params": {}, + "description": "List a user's repository invitations. (In preview period. See README.)" + }, + "accept-repo-invite": { + "url": "/user/repository_invitations/:invitation_id", + "method": "PATCH", + "params": { + "$invitation_id": null + }, + "description": "Accept a repository invitation. (In preview period. See README.)" + }, + "decline-repo-invite": { + "url": "/user/repository_invitations/:invitation_id", + "method": "DELETE", + "params": { + "$invitation_id": null + }, + "description": "Decline a repository invitation. (In preview period. See README.)" + } + }, + "enterprise": { + "stats": { + "url": "/enterprise/stats/:type", + "method": "GET", + "params": { + "type": { + "type": "String", + "required": true, + "validation": "^(issues|hooks|milestones|orgs|comments|pages|users|gists|pulls|repos|all)$", + "invalidmsg": "Possible values: issues, hooks, milestones, orgs, comments, pages, users, gists, pulls, repos, all.", + "description": "Possible values: issues, hooks, milestones, orgs, comments, pages, users, gists, pulls, repos, all.", + "enum": [ + "issues", + "hooks", + "milestones", + "orgs", + "comments", + "pages", + "users", + "gists", + "pulls", + "repos", + "all" + ] + } + }, + "description": "Get statistics." + }, + "update-ldap-for-user": { + "url": "/admin/ldap/users/:username/mapping", + "method": "PATCH", + "params": { + "$username": null, + "ldap_dn": { + "type": "String", + "required": true, + "validation": "", + "invalidmsg": "Invalid DN", + "description": "LDAP DN for user" + } + }, + "description": "Update LDAP mapping for a user." + }, + "sync-ldap-for-user": { + "url": "/admin/ldap/users/:username/sync", + "method": "POST", + "params": { + "$username": null + }, + "description": "Sync LDAP mapping for a user." + }, + "update-ldap-for-team": { + "url": "/admin/ldap/teams/:team_id/mapping", + "method": "PATCH", + "params": { + "team_id": { + "type": "Number", + "required": true, + "validation": "^[0-9]+$", + "invalidmsg": "", + "description": "" + }, + "ldap_dn": { + "type": "String", + "required": true, + "validation": "", + "invalidmsg": "Invalid DN", + "description": "LDAP DN for user" + } + }, + "description": "Update LDAP mapping for a team." + }, + "sync-ldap-for-team": { + "url": "/admin/ldap/teams/:team_id/sync", + "method": "POST", + "params": { + "team_id": { + "type": "Number", + "required": true, + "validation": "^[0-9]+$", + "invalidmsg": "", + "description": "" + } + }, + "description": "Sync LDAP mapping for a team." + }, + "get-license": { + "url": "/enterprise/settings/license", + "method": "GET", + "params": {}, + "description": "Get license information" + }, + "get-pre-receive-environment": { + "url": "/admin/pre-receive-environments/:id", + "method": "GET", + "params": { + "$id": null + }, + "description": "Get a single pre-receive environment. (In preview period. See README.)" + }, + "get-pre-receive-environments": { + "url": "/admin/pre_receive_environments", + "method": "GET", + "params": {}, + "description": "List pre-receive environments. (In preview period. See README.)" + }, + "create-pre-receive-environment": { + "url": "/admin/pre_receive_environments", + "method": "POST", + "params": { + "name": { + "type": "String", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "The new pre-receive environment's name." + }, + "image_url": { + "type": "String", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "URL from which to download a tarball of this environment." + } + }, + "description": "Create a pre-receive environment. (In preview period. See README.)" + }, + "edit-pre-receive-environment": { + "url": "/admin/pre_receive_environments/:id", + "method": "PATCH", + "params": { + "$id": null, + "name": { + "type": "String", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "This pre-receive environment's new name." + }, + "image_url": { + "type": "String", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "URL from which to download a tarball of this environment." + } + }, + "description": "Create a pre-receive environment. (In preview period. See README.)" + }, + "delete-pre-receive-environment": { + "url": "/admin/pre_receive_environments/:id", + "method": "DELETE", + "params": { + "$id": null + }, + "description": "Delete a pre-receive environment. (In preview period. See README.)" + }, + "get-pre-receive-environment-download-status": { + "url": "/admin/pre-receive-environments/:id/downloads/latest", + "method": "GET", + "params": { + "$id": null + }, + "description": "Get a pre-receive environment's download status. (In preview period. See README.)" + }, + "trigger-pre-receive-environment-download": { + "url": "/admin/pre_receive_environments/:id/downloads", + "method": "POST", + "params": { + "$id": null + }, + "description": "Trigger a pre-receive environment download. (In preview period. See README.)" + }, + "get-pre-receive-hook": { + "url": "/admin/pre-receive-hooks/:id", + "method": "GET", + "params": { + "$id": null + }, + "description": "Get a single pre-receive hook. (In preview period. See README.)" + }, + "get-pre-receive-hooks": { + "url": "/admin/pre-receive-hooks", + "method": "GET", + "params": {}, + "description": "List pre-receive hooks. (In preview period. See README.)" + }, + "create-pre-receive-hook": { + "url": "/admin/pre-receive-hooks", + "method": "POST", + "params": { + "name": { + "type": "String", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "The name of the hook." + }, + "script": { + "type": "String", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "The script that the hook runs." + }, + "script_repository": { + "type": "Json", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "The GitHub repository where the script is kept." + }, + "environment": { + "type": "Json", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "The pre-receive environment where the script is executed." + }, + "enforcement": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "The state of enforcement for this hook. default: disabled", + "default": "disabled" + }, + "allow_downstream_configuration": { + "type": "Boolean", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "Whether enforcement can be overridden at the org or repo level. default: false", + "default": "false" + } + }, + "description": "Create a pre-receive hook. (In preview period. See README.)" + }, + "edit-pre-receive-hook": { + "url": "/admin/pre_receive_hooks/:id", + "method": "PATCH", + "params": { + "$id": null, + "hook": { + "type": "Json", + "sendValueAsBody": true, + "required": true, + "validation": "", + "invalidmsg": "", + "description": "JSON object that contains pre-receive hook info." + } + }, + "description": "Edit a pre-receive hook. (In preview period. See README.)" + }, + "delete-pre-receive-hook": { + "url": "/admin/pre_receive_hooks/:id", + "method": "DELETE", + "params": { + "$id": null + }, + "description": "Delete a pre-receive hook. (In preview period. See README.)" + }, + "queue-indexing-job": { + "url": "/staff/indexing_jobs", + "method": "POST", + "params": { + "target": { + "type": "String", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "A string representing the item to index." + } + }, + "description": "Queue an indexing job" + }, + "create-org": { + "url": "/admin/organizations", + "method": "POST", + "params": { + "login": { + "type": "String", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "The organization's username." + }, + "admin": { + "type": "String", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "The login of the user who will manage this organization." + }, + "profile_name": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "The organization's display name." + } + }, + "description": "Create an organization" + } + } +} \ No newline at end of file diff --git a/util.js b/lib/util.js similarity index 92% rename from util.js rename to lib/util.js index 7d536d6a1a..53829509e6 100644 --- a/util.js +++ b/lib/util.js @@ -1,6 +1,6 @@ /** section: github * class Util - * + * * Copyright 2012 Cloud9 IDE, Inc. * * This product includes software developed by @@ -23,8 +23,9 @@ var Util = require("util"); **/ exports.extend = function(dest, src, noOverwrite) { for (var prop in src) { - if (!noOverwrite || typeof dest[prop] == "undefined") + if (!noOverwrite || typeof dest[prop] == "undefined") { dest[prop] = src[prop]; + } } return dest; }; @@ -32,7 +33,7 @@ exports.extend = function(dest, src, noOverwrite) { /** * Util#escapeRegExp(str) -> String * - str (String): string to escape - * + * * Escapes characters inside a string that will an error when it is used as part * of a regex upon instantiation like in `new RegExp("[0-9" + str + "]")` **/ @@ -44,12 +45,12 @@ exports.escapeRegExp = function(str) { * Util#toCamelCase(str, [upper]) -> String * - str (String): string to transform * - upper (Boolean): set to `true` to transform to CamelCase - * + * * Transform a string that contains spaces or dashes to camelCase. If `upper` is * set to `true`, the string will be transformed to CamelCase. - * + * * Example: - * + * * Util.toCamelCase("why U no-work"); // returns 'whyUNoWork' * Util.toCamelCase("I U no-work", true); // returns 'WhyUNoWork' **/ @@ -57,8 +58,9 @@ exports.toCamelCase = function(str, upper) { str = str.toLowerCase().replace(/(?:(^.)|(\s+.)|(-.))/g, function(match) { return match.charAt(match.length - 1).toUpperCase(); }); - if (upper) + if (upper) { return str; + } return str.charAt(0).toLowerCase() + str.substr(1); }; @@ -70,7 +72,7 @@ exports.toCamelCase = function(str, upper) { * 'on' The function returns true. * 1 The function returns true. * '1' The function returns true. - * + * * Determines whether a string is true in the html attribute sense. **/ exports.isTrue = function(c){ @@ -85,7 +87,7 @@ exports.isTrue = function(c){ * 'off' The function returns true. * 0 The function returns true. * '0' The function returns true. - * + * * Determines whether a string is false in the html attribute sense. **/ exports.isFalse = function(c){ @@ -93,10 +95,10 @@ exports.isFalse = function(c){ }; var levels = { - "info": ["\033[90m", "\033[39m"], // grey - "error": ["\033[31m", "\033[39m"], // red - "fatal": ["\033[35m", "\033[39m"], // magenta - "exit": ["\033[36m", "\033[39m"] // cyan + "info": ["\u001b[90m", "\u001b[39m"], // grey + "error": ["\u001b[31m", "\u001b[39m"], // red + "fatal": ["\u001b[35m", "\u001b[39m"], // magenta + "exit": ["\u001b[36m", "\u001b[39m"] // cyan }; var _slice = Array.prototype.slice; @@ -105,19 +107,19 @@ var _slice = Array.prototype.slice; * - arg1 (mixed): messages to be printed to the standard output * - type (String): type denotation of the message. Possible values: * 'info', 'error', 'fatal', 'exit'. Optional, defaults to 'info'. - * + * * Unified logging to the console; arguments passed to this function will put logged * to the standard output of the current process and properly formatted. * Any non-String object will be inspected by the NodeJS util#inspect utility * function. * Messages will be prefixed with its type (with corresponding font color), like so: - * + * * [info] informational message * [error] error message * [fatal] fatal error message * [exit] program exit message (not an error) - * - * The type of message can be defined by passing it to this function as the last/ + * + * The type of message can be defined by passing it to this function as the last/ * final argument. If the type can not be found, this last/ final argument will be * regarded as yet another message. **/ @@ -126,8 +128,9 @@ exports.log = function() { var lastArg = args[args.length - 1]; var level = levels[lastArg] ? args.pop() : "info"; - if (!args.length) + if (!args.length) { return; + } var msg = args.map(function(arg) { return typeof arg != "string" ? Util.inspect(arg) : arg; diff --git a/package.json b/package.json index 2cf492ad6f..9ac0047082 100644 --- a/package.json +++ b/package.json @@ -1,31 +1,58 @@ { - "name" : "github", - "version" : "0.2.1", - "description" : "NodeJS wrapper for the GitHub API", - "author": "Mike de Boer ", - "contributors": [ - { "name": "Mike de Boer", "email": "info@mikedeboer.nl" }, - { "name": "Fabian Jakobs", "email": "fabian@c9.io" } - ], - "homepage": "http://github.com/mikedeboer/node-github", - "repository" : { - "type" : "git", - "url" : "http://github.com/mikedeboer/node-github.git" + "name": "github", + "version": "9.0.0", + "description": "NodeJS wrapper for the GitHub API", + "author": "Mike de Boer ", + "contributors": [ + { + "name": "Mike de Boer", + "email": "info@mikedeboer.nl" }, - "engine" : { - "node": ">=0.4.0" + { + "name": "Fabian Jakobs", + "email": "fabian@c9.io" }, - "devDependencies": { - "oauth": "~0.9.7", - "optimist": "~0.6.0", - "mocha": "~1.13.0" - }, - "main" : ".", - "scripts": { - "test": "node ./test/all.js" - }, - "licenses": [{ - "type": "The MIT License", - "url": "http://www.opensource.org/licenses/mit-license.php" - }] + { + "name": "Joe Gallo", + "email": "joe@brassafrax.com" + } + ], + "homepage": "https://github.com/mikedeboer/node-github", + "repository": { + "type": "git", + "url": "https://github.com/mikedeboer/node-github.git" + }, + "engine": { + "node": ">=0.4.0" + }, + "dependencies": { + "follow-redirects": "0.0.7", + "https-proxy-agent": "^1.0.0", + "mime": "^1.2.11", + "netrc": "^0.1.4" + }, + "devDependencies": { + "mocha": "~1.13.0", + "mustache": "^2.2.1" + }, + "main": "lib", + "types": "lib/index.d.ts", + "scripts": { + "test": "mocha" + }, + "license": "MIT", + "licenses": [ + { + "type": "The MIT License", + "url": "http://www.opensource.org/licenses/mit-license.php" + } + ], + "apidoc": { + "title": "node-github", + "name": "node-github", + "version": "9.0.0", + "template": { + "withCompare": true + } + } } diff --git a/seed.yml b/seed.yml deleted file mode 100644 index 13ef4c04e0..0000000000 --- a/seed.yml +++ /dev/null @@ -1,5 +0,0 @@ ---- - name: node-github - description: NodeJS wrapper for the GitHub API - tags: git github web - version: 0.2.1 diff --git a/templates/after_request.js.tpl b/templates/after_request.js.tpl deleted file mode 100644 index 646272d58d..0000000000 --- a/templates/after_request.js.tpl +++ /dev/null @@ -1,9 +0,0 @@ - - if (!ret) - ret = {}; - if (!ret.meta) - ret.meta = {}; - [<%headers%>].forEach(function(header) { - if (res.headers[header]) - ret.meta[header] = res.headers[header]; - }); diff --git a/templates/handler.js.tpl b/templates/handler.js.tpl deleted file mode 100644 index 0feb4e7fff..0000000000 --- a/templates/handler.js.tpl +++ /dev/null @@ -1,21 +0,0 @@ -<%comment%> - this.<%funcName%> = function(msg, block, callback) { - var self = this; - this.client.httpSend(msg, block, function(err, res) { - if (err) - return self.sendError(err, null, msg, callback); - - var ret; - try { - ret = res.data && JSON.parse(res.data); - } - catch (ex) { - if (callback) - callback(new error.InternalServerError(ex.message), res); - return; - } -<%afterRequest%> - if (callback) - callback(null, ret); - }); - }; diff --git a/templates/index.d.ts.tpl b/templates/index.d.ts.tpl new file mode 100644 index 0000000000..c304856978 --- /dev/null +++ b/templates/index.d.ts.tpl @@ -0,0 +1,121 @@ +/** + * This declaration file requires TypeScript 2.1 or above. + */ + +declare namespace Github { + export type WellKnownHeader = + {{#requestHeaders}} + | {{{.}}} + {{/requestHeaders}} + ; + + export interface Options { + debug?: boolean; + protocol?: string; + host?: string; + pathPrefix?: string; + headers?: {[header: string]: any}; + Promise?: typeof Promise; + followRedirects?: boolean; + timeout?: number; + } + + export interface AuthBasic { + type: "basic"; + username: string; + password: string; + } + + export interface AuthOAuthToken { + type: "oauth"; + token: string; + } + + export interface AuthOAuthSecret { + type: "oauth"; + key: string; + secret: string; + } + + export interface AuthUserToken { + type: "token"; + token: string; + } + + export interface AuthJWT { + type: "integration"; + token: string; + } + + export type Auth = + | AuthBasic + | AuthOAuthToken + | AuthOAuthSecret + | AuthUserToken + | AuthJWT; + + export type Link = + | { link: string; } + | { meta: { link: string; }; } + | string; + + export interface Callback { + (error: Error | null, result: any): any; + } + + {{#params}} + export interface {{name}} { {{key}}{{^required}}?{{/required}}: {{{type}}}; } + {{/params}} + + {{#namespaces}} + {{#methods}} + {{#paramTypeName}} + export type {{paramTypeName}} = + {{#unionTypeNames}} + & {{.}} + {{/unionTypeNames}} + {{#ownParams}} + & { + {{#params}} + {{key}}{{^required}}?{{/required}}: {{{type}}}; + {{/params}} + }; + {{/ownParams}} + {{^ownParams}} + ; + {{/ownParams}} + {{/paramTypeName}} + {{/methods}} + {{/namespaces}} +} + +declare class Github { + constructor(options?: Github.Options); + authenticate(auth: Github.Auth): void; + hasNextPage(link: Github.Link): string | undefined; + hasPreviousPage(link: Github.Link): string | undefined; + hasLastPage(link: Github.Link): string | undefined; + hasFirstPage(link: Github.Link): string | undefined; + + getNextPage(link: Github.Link, callback?: Github.Callback): Promise; + getNextPage(link: Github.Link, headers?: {[header: string]: any}, callback?: Github.Callback): Promise; + + getPreviousPage(link: Github.Link, callback?: Github.Callback): Promise; + getPreviousPage(link: Github.Link, headers?: {[header: string]: any}, callback?: Github.Callback): Promise; + + getLastPage(link: Github.Link, callback?: Github.Callback): Promise; + getLastPage(link: Github.Link, headers?: {[header: string]: any}, callback?: Github.Callback): Promise; + + getFirstPage(link: Github.Link, callback?: Github.Callback): Promise; + getFirstPage(link: Github.Link, headers?: {[header: string]: any}, callback?: Github.Callback): Promise; + + {{#namespaces}} + {{namespace}}: { + {{#methods}} + {{method}}({{#paramTypeName}}params: Github.{{.}}, {{/paramTypeName}}callback?: Github.Callback): Promise; + {{/methods}} + }; + {{/namespaces}} +} + +export = Github; \ No newline at end of file diff --git a/templates/index.js.flow.tpl b/templates/index.js.flow.tpl new file mode 100644 index 0000000000..0e700daf4b --- /dev/null +++ b/templates/index.js.flow.tpl @@ -0,0 +1,107 @@ +declare module "github" { + declare type Header = + {{#requestHeaders}} + | {{{.}}} + {{/requestHeaders}} + | string; + + declare type Options = { + debug?: boolean; + protocol?: string; + host?: string; + pathPrefix?: string; + headers?: {[header: Header]: any}; + Promise?: typeof Promise; + followRedirects?: boolean; + timeout?: number; + }; + + declare type AuthBasic = { + type: "basic"; + username: string; + password: string; + }; + + declare type AuthOAuthToken = { + type: "oauth"; + token: string; + }; + + declare type AuthOAuthSecret = { + type: "oauth"; + key: string; + secret: string; + }; + + declare type AuthUserToken = { + type: "token"; + token: string; + }; + + declare type AuthJWT = { + type: "integration"; + token: string; + }; + + declare type Auth = + | AuthBasic + | AuthOAuthToken + | AuthOAuthSecret + | AuthUserToken + | AuthJWT; + + declare type Link = + | { link: string; } + | { meta: { link: string; }; } + | string + | any; + + declare type Callback = (error: ?Error, result: ?any) => any; + + {{#params}} + declare type {{name}} = { {{key}}{{^required}}?{{/required}}: {{{type}}}; }; + {{/params}} + + {{#namespaces}} + {{#methods}} + {{#paramTypeName}} + declare type {{paramTypeName}} = + {{#unionTypeNames}} + & {{.}} + {{/unionTypeNames}} + {{#ownParams}} + & { + {{#params}} + {{key}}{{^required}}?{{/required}}: {{{type}}}; + {{/params}} + }; + {{/ownParams}} + {{^ownParams}} + ; + {{/ownParams}} + {{/paramTypeName}} + {{/methods}} + {{/namespaces}} + + declare class Github { + constructor(options?: Options): Github; + authenticate(auth: Auth): void; + hasNextPage(link: Link): ?string; + hasPreviousPage(link: Link): ?string; + hasLastPage(link: Link): ?string; + hasFirstPage(link: Link): ?string; + getNextPage(link: Link, headers?: {[header: Header]: any}, callback?: Callback): Promise; + getPreviousPage(link: Link, headers?: {[header: Header]: any}, callback?: Callback): Promise; + getLastPage(link: Link, headers?: {[header: Header]: any}, callback?: Callback): Promise; + getFirstPage(link: Link, headers?: {[header: Header]: any}, callback?: Callback): Promise; + {{#namespaces}} + {{namespace}}: { + {{#methods}} + {{method}}({{#paramTypeName}}params: {{.}}, {{/paramTypeName}}callback?: Callback): Promise; + {{/methods}} + }; + {{/namespaces}} + } + + declare var exports: Class; +} diff --git a/templates/index.js.tpl b/templates/index.js.tpl deleted file mode 100644 index b5a585ff41..0000000000 --- a/templates/index.js.tpl +++ /dev/null @@ -1,40 +0,0 @@ -/** - * class <%name%> - * - * <%description%> - * - * Copyright 2012 Cloud9 IDE, Inc. - * - * This product includes software developed by - * Cloud9 IDE, Inc (http://c9.io). - * - * Author: Mike de Boer - **/ - -"use strict"; - -var Fs = require("fs"); -var Util = require("./../../util"); -var error = require("./../../error"); - -var GithubHandler = module.exports = function(client) { - this.client = client; - this.routes = JSON.parse(Fs.readFileSync(__dirname + "/routes.json", "utf8")); -}; - -var proto = { - sendError: function(err, block, msg, callback) { - if (this.client.debug) - Util.log(err, block, msg.user, "error"); - if (typeof err == "string") - err = new error.InternalServerError(err); - if (callback) - callback(err); - } -}; - -[<%scripts%>].forEach(function(api) { - Util.extend(proto, require("./" + api)); -}); - -GithubHandler.prototype = proto; diff --git a/templates/section.js.tpl b/templates/section.js.tpl deleted file mode 100644 index 82a7c5ea58..0000000000 --- a/templates/section.js.tpl +++ /dev/null @@ -1,23 +0,0 @@ -/** - * mixin <%sectionName%> - * - * Copyright 2012 Cloud9 IDE, Inc. - * - * This product includes software developed by - * Cloud9 IDE, Inc (http://c9.io). - * - * Author: Mike de Boer - **/ - -"use strict"; - -var error = require("./../../error"); -var Util = require("./../../util"); - -var <%sectionName%> = module.exports = { - <%sectionName%>: {} -}; - -(function() { -<%sectionBody%> -}).call(<%sectionName%>.<%sectionName%>); diff --git a/templates/test_section.js.tpl b/templates/test_section.js.tpl index bde8fbfec0..a1bb5be590 100644 --- a/templates/test_section.js.tpl +++ b/templates/test_section.js.tpl @@ -10,18 +10,17 @@ "use strict"; var Assert = require("assert"); -var Client = require("./../../index"); +var Client = require("./../lib/index"); +var testAuth = require("./../testAuth.json"); describe("[<%sectionName%>]", function() { var client; - var token = "c286e38330e15246a640c2cf32a45ea45d93b2ba"; + var token = testAuth["token"]; beforeEach(function() { - client = new Client({ - version: "<%version%>" - }); + client = new Client(); client.authenticate({ - type: "oauth", + type: "<%sectionAuthType%>", token: token }); }); diff --git a/test/activityTest.js b/test/activityTest.js new file mode 100644 index 0000000000..c0cb27ff2d --- /dev/null +++ b/test/activityTest.js @@ -0,0 +1,504 @@ +/* + * Copyright 2012 Cloud9 IDE, Inc. + * + * This product includes software developed by + * Cloud9 IDE, Inc (http://c9.io). + * + * Author: Mike de Boer + */ + +"use strict"; + +var Assert = require("assert"); +var Client = require("./../lib/index"); +var testAuth = require("./../testAuth.json"); + +describe("[activity]", function() { + var client; + var token = testAuth["token"]; + + beforeEach(function() { + client = new Client(); + client.authenticate({ + type: "oauth", + token: token + }); + }); + + it("should successfully execute GET /notifications/threads/:id/subscription (checkNotificationThreadSubscription)", function(next) { + client.activity.checkNotificationThreadSubscription( + { + id: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /user/starred/:owner/:repo (checkStarringRepo)", function(next) { + client.activity.checkStarringRepo( + { + owner: "String", + repo: "String", + page: "Number", + per_page: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute DELETE /notifications/threads/:id/subscription (deleteNotificationThreadSubscription)", function(next) { + client.activity.deleteNotificationThreadSubscription( + { + id: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /events (getEvents)", function(next) { + client.activity.getEvents( + { + page: "Number", + per_page: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /orgs/:org/events (getEventsForOrg)", function(next) { + client.activity.getEventsForOrg( + { + org: "String", + page: "Number", + per_page: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /repos/:owner/:repo/events (getEventsForRepo)", function(next) { + client.activity.getEventsForRepo( + { + owner: "String", + repo: "String", + page: "Number", + per_page: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /repos/:owner/:repo/issues/events (getEventsForRepoIssues)", function(next) { + client.activity.getEventsForRepoIssues( + { + owner: "String", + repo: "String", + page: "Number", + per_page: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /networks/:owner/:repo/events (getEventsForRepoNetwork)", function(next) { + client.activity.getEventsForRepoNetwork( + { + owner: "String", + repo: "String", + page: "Number", + per_page: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /users/:username/events (getEventsForUser)", function(next) { + client.activity.getEventsForUser( + { + username: "String", + page: "Number", + per_page: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /users/:username/events/orgs/:org (getEventsForUserOrg)", function(next) { + client.activity.getEventsForUserOrg( + { + username: "String", + org: "String", + page: "Number", + per_page: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /users/:username/events/public (getEventsForUserPublic)", function(next) { + client.activity.getEventsForUserPublic( + { + username: "String", + page: "Number", + per_page: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /users/:username/received_events (getEventsReceived)", function(next) { + client.activity.getEventsReceived( + { + username: "String", + page: "Number", + per_page: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /users/:username/received_events/public (getEventsReceivedPublic)", function(next) { + client.activity.getEventsReceivedPublic( + { + username: "String", + page: "Number", + per_page: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /feeds (getFeeds)", function(next) { + client.activity.getFeeds( + {}, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /notifications/threads/:id (getNotificationThread)", function(next) { + client.activity.getNotificationThread( + { + id: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /notifications (getNotifications)", function(next) { + client.activity.getNotifications( + { + all: "Boolean", + participating: "Boolean", + since: "Date", + before: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /repos/:owner/:repo/notifications (getNotificationsForUser)", function(next) { + client.activity.getNotificationsForUser( + { + owner: "String", + repo: "String", + all: "Boolean", + participating: "Boolean", + since: "Date", + before: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /repos/:owner/:repo/subscription (getRepoSubscription)", function(next) { + client.activity.getRepoSubscription( + { + owner: "String", + repo: "String", + page: "Number", + per_page: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /repos/:owner/:repo/stargazers (getStargazersForRepo)", function(next) { + client.activity.getStargazersForRepo( + { + owner: "String", + repo: "String", + page: "Number", + per_page: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /user/starred (getStarredRepos)", function(next) { + client.activity.getStarredRepos( + { + sort: "String", + direction: "String", + page: "Number", + per_page: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /users/:username/starred (getStarredReposForUser)", function(next) { + client.activity.getStarredReposForUser( + { + username: "String", + sort: "String", + direction: "String", + page: "Number", + per_page: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /user/subscriptions (getWatchedRepos)", function(next) { + client.activity.getWatchedRepos( + { + page: "Number", + per_page: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /users/:username/subscriptions (getWatchedReposForUser)", function(next) { + client.activity.getWatchedReposForUser( + { + username: "String", + page: "Number", + per_page: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /repos/:owner/:repo/subscribers (getWatchersForRepo)", function(next) { + client.activity.getWatchersForRepo( + { + owner: "String", + repo: "String", + page: "Number", + per_page: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute PATCH /notifications/threads/:id (markNotificationThreadAsRead)", function(next) { + client.activity.markNotificationThreadAsRead( + { + id: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute PUT /notifications (markNotificationsAsRead)", function(next) { + client.activity.markNotificationsAsRead( + { + last_read_at: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute PUT /repos/:owner/:repo/notifications (markNotificationsAsReadForRepo)", function(next) { + client.activity.markNotificationsAsReadForRepo( + { + owner: "String", + repo: "String", + last_read_at: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute PUT /notifications/threads/:id/subscription (setNotificationThreadSubscription)", function(next) { + client.activity.setNotificationThreadSubscription( + { + id: "String", + subscribed: "Boolean", + ignored: "Boolean" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute PUT /repos/:owner/:repo/subscription (setRepoSubscription)", function(next) { + client.activity.setRepoSubscription( + { + owner: "String", + repo: "String", + subscribed: "Boolean", + ignored: "Boolean" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute PUT /user/starred/:owner/:repo (starRepo)", function(next) { + client.activity.starRepo( + { + owner: "String", + repo: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute DELETE /user/starred/:owner/:repo (unstarRepo)", function(next) { + client.activity.unstarRepo( + { + owner: "String", + repo: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute DELETE /repos/:owner/:repo/subscription (unwatchRepo)", function(next) { + client.activity.unwatchRepo( + { + owner: "String", + repo: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); +}); diff --git a/test/authorizationTest.js b/test/authorizationTest.js new file mode 100644 index 0000000000..d22f7e8d84 --- /dev/null +++ b/test/authorizationTest.js @@ -0,0 +1,224 @@ +/* + * Copyright 2012 Cloud9 IDE, Inc. + * + * This product includes software developed by + * Cloud9 IDE, Inc (http://c9.io). + * + * Author: Mike de Boer + */ + +"use strict"; + +var Assert = require("assert"); +var Client = require("./../lib/index"); +var testAuth = require("./../testAuth.json"); + +describe("[authorization]", function() { + var client; + var token = testAuth["token"]; + + beforeEach(function() { + client = new Client(); + client.authenticate({ + type: "oauth", + token: token + }); + }); + + it("should successfully execute GET /applications/:client_id/tokens/:access_token (check)", function(next) { + client.authorization.check( + { + client_id: "String", + access_token: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute POST /authorizations (create)", function(next) { + client.authorization.create( + { + scopes: "Array", + note: "String", + note_url: "String", + client_id: "String", + client_secret: "String", + fingerprint: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute DELETE /authorizations/:id (delete)", function(next) { + client.authorization.delete( + { + id: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute DELETE /applications/grants/:id (deleteGrant)", function(next) { + client.authorization.deleteGrant( + { + id: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /authorizations/:id (get)", function(next) { + client.authorization.get( + { + id: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /authorizations (getAll)", function(next) { + client.authorization.getAll( + { + page: "Number", + per_page: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /applications/grants/:id (getGrant)", function(next) { + client.authorization.getGrant( + { + id: "String", + page: "Number", + per_page: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /applications/grants (getGrants)", function(next) { + client.authorization.getGrants( + { + page: "Number", + per_page: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute PUT /authorizations/clients/:client_id (getOrCreateAuthorizationForApp)", function(next) { + client.authorization.getOrCreateAuthorizationForApp( + { + client_id: "String", + client_secret: "String", + scopes: "Array", + note: "String", + note_url: "String", + fingerprint: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute PUT /authorizations/clients/:client_id/:fingerprint (getOrCreateAuthorizationForAppAndFingerprint)", function(next) { + client.authorization.getOrCreateAuthorizationForAppAndFingerprint( + { + client_id: "String", + fingerprint: "String", + client_secret: "String", + scopes: "Array", + note: "String", + note_url: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute POST /applications/:client_id/tokens/:access_token (reset)", function(next) { + client.authorization.reset( + { + client_id: "String", + access_token: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute DELETE /applications/:client_id/tokens/:access_token (revoke)", function(next) { + client.authorization.revoke( + { + client_id: "String", + access_token: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute PATCH /authorizations/:id (update)", function(next) { + client.authorization.update( + { + id: "String", + scopes: "Array", + add_scopes: "Array", + remove_scopes: "Array", + note: "String", + note_url: "String", + fingerprint: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); +}); diff --git a/test/client_test.js b/test/client_test.js deleted file mode 100644 index 85305895ba..0000000000 --- a/test/client_test.js +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright 2012 Cloud9 IDE, Inc. - * - * This product includes software developed by - * Cloud9 IDE, Inc (http://c9.io). - * - * Author: Mike de Boer - */ - -"use strict"; - -var Assert = require("assert"); -var Client = require("./../index"); - -describe("[client]", function() { - var client; - var token = "e5a4a27487c26e571892846366de023349321a73"; - - beforeEach(function() { - client = new Client({ - version: "3.0.0" - }); - /*client.authenticate({ - type: "oauth", - token: token - });*/ - }); - - it("should successfully execute GET /authorizations (getAll)", function(next) { - // `aseemk` has two pages of followers right now. - client.user.getFollowers( - { - user: "aseemk" - }, - function(err, res) { - Assert.equal(err, null); - - Assert.ok(!!client.hasNextPage(res)); - Assert.ok(!!client.hasLastPage(res)); - Assert.ok(!client.hasPreviousPage(res)); - - client.getNextPage(res, function(err, res) { - Assert.equal(err, null); - - Assert.ok(!!client.hasPreviousPage(res)); - Assert.ok(!!client.hasFirstPage(res)); - Assert.ok(!client.hasNextPage(res)); - Assert.ok(!client.hasLastPage(res)); - - client.getPreviousPage(res.meta.link, function(err, res) { - Assert.equal(err, null); - - Assert.ok(!!client.hasNextPage(res)); - Assert.ok(!!client.hasLastPage(res)); - Assert.ok(!client.hasPreviousPage(res)); - next(); - }); - }); - } - ); - }); -}); diff --git a/test/enterpriseTest.js b/test/enterpriseTest.js new file mode 100644 index 0000000000..6c7d971138 --- /dev/null +++ b/test/enterpriseTest.js @@ -0,0 +1,294 @@ +/* + * Copyright 2012 Cloud9 IDE, Inc. + * + * This product includes software developed by + * Cloud9 IDE, Inc (http://c9.io). + * + * Author: Mike de Boer + */ + +"use strict"; + +var Assert = require("assert"); +var Client = require("./../lib/index"); +var testAuth = require("./../testAuth.json"); + +describe("[enterprise]", function() { + var client; + var token = testAuth["token"]; + + beforeEach(function() { + client = new Client(); + client.authenticate({ + type: "oauth", + token: token + }); + }); + + it("should successfully execute POST /admin/organizations (createOrg)", function(next) { + client.enterprise.createOrg( + { + login: "String", + admin: "String", + profile_name: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute POST /admin/pre_receive_environments (createPreReceiveEnvironment)", function(next) { + client.enterprise.createPreReceiveEnvironment( + { + name: "String", + image_url: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute POST /admin/pre-receive-hooks (createPreReceiveHook)", function(next) { + client.enterprise.createPreReceiveHook( + { + name: "String", + script: "String", + script_repository: "Json", + environment: "Json", + enforcement: "String", + allow_downstream_configuration: "Boolean" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute DELETE /admin/pre_receive_environments/:id (deletePreReceiveEnvironment)", function(next) { + client.enterprise.deletePreReceiveEnvironment( + { + id: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute DELETE /admin/pre_receive_hooks/:id (deletePreReceiveHook)", function(next) { + client.enterprise.deletePreReceiveHook( + { + id: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute PATCH /admin/pre_receive_environments/:id (editPreReceiveEnvironment)", function(next) { + client.enterprise.editPreReceiveEnvironment( + { + id: "String", + name: "String", + image_url: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute PATCH /admin/pre_receive_hooks/:id (editPreReceiveHook)", function(next) { + client.enterprise.editPreReceiveHook( + { + id: "String", + hook: "Json" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /enterprise/settings/license (getLicense)", function(next) { + client.enterprise.getLicense( + {}, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /admin/pre-receive-environments/:id (getPreReceiveEnvironment)", function(next) { + client.enterprise.getPreReceiveEnvironment( + { + id: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /admin/pre-receive-environments/:id/downloads/latest (getPreReceiveEnvironmentDownloadStatus)", function(next) { + client.enterprise.getPreReceiveEnvironmentDownloadStatus( + { + id: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /admin/pre_receive_environments (getPreReceiveEnvironments)", function(next) { + client.enterprise.getPreReceiveEnvironments( + {}, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /admin/pre-receive-hooks/:id (getPreReceiveHook)", function(next) { + client.enterprise.getPreReceiveHook( + { + id: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /admin/pre-receive-hooks (getPreReceiveHooks)", function(next) { + client.enterprise.getPreReceiveHooks( + {}, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute POST /staff/indexing_jobs (queueIndexingJob)", function(next) { + client.enterprise.queueIndexingJob( + { + target: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /enterprise/stats/:type (stats)", function(next) { + client.enterprise.stats( + { + type: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute POST /admin/ldap/teams/:team_id/sync (syncLdapForTeam)", function(next) { + client.enterprise.syncLdapForTeam( + { + team_id: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute POST /admin/ldap/users/:username/sync (syncLdapForUser)", function(next) { + client.enterprise.syncLdapForUser( + { + username: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute POST /admin/pre_receive_environments/:id/downloads (triggerPreReceiveEnvironmentDownload)", function(next) { + client.enterprise.triggerPreReceiveEnvironmentDownload( + { + id: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute PATCH /admin/ldap/teams/:team_id/mapping (updateLdapForTeam)", function(next) { + client.enterprise.updateLdapForTeam( + { + team_id: "Number", + ldap_dn: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute PATCH /admin/ldap/users/:username/mapping (updateLdapForUser)", function(next) { + client.enterprise.updateLdapForUser( + { + username: "String", + ldap_dn: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); +}); diff --git a/test/example.js b/test/example.js deleted file mode 100644 index 4c28886244..0000000000 --- a/test/example.js +++ /dev/null @@ -1,37 +0,0 @@ -/** section: github, internal - * Example - * - * Github API usage example. - * - * Copyright 2012 Cloud9 IDE, Inc. - * - * This product includes software developed by - * Cloud9 IDE, Inc (http://c9.io). - * - * Author: Mike de Boer - **/ - -"use strict"; - -var Client = require("./../index"); - -var github = new Client({ - debug: true, - version: "3.0.0" -}); - -github.authenticate({ - type: "basic", - username: "mikedeboer", - password: "mysecretpass" -}); - -github.user.get({}, function(err, res) { - console.log("GOT ERR?", err); - console.log("GOT RES?", res); - - github.repos.getAll({}, function(err, res) { - console.log("GOT ERR?", err); - console.log("GOT RES?", res); - }); -}); diff --git a/api/v3.0.0/userTest.js b/test/gistsTest.js similarity index 57% rename from api/v3.0.0/userTest.js rename to test/gistsTest.js index c7b7a1061e..91e4b4bac6 100644 --- a/api/v3.0.0/userTest.js +++ b/test/gistsTest.js @@ -10,26 +10,25 @@ "use strict"; var Assert = require("assert"); -var Client = require("./../../index"); +var Client = require("./../lib/index"); +var testAuth = require("./../testAuth.json"); -describe("[user]", function() { +describe("[gists]", function() { var client; - var token = "c286e38330e15246a640c2cf32a45ea45d93b2ba"; + var token = testAuth["token"]; beforeEach(function() { - client = new Client({ - version: "3.0.0" - }); + client = new Client(); client.authenticate({ type: "oauth", token: token }); }); - it("should successfully execute GET /users/:user (getFrom)", function(next) { - client.user.getFrom( + it("should successfully execute GET /gists/:id/star (checkStar)", function(next) { + client.gists.checkStar( { - user: "String" + id: "String" }, function(err, res) { Assert.equal(err, null); @@ -39,9 +38,13 @@ describe("[user]", function() { ); }); - it("should successfully execute GET /user (get)", function(next) { - client.user.get( - {}, + it("should successfully execute POST /gists (create)", function(next) { + client.gists.create( + { + files: "Json", + description: "String", + public: "Boolean" + }, function(err, res) { Assert.equal(err, null); // other assertions go here @@ -50,16 +53,11 @@ describe("[user]", function() { ); }); - it("should successfully execute PATCH /user (update)", function(next) { - client.user.update( + it("should successfully execute POST /gists/:gist_id/comments (createComment)", function(next) { + client.gists.createComment( { - name: "String", - email: "String", - blog: "String", - company: "String", - location: "String", - hireable: "Boolean", - bio: "String" + gist_id: "String", + body: "String" }, function(err, res) { Assert.equal(err, null); @@ -69,11 +67,10 @@ describe("[user]", function() { ); }); - it("should successfully execute GET /user/orgs (getOrgs)", function(next) { - client.user.getOrgs( + it("should successfully execute DELETE /gists/:id (delete)", function(next) { + client.gists.delete( { - page: "Number", - per_page: "Number" + id: "String" }, function(err, res) { Assert.equal(err, null); @@ -83,11 +80,11 @@ describe("[user]", function() { ); }); - it("should successfully execute GET /user/teams (getTeams)", function(next) { - client.user.getTeams( + it("should successfully execute DELETE /gists/:gist_id/comments/:id (deleteComment)", function(next) { + client.gists.deleteComment( { - page: "Number", - per_page: "Number" + gist_id: "String", + id: "String" }, function(err, res) { Assert.equal(err, null); @@ -97,11 +94,14 @@ describe("[user]", function() { ); }); - it("should successfully execute GET /user/emails (getEmails)", function(next) { - client.user.getEmails( + it("should successfully execute PATCH /gists/:id (edit)", function(next) { + client.gists.edit( { - page: "Number", - per_page: "Number" + id: "String", + description: "String", + files: "Json", + content: "String", + filename: "String" }, function(err, res) { Assert.equal(err, null); @@ -111,9 +111,13 @@ describe("[user]", function() { ); }); - it("should successfully execute POST /user/emails (addEmails)", function(next) { - client.user.addEmails( - {}, + it("should successfully execute PATCH /gists/:gist_id/comments/:id (editComment)", function(next) { + client.gists.editComment( + { + gist_id: "String", + id: "String", + body: "String" + }, function(err, res) { Assert.equal(err, null); // other assertions go here @@ -122,9 +126,11 @@ describe("[user]", function() { ); }); - it("should successfully execute DELETE /user/emails (deleteEmails)", function(next) { - client.user.deleteEmails( - {}, + it("should successfully execute POST /gists/:id/forks (fork)", function(next) { + client.gists.fork( + { + id: "String" + }, function(err, res) { Assert.equal(err, null); // other assertions go here @@ -133,12 +139,10 @@ describe("[user]", function() { ); }); - it("should successfully execute GET /users/:user/followers (getFollowers)", function(next) { - client.user.getFollowers( + it("should successfully execute GET /gists/:id (get)", function(next) { + client.gists.get( { - user: "String", - page: "Number", - per_page: "Number" + id: "String" }, function(err, res) { Assert.equal(err, null); @@ -148,10 +152,10 @@ describe("[user]", function() { ); }); - it("should successfully execute GET /users/:user/following (getFollowingFromUser)", function(next) { - client.user.getFollowingFromUser( + it("should successfully execute GET /gists (getAll)", function(next) { + client.gists.getAll( { - user: "String", + since: "Date", page: "Number", per_page: "Number" }, @@ -163,11 +167,11 @@ describe("[user]", function() { ); }); - it("should successfully execute GET /user/following (getFollowing)", function(next) { - client.user.getFollowing( + it("should successfully execute GET /gists/:gist_id/comments/:id (getComment)", function(next) { + client.gists.getComment( { - page: "Number", - per_page: "Number" + gist_id: "String", + id: "String" }, function(err, res) { Assert.equal(err, null); @@ -177,12 +181,10 @@ describe("[user]", function() { ); }); - it("should successfully execute GET /user/following/:user (getFollowUser)", function(next) { - client.user.getFollowUser( + it("should successfully execute GET /gists/:gist_id/comments (getComments)", function(next) { + client.gists.getComments( { - user: "String", - page: "Number", - per_page: "Number" + gist_id: "String" }, function(err, res) { Assert.equal(err, null); @@ -192,10 +194,10 @@ describe("[user]", function() { ); }); - it("should successfully execute PUT /user/following/:user (followUser)", function(next) { - client.user.followUser( + it("should successfully execute GET /gists/:id/commits (getCommits)", function(next) { + client.gists.getCommits( { - user: "String" + id: "String" }, function(err, res) { Assert.equal(err, null); @@ -205,10 +207,13 @@ describe("[user]", function() { ); }); - it("should successfully execute DELETE /user/following/:user (unFollowUser)", function(next) { - client.user.unFollowUser( + it("should successfully execute GET /users/:username/gists (getForUser)", function(next) { + client.gists.getForUser( { - user: "String" + username: "String", + since: "Date", + page: "Number", + per_page: "Number" }, function(err, res) { Assert.equal(err, null); @@ -218,9 +223,10 @@ describe("[user]", function() { ); }); - it("should successfully execute GET /user/keys (getKeys)", function(next) { - client.user.getKeys( + it("should successfully execute GET /gists/:id/forks (getForks)", function(next) { + client.gists.getForks( { + id: "String", page: "Number", per_page: "Number" }, @@ -232,12 +238,10 @@ describe("[user]", function() { ); }); - it("should successfully execute GET /users/:user/keys (getKeysFromUser)", function(next) { - client.user.getKeysFromUser( + it("should successfully execute GET /gists/public (getPublic)", function(next) { + client.gists.getPublic( { - user: "String", - page: "Number", - per_page: "Number" + since: "Date" }, function(err, res) { Assert.equal(err, null); @@ -247,10 +251,11 @@ describe("[user]", function() { ); }); - it("should successfully execute GET /user/keys/:id (getKey)", function(next) { - client.user.getKey( + it("should successfully execute GET /gists/:id/:sha (getRevision)", function(next) { + client.gists.getRevision( { - id: "String" + id: "String", + sha: "String" }, function(err, res) { Assert.equal(err, null); @@ -260,11 +265,10 @@ describe("[user]", function() { ); }); - it("should successfully execute POST /user/keys (createKey)", function(next) { - client.user.createKey( + it("should successfully execute GET /gists/starred (getStarred)", function(next) { + client.gists.getStarred( { - title: "String", - key: "String" + since: "Date" }, function(err, res) { Assert.equal(err, null); @@ -274,12 +278,10 @@ describe("[user]", function() { ); }); - it("should successfully execute PATCH /user/keys/:id (updateKey)", function(next) { - client.user.updateKey( + it("should successfully execute PUT /gists/:id/star (star)", function(next) { + client.gists.star( { - id: "String", - title: "String", - key: "String" + id: "String" }, function(err, res) { Assert.equal(err, null); @@ -289,8 +291,8 @@ describe("[user]", function() { ); }); - it("should successfully execute DELETE /user/keys/:id (deleteKey)", function(next) { - client.user.deleteKey( + it("should successfully execute DELETE /gists/:id/star (unstar)", function(next) { + client.gists.unstar( { id: "String" }, diff --git a/test/gitdataTest.js b/test/gitdataTest.js new file mode 100644 index 0000000000..8b8611e18d --- /dev/null +++ b/test/gitdataTest.js @@ -0,0 +1,285 @@ +/* + * Copyright 2012 Cloud9 IDE, Inc. + * + * This product includes software developed by + * Cloud9 IDE, Inc (http://c9.io). + * + * Author: Mike de Boer + */ + +"use strict"; + +var Assert = require("assert"); +var Client = require("./../lib/index"); +var testAuth = require("./../testAuth.json"); + +describe("[gitdata]", function() { + var client; + var token = testAuth["token"]; + + beforeEach(function() { + client = new Client(); + client.authenticate({ + type: "oauth", + token: token + }); + }); + + it("should successfully execute POST /repos/:owner/:repo/git/blobs (createBlob)", function(next) { + client.gitdata.createBlob( + { + owner: "String", + repo: "String", + content: "String", + encoding: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute POST /repos/:owner/:repo/git/commits (createCommit)", function(next) { + client.gitdata.createCommit( + { + owner: "String", + repo: "String", + message: "String", + tree: "String", + parents: "Array", + author: "Json", + committer: "Json" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute POST /repos/:owner/:repo/git/refs (createReference)", function(next) { + client.gitdata.createReference( + { + owner: "String", + repo: "String", + ref: "String", + sha: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute POST /repos/:owner/:repo/git/tags (createTag)", function(next) { + client.gitdata.createTag( + { + owner: "String", + repo: "String", + tag: "String", + message: "String", + object: "String", + type: "String", + tagger: "Json" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute POST /repos/:owner/:repo/git/trees (createTree)", function(next) { + client.gitdata.createTree( + { + owner: "String", + repo: "String", + tree: "Json", + base_tree: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute DELETE /repos/:owner/:repo/git/refs/:ref (deleteReference)", function(next) { + client.gitdata.deleteReference( + { + owner: "String", + repo: "String", + ref: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /repos/:owner/:repo/git/blobs/:sha (getBlob)", function(next) { + client.gitdata.getBlob( + { + owner: "String", + repo: "String", + sha: "String", + page: "Number", + per_page: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /repos/:owner/:repo/git/commits/:sha (getCommit)", function(next) { + client.gitdata.getCommit( + { + owner: "String", + repo: "String", + sha: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /repos/:owner/:repo/git/commits/:sha (getCommitSignatureVerification)", function(next) { + client.gitdata.getCommitSignatureVerification( + { + owner: "String", + repo: "String", + sha: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /repos/:owner/:repo/git/refs/:ref (getReference)", function(next) { + client.gitdata.getReference( + { + owner: "String", + repo: "String", + ref: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /repos/:owner/:repo/git/refs/ (getReferences)", function(next) { + client.gitdata.getReferences( + { + owner: "String", + repo: "String", + page: "Number", + per_page: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /repos/:owner/:repo/git/tags/:sha (getTag)", function(next) { + client.gitdata.getTag( + { + owner: "String", + repo: "String", + sha: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /repos/:owner/:repo/git/tags/:sha (getTagSignatureVerification)", function(next) { + client.gitdata.getTagSignatureVerification( + { + owner: "String", + repo: "String", + sha: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /repos/:owner/:repo/git/refs/tags (getTags)", function(next) { + client.gitdata.getTags( + { + owner: "String", + repo: "String", + page: "Number", + per_page: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /repos/:owner/:repo/git/trees/:sha (getTree)", function(next) { + client.gitdata.getTree( + { + owner: "String", + repo: "String", + sha: "String", + recursive: "Boolean" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute PATCH /repos/:owner/:repo/git/refs/:ref (updateReference)", function(next) { + client.gitdata.updateReference( + { + owner: "String", + repo: "String", + ref: "String", + sha: "String", + force: "Boolean" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); +}); diff --git a/test/installationsTest.js b/test/installationsTest.js new file mode 100644 index 0000000000..76847a67c6 --- /dev/null +++ b/test/installationsTest.js @@ -0,0 +1,41 @@ +/* + * Copyright 2012 Cloud9 IDE, Inc. + * + * This product includes software developed by + * Cloud9 IDE, Inc (http://c9.io). + * + * Author: Mike de Boer + */ + +"use strict"; + +var Assert = require("assert"); +var Client = require("./../lib/index"); +var testAuth = require("./../testAuth.json"); + +describe("[installations]", function() { + var client; + var token = testAuth["token"]; + + beforeEach(function() { + client = new Client(); + client.authenticate({ + type: "integration", + token: token + }); + }); + + it("should successfully execute POST /installations/:installation_id/access_tokens (create)", function(next) { + client.installations.create( + { + installation_id: "Number", + user_id: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); +}); diff --git a/test/integrationsTest.js b/test/integrationsTest.js new file mode 100644 index 0000000000..a2c389a230 --- /dev/null +++ b/test/integrationsTest.js @@ -0,0 +1,109 @@ +/* + * Copyright 2012 Cloud9 IDE, Inc. + * + * This product includes software developed by + * Cloud9 IDE, Inc (http://c9.io). + * + * Author: Mike de Boer + */ + +"use strict"; + +var Assert = require("assert"); +var Client = require("./../lib/index"); +var testAuth = require("./../testAuth.json"); + +describe("[integrations]", function() { + var client; + var token = testAuth["token"]; + + beforeEach(function() { + client = new Client(); + client.authenticate({ + type: "oauth", + token: token + }); + }); + + it("should successfully execute POST /installations/:installation_id/repositories/:repository_id (addRepoToInstallation)", function(next) { + client.integrations.addRepoToInstallation( + { + installation_id: "String", + repository_id: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute POST /installations/:installation_id/access_tokens (createInstallationToken)", function(next) { + client.integrations.createInstallationToken( + { + installation_id: "String", + user_id: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /installation/repositories (getInstallationRepositories)", function(next) { + client.integrations.getInstallationRepositories( + { + user_id: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /integration/installations (getInstallations)", function(next) { + client.integrations.getInstallations( + { + page: "Number", + per_page: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute POST /integration/identity/user (getUserIdentity)", function(next) { + client.integrations.getUserIdentity( + { + nonce: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute POST /installations/:installation_id/repositories/:repository_id (removeRepoFromInstallation)", function(next) { + client.integrations.removeRepoFromInstallation( + { + installation_id: "String", + repository_id: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); +}); diff --git a/test/issuesTest.js b/test/issuesTest.js new file mode 100644 index 0000000000..6264ed2d96 --- /dev/null +++ b/test/issuesTest.js @@ -0,0 +1,682 @@ +/* + * Copyright 2012 Cloud9 IDE, Inc. + * + * This product includes software developed by + * Cloud9 IDE, Inc (http://c9.io). + * + * Author: Mike de Boer + */ + +"use strict"; + +var Assert = require("assert"); +var Client = require("./../lib/index"); +var testAuth = require("./../testAuth.json"); + +describe("[issues]", function() { + var client; + var token = testAuth["token"]; + + beforeEach(function() { + client = new Client(); + client.authenticate({ + type: "oauth", + token: token + }); + }); + + it("should successfully execute POST /repos/:owner/:repo/issues/:number/assignees (addAssigneesToIssue)", function(next) { + client.issues.addAssigneesToIssue( + { + owner: "String", + repo: "String", + number: "Number", + assignees: "Array" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute POST /repos/:owner/:repo/issues/:number/labels (addLabels)", function(next) { + client.issues.addLabels( + { + owner: "String", + repo: "String", + number: "Number", + labels: "Array" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /repos/:owner/:repo/assignees/:assignee (checkAssignee)", function(next) { + client.issues.checkAssignee( + { + owner: "String", + repo: "String", + assignee: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute POST /repos/:owner/:repo/issues (create)", function(next) { + client.issues.create( + { + owner: "String", + repo: "String", + title: "String", + body: "String", + assignee: "String", + milestone: "Number", + labels: "Array", + assignees: "Array" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute POST /repos/:owner/:repo/issues/:number/comments (createComment)", function(next) { + client.issues.createComment( + { + owner: "String", + repo: "String", + number: "Number", + body: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute POST /repos/:owner/:repo/labels (createLabel)", function(next) { + client.issues.createLabel( + { + owner: "String", + repo: "String", + name: "String", + color: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute POST /repos/:owner/:repo/milestones (createMilestone)", function(next) { + client.issues.createMilestone( + { + owner: "String", + repo: "String", + title: "String", + state: "String", + description: "String", + due_on: "Date" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute DELETE /repos/:owner/:repo/issues/comments/:id (deleteComment)", function(next) { + client.issues.deleteComment( + { + owner: "String", + repo: "String", + id: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute DELETE /repos/:owner/:repo/labels/:name (deleteLabel)", function(next) { + client.issues.deleteLabel( + { + owner: "String", + repo: "String", + name: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute DELETE /repos/:owner/:repo/milestones/:number (deleteMilestone)", function(next) { + client.issues.deleteMilestone( + { + owner: "String", + repo: "String", + number: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute PATCH /repos/:owner/:repo/issues/:number (edit)", function(next) { + client.issues.edit( + { + owner: "String", + repo: "String", + number: "Number", + title: "String", + body: "String", + assignee: "String", + state: "String", + milestone: "Number", + labels: "Array", + assignees: "Array" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute PATCH /repos/:owner/:repo/issues/comments/:id (editComment)", function(next) { + client.issues.editComment( + { + owner: "String", + repo: "String", + id: "String", + body: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /repos/:owner/:repo/issues/:number (get)", function(next) { + client.issues.get( + { + owner: "String", + repo: "String", + number: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /issues (getAll)", function(next) { + client.issues.getAll( + { + filter: "String", + state: "String", + labels: "String", + sort: "String", + direction: "String", + since: "Date", + page: "Number", + per_page: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /repos/:owner/:repo/assignees (getAssignees)", function(next) { + client.issues.getAssignees( + { + owner: "String", + repo: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /repos/:owner/:repo/issues/comments/:id (getComment)", function(next) { + client.issues.getComment( + { + owner: "String", + repo: "String", + id: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /repos/:owner/:repo/issues/:number/comments (getComments)", function(next) { + client.issues.getComments( + { + owner: "String", + repo: "String", + number: "Number", + page: "Number", + per_page: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /repos/:owner/:repo/issues/comments (getCommentsForRepo)", function(next) { + client.issues.getCommentsForRepo( + { + owner: "String", + repo: "String", + sort: "String", + direction: "String", + since: "Date", + page: "Number", + per_page: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /repos/:owner/:repo/issues/events/:id (getEvent)", function(next) { + client.issues.getEvent( + { + owner: "String", + repo: "String", + id: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /repos/:owner/:repo/issues/:issue_number/events (getEvents)", function(next) { + client.issues.getEvents( + { + owner: "String", + repo: "String", + issue_number: "Number", + page: "Number", + per_page: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /repos/:owner/:repo/issues/events (getEventsForRepo)", function(next) { + client.issues.getEventsForRepo( + { + owner: "String", + repo: "String", + page: "Number", + per_page: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /repos/:owner/:repo/issues/:issue_number/timeline (getEventsTimeline)", function(next) { + client.issues.getEventsTimeline( + { + owner: "String", + repo: "String", + issue_number: "Number", + page: "Number", + per_page: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /orgs/:org/issues (getForOrg)", function(next) { + client.issues.getForOrg( + { + org: "String", + filter: "String", + state: "String", + labels: "String", + sort: "String", + direction: "String", + since: "Date", + page: "Number", + per_page: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /repos/:owner/:repo/issues (getForRepo)", function(next) { + client.issues.getForRepo( + { + owner: "String", + repo: "String", + milestone: "String", + state: "String", + assignee: "String", + creator: "String", + mentioned: "String", + labels: "String", + sort: "String", + direction: "String", + since: "Date", + page: "Number", + per_page: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /user/issues (getForUser)", function(next) { + client.issues.getForUser( + { + filter: "String", + state: "String", + labels: "String", + sort: "String", + direction: "String", + since: "Date", + page: "Number", + per_page: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /repos/:owner/:repo/issues/:number/labels (getIssueLabels)", function(next) { + client.issues.getIssueLabels( + { + owner: "String", + repo: "String", + number: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /repos/:owner/:repo/labels/:name (getLabel)", function(next) { + client.issues.getLabel( + { + owner: "String", + repo: "String", + name: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /repos/:owner/:repo/labels (getLabels)", function(next) { + client.issues.getLabels( + { + owner: "String", + repo: "String", + page: "Number", + per_page: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /repos/:owner/:repo/milestones/:number (getMilestone)", function(next) { + client.issues.getMilestone( + { + owner: "String", + repo: "String", + number: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /repos/:owner/:repo/milestones/:number/labels (getMilestoneLabels)", function(next) { + client.issues.getMilestoneLabels( + { + owner: "String", + repo: "String", + number: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /repos/:owner/:repo/milestones (getMilestones)", function(next) { + client.issues.getMilestones( + { + owner: "String", + repo: "String", + state: "String", + sort: "String", + direction: "String", + page: "Number", + per_page: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute PUT /repos/:owner/:repo/issues/:number/lock (lock)", function(next) { + client.issues.lock( + { + owner: "String", + repo: "String", + number: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute DELETE /repos/:owner/:repo/issues/:number/labels (removeAllLabels)", function(next) { + client.issues.removeAllLabels( + { + owner: "String", + repo: "String", + number: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute DELETE /repos/:owner/:repo/issues/:number/assignees (removeAssigneesFromIssue)", function(next) { + client.issues.removeAssigneesFromIssue( + { + owner: "String", + repo: "String", + number: "Number", + assignees: "Array" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute DELETE /repos/:owner/:repo/issues/:number/labels/:name (removeLabel)", function(next) { + client.issues.removeLabel( + { + owner: "String", + repo: "String", + number: "Number", + name: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute PUT /repos/:owner/:repo/issues/:number/labels (replaceAllLabels)", function(next) { + client.issues.replaceAllLabels( + { + owner: "String", + repo: "String", + number: "Number", + labels: "Array" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute DELETE /repos/:owner/:repo/issues/:number/lock (unlock)", function(next) { + client.issues.unlock( + { + owner: "String", + repo: "String", + number: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute PATCH /repos/:owner/:repo/labels/:oldname (updateLabel)", function(next) { + client.issues.updateLabel( + { + owner: "String", + repo: "String", + oldname: "String", + name: "String", + color: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute PATCH /repos/:owner/:repo/milestones/:number (updateMilestone)", function(next) { + client.issues.updateMilestone( + { + owner: "String", + repo: "String", + number: "Number", + title: "String", + state: "String", + description: "String", + due_on: "Date" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); +}); diff --git a/test/migrationsTest.js b/test/migrationsTest.js new file mode 100644 index 0000000000..0f1e1bfa0d --- /dev/null +++ b/test/migrationsTest.js @@ -0,0 +1,237 @@ +/* + * Copyright 2012 Cloud9 IDE, Inc. + * + * This product includes software developed by + * Cloud9 IDE, Inc (http://c9.io). + * + * Author: Mike de Boer + */ + +"use strict"; + +var Assert = require("assert"); +var Client = require("./../lib/index"); +var testAuth = require("./../testAuth.json"); + +describe("[migrations]", function() { + var client; + var token = testAuth["token"]; + + beforeEach(function() { + client = new Client(); + client.authenticate({ + type: "oauth", + token: token + }); + }); + + it("should successfully execute DELETE /repos/:owner/:repo/import (cancelImport)", function(next) { + client.migrations.cancelImport( + { + owner: "String", + repo: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute DELETE /orgs/:org/migrations/:id/archive (deleteMigrationArchive)", function(next) { + client.migrations.deleteMigrationArchive( + { + org: "String", + id: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /repos/:owner/:repo/import/authors (getImportCommitAuthors)", function(next) { + client.migrations.getImportCommitAuthors( + { + owner: "String", + repo: "String", + since: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /repos/:owner/:repo/import (getImportProgress)", function(next) { + client.migrations.getImportProgress( + { + owner: "String", + repo: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /:owner/:name/import/large_files (getLargeImportFiles)", function(next) { + client.migrations.getLargeImportFiles( + { + owner: "String", + name: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /orgs/:org/migrations/:id/archive (getMigrationArchiveLink)", function(next) { + client.migrations.getMigrationArchiveLink( + { + org: "String", + id: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /orgs/:org/migrations/:id (getMigrationStatus)", function(next) { + client.migrations.getMigrationStatus( + { + org: "String", + id: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /orgs/:org/migrations (getMigrations)", function(next) { + client.migrations.getMigrations( + { + org: "String", + page: "Number", + per_page: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute PATCH /repos/:owner/:repo/import/authors/:author_id (mapImportCommitAuthor)", function(next) { + client.migrations.mapImportCommitAuthor( + { + owner: "String", + repo: "String", + author_id: "String", + email: "String", + name: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute PATCH /:owner/:name/import/lfs (setImportLfsPreference)", function(next) { + client.migrations.setImportLfsPreference( + { + owner: "String", + name: "String", + use_lfs: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute PUT /repos/:owner/:repo/import (startImport)", function(next) { + client.migrations.startImport( + { + owner: "String", + repo: "String", + vcs_url: "String", + vcs: "String", + vcs_username: "String", + vcs_password: "String", + tfvc_project: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute POST /orgs/:org/migrations (startMigration)", function(next) { + client.migrations.startMigration( + { + org: "String", + repositories: "Array", + lock_repositories: "Boolean", + exclude_attachments: "Boolean" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute DELETE /orgs/:org/migrations/:id/repos/:repo_name/lock (unlockRepoLockedForMigration)", function(next) { + client.migrations.unlockRepoLockedForMigration( + { + org: "String", + id: "String", + repo_name: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute PATCH /repos/:owner/:repo/import (updateImport)", function(next) { + client.migrations.updateImport( + { + owner: "String", + repo: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); +}); diff --git a/test/miscTest.js b/test/miscTest.js new file mode 100644 index 0000000000..bd7b2fce8b --- /dev/null +++ b/test/miscTest.js @@ -0,0 +1,150 @@ +/* + * Copyright 2012 Cloud9 IDE, Inc. + * + * This product includes software developed by + * Cloud9 IDE, Inc (http://c9.io). + * + * Author: Mike de Boer + */ + +"use strict"; + +var Assert = require("assert"); +var Client = require("./../lib/index"); +var testAuth = require("./../testAuth.json"); + +describe("[misc]", function() { + var client; + var token = testAuth["token"]; + + beforeEach(function() { + client = new Client(); + client.authenticate({ + type: "oauth", + token: token + }); + }); + + it("should successfully execute GET /emojis (getEmojis)", function(next) { + client.misc.getEmojis( + {}, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /gitignore/templates/:name (getGitignoreTemplate)", function(next) { + client.misc.getGitignoreTemplate( + { + name: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /gitignore/templates (getGitignoreTemplates)", function(next) { + client.misc.getGitignoreTemplates( + {}, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /licenses/:license (getLicense)", function(next) { + client.misc.getLicense( + { + license: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /licenses (getLicenses)", function(next) { + client.misc.getLicenses( + {}, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /meta (getMeta)", function(next) { + client.misc.getMeta( + {}, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /rate_limit (getRateLimit)", function(next) { + client.misc.getRateLimit( + {}, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /repos/:owner/:repo/license (getRepoLicense)", function(next) { + client.misc.getRepoLicense( + { + owner: "String", + repo: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute POST /markdown (renderMarkdown)", function(next) { + client.misc.renderMarkdown( + { + text: "String", + mode: "String", + context: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute POST /markdown/raw (renderMarkdownRaw)", function(next) { + client.misc.renderMarkdownRaw( + { + data: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); +}); diff --git a/test/oauth.js b/test/oauth.js deleted file mode 100644 index 3fbeadd663..0000000000 --- a/test/oauth.js +++ /dev/null @@ -1,95 +0,0 @@ -/** section: github, internal - * OAuth - * - * OAuth usage example. - * - * Copyright 2012 Cloud9 IDE, Inc. - * - * This product includes software developed by - * Cloud9 IDE, Inc (http://c9.io). - * - * Author: Mike de Boer - **/ - -var http = require("http"); -var Url = require("url"); -var querystring = require("querystring"); - -var Client = require("../index"); -var OAuth2 = require("oauth").OAuth2; - -var github = new Client({ - version: "3.0.0" -}); - -var clientId = "e8c434a1c92e9de7ff8d"; -var secret = "1d0fcbb060e1dd86a0aa3d12265419c9bb19a333"; -var oauth = new OAuth2(clientId, secret, "https://github.com/", "login/oauth/authorize", "login/oauth/access_token"); - -// for demo purposes use one global access token -// in production this has to be stored in a user session -var accessToken = ""; - -http.createServer(function(req, res) { - var url = Url.parse(req.url); - var path = url.pathname; - var query = querystring.parse(url.query); - - if (path == "/" || path.match(/^\/user\/?$/)) { - // redirect to github if there is no access token - if (!accessToken) { - res.writeHead(303, { - Location: oauth.getAuthorizeUrl({ - redirect_uri: 'http://localhost:7878/github-callback', - scope: "user,repo,gist" - }) - }); - res.end(); - return; - } - - // use github API - github.user.get({}, function(err, user) { - if (err) { - res.writeHead(err.code); - res.end(err + ""); - return; - } - res.writeHead(200); - res.end(JSON.stringify(user)); - }); - return; - } - // URL called by github after authenticating - else if (path.match(/^\/github-callback\/?$/)) { - // upgrade the code to an access token - oauth.getOAuthAccessToken(query.code, {}, function (err, access_token, refresh_token) { - if (err) { - console.log(err); - res.writeHead(500); - res.end(err + ""); - return; - } - - accessToken = access_token; - - // authenticate github API - github.authenticate({ - type: "oauth", - token: accessToken - }); - - //redirect back - res.writeHead(303, { - Location: "/" - }); - res.end(); - }); - return; - } - - res.writeHead(404); - res.end("404 - Not found"); -}).listen(7878); - -console.log("listening at http://localhost:7878"); diff --git a/test/oauth_server.js b/test/oauth_server.js deleted file mode 100644 index 1a2e7cf73b..0000000000 --- a/test/oauth_server.js +++ /dev/null @@ -1,59 +0,0 @@ -"use strict"; - -var GitHubApi = require("./../index"); - -var github = new GitHubApi({ - version: "3.0.0" -}); - -/* -!!!UNCOMMENT THE FOLLOWING TO MAKE THIS SCRIPT WORK, BUT CHANGE THE CREDENTIALS TO YOUR OWN!!! -github.authenticate({ - type: "basic", - username: "mikedeboertest", - password: "test1324" -}); -*/ - -github.authorization.getAll({}, function(err, res) { - if (err) - throw err; - - var ids = res.map(function(app) { return app.id; }); - - function next(id) { - github.authorization["delete"]({ - id: id - }, function(err, res) { - if (err) - throw err; - if (ids.length) - next(ids.shift()); - else - allRemoved(); - }); - } - - next(ids.shift()); - - function allRemoved() { - github.authorization.create({ - scopes: ["user", "public_repo", "repo", "repo:status", "delete_repo", "gist"], - note: "Authorization created to create unit tests", - note_url: "https://github.com/ajaxorg/node-github" - }, function(err, res) { - if (err) - throw err; - - // you can use the token within server-side apps. - // use it by doing: - // github.authenticate({ - // type: "oauth", - // token: e5a4a27487c26e571892846366de023349321a73 - // }); - console.log("TOKEN:", res.token); - console.log(res); - }); - } - -}); \ No newline at end of file diff --git a/test/orgsTest.js b/test/orgsTest.js new file mode 100644 index 0000000000..b138f6ac30 --- /dev/null +++ b/test/orgsTest.js @@ -0,0 +1,593 @@ +/* + * Copyright 2012 Cloud9 IDE, Inc. + * + * This product includes software developed by + * Cloud9 IDE, Inc (http://c9.io). + * + * Author: Mike de Boer + */ + +"use strict"; + +var Assert = require("assert"); +var Client = require("./../lib/index"); +var testAuth = require("./../testAuth.json"); + +describe("[orgs]", function() { + var client; + var token = testAuth["token"]; + + beforeEach(function() { + client = new Client(); + client.authenticate({ + type: "oauth", + token: token + }); + }); + + it("should successfully execute PUT /orgs/:org/memberships/:username (addOrgMembership)", function(next) { + client.orgs.addOrgMembership( + { + org: "String", + username: "String", + role: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute PUT /teams/:id/memberships/:username (addTeamMembership)", function(next) { + client.orgs.addTeamMembership( + { + id: "String", + username: "String", + role: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute PUT /teams/:id/repos/:org/:repo (addTeamRepo)", function(next) { + client.orgs.addTeamRepo( + { + id: "String", + org: "String", + repo: "String", + permission: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /orgs/:org/members/:username (checkMembership)", function(next) { + client.orgs.checkMembership( + { + org: "String", + username: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /orgs/:org/public_members/:username (checkPublicMembership)", function(next) { + client.orgs.checkPublicMembership( + { + org: "String", + username: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /teams/:id/repos/:owner/:repo (checkTeamRepo)", function(next) { + client.orgs.checkTeamRepo( + { + id: "String", + owner: "String", + repo: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute DELETE /orgs/:org/public_members/:username (concealMembership)", function(next) { + client.orgs.concealMembership( + { + org: "String", + username: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute PUT /orgs/:org/outside_collaborator/:username (convertMemberToOutsideCollaborator)", function(next) { + client.orgs.convertMemberToOutsideCollaborator( + { + org: "String", + username: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute POST /orgs/:org/hooks (createHook)", function(next) { + client.orgs.createHook( + { + org: "String", + name: "String", + config: "Json", + events: "Array", + active: "Boolean" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute POST /orgs/:org/teams (createTeam)", function(next) { + client.orgs.createTeam( + { + org: "String", + name: "String", + description: "String", + maintainers: "Array", + repo_names: "Array", + privacy: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute DELETE /orgs/:org/hooks/:id (deleteHook)", function(next) { + client.orgs.deleteHook( + { + org: "String", + id: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute DELETE /teams/:id (deleteTeam)", function(next) { + client.orgs.deleteTeam( + { + id: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute DELETE /teams/:id/repos/:owner/:repo (deleteTeamRepo)", function(next) { + client.orgs.deleteTeamRepo( + { + id: "String", + owner: "String", + repo: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute PATCH /orgs/:org/hooks/:id (editHook)", function(next) { + client.orgs.editHook( + { + org: "String", + id: "String", + config: "Json", + events: "Array", + active: "Boolean" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute PATCH /teams/:id (editTeam)", function(next) { + client.orgs.editTeam( + { + id: "String", + name: "String", + description: "String", + privacy: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /orgs/:org (get)", function(next) { + client.orgs.get( + { + org: "String", + page: "Number", + per_page: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /organizations (getAll)", function(next) { + client.orgs.getAll( + { + since: "String", + page: "Number", + per_page: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /users/:username/orgs (getForUser)", function(next) { + client.orgs.getForUser( + { + username: "String", + page: "Number", + per_page: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /orgs/:org/hooks/:id (getHook)", function(next) { + client.orgs.getHook( + { + org: "String", + id: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /orgs/:org/hooks (getHooks)", function(next) { + client.orgs.getHooks( + { + org: "String", + page: "Number", + per_page: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /orgs/:org/members (getMembers)", function(next) { + client.orgs.getMembers( + { + org: "String", + filter: "String", + role: "String", + page: "Number", + per_page: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /orgs/:org/memberships/:username (getOrgMembership)", function(next) { + client.orgs.getOrgMembership( + { + org: "String", + username: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /orgs/:org/outside_collaborators (getOutsideCollaborators)", function(next) { + client.orgs.getOutsideCollaborators( + { + org: "String", + page: "Number", + per_page: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /orgs/:org/invitations (getPendingOrgInvites)", function(next) { + client.orgs.getPendingOrgInvites( + { + org: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /teams/:id/invitations (getPendingTeamInvites)", function(next) { + client.orgs.getPendingTeamInvites( + { + id: "String", + page: "Number", + per_page: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /orgs/:org/public_members (getPublicMembers)", function(next) { + client.orgs.getPublicMembers( + { + org: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /teams/:id (getTeam)", function(next) { + client.orgs.getTeam( + { + id: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /teams/:id/members (getTeamMembers)", function(next) { + client.orgs.getTeamMembers( + { + id: "String", + role: "String", + page: "Number", + per_page: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /teams/:id/memberships/:username (getTeamMembership)", function(next) { + client.orgs.getTeamMembership( + { + id: "String", + username: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /teams/:id/repos (getTeamRepos)", function(next) { + client.orgs.getTeamRepos( + { + id: "String", + page: "Number", + per_page: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /orgs/:org/teams (getTeams)", function(next) { + client.orgs.getTeams( + { + org: "String", + page: "Number", + per_page: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute POST /orgs/:org/hooks/:id/pings (pingHook)", function(next) { + client.orgs.pingHook( + { + org: "String", + id: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute PUT /orgs/:org/public_members/:username (publicizeMembership)", function(next) { + client.orgs.publicizeMembership( + { + org: "String", + username: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute DELETE /orgs/:org/members/:username (removeMember)", function(next) { + client.orgs.removeMember( + { + org: "String", + username: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute DELETE /orgs/:org/memberships/:username (removeOrgMembership)", function(next) { + client.orgs.removeOrgMembership( + { + org: "String", + username: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute DELETE /orgs/:org/outside_collaborator/:username (removeOutsideCollaborator)", function(next) { + client.orgs.removeOutsideCollaborator( + { + org: "String", + username: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute DELETE /teams/:id/memberships/:username (removeTeamMembership)", function(next) { + client.orgs.removeTeamMembership( + { + id: "String", + username: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute PATCH /orgs/:org (update)", function(next) { + client.orgs.update( + { + org: "String", + billing_email: "String", + company: "String", + email: "String", + location: "String", + name: "String", + description: "String", + default_repository_permission: "String", + members_can_create_repositories: "Boolean" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); +}); diff --git a/test/projectsTest.js b/test/projectsTest.js new file mode 100644 index 0000000000..cdf5e3dadd --- /dev/null +++ b/test/projectsTest.js @@ -0,0 +1,291 @@ +/* + * Copyright 2012 Cloud9 IDE, Inc. + * + * This product includes software developed by + * Cloud9 IDE, Inc (http://c9.io). + * + * Author: Mike de Boer + */ + +"use strict"; + +var Assert = require("assert"); +var Client = require("./../lib/index"); +var testAuth = require("./../testAuth.json"); + +describe("[projects]", function() { + var client; + var token = testAuth["token"]; + + beforeEach(function() { + client = new Client(); + client.authenticate({ + type: "oauth", + token: token + }); + }); + + it("should successfully execute POST /orgs/:org/projects (createOrgProject)", function(next) { + client.projects.createOrgProject( + { + org: "String", + name: "String", + body: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute POST /projects/columns/:column_id/cards (createProjectCard)", function(next) { + client.projects.createProjectCard( + { + column_id: "String", + note: "String", + content_id: "String", + content_type: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute POST /projects/:project_id/columns (createProjectColumn)", function(next) { + client.projects.createProjectColumn( + { + project_id: "String", + name: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute POST /repos/:owner/:repo/projects (createRepoProject)", function(next) { + client.projects.createRepoProject( + { + owner: "String", + repo: "String", + name: "String", + body: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute DELETE /projects/:id (deleteProject)", function(next) { + client.projects.deleteProject( + { + id: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute DELETE /projects/columns/cards/:id (deleteProjectCard)", function(next) { + client.projects.deleteProjectCard( + { + id: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute DELETE /projects/columns/:id (deleteProjectColumn)", function(next) { + client.projects.deleteProjectColumn( + { + id: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /orgs/:org/projects (getOrgProjects)", function(next) { + client.projects.getOrgProjects( + { + org: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /projects/:id (getProject)", function(next) { + client.projects.getProject( + { + id: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /projects/columns/cards/:id (getProjectCard)", function(next) { + client.projects.getProjectCard( + { + id: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /projects/columns/:column_id/cards (getProjectCards)", function(next) { + client.projects.getProjectCards( + { + column_id: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /projects/columns/:id (getProjectColumn)", function(next) { + client.projects.getProjectColumn( + { + id: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /projects/:project_id/columns (getProjectColumns)", function(next) { + client.projects.getProjectColumns( + { + project_id: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /repos/:owner/:repo/projects (getRepoProjects)", function(next) { + client.projects.getRepoProjects( + { + owner: "String", + repo: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute POST /projects/columns/cards/:id/moves (moveProjectCard)", function(next) { + client.projects.moveProjectCard( + { + id: "String", + position: "String", + column_id: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute POST /projects/columns/:id/moves (moveProjectColumn)", function(next) { + client.projects.moveProjectColumn( + { + id: "String", + position: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute PATCH /projects/:id (updateProject)", function(next) { + client.projects.updateProject( + { + id: "String", + name: "String", + body: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute PATCH /projects/columns/cards/:id (updateProjectCard)", function(next) { + client.projects.updateProjectCard( + { + id: "String", + note: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute PATCH /projects/columns/:id (updateProjectColumn)", function(next) { + client.projects.updateProjectColumn( + { + id: "String", + name: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); +}); diff --git a/test/pullRequestsTest.js b/test/pullRequestsTest.js new file mode 100644 index 0000000000..2c60f7ec1c --- /dev/null +++ b/test/pullRequestsTest.js @@ -0,0 +1,463 @@ +/* + * Copyright 2012 Cloud9 IDE, Inc. + * + * This product includes software developed by + * Cloud9 IDE, Inc (http://c9.io). + * + * Author: Mike de Boer + */ + +"use strict"; + +var Assert = require("assert"); +var Client = require("./../lib/index"); +var testAuth = require("./../testAuth.json"); + +describe("[pullRequests]", function() { + var client; + var token = testAuth["token"]; + + beforeEach(function() { + client = new Client(); + client.authenticate({ + type: "oauth", + token: token + }); + }); + + it("should successfully execute GET /repos/:owner/:repo/pulls/:number/merge (checkMerged)", function(next) { + client.pullRequests.checkMerged( + { + owner: "String", + repo: "String", + number: "Number", + page: "Number", + per_page: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute POST /repos/:owner/:repo/pulls (create)", function(next) { + client.pullRequests.create( + { + owner: "String", + repo: "String", + title: "String", + head: "String", + base: "String", + body: "String", + maintainer_can_modify: "Boolean" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute POST /repos/:owner/:repo/pulls/:number/comments (createComment)", function(next) { + client.pullRequests.createComment( + { + owner: "String", + repo: "String", + number: "Number", + body: "String", + commit_id: "String", + path: "String", + position: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute POST /repos/:owner/:repo/pulls/:number/comments (createCommentReply)", function(next) { + client.pullRequests.createCommentReply( + { + owner: "String", + repo: "String", + number: "Number", + body: "String", + in_reply_to: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute POST /repos/:owner/:repo/pulls (createFromIssue)", function(next) { + client.pullRequests.createFromIssue( + { + owner: "String", + repo: "String", + issue: "Number", + head: "String", + base: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute POST /repos/:owner/:repo/pulls/:number/reviews (createReview)", function(next) { + client.pullRequests.createReview( + { + owner: "String", + repo: "String", + number: "Number", + body: "String", + event: "String", + comments: "Array", + path: "String", + position: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute POST /repos/:owner/:repo/pulls/:number/requested_reviewers (createReviewRequest)", function(next) { + client.pullRequests.createReviewRequest( + { + owner: "String", + repo: "String", + number: "Number", + reviewers: "Array" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute DELETE /repos/:owner/:repo/pulls/comments/:id (deleteComment)", function(next) { + client.pullRequests.deleteComment( + { + owner: "String", + repo: "String", + id: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute DELETE /repos/:owner/:repo/pulls/:number/requested_reviewers (deleteReviewRequest)", function(next) { + client.pullRequests.deleteReviewRequest( + { + owner: "String", + repo: "String", + number: "Number", + reviewers: "Array" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute PUT /repos/:owner/:repo/pulls/:number/reviews/:id/dismissals (dismissReview)", function(next) { + client.pullRequests.dismissReview( + { + owner: "String", + repo: "String", + number: "Number", + id: "String", + message: "String", + page: "Number", + per_page: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute PATCH /repos/:owner/:repo/pulls/comments/:id (editComment)", function(next) { + client.pullRequests.editComment( + { + owner: "String", + repo: "String", + id: "String", + body: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /repos/:owner/:repo/pulls/:number (get)", function(next) { + client.pullRequests.get( + { + owner: "String", + repo: "String", + number: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /repos/:owner/:repo/pulls (getAll)", function(next) { + client.pullRequests.getAll( + { + owner: "String", + repo: "String", + state: "String", + head: "String", + base: "String", + sort: "String", + direction: "String", + page: "Number", + per_page: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /repos/:owner/:repo/pulls/comments/:id (getComment)", function(next) { + client.pullRequests.getComment( + { + owner: "String", + repo: "String", + id: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /repos/:owner/:repo/pulls/:number/comments (getComments)", function(next) { + client.pullRequests.getComments( + { + owner: "String", + repo: "String", + number: "Number", + page: "Number", + per_page: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /repos/:owner/:repo/pulls/comments (getCommentsForRepo)", function(next) { + client.pullRequests.getCommentsForRepo( + { + owner: "String", + repo: "String", + sort: "String", + direction: "String", + since: "Date", + page: "Number", + per_page: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /repos/:owner/:repo/pulls/:number/commits (getCommits)", function(next) { + client.pullRequests.getCommits( + { + owner: "String", + repo: "String", + number: "Number", + page: "Number", + per_page: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /repos/:owner/:repo/pulls/:number/files (getFiles)", function(next) { + client.pullRequests.getFiles( + { + owner: "String", + repo: "String", + number: "Number", + page: "Number", + per_page: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /repos/:owner/:repo/pulls/:number/reviews/:id (getReview)", function(next) { + client.pullRequests.getReview( + { + owner: "String", + repo: "String", + number: "Number", + id: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /repos/:owner/:repo/pulls/:number/reviews/:id/comments (getReviewComments)", function(next) { + client.pullRequests.getReviewComments( + { + owner: "String", + repo: "String", + number: "Number", + id: "String", + page: "Number", + per_page: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /repos/:owner/:repo/pulls/:number/requested_reviewers (getReviewRequests)", function(next) { + client.pullRequests.getReviewRequests( + { + owner: "String", + repo: "String", + number: "Number", + page: "Number", + per_page: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /repos/:owner/:repo/pulls/:number/reviews (getReviews)", function(next) { + client.pullRequests.getReviews( + { + owner: "String", + repo: "String", + number: "Number", + page: "Number", + per_page: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute PUT /repos/:owner/:repo/pulls/:number/merge (merge)", function(next) { + client.pullRequests.merge( + { + owner: "String", + repo: "String", + number: "Number", + commit_title: "String", + commit_message: "String", + sha: "String", + merge_method: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute POST /repos/:owner/:repo/pulls/:number/reviews/:id/events (submitReview)", function(next) { + client.pullRequests.submitReview( + { + owner: "String", + repo: "String", + number: "Number", + id: "String", + body: "String", + event: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute PATCH /repos/:owner/:repo/pulls/:number (update)", function(next) { + client.pullRequests.update( + { + owner: "String", + repo: "String", + number: "Number", + title: "String", + body: "String", + state: "String", + base: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); +}); diff --git a/test/reactionsTest.js b/test/reactionsTest.js new file mode 100644 index 0000000000..594b29cda7 --- /dev/null +++ b/test/reactionsTest.js @@ -0,0 +1,168 @@ +/* + * Copyright 2012 Cloud9 IDE, Inc. + * + * This product includes software developed by + * Cloud9 IDE, Inc (http://c9.io). + * + * Author: Mike de Boer + */ + +"use strict"; + +var Assert = require("assert"); +var Client = require("./../lib/index"); +var testAuth = require("./../testAuth.json"); + +describe("[reactions]", function() { + var client; + var token = testAuth["token"]; + + beforeEach(function() { + client = new Client(); + client.authenticate({ + type: "oauth", + token: token + }); + }); + + it("should successfully execute POST /repos/:owner/:repo/comments/:id/reactions (createForCommitComment)", function(next) { + client.reactions.createForCommitComment( + { + owner: "String", + repo: "String", + id: "String", + content: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute POST /repos/:owner/:repo/issues/:number/reactions (createForIssue)", function(next) { + client.reactions.createForIssue( + { + owner: "String", + repo: "String", + number: "Number", + content: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute POST /repos/:owner/:repo/issues/comments/:id/reactions (createForIssueComment)", function(next) { + client.reactions.createForIssueComment( + { + owner: "String", + repo: "String", + id: "String", + content: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute POST /repos/:owner/:repo/pulls/comments/:id/reactions (createForPullRequestReviewComment)", function(next) { + client.reactions.createForPullRequestReviewComment( + { + owner: "String", + repo: "String", + id: "String", + content: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute DELETE /reactions/:id (delete)", function(next) { + client.reactions.delete( + { + id: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /repos/:owner/:repo/comments/:id/reactions (getForCommitComment)", function(next) { + client.reactions.getForCommitComment( + { + owner: "String", + repo: "String", + id: "String", + content: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /repos/:owner/:repo/issues/:number/reactions (getForIssue)", function(next) { + client.reactions.getForIssue( + { + owner: "String", + repo: "String", + number: "Number", + content: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /repos/:owner/:repo/issues/comments/:id/reactions (getForIssueComment)", function(next) { + client.reactions.getForIssueComment( + { + owner: "String", + repo: "String", + id: "String", + content: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /repos/:owner/:repo/pulls/comments/:id/reactions (getForPullRequestReviewComment)", function(next) { + client.reactions.getForPullRequestReviewComment( + { + owner: "String", + repo: "String", + id: "String", + content: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); +}); diff --git a/test/reposTest.js b/test/reposTest.js new file mode 100644 index 0000000000..51f035f756 --- /dev/null +++ b/test/reposTest.js @@ -0,0 +1,1907 @@ +/* + * Copyright 2012 Cloud9 IDE, Inc. + * + * This product includes software developed by + * Cloud9 IDE, Inc (http://c9.io). + * + * Author: Mike de Boer + */ + +"use strict"; + +var Assert = require("assert"); +var Client = require("./../lib/index"); +var testAuth = require("./../testAuth.json"); + +describe("[repos]", function() { + var client; + var token = testAuth["token"]; + + beforeEach(function() { + client = new Client(); + client.authenticate({ + type: "oauth", + token: token + }); + }); + + it("should successfully execute PUT /repos/:owner/:repo/collaborators/:username (addCollaborator)", function(next) { + client.repos.addCollaborator( + { + owner: "String", + repo: "String", + username: "String", + permission: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute POST /repos/:owner/:repo/branches/:branch/protection/required_status_checks/contexts (addProtectedBranchRequiredStatusChecksContexts)", function(next) { + client.repos.addProtectedBranchRequiredStatusChecksContexts( + { + owner: "String", + repo: "String", + branch: "String", + contexts: "Array" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute POST /repos/:owner/:repo/branches/:branch/protection/restrictions/teams (addProtectedBranchTeamRestrictions)", function(next) { + client.repos.addProtectedBranchTeamRestrictions( + { + owner: "String", + repo: "String", + branch: "String", + teams: "Array" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute POST /repos/:owner/:repo/branches/:branch/protection/restrictions/users (addProtectedBranchUserRestrictions)", function(next) { + client.repos.addProtectedBranchUserRestrictions( + { + owner: "String", + repo: "String", + branch: "String", + users: "Array" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /repos/:owner/:repo/collaborators/:username (checkCollaborator)", function(next) { + client.repos.checkCollaborator( + { + owner: "String", + repo: "String", + username: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /repos/:owner/:repo/compare/:base...:head (compareCommits)", function(next) { + client.repos.compareCommits( + { + owner: "String", + repo: "String", + base: "String", + head: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute POST /user/repos (create)", function(next) { + client.repos.create( + { + name: "String", + description: "String", + homepage: "String", + private: "Boolean", + has_issues: "Boolean", + has_wiki: "Boolean", + has_downloads: "Boolean", + team_id: "Number", + auto_init: "Boolean", + gitignore_template: "String", + license_template: "String", + allow_squash_merge: "Boolean", + allow_merge_commit: "Boolean", + allow_rebase_merge: "Boolean" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute POST /repos/:owner/:repo/commits/:sha/comments (createCommitComment)", function(next) { + client.repos.createCommitComment( + { + owner: "String", + repo: "String", + sha: "String", + body: "String", + path: "String", + position: "Number", + line: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute POST /repos/:owner/:repo/deployments (createDeployment)", function(next) { + client.repos.createDeployment( + { + owner: "String", + repo: "String", + ref: "String", + task: "String", + auto_merge: "Boolean", + required_contexts: "Array", + payload: "String", + environment: "String", + description: "String", + transient_environment: "Boolean", + production_environment: "Boolean" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute POST /repos/:owner/:repo/deployments/:id/statuses (createDeploymentStatus)", function(next) { + client.repos.createDeploymentStatus( + { + owner: "String", + repo: "String", + id: "String", + state: "String", + target_url: "String", + log_url: "String", + description: "String", + environment_url: "String", + auto_inactive: "Boolean" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute PUT /repos/:owner/:repo/contents/:path (createFile)", function(next) { + client.repos.createFile( + { + owner: "String", + repo: "String", + path: "String", + message: "String", + content: "String", + branch: "String", + committer: "Json" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute POST /orgs/:org/repos (createForOrg)", function(next) { + client.repos.createForOrg( + { + org: "String", + name: "String", + description: "String", + homepage: "String", + private: "Boolean", + has_issues: "Boolean", + has_wiki: "Boolean", + has_downloads: "Boolean", + team_id: "Number", + auto_init: "Boolean", + gitignore_template: "String", + license_template: "String", + allow_squash_merge: "Boolean", + allow_merge_commit: "Boolean", + allow_rebase_merge: "Boolean" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute POST /repos/:owner/:repo/hooks (createHook)", function(next) { + client.repos.createHook( + { + owner: "String", + repo: "String", + name: "String", + config: "Json", + events: "Array", + active: "Boolean" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute POST /repos/:owner/:repo/keys (createKey)", function(next) { + client.repos.createKey( + { + owner: "String", + repo: "String", + title: "String", + key: "String", + read_only: "Boolean" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute POST /repos/:owner/:repo/releases (createRelease)", function(next) { + client.repos.createRelease( + { + owner: "String", + repo: "String", + tag_name: "String", + target_commitish: "String", + name: "String", + body: "String", + draft: "Boolean", + prerelease: "Boolean" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute POST /repos/:owner/:repo/statuses/:sha (createStatus)", function(next) { + client.repos.createStatus( + { + owner: "String", + repo: "String", + sha: "String", + state: "String", + target_url: "String", + description: "String", + context: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute DELETE /repos/:owner/:repo (delete)", function(next) { + client.repos.delete( + { + owner: "String", + repo: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute DELETE /repos/:owner/:repo/releases/assets/:id (deleteAsset)", function(next) { + client.repos.deleteAsset( + { + owner: "String", + repo: "String", + id: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute DELETE /repos/:owner/:repo/comments/:id (deleteCommitComment)", function(next) { + client.repos.deleteCommitComment( + { + owner: "String", + repo: "String", + id: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute DELETE /repos/:owner/:repo/downloads/:id (deleteDownload)", function(next) { + client.repos.deleteDownload( + { + owner: "String", + repo: "String", + id: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute DELETE /repos/:owner/:repo/contents/:path (deleteFile)", function(next) { + client.repos.deleteFile( + { + owner: "String", + repo: "String", + path: "String", + message: "String", + sha: "String", + branch: "String", + committer: "Json" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute DELETE /repos/:owner/:repo/hooks/:id (deleteHook)", function(next) { + client.repos.deleteHook( + { + owner: "String", + repo: "String", + id: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute DELETE /repositories/:repo_id/invitations/:invitation_id (deleteInvite)", function(next) { + client.repos.deleteInvite( + { + repo_id: "String", + invitation_id: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute DELETE /repos/:owner/:repo/keys/:id (deleteKey)", function(next) { + client.repos.deleteKey( + { + owner: "String", + repo: "String", + id: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute DELETE /repos/:owner/:repo/releases/:id (deleteRelease)", function(next) { + client.repos.deleteRelease( + { + owner: "String", + repo: "String", + id: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute PATCH /repos/:owner/:repo (edit)", function(next) { + client.repos.edit( + { + owner: "String", + repo: "String", + name: "String", + description: "String", + homepage: "String", + private: "Boolean", + has_issues: "Boolean", + has_wiki: "Boolean", + has_downloads: "Boolean", + default_branch: "String", + allow_squash_merge: "Boolean", + allow_merge_commit: "Boolean", + allow_rebase_merge: "Boolean" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute PATCH /repos/:owner/:repo/releases/assets/:id (editAsset)", function(next) { + client.repos.editAsset( + { + owner: "String", + repo: "String", + id: "String", + name: "String", + label: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute PATCH /repos/:owner/:repo/hooks/:id (editHook)", function(next) { + client.repos.editHook( + { + owner: "String", + repo: "String", + id: "String", + name: "String", + config: "Json", + events: "Array", + add_events: "Array", + remove_events: "Array", + active: "Boolean" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute PATCH /repos/:owner/:repo/releases/:id (editRelease)", function(next) { + client.repos.editRelease( + { + owner: "String", + repo: "String", + id: "String", + tag_name: "String", + target_commitish: "String", + name: "String", + body: "String", + draft: "Boolean", + prerelease: "Boolean" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute POST /repos/:owner/:repo/forks (fork)", function(next) { + client.repos.fork( + { + owner: "String", + repo: "String", + organization: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /repos/:owner/:repo (get)", function(next) { + client.repos.get( + { + owner: "String", + repo: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /user/repos (getAll)", function(next) { + client.repos.getAll( + { + visibility: "String", + affiliation: "String", + type: "String", + sort: "String", + direction: "String", + page: "Number", + per_page: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /repos/:owner/:repo/comments (getAllCommitComments)", function(next) { + client.repos.getAllCommitComments( + { + owner: "String", + repo: "String", + page: "Number", + per_page: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /repos/:owner/:repo/:archive_format/:ref (getArchiveLink)", function(next) { + client.repos.getArchiveLink( + { + owner: "String", + repo: "String", + archive_format: "String", + ref: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /repos/:owner/:repo/releases/assets/:id (getAsset)", function(next) { + client.repos.getAsset( + { + owner: "String", + repo: "String", + id: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /repos/:owner/:repo/releases/:id/assets (getAssets)", function(next) { + client.repos.getAssets( + { + owner: "String", + repo: "String", + id: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /repos/:owner/:repo/branches/:branch (getBranch)", function(next) { + client.repos.getBranch( + { + owner: "String", + repo: "String", + branch: "String", + page: "Number", + per_page: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /repos/:owner/:repo/branches/:branch/protection (getBranchProtection)", function(next) { + client.repos.getBranchProtection( + { + owner: "String", + repo: "String", + branch: "String", + page: "Number", + per_page: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /repos/:owner/:repo/branches (getBranches)", function(next) { + client.repos.getBranches( + { + owner: "String", + repo: "String", + protected: "Boolean", + page: "Number", + per_page: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /repositories/:id (getById)", function(next) { + client.repos.getById( + { + id: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /repos/:owner/:repo/traffic/clones (getClones)", function(next) { + client.repos.getClones( + { + owner: "String", + repo: "String", + page: "Number", + per_page: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /repos/:owner/:repo/collaborators (getCollaborators)", function(next) { + client.repos.getCollaborators( + { + owner: "String", + repo: "String", + affiliation: "String", + page: "Number", + per_page: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /repos/:owner/:repo/commits/:ref/status (getCombinedStatus)", function(next) { + client.repos.getCombinedStatus( + { + owner: "String", + repo: "String", + ref: "String", + page: "Number", + per_page: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /repos/:owner/:repo/commits/:sha (getCommit)", function(next) { + client.repos.getCommit( + { + owner: "String", + repo: "String", + sha: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /repos/:owner/:repo/comments/:id (getCommitComment)", function(next) { + client.repos.getCommitComment( + { + owner: "String", + repo: "String", + id: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /repos/:owner/:repo/commits/:ref/comments (getCommitComments)", function(next) { + client.repos.getCommitComments( + { + owner: "String", + repo: "String", + ref: "String", + page: "Number", + per_page: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /repos/:owner/:repo/commits (getCommits)", function(next) { + client.repos.getCommits( + { + owner: "String", + repo: "String", + sha: "String", + path: "String", + author: "String", + since: "Date", + until: "Date", + page: "Number", + per_page: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /repositories/:repo_id/community/profile (getCommunityHealthMetrics)", function(next) { + client.repos.getCommunityHealthMetrics( + { + repo_id: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /repos/:owner/:repo/contents/:path (getContent)", function(next) { + client.repos.getContent( + { + owner: "String", + repo: "String", + path: "String", + ref: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /repos/:owner/:repo/contributors (getContributors)", function(next) { + client.repos.getContributors( + { + owner: "String", + repo: "String", + anon: "Boolean", + page: "Number", + per_page: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /repos/:owner/:repo/deployments/:id/statuses (getDeploymentStatuses)", function(next) { + client.repos.getDeploymentStatuses( + { + owner: "String", + repo: "String", + id: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /repos/:owner/:repo/deployments (getDeployments)", function(next) { + client.repos.getDeployments( + { + owner: "String", + repo: "String", + sha: "String", + ref: "String", + task: "String", + environment: "String", + page: "Number", + per_page: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /repos/:owner/:repo/downloads/:id (getDownload)", function(next) { + client.repos.getDownload( + { + owner: "String", + repo: "String", + id: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /repos/:owner/:repo/downloads (getDownloads)", function(next) { + client.repos.getDownloads( + { + owner: "String", + repo: "String", + page: "Number", + per_page: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /orgs/:org/repos (getForOrg)", function(next) { + client.repos.getForOrg( + { + org: "String", + type: "String", + page: "Number", + per_page: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /users/:username/repos (getForUser)", function(next) { + client.repos.getForUser( + { + username: "String", + type: "String", + sort: "String", + direction: "String", + page: "Number", + per_page: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /repos/:owner/:repo/forks (getForks)", function(next) { + client.repos.getForks( + { + owner: "String", + repo: "String", + sort: "String", + page: "Number", + per_page: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /repos/:owner/:repo/hooks/:id (getHook)", function(next) { + client.repos.getHook( + { + owner: "String", + repo: "String", + id: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /repos/:owner/:repo/hooks (getHooks)", function(next) { + client.repos.getHooks( + { + owner: "String", + repo: "String", + page: "Number", + per_page: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /repositories/:repo_id/invitations (getInvites)", function(next) { + client.repos.getInvites( + { + repo_id: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /repos/:owner/:repo/keys/:id (getKey)", function(next) { + client.repos.getKey( + { + owner: "String", + repo: "String", + id: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /repos/:owner/:repo/keys (getKeys)", function(next) { + client.repos.getKeys( + { + owner: "String", + repo: "String", + page: "Number", + per_page: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /repos/:owner/:repo/languages (getLanguages)", function(next) { + client.repos.getLanguages( + { + owner: "String", + repo: "String", + page: "Number", + per_page: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /repos/:owner/:repo/pages/builds/latest (getLatestPagesBuild)", function(next) { + client.repos.getLatestPagesBuild( + { + owner: "String", + repo: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /repos/:owner/:repo/releases/latest (getLatestRelease)", function(next) { + client.repos.getLatestRelease( + { + owner: "String", + repo: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /repos/:owner/:repo/pages (getPages)", function(next) { + client.repos.getPages( + { + owner: "String", + repo: "String", + page: "Number", + per_page: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /repos/:owner/:repo/pages/builds/:id (getPagesBuild)", function(next) { + client.repos.getPagesBuild( + { + owner: "String", + repo: "String", + id: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /repos/:owner/:repo/pages/builds (getPagesBuilds)", function(next) { + client.repos.getPagesBuilds( + { + owner: "String", + repo: "String", + page: "Number", + per_page: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /repos/:owner/:repo/traffic/popular/paths (getPaths)", function(next) { + client.repos.getPaths( + { + owner: "String", + repo: "String", + page: "Number", + per_page: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /repos/:owner/:repo/branches/:branch/protection/required_pull_request_reviews (getProtectedBranchPullRequestReviewEnforcement)", function(next) { + client.repos.getProtectedBranchPullRequestReviewEnforcement( + { + owner: "String", + repo: "String", + branch: "String", + page: "Number", + per_page: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /repos/:owner/:repo/branches/:branch/protection/required_status_checks (getProtectedBranchRequiredStatusChecks)", function(next) { + client.repos.getProtectedBranchRequiredStatusChecks( + { + owner: "String", + repo: "String", + branch: "String", + page: "Number", + per_page: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /repos/:owner/:repo/branches/:branch/protection/required_status_checks/contexts (getProtectedBranchRequiredStatusChecksContexts)", function(next) { + client.repos.getProtectedBranchRequiredStatusChecksContexts( + { + owner: "String", + repo: "String", + branch: "String", + page: "Number", + per_page: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /repos/:owner/:repo/branches/:branch/protection/restrictions (getProtectedBranchRestrictions)", function(next) { + client.repos.getProtectedBranchRestrictions( + { + owner: "String", + repo: "String", + branch: "String", + page: "Number", + per_page: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /repos/:owner/:repo/branches/:branch/protection/restrictions/teams (getProtectedBranchTeamRestrictions)", function(next) { + client.repos.getProtectedBranchTeamRestrictions( + { + owner: "String", + repo: "String", + branch: "String", + page: "Number", + per_page: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /repos/:owner/:repo/branches/:branch/protection/restrictions/users (getProtectedBranchUserRestrictions)", function(next) { + client.repos.getProtectedBranchUserRestrictions( + { + owner: "String", + repo: "String", + branch: "String", + page: "Number", + per_page: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /repositories (getPublic)", function(next) { + client.repos.getPublic( + { + since: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /repos/:owner/:repo/readme (getReadme)", function(next) { + client.repos.getReadme( + { + owner: "String", + repo: "String", + ref: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /repos/:owner/:repo/traffic/popular/referrers (getReferrers)", function(next) { + client.repos.getReferrers( + { + owner: "String", + repo: "String", + page: "Number", + per_page: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /repos/:owner/:repo/releases/:id (getRelease)", function(next) { + client.repos.getRelease( + { + owner: "String", + repo: "String", + id: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /repos/:owner/:repo/releases/tags/:tag (getReleaseByTag)", function(next) { + client.repos.getReleaseByTag( + { + owner: "String", + repo: "String", + tag: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /repos/:owner/:repo/releases (getReleases)", function(next) { + client.repos.getReleases( + { + owner: "String", + repo: "String", + page: "Number", + per_page: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /repos/:owner/:repo/commits/:ref (getShaOfCommitRef)", function(next) { + client.repos.getShaOfCommitRef( + { + owner: "String", + repo: "String", + ref: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /repos/:owner/:repo/stats/code_frequency (getStatsCodeFrequency)", function(next) { + client.repos.getStatsCodeFrequency( + { + owner: "String", + repo: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /repos/:owner/:repo/stats/commit_activity (getStatsCommitActivity)", function(next) { + client.repos.getStatsCommitActivity( + { + owner: "String", + repo: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /repos/:owner/:repo/stats/contributors (getStatsContributors)", function(next) { + client.repos.getStatsContributors( + { + owner: "String", + repo: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /repos/:owner/:repo/stats/participation (getStatsParticipation)", function(next) { + client.repos.getStatsParticipation( + { + owner: "String", + repo: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /repos/:owner/:repo/stats/punch_card (getStatsPunchCard)", function(next) { + client.repos.getStatsPunchCard( + { + owner: "String", + repo: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /repos/:owner/:repo/commits/:ref/statuses (getStatuses)", function(next) { + client.repos.getStatuses( + { + owner: "String", + repo: "String", + ref: "String", + page: "Number", + per_page: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /repos/:owner/:repo/tags (getTags)", function(next) { + client.repos.getTags( + { + owner: "String", + repo: "String", + page: "Number", + per_page: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /repos/:owner/:repo/teams (getTeams)", function(next) { + client.repos.getTeams( + { + owner: "String", + repo: "String", + page: "Number", + per_page: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /repos/:owner/:repo/traffic/views (getViews)", function(next) { + client.repos.getViews( + { + owner: "String", + repo: "String", + page: "Number", + per_page: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute POST /repos/:owner/:repo/merges (merge)", function(next) { + client.repos.merge( + { + owner: "String", + repo: "String", + base: "String", + head: "String", + commit_message: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute POST /repos/:owner/:repo/hooks/:id/pings (pingHook)", function(next) { + client.repos.pingHook( + { + owner: "String", + repo: "String", + id: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute DELETE /repos/:owner/:repo/branches/:branch/protection (removeBranchProtection)", function(next) { + client.repos.removeBranchProtection( + { + owner: "String", + repo: "String", + branch: "String", + page: "Number", + per_page: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute DELETE /repos/:owner/:repo/collaborators/:username (removeCollaborator)", function(next) { + client.repos.removeCollaborator( + { + owner: "String", + repo: "String", + username: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute DELETE /repos/:owner/:repo/branches/:branch/protection/required_pull_request_reviews (removeProtectedBranchPullRequestReviewEnforcement)", function(next) { + client.repos.removeProtectedBranchPullRequestReviewEnforcement( + { + owner: "String", + repo: "String", + branch: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute DELETE /repos/:owner/:repo/branches/:branch/protection/required_status_checks (removeProtectedBranchRequiredStatusChecks)", function(next) { + client.repos.removeProtectedBranchRequiredStatusChecks( + { + owner: "String", + repo: "String", + branch: "String", + page: "Number", + per_page: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute DELETE /repos/:owner/:repo/branches/:branch/protection/required_status_checks/contexts (removeProtectedBranchRequiredStatusChecksContexts)", function(next) { + client.repos.removeProtectedBranchRequiredStatusChecksContexts( + { + owner: "String", + repo: "String", + branch: "String", + contexts: "Array" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute DELETE /repos/:owner/:repo/branches/:branch/protection/restrictions (removeProtectedBranchRestrictions)", function(next) { + client.repos.removeProtectedBranchRestrictions( + { + owner: "String", + repo: "String", + branch: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute DELETE /repos/:owner/:repo/branches/:branch/protection/restrictions/teams (removeProtectedBranchTeamRestrictions)", function(next) { + client.repos.removeProtectedBranchTeamRestrictions( + { + owner: "String", + repo: "String", + branch: "String", + teams: "Array" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute DELETE /repos/:owner/:repo/branches/:branch/protection/restrictions/users (removeProtectedBranchUserRestrictions)", function(next) { + client.repos.removeProtectedBranchUserRestrictions( + { + owner: "String", + repo: "String", + branch: "String", + users: "Array" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute PUT /repos/:owner/:repo/branches/:branch/protection/required_status_checks/contexts (replaceProtectedBranchRequiredStatusChecksContexts)", function(next) { + client.repos.replaceProtectedBranchRequiredStatusChecksContexts( + { + owner: "String", + repo: "String", + branch: "String", + contexts: "Array" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute PUT /repos/:owner/:repo/branches/:branch/protection/restrictions/teams (replaceProtectedBranchTeamRestrictions)", function(next) { + client.repos.replaceProtectedBranchTeamRestrictions( + { + owner: "String", + repo: "String", + branch: "String", + teams: "Array" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute PUT /repos/:owner/:repo/branches/:branch/protection/restrictions/users (replaceProtectedBranchUserRestrictions)", function(next) { + client.repos.replaceProtectedBranchUserRestrictions( + { + owner: "String", + repo: "String", + branch: "String", + users: "Array" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute POST /repos/:owner/:repo/pages/builds (requestPageBuild)", function(next) { + client.repos.requestPageBuild( + { + owner: "String", + repo: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /repos/:owner/:repo/collaborators/:username/permission (reviewUserPermissionLevel)", function(next) { + client.repos.reviewUserPermissionLevel( + { + owner: "String", + repo: "String", + username: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute POST /repos/:owner/:repo/hooks/:id/tests (testHook)", function(next) { + client.repos.testHook( + { + owner: "String", + repo: "String", + id: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute PUT /repos/:owner/:repo/branches/:branch/protection (updateBranchProtection)", function(next) { + client.repos.updateBranchProtection( + { + owner: "String", + repo: "String", + branch: "String", + required_status_checks: "Json", + required_pull_request_reviews: "Json", + restrictions: "Json", + page: "Number", + per_page: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute PATCH /repos/:owner/:repo/comments/:id (updateCommitComment)", function(next) { + client.repos.updateCommitComment( + { + owner: "String", + repo: "String", + id: "String", + body: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute PUT /repos/:owner/:repo/contents/:path (updateFile)", function(next) { + client.repos.updateFile( + { + owner: "String", + repo: "String", + path: "String", + message: "String", + content: "String", + sha: "String", + branch: "String", + committer: "Json" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute PATCH /repositories/:repo_id/invitations/:invitation_id (updateInvite)", function(next) { + client.repos.updateInvite( + { + repo_id: "String", + invitation_id: "String", + permission: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute PATCH /repos/:owner/:repo/branches/:branch/protection/required_pull_request_reviews (updateProtectedBranchPullRequestReviewEnforcement)", function(next) { + client.repos.updateProtectedBranchPullRequestReviewEnforcement( + { + owner: "String", + repo: "String", + branch: "String", + include_admins: "Boolean" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute PATCH /repos/:owner/:repo/branches/:branch/protection/required_status_checks (updateProtectedBranchRequiredStatusChecks)", function(next) { + client.repos.updateProtectedBranchRequiredStatusChecks( + { + owner: "String", + repo: "String", + branch: "String", + include_admins: "Boolean", + strict: "Boolean", + contexts: "Array", + page: "Number", + per_page: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute POST /repos/:owner/:repo/releases/:id/assets (uploadAsset)", function(next) { + client.repos.uploadAsset( + { + owner: "String", + repo: "String", + id: "String", + filePath: "String", + name: "String", + label: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); +}); diff --git a/test/searchTest.js b/test/searchTest.js new file mode 100644 index 0000000000..85649d60bd --- /dev/null +++ b/test/searchTest.js @@ -0,0 +1,125 @@ +/* + * Copyright 2012 Cloud9 IDE, Inc. + * + * This product includes software developed by + * Cloud9 IDE, Inc (http://c9.io). + * + * Author: Mike de Boer + */ + +"use strict"; + +var Assert = require("assert"); +var Client = require("./../lib/index"); +var testAuth = require("./../testAuth.json"); + +describe("[search]", function() { + var client; + var token = testAuth["token"]; + + beforeEach(function() { + client = new Client(); + client.authenticate({ + type: "oauth", + token: token + }); + }); + + it("should successfully execute GET /search/code (code)", function(next) { + client.search.code( + { + q: "String", + sort: "String", + order: "String", + page: "Number", + per_page: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /search/commits (commits)", function(next) { + client.search.commits( + { + q: "String", + sort: "String", + order: "String", + page: "Number", + per_page: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /legacy/user/email/:email (email)", function(next) { + client.search.email( + { + email: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /search/issues (issues)", function(next) { + client.search.issues( + { + q: "String", + sort: "String", + order: "String", + page: "Number", + per_page: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /search/repositories (repos)", function(next) { + client.search.repos( + { + q: "String", + sort: "String", + order: "String", + page: "Number", + per_page: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /search/users (users)", function(next) { + client.search.users( + { + q: "String", + sort: "String", + order: "String", + page: "Number", + per_page: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); +}); diff --git a/test/usersTest.js b/test/usersTest.js new file mode 100644 index 0000000000..6c168bfa9c --- /dev/null +++ b/test/usersTest.js @@ -0,0 +1,526 @@ +/* + * Copyright 2012 Cloud9 IDE, Inc. + * + * This product includes software developed by + * Cloud9 IDE, Inc (http://c9.io). + * + * Author: Mike de Boer + */ + +"use strict"; + +var Assert = require("assert"); +var Client = require("./../lib/index"); +var testAuth = require("./../testAuth.json"); + +describe("[users]", function() { + var client; + var token = testAuth["token"]; + + beforeEach(function() { + client = new Client(); + client.authenticate({ + type: "oauth", + token: token + }); + }); + + it("should successfully execute PATCH /user/repository_invitations/:invitation_id (acceptRepoInvite)", function(next) { + client.users.acceptRepoInvite( + { + invitation_id: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute POST /user/emails (addEmails)", function(next) { + client.users.addEmails( + { + emails: "Array" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /user/following/:username (checkFollowing)", function(next) { + client.users.checkFollowing( + { + username: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /users/:username/following/:target_user (checkIfOneFollowersOther)", function(next) { + client.users.checkIfOneFollowersOther( + { + username: "String", + target_user: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute POST /user/gpg_keys (createGpgKey)", function(next) { + client.users.createGpgKey( + { + armored_public_key: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute POST /user/keys (createKey)", function(next) { + client.users.createKey( + { + title: "String", + key: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute DELETE /user/repository_invitations/:invitation_id (declineRepoInvite)", function(next) { + client.users.declineRepoInvite( + { + invitation_id: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute DELETE /user/emails (deleteEmails)", function(next) { + client.users.deleteEmails( + { + emails: "Array" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute DELETE /user/gpg_keys/:id (deleteGpgKey)", function(next) { + client.users.deleteGpgKey( + { + id: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute DELETE /user/keys/:id (deleteKey)", function(next) { + client.users.deleteKey( + { + id: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute DELETE /users/:username/site_admin (demote)", function(next) { + client.users.demote( + { + username: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute PATCH /user/memberships/orgs/:org (editOrgMembership)", function(next) { + client.users.editOrgMembership( + { + org: "String", + state: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute PUT /user/following/:username (followUser)", function(next) { + client.users.followUser( + { + username: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /user (get)", function(next) { + client.users.get( + {}, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /users (getAll)", function(next) { + client.users.getAll( + { + since: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /user/:id (getById)", function(next) { + client.users.getById( + { + id: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /user/emails (getEmails)", function(next) { + client.users.getEmails( + { + page: "Number", + per_page: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /user/followers (getFollowers)", function(next) { + client.users.getFollowers( + { + page: "Number", + per_page: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /users/:username/followers (getFollowersForUser)", function(next) { + client.users.getFollowersForUser( + { + username: "String", + page: "Number", + per_page: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /user/following (getFollowing)", function(next) { + client.users.getFollowing( + { + page: "Number", + per_page: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /users/:username/following (getFollowingForUser)", function(next) { + client.users.getFollowingForUser( + { + username: "String", + page: "Number", + per_page: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /users/:username (getForUser)", function(next) { + client.users.getForUser( + { + username: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /user/gpg_keys/:id (getGpgKey)", function(next) { + client.users.getGpgKey( + { + id: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /user/gpg_keys (getGpgKeys)", function(next) { + client.users.getGpgKeys( + { + page: "Number", + per_page: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /user/keys/:id (getKey)", function(next) { + client.users.getKey( + { + id: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /user/keys (getKeys)", function(next) { + client.users.getKeys( + { + page: "Number", + per_page: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /users/:username/keys (getKeysForUser)", function(next) { + client.users.getKeysForUser( + { + username: "String", + page: "Number", + per_page: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /user/memberships/orgs/:org (getOrgMembership)", function(next) { + client.users.getOrgMembership( + { + org: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /user/memberships/orgs (getOrgMemberships)", function(next) { + client.users.getOrgMemberships( + { + state: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /user/orgs (getOrgs)", function(next) { + client.users.getOrgs( + { + page: "Number", + per_page: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /user/repository_invitations (getRepoInvites)", function(next) { + client.users.getRepoInvites( + {}, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /user/teams (getTeams)", function(next) { + client.users.getTeams( + { + page: "Number", + per_page: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute PUT /users/:username/site_admin (promote)", function(next) { + client.users.promote( + { + username: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute PUT /users/:username/suspended (suspend)", function(next) { + client.users.suspend( + { + username: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute DELETE /user/following/:username (unfollowUser)", function(next) { + client.users.unfollowUser( + { + username: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute DELETE /users/:username/suspended (unsuspend)", function(next) { + client.users.unsuspend( + { + username: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute PATCH /user (update)", function(next) { + client.users.update( + { + name: "String", + email: "String", + blog: "String", + company: "String", + location: "String", + hireable: "Boolean", + bio: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); +});