diff --git a/.prettierrc b/.prettierrc index cab9893e0..f7587a356 100644 --- a/.prettierrc +++ b/.prettierrc @@ -1,5 +1,5 @@ { - "printWidth": 100, + "printWidth": 120, "tabWidth": 2, "trailingComma": "all" } diff --git a/CHANGELOG.md b/CHANGELOG.md index 2d17909a8..d8c45f2f4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,38 @@ # next release +# 10.0.0 + +- `--extract-response-body` option - extract response body type to data contract +- `--extract-response-error` option - extract response error type to data contract +- `--add-readonly` option - generate readonly properties +- `authorizationToken` for axios fetch swagger schema request +- fix: change COMPLEX_NOT_OF to COMPLEX_NOT (internal) +- feat: improve `@deprecated` jsdoc info +- feat: improve `required` field in complex data schemas (anyOf, oneOf, allOf etc) +- feat: abortSignal for fetch http client +- chore: improve typings in index.d.ts +- fixed [Request falls if FormData attachment is File instance](https://github.com/acacode/swagger-typescript-api/issues/293) +- fixed [Response format - global default or override ?](https://github.com/acacode/swagger-typescript-api/issues/251) + +> Co-authored-by: Sergey S. Volkov +> Co-authored-by: Xavier Cassel <57092100+xcassel@users.noreply.github.com> +> Co-authored-by: cassel +> Co-authored-by: Adrian Wieprzkowicz +> Co-authored-by: EvgenBabenko +> Co-authored-by: RoCat +> Co-authored-by: rcatoio +> Co-authored-by: 卡色 +> Co-authored-by: 江麻妞 <50100681+jiangmaniu@users.noreply.github.com> +> Co-authored-by: Kasper Moskwiak +> Co-authored-by: Ben Watkins +> Co-authored-by: bonukai +> Co-authored-by: baggoedw <92381702+baggoedw@users.noreply.github.com> +> Co-authored-by: Marcus Dunn <51931484+MarcusDunn@users.noreply.github.com> +> Co-authored-by: Daniele De Matteo +> Co-authored-by: Daniel Playfair Cal +> Co-authored-by: Anders Cassidy +> Co-authored-by: Daniel Playfair Cal + # 9.2.0 Features: diff --git a/README.md b/README.md index c9a33bffa..cb47048a5 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,11 @@ Any questions you can ask [**here**](https://github.com/acacode/swagger-typescri
-![](https://raw.githubusercontent.com/acacode/swagger-typescript-api/master/assets/components-converter-example.jpg) +![](https://raw.githubusercontent.com/acacode/swagger-typescript-api/master/assets/components-converter-example.jpg) + +👀 This project is looking for a code maintainer 👀 +P.S. If you are creating the PR, please check your changes with using command `npm run prepare` +P.S. If you want to contribute please use branch `next`. All PRs which will have target `master` will be declined ## 👀 Examples @@ -38,32 +42,34 @@ Options: -n, --name name of output typescript api file (default: "Api.ts") -t, --templates path to folder containing templates -d, --default-as-success use "default" response status code as success response too. - some swagger schemas use "default" response status code - as success response type by default. (default: false) + some swagger schemas use "default" response status code as success response type by default. (default: false) -r, --responses generate additional information about request responses also add typings for bad responses (default: false) --union-enums generate all "enum" types as union types (T1 | T2 | TN) (default: false) + --add-readonly generate readonly properties (default: false) --route-types generate type definitions for API routes (default: false) --no-client do not generate an API class --enum-names-as-values use values in 'x-enumNames' as enum values (not only as keys) (default: false) - --js generate js api module with declaration file (default: false) - --extract-request-params extract request params to data contract (default: false) - Also combine path params and query params into one object - --extract-request-body extract request body type to data contract (default: false) - --module-name-index determines which path index should be used for routes separation (default: 0) - (example: GET:/fruites/getFruit -> index:0 -> moduleName -> fruites) - --module-name-first-tag splits routes based on the first tag + --extract-request-params extract request params to data contract (Also combine path params and query params into one object) (default: false) + --extract-request-body extract request body type to data contract (default: false) + --extract-response-body extract response body type to data contract (default: false) + --extract-response-error extract response error type to data contract (default: false) --modular generate separated files for http client, data contracts, and routes (default: false) + --js generate js api module with declaration file (default: false) + --module-name-index determines which path index should be used for routes separation (example: GET:/fruites/getFruit -> index:0 -> moduleName -> fruites) (default: 0) + --module-name-first-tag splits routes based on the first tag (default: false) --disableStrictSSL disabled strict SSL (default: false) --disableProxy disabled proxy (default: false) - --clean-output clean output folder before generate api. WARNING: May cause data loss (default: false) --axios generate axios http client (default: false) + --unwrap-response-data unwrap the data item from the response (default: false) + --disable-throw-on-error Do not throw an error when response.ok is not true (default: false) --single-http-client Ability to send HttpClient instance to Api constructor (default: false) --silent Output only errors to console (default: false) --default-response default type for empty response schema (default: "void") --type-prefix data contract name prefix (default: "") --type-suffix data contract name suffix (default: "") - -h, --help display help for command + --clean-output clean output folder before generate api. WARNING: May cause data loss (default: false) + --patch fix up small errors in the swagger source definition (default: false) ``` Also you can use `npx`: @@ -99,7 +105,7 @@ generateApi({ toJS: false, extractRequestParams: false, extractRequestBody: false, - prettier: { + prettier: { // By default prettier config is load from your project printWidth: 120, tabWidth: 2, trailingComma: "all", diff --git a/index.d.ts b/index.d.ts index 4673b93c8..d8a4a4757 100644 --- a/index.d.ts +++ b/index.d.ts @@ -1,19 +1,4 @@ -interface GenerateApiParams { - /** - * path to swagger schema - */ - input: string; - - /** - * url to swagger schema - */ - url: string; - - /** - * swagger schema JSON - */ - spec: import("swagger-schema-official").Spec; - +interface GenerateApiParamsBase { /** * default 'api.ts' */ @@ -25,7 +10,7 @@ interface GenerateApiParams { output?: string; /** - * path to folder containing templates (default: ./scr/templates) + * path to folder containing templates (default: ./src/templates) */ templates?: string; @@ -88,6 +73,18 @@ interface GenerateApiParams { * extract request params to data contract (Also combine path params and query params into one object) */ extractRequestParams?: boolean; + /** + * extract request body type to data contract + */ + extractRequestBody?: boolean; + /** + * extract response body type to data contract + */ + extractResponseBody?: boolean; + /** + * extract response error type to data contract + */ + extractResponseError?: boolean; /** * prettier configuration */ @@ -112,8 +109,40 @@ interface GenerateApiParams { * extra templates */ extraTemplates?: { name: string; path: string }[]; + + /** + * fix up small errors in the swagger source definition + */ + patch?: boolean; + /** + * authorization token + */ + authorizationToken?: string; +} + +interface GenerateApiParamsFromPath extends GenerateApiParamsBase { + /** + * path to swagger schema + */ + input: string; +} + +interface GenerateApiParamsFromUrl extends GenerateApiParamsBase { + /** + * url to swagger schema + */ + url: string; +} + +interface GenerateApiParamsFromSpecLiteral extends GenerateApiParamsBase { + /** + * swagger schema JSON + */ + spec: import("swagger-schema-official").Spec; } +export type GenerateApiParams = GenerateApiParamsFromPath | GenerateApiParamsFromUrl | GenerateApiParamsFromSpecLiteral; + export interface Hooks { /** calls after parse schema component */ onCreateComponent: (component: SchemaComponent) => SchemaComponent | void; @@ -126,14 +155,9 @@ export interface Hooks { /** customize configuration object before sending it to ETA templates */ onPrepareConfig?: (currentConfiguration: C) => C | void; /** customize route name as you need */ - onCreateRouteName?: ( - routeNameInfo: RouteNameInfo, - rawRouteInfo: RawRouteInfo, - ) => RouteNameInfo | void; + onCreateRouteName?: (routeNameInfo: RouteNameInfo, rawRouteInfo: RawRouteInfo) => RouteNameInfo | void; /** customize request params (path params, query params) */ - onCreateRequestParams?: ( - rawType: SchemaComponent["rawTypeData"], - ) => SchemaComponent["rawTypeData"] | void; + onCreateRequestParams?: (rawType: SchemaComponent["rawTypeData"]) => SchemaComponent["rawTypeData"] | void; /** customize name of model type */ onFormatTypeName?: (typeName: string, rawTypeName?: string) => string | void; /** customize name of route (operationId), you can do it with using onCreateRouteName too */ @@ -210,14 +234,10 @@ export interface SchemaComponent { discriminator?: { propertyName?: string; }; - $parsed: ParsedSchema< - SchemaTypeObjectContent | SchemaTypeEnumContent | SchemaTypePrimitiveContent - >; + $parsed: ParsedSchema; }; componentName: string; - typeData: ParsedSchema< - SchemaTypeObjectContent | SchemaTypeEnumContent | SchemaTypePrimitiveContent - > | null; + typeData: ParsedSchema | null; } export enum RequestContentKind { @@ -323,6 +343,7 @@ export interface GenerateApiConfiguration { routeName: string; }; routeNameDuplicatesMap: Map; + apiClassName: string }; modelTypes: ModelType[]; rawModelTypes: SchemaComponent[]; @@ -341,10 +362,7 @@ export interface GenerateApiConfiguration { formatDescription: (description: string, inline?: boolean) => string; internalCase: (value: string) => string; classNameCase: (value: string) => string; - getInlineParseContent: ( - rawTypeData: SchemaComponent["rawTypeData"], - typeName?: string, - ) => string; + getInlineParseContent: (rawTypeData: SchemaComponent["rawTypeData"], typeName?: string) => string; getParseContent: (rawTypeData: SchemaComponent["rawTypeData"], typeName?: string) => ModelType; getComponentByRef: (ref: string) => SchemaComponent; parseSchema: ( @@ -352,14 +370,8 @@ export interface GenerateApiConfiguration { typeName?: string, formattersMap?: Record string>, ) => ModelType; - formatters: Record< - MAIN_SCHEMA_TYPES, - (content: string | object | string[] | object[]) => string - >; - inlineExtraFormatters: Record< - Exclude, - (schema: ModelType) => string - >; + formatters: Record string>; + inlineExtraFormatters: Record, (schema: ModelType) => string>; formatModelName: (name: string) => string; fmtToJSDocLine: (line: string, params?: { eol?: boolean }) => string; _: import("lodash").LoDashStatic; @@ -370,12 +382,7 @@ export interface GenerateApiConfiguration { export interface GenerateApiOutput { configuration: GenerateApiConfiguration; files: { name: string; content: string; declaration: { name: string; content: string } | null }[]; - createFile: (params: { - path: string; - fileName: string; - content: string; - withPrefix?: boolean; - }) => void; + createFile: (params: { path: string; fileName: string; content: string; withPrefix?: boolean }) => void; renderTemplate: ( templateContent: string, data: Record, @@ -385,12 +392,4 @@ export interface GenerateApiOutput { formatTSContent: (content: string) => string; } -export declare function generateApi( - params: Omit, -): Promise; -export declare function generateApi( - params: Omit, -): Promise; -export declare function generateApi( - params: Omit, -): Promise; +export declare function generateApi(params: GenerateApiParams): Promise; diff --git a/index.js b/index.js index a42b61a50..9ff650a0f 100755 --- a/index.js +++ b/index.js @@ -33,29 +33,23 @@ program ) .option( "-r, --responses", - "generate additional information about request responses\n" + - "also add typings for bad responses", + "generate additional information about request responses\n" + "also add typings for bad responses", false, ) .option("--union-enums", 'generate all "enum" types as union types (T1 | T2 | TN)', false) + .option("--add-readonly", "generate readonly properties", false) .option("--route-types", "generate type definitions for API routes", false) .option("--no-client", "do not generate an API class", false) - .option( - "--enum-names-as-values", - "use values in 'x-enumNames' as enum values (not only as keys)", - false, - ) + .option("--enum-names-as-values", "use values in 'x-enumNames' as enum values (not only as keys)", false) .option( "--extract-request-params", "extract request params to data contract (Also combine path params and query params into one object)", false, ) .option("--extract-request-body", "extract request body type to data contract", false) - .option( - "--modular", - "generate separated files for http client, data contracts, and routes", - false, - ) + .option("--extract-response-body", "extract response body type to data contract", false) + .option("--extract-response-error", "extract response error type to data contract", false) + .option("--modular", "generate separated files for http client, data contracts, and routes", false) .option("--js", "generate js api module with declaration file", false) .option( "--module-name-index ", @@ -67,74 +61,55 @@ program .option("--disableProxy", "disabled proxy", false) .option("--axios", "generate axios http client", false) .option("--unwrap-response-data", "unwrap the data item from the response", false) + .option("--disable-throw-on-error", "Do not throw an error when response.ok is not true", false) .option("--single-http-client", "Ability to send HttpClient instance to Api constructor", false) .option("--silent", "Output only errors to console", false) .option("--default-response ", "default type for empty response schema", TS_KEYWORDS.VOID) .option("--type-prefix ", "data contract name prefix", "") .option("--type-suffix ", "data contract name suffix", "") - .option( - "--clean-output", - "clean output folder before generate api. WARNING: May cause data loss", - false, - ); + .option("--clean-output", "clean output folder before generate api. WARNING: May cause data loss", false) + .option("--patch", "fix up small errors in the swagger source definition", false); program.parse(process.argv); -const { - path, - output, - name, - templates, - unionEnums, - routeTypes, - client, - defaultAsSuccess, - responses, - modular, - js, - moduleNameIndex, - moduleNameFirstTag, - extractRequestParams, - extractRequestBody, - enumNamesAsValues, - disableStrictSSL, - disableProxy, - cleanOutput, - defaultResponse, - unwrapResponseData, - singleHttpClient, - axios, - silent, - typePrefix, - typeSuffix, -} = program; - generateApi({ - name, - url: path, - generateRouteTypes: routeTypes, - generateClient: !!(axios || client), - httpClientType: axios ? HTTP_CLIENT.AXIOS : HTTP_CLIENT.FETCH, - defaultResponseAsSuccess: defaultAsSuccess, - defaultResponseType: defaultResponse, - unwrapResponseData: unwrapResponseData, - generateUnionEnums: unionEnums, - generateResponses: responses, - extractRequestParams: !!extractRequestParams, - extractRequestBody: !!extractRequestBody, - input: resolve(process.cwd(), path), - output: resolve(process.cwd(), output || "."), - templates, - modular: !!modular, - toJS: !!js, - enumNamesAsValues: enumNamesAsValues, - moduleNameIndex: +(moduleNameIndex || 0), - moduleNameFirstTag: moduleNameFirstTag, - disableStrictSSL: !!disableStrictSSL, - disableProxy: !!disableProxy, - singleHttpClient: !!singleHttpClient, - cleanOutput: !!cleanOutput, - silent: !!silent, - typePrefix, - typeSuffix, + name: program.name, + url: program.path, + generateRouteTypes: program.routeTypes, + generateClient: !!(program.axios || program.client), + httpClientType: program.axios ? HTTP_CLIENT.AXIOS : HTTP_CLIENT.FETCH, + defaultResponseAsSuccess: program.defaultAsSuccess, + defaultResponseType: program.defaultResponse, + unwrapResponseData: program.unwrapResponseData, + disableThrowOnError: program.disableThrowOnError, + sortTypes: program.sortTypes, + generateUnionEnums: program.unionEnums, + addReadonly: program.addReadonly, + generateResponses: program.responses, + extractRequestParams: !!program.extractRequestParams, + extractRequestBody: !!program.extractRequestBody, + extractResponseBody: !!program.extractResponseBody, + extractResponseError: !!program.extractResponseError, + input: resolve(process.cwd(), program.path), + output: resolve(process.cwd(), program.output || "."), + templates: program.templates, + modular: !!program.modular, + toJS: !!program.js, + enumNamesAsValues: program.enumNamesAsValues, + moduleNameIndex: +(program.moduleNameIndex || 0), + moduleNameFirstTag: program.moduleNameFirstTag, + disableStrictSSL: !!program.disableStrictSSL, + disableProxy: !!program.disableProxy, + singleHttpClient: !!program.singleHttpClient, + cleanOutput: !!program.cleanOutput, + silent: !!program.silent, + typePrefix: program.typePrefix, + typeSuffix: program.typeSuffix, + patch: !!program.patch, + apiClassName, +}).catch((err) => { + // NOTE collect all errors on top level and shows to users in any case + console.error(err); + + process.exit(1); }); diff --git a/package-lock.json b/package-lock.json index 1c9cbc89f..2138718d9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,31 +1,28 @@ { "name": "swagger-typescript-api", - "version": "9.2.0", + "version": "9.3.1", "lockfileVersion": 1, "requires": true, "dependencies": { "@babel/code-frame": { - "version": "7.12.11", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.11.tgz", - "integrity": "sha512-Zt1yodBx1UcyiePMSkWnU4hPqhwq7hGi2nFL1LeA3EUl+q2LQx16MISgJ0+z7dnmgvP9QtIleuETGOiOH1RcIw==", - "dev": true, + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.14.5.tgz", + "integrity": "sha512-9pzDqyc6OLDaqe+zbACgFkb6fKMNG6CObKpnYXChRsvYGyEdc7CA2BaqeOM+vOtCS5ndmJicPJhKAwYRI6UfFw==", "requires": { - "@babel/highlight": "^7.10.4" + "@babel/highlight": "^7.14.5" } }, "@babel/helper-validator-identifier": { - "version": "7.12.11", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.12.11.tgz", - "integrity": "sha512-np/lG3uARFybkoHokJUmf1QfEvRVCPbmQeUQpKow5cQ3xWrV9i3rUHodKDJPQfTVX61qKi+UdYk8kik84n7XOw==", - "dev": true + "version": "7.14.9", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.9.tgz", + "integrity": "sha512-pQYxPY0UP6IHISRitNe8bsijHex4TWZXi2HwKVsjPiltzlhse2znVcm9Ace510VT1kxIHjGJCZZQBX2gJDbo0g==" }, "@babel/highlight": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.10.4.tgz", - "integrity": "sha512-i6rgnR/YgPEQzZZnbTHHuZdlE8qyoBNalD6F+q4vAFlcMEcqmkoG+mPqJYJCo63qPf74+Y1UZsl3l6f7/RIkmA==", - "dev": true, + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.14.5.tgz", + "integrity": "sha512-qf9u2WFWVV0MppaL877j2dBtQIDgmidgjGk5VIMw3OadXvYaXn66U1BFlH2t4+t3i+8PhedppRv+i40ABzd+gg==", "requires": { - "@babel/helper-validator-identifier": "^7.10.4", + "@babel/helper-validator-identifier": "^7.14.5", "chalk": "^2.0.0", "js-tokens": "^4.0.0" } @@ -44,6 +41,15 @@ "resolved": "https://registry.npmjs.org/@exodus/schemasafe/-/schemasafe-1.0.0-rc.3.tgz", "integrity": "sha512-GoXw0U2Qaa33m3eUcxuHnHpNvHjNlLo0gtV091XBpaRINaB4X6FGCG5XKxSFNFiPpugUDqNruHzaqpTdDm4AOg==" }, + "@types/axios": { + "version": "0.14.0", + "resolved": "https://registry.npmjs.org/@types/axios/-/axios-0.14.0.tgz", + "integrity": "sha1-7CMA++fX3d1+udOr+HmZlkyvzkY=", + "dev": true, + "requires": { + "axios": "*" + } + }, "@types/lodash": { "version": "4.14.166", "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.166.tgz", @@ -65,8 +71,7 @@ "@types/parse-json": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/@types/parse-json/-/parse-json-4.0.0.tgz", - "integrity": "sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA==", - "dev": true + "integrity": "sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA==" }, "@types/prettier": { "version": "2.1.6", @@ -229,7 +234,6 @@ "version": "3.2.1", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, "requires": { "color-convert": "^1.9.0" } @@ -264,11 +268,11 @@ "dev": true }, "axios": { - "version": "0.21.1", - "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.1.tgz", - "integrity": "sha512-dKQiRHxGD9PPRIUNIWvZhPTPpl1rf/OxTYKsqKUDjBwYylTvV7SjSHJb9ratfyzM6wCdLCOYLzs73qpg5c4iGA==", + "version": "0.21.4", + "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.4.tgz", + "integrity": "sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg==", "requires": { - "follow-redirects": "^1.10.0" + "follow-redirects": "^1.14.0" } }, "balanced-match": { @@ -295,8 +299,7 @@ "callsites": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", - "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", - "dev": true + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==" }, "camelcase": { "version": "5.3.1", @@ -308,7 +311,6 @@ "version": "2.4.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, "requires": { "ansi-styles": "^3.2.1", "escape-string-regexp": "^1.0.5", @@ -356,7 +358,6 @@ "version": "1.9.3", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, "requires": { "color-name": "1.1.3" } @@ -364,8 +365,7 @@ "color-name": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", - "dev": true + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" }, "commander": { "version": "6.2.1", @@ -388,33 +388,12 @@ "version": "7.0.0", "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-7.0.0.tgz", "integrity": "sha512-pondGvTuVYDk++upghXJabWzL6Kxu6f26ljFw64Swq9v6sQPUL3EUlVDV56diOjpCayKihL6hVe8exIACU4XcA==", - "dev": true, "requires": { "@types/parse-json": "^4.0.0", "import-fresh": "^3.2.1", "parse-json": "^5.0.0", "path-type": "^4.0.0", "yaml": "^1.10.0" - }, - "dependencies": { - "parse-json": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.1.0.tgz", - "integrity": "sha512-+mi/lmVVNKFNVyLXV31ERiy2CY5E1/F6QtJFEzoChPRwwngMNXRDQ9GJ5WdE2Z2P4AujsOi0/+2qHID68KwfIQ==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.0.0", - "error-ex": "^1.3.1", - "json-parse-even-better-errors": "^2.3.0", - "lines-and-columns": "^1.1.6" - } - }, - "path-type": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", - "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", - "dev": true - } } }, "decamelize": { @@ -447,7 +426,6 @@ "version": "1.3.2", "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", - "dev": true, "requires": { "is-arrayish": "^0.2.1" } @@ -465,8 +443,7 @@ "escape-string-regexp": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", - "dev": true + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=" }, "eta": { "version": "1.12.1", @@ -578,9 +555,9 @@ } }, "follow-redirects": { - "version": "1.13.1", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.13.1.tgz", - "integrity": "sha512-SSG5xmZh1mkPGyKzjZP8zLjltIfpW32Y5QpdNJyjcfGxK3qo3NDDkZOZSFiGn1A6SclQxY9GzEwAHQ3dmYRWpg==" + "version": "1.14.4", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.4.tgz", + "integrity": "sha512-zwGkiSXC1MUJG/qmeIFH2HBJx9u0V46QGUe3YR1fXG8bXQxq7fLj0RjLZQ5nubr9qNJUZrH+xUcwXEoXNpfS+g==" }, "get-caller-file": { "version": "2.0.5", @@ -599,8 +576,7 @@ "has-flag": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", - "dev": true + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=" }, "http2-client": { "version": "1.3.3", @@ -701,7 +677,6 @@ "version": "3.3.0", "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", - "dev": true, "requires": { "parent-module": "^1.0.0", "resolve-from": "^4.0.0" @@ -782,8 +757,7 @@ "is-arrayish": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", - "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", - "dev": true + "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=" }, "is-fullwidth-code-point": { "version": "3.0.0", @@ -805,8 +779,7 @@ "js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", - "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", - "dev": true + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==" }, "js-yaml": { "version": "4.0.0", @@ -881,14 +854,12 @@ "json-parse-even-better-errors": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", - "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", - "dev": true + "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==" }, "lines-and-columns": { "version": "1.1.6", "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.1.6.tgz", - "integrity": "sha1-HADHQ7QzzQpOgHWPe2SldEDZ/wA=", - "dev": true + "integrity": "sha1-HADHQ7QzzQpOgHWPe2SldEDZ/wA=" }, "locate-path": { "version": "5.0.0", @@ -1129,17 +1100,32 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", - "dev": true, "requires": { "callsites": "^3.0.0" } }, + "parse-json": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", + "integrity": "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==", + "requires": { + "@babel/code-frame": "^7.0.0", + "error-ex": "^1.3.1", + "json-parse-even-better-errors": "^2.3.0", + "lines-and-columns": "^1.1.6" + } + }, "path-exists": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", "dev": true }, + "path-type": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==" + }, "pegjs": { "version": "0.10.0", "resolved": "https://registry.npmjs.org/pegjs/-/pegjs-0.10.0.tgz", @@ -1269,8 +1255,7 @@ "resolve-from": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", - "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", - "dev": true + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==" }, "restore-cursor": { "version": "3.1.0", @@ -1409,7 +1394,6 @@ "version": "5.5.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, "requires": { "has-flag": "^3.0.0" } diff --git a/package.json b/package.json index 86e118e37..94205c470 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "swagger-typescript-api", - "version": "9.2.0", + "version": "10.0.0", "description": "Generate typescript/javascript api from swagger schema", "scripts": { "cli:json": "node index.js -r -d -p ./swagger-test-cli.json -n swagger-test-cli.ts", @@ -23,6 +23,7 @@ "test:--default-as-success": "node tests/spec/defaultAsSuccess/test.js", "test:--templates": "node tests/spec/templates/test.js", "test:--union-enums": "node tests/spec/unionEnums/test.js", + "test:--add-readonly": "node tests/spec/readonly/test.js", "test:--responses": "node tests/spec/responses/test.js", "test:specProperty": "node tests/spec/specProperty/test.js", "test:--module-name-index": "node tests/spec/moduleNameIndex/test.js", @@ -31,6 +32,8 @@ "test:--single-http-client": "node tests/spec/singleHttpClient/test.js", "test:--extract-request-params": "node tests/spec/extractRequestParams/test.js", "test:--extract-request-body": "node tests/spec/extractRequestBody/test.js", + "test:--extract-response-body": "node tests/spec/extractResponseBody/test.js", + "test:--extract-response-error": "node tests/spec/extractResponseError/test.js", "test:--enum-names-as-values": "node tests/spec/enumNamesAsValues/test.js", "test:--default-response": "node tests/spec/defaultResponse/test.js", "test:--js": "node tests/spec/js/test.js", @@ -39,34 +42,37 @@ "test:--axios--single-http-client": "node tests/spec/axiosSingleHttpClient/test.js", "test:--type-suffix--type-prefix": "node tests/spec/typeSuffixPrefix/test.js", "test:partialBaseTemplate": "node tests/spec/partialBaseTemplate/test.js", - "test:partialDefaultTemplate": "node tests/spec/partialDefaultTemplate/test.js" + "test:partialDefaultTemplate": "node tests/spec/partialDefaultTemplate/test.js", + "test:--patch": "node tests/spec/patch/test.js" }, "author": "acacode", "license": "MIT", "typings": "./index.d.ts", "main": "src/index.js", "devDependencies": { - "@types/lodash": "^4.14.166", + "@types/axios": "^0.14.0", + "@types/lodash": "^4.14.182", "@types/node": "^15.0.2", - "@types/prettier": "^2.1.6", - "all-contributors-cli": "^6.19.0", + "@types/prettier": "^2.7.0", + "all-contributors-cli": "^6.20.0", "husky": "^4.3.6", "pretty-quick": "^3.1.0" }, "dependencies": { - "@types/swagger-schema-official": "2.0.21", - "axios": "^0.21.1", - "commander": "^6.2.1", - "eta": "^1.12.1", - "js-yaml": "^4.0.0", + "axios": "^0.27.2", + "@types/swagger-schema-official": "2.0.22", + "commander": "^9.4.0", + "cosmiconfig": "^7.0.1", + "eta": "^1.12.3", + "js-yaml": "^4.1.0", "lodash": "^4.17.21", "make-dir": "^3.1.0", - "nanoid": "^3.1.22", - "node-emoji": "^1.10.0", - "prettier": "^2.2.1", + "nanoid": "^3.3.4", + "node-emoji": "^1.11.0", + "prettier": "^2.7.1", "swagger-schema-official": "2.0.0-bab6bed", - "swagger2openapi": "^7.0.5", - "typescript": "^4.2.4" + "swagger2openapi": "^7.0.8", + "typescript": "^4.7.4" }, "bin": { "swagger-typescript-api": "index.js", diff --git a/src/config.js b/src/config.js index b9f3d63a5..005b7ea79 100644 --- a/src/config.js +++ b/src/config.js @@ -14,6 +14,8 @@ const config = { generateClient: true, /** CLI flag */ generateUnionEnums: false, + /** CLI flag */ + addReadonly: false, enumNamesAsValues: false, /** parsed swagger schema from getSwaggerObject() */ @@ -36,6 +38,8 @@ const config = { disableProxy: false, extractRequestParams: false, extractRequestBody: false, + extractResponseBody: false, + extractResponseError: false, fileNames: { dataContracts: "data-contracts", routeTypes: "route-types", @@ -59,6 +63,8 @@ const config = { singleHttpClient: false, httpClientType: HTTP_CLIENT.FETCH, unwrapResponseData: false, + disableThrowOnError: false, + sortTypes: false, templatePaths: { /** `templates/base` */ base: "", @@ -83,7 +89,10 @@ const config = { silent: false, typePrefix: "", typeSuffix: "", + patch: false, componentTypeNameResolver: new NameResolver([]), + /** name of the main exported class */ + apiClassName: "Api", }; /** needs to use data everywhere in project */ diff --git a/src/index.js b/src/index.js index 6ccbdd3ab..dc946e546 100644 --- a/src/index.js +++ b/src/index.js @@ -21,6 +21,7 @@ const { generateOutputFiles } = require("./output"); const formatFileContent = require("./formatFileContent"); const { logger } = require("./logger"); const { ComponentTypeNameResolver } = require("./utils/resolveName"); +const { getPrettierOptions } = require("./prettierOptions"); module.exports = { constants: constants, @@ -39,14 +40,19 @@ module.exports = { generateClient = config.generateClient, httpClientType = config.httpClientType, generateUnionEnums = config.generateUnionEnums, + addReadonly = config.addReadonly, moduleNameIndex = config.moduleNameIndex, moduleNameFirstTag = config.moduleNameFirstTag, extractRequestParams = config.extractRequestParams, extractRequestBody = config.extractRequestBody, + extractResponseBody = config.extractResponseBody, + extractResponseError = config.extractResponseError, defaultResponseType = config.defaultResponseType, unwrapResponseData = config.unwrapResponseData, + disableThrowOnError = config.disableThrowOnError, + sortTypes = config.sortTypes, singleHttpClient = config.singleHttpClient, - prettier: prettierOptions = constants.PRETTIER_OPTIONS, + prettier: prettierOptions = getPrettierOptions(), hooks: rawHooks, extraTemplates, enumNamesAsValues, @@ -56,6 +62,9 @@ module.exports = { silent = config.silent, typePrefix = config.typePrefix, typeSuffix = config.typeSuffix, + patch = config.patch, + authorizationToken, + apiClassName = config.apiClassName, }) => new Promise((resolve, reject) => { addToConfig({ @@ -66,12 +75,15 @@ module.exports = { generateResponses, templates, generateUnionEnums, + addReadonly, moduleNameIndex, moduleNameFirstTag, prettierOptions, modular, extractRequestParams, extractRequestBody, + extractResponseBody, + extractResponseError, hooks: _.merge(config.hooks, rawHooks || {}), enumNamesAsValues, disableStrictSSL, @@ -79,16 +91,20 @@ module.exports = { cleanOutput, defaultResponseType, unwrapResponseData, + disableThrowOnError, + sortTypes, singleHttpClient, constants, silent, toJS: translateToJavaScript, typePrefix, typeSuffix, + patch, + apiClassName, }); (spec - ? convertSwaggerObject(spec) - : getSwaggerObject(input, url, disableStrictSSL, disableProxy) + ? convertSwaggerObject(spec, { patch }) + : getSwaggerObject(input, url, disableStrictSSL, disableProxy, authorizationToken, { patch }) ) .then(({ usageSchema, originalSchema }) => { const templatePaths = getTemplatePaths(config); @@ -113,9 +129,7 @@ module.exports = { const componentsMap = createComponentsMap(components); - const componentSchemasNames = filterComponentsMap(componentsMap, "schemas").map( - (c) => c.typeName, - ); + const componentSchemasNames = filterComponentsMap(componentsMap, "schemas").map((c) => c.typeName); addToConfig({ componentTypeNameResolver: new ComponentTypeNameResolver(componentSchemasNames), @@ -138,11 +152,44 @@ module.exports = { const hasFormDataRoutes = routes.some((route) => route.hasFormDataParams); const usageComponentSchemas = filterComponentsMap(componentsMap, "schemas"); + const sortByProperty = (o1, o2, propertyName) => { + if (o1[propertyName] > o2[propertyName]) { + return 1; + } + if (o1[propertyName] < o2[propertyName]) { + return -1; + } + return 0; + }; + const sortByTypeName = (o1, o2) => sortByProperty(o1, o2, "typeName"); + + const sortByName = (o1, o2) => sortByProperty(o1, o2, "name"); + + const sortSchemas = (schemas) => { + if (config.sortTypes) { + return schemas.sort(sortByTypeName).map((schema) => { + if (schema.rawTypeData?.properties) { + return { + ...schema, + rawTypeData: { + ...schema.rawTypeData, + $parsed: { + ...schema.rawTypeData["$parsed"], + content: schema.rawTypeData["$parsed"].content.sort(sortByName), + }, + }, + }; + } + return schema; + }); + } + return schemas; + }; const rawConfiguration = { apiConfig: createApiConfig(usageSchema), config, - modelTypes: _.map(usageComponentSchemas, prepareModelType), + modelTypes: _.map(sortSchemas(usageComponentSchemas), prepareModelType), rawModelTypes: usageComponentSchemas, hasFormDataRoutes, hasSecurityRoutes, diff --git a/src/prettierOptions.js b/src/prettierOptions.js new file mode 100644 index 000000000..47f036939 --- /dev/null +++ b/src/prettierOptions.js @@ -0,0 +1,23 @@ +const { cosmiconfigSync } = require("cosmiconfig"); +const constants = require("./constants"); + +/** + * Get prettier options from user's project or return the default one + * @return {import('prettier').Options} Prettier options + */ +function getPrettierOptions() { + const prettier = cosmiconfigSync("prettier").search(); + + if (prettier) { + return { + ...prettier.config, + parser: "typescript", + }; + } + + return constants.PRETTIER_OPTIONS; +} + +module.exports = { + getPrettierOptions, +}; diff --git a/src/routeNames.js b/src/routeNames.js index 279df3f14..2c585fec8 100644 --- a/src/routeNames.js +++ b/src/routeNames.js @@ -13,19 +13,15 @@ const getRouteName = (routeInfo) => { config, }); - const routeName = - config.hooks.onFormatRouteName(routeInfo, routeNameFromTemplate) || routeNameFromTemplate; + const routeName = config.hooks.onFormatRouteName(routeInfo, routeNameFromTemplate) || routeNameFromTemplate; const duplicateIdentifier = `${moduleName}|${routeName}`; if (routeNameDuplicatesMap.has(duplicateIdentifier)) { - routeNameDuplicatesMap.set( - duplicateIdentifier, - routeNameDuplicatesMap.get(duplicateIdentifier) + 1, - ); + routeNameDuplicatesMap.set(duplicateIdentifier, routeNameDuplicatesMap.get(duplicateIdentifier) + 1); logger.warn( - `Module "${moduleName}" already have method "${routeName}()"`, + `Module "${moduleName}" already has method "${routeName}()"`, `\nThis method has been renamed to "${ routeName + routeNameDuplicatesMap.get(duplicateIdentifier) }()" to solve conflict names.`, diff --git a/src/routes.js b/src/routes.js index 2beb1a0fc..05b679ead 100644 --- a/src/routes.js +++ b/src/routes.js @@ -1,12 +1,5 @@ const _ = require("lodash"); -const { - types, - parseSchema, - getType, - getRefType, - getInlineParseContent, - checkAndAddNull, -} = require("./schema"); +const { types, parseSchema, getType, getRefType, getInlineParseContent, checkAndAddNull } = require("./schema"); const { formatModelName } = require("./modelNames"); const { DEFAULT_BODY_ARG_NAME, @@ -19,7 +12,7 @@ const { } = require("./constants"); const { formatDescription, classNameCase } = require("./common"); const { config } = require("./config"); -const { nanoid } = require("nanoid"); +const { generateId } = require("./utils/id"); const { getRouteName } = require("./routeNames"); const { createComponent } = require("./components"); const { logger } = require("./logger"); @@ -47,26 +40,15 @@ const getSchemaFromRequestType = (requestInfo) => { return null; }; -const getTypeFromRequestInfo = ({ - requestInfo, - parsedSchemas, - operationId, - defaultType, - typeName, -}) => { +const getTypeFromRequestInfo = ({ requestInfo, parsedSchemas, operationId, defaultType, typeName }) => { // TODO: make more flexible pick schema without content type const schema = getSchemaFromRequestType(requestInfo); const refTypeInfo = getRefType(requestInfo); if (schema) { const content = getInlineParseContent(schema, typeName); - const foundedSchemaByName = _.find( - parsedSchemas, - (parsedSchema) => formatModelName(parsedSchema.name) === content, - ); - const foundSchemaByContent = _.find(parsedSchemas, (parsedSchema) => - _.isEqual(parsedSchema.content, content), - ); + const foundedSchemaByName = _.find(parsedSchemas, (parsedSchema) => formatModelName(parsedSchema.name) === content); + const foundSchemaByContent = _.find(parsedSchemas, (parsedSchema) => _.isEqual(parsedSchema.content, content)); const foundSchema = foundedSchemaByName || foundSchemaByContent; @@ -88,10 +70,7 @@ const getTypeFromRequestInfo = ({ return formatModelName(refTypeInfo.typeName); case "responses": case "requestBodies": - return getInlineParseContent( - getSchemaFromRequestType(refTypeInfo.rawTypeData), - refTypeInfo.typeName || null, - ); + return getInlineParseContent(getSchemaFromRequestType(refTypeInfo.rawTypeData), refTypeInfo.typeName || null); default: return getInlineParseContent(refTypeInfo.rawTypeData, refTypeInfo.typeName || null); } @@ -344,9 +323,7 @@ const createRequestParamsSchema = ({ if (fixedSchema) return fixedSchema; if (extractRequestParams) { - const typeName = config.componentTypeNameResolver.resolve([ - classNameCase(`${routeName.usage} Params`), - ]); + const typeName = config.componentTypeNameResolver.resolve([classNameCase(`${routeName.usage} Params`)]); return createComponent("schemas", typeName, { ...schema }); } @@ -358,9 +335,7 @@ const getContentTypes = (requestInfo, extraContentTypes) => _.uniq( _.compact([ ...(extraContentTypes || []), - ..._.flatten( - _.map(requestInfo, (requestInfoData) => requestInfoData && _.keys(requestInfoData.content)), - ), + ..._.flatten(_.map(requestInfo, (requestInfoData) => requestInfoData && _.keys(requestInfoData.content))), ]), ); @@ -400,10 +375,7 @@ const getRequestBodyInfo = (routeInfo, routeParams, parsedSchemas, routeName) => let schema = null; let type = null; - const contentTypes = getContentTypes( - [requestBody], - [...(consumes || []), routeInfo["x-contentType"]], - ); + const contentTypes = getContentTypes([requestBody], [...(consumes || []), routeInfo["x-contentType"]]); let contentKind = getContentKind(contentTypes); let typeName = null; @@ -454,8 +426,7 @@ const getRequestBodyInfo = (routeInfo, routeParams, parsedSchemas, routeName) => contentKind, schema, type, - required: - requestBody && (typeof requestBody.required === "undefined" || !!requestBody.required), + required: requestBody && (typeof requestBody.required === "undefined" || !!requestBody.required), }; }; @@ -472,9 +443,7 @@ const getResponseBodyInfo = (routeInfo, routeParams, parsedSchemas) => { }); const successResponse = responseInfos.find((response) => response.isSuccess); - const errorResponses = responseInfos.filter( - (response) => !response.isSuccess && response.type !== TS_KEYWORDS.ANY, - ); + const errorResponses = responseInfos.filter((response) => !response.isSuccess && response.type !== TS_KEYWORDS.ANY); const handleResponseHeaders = (src) => { if (!src) { @@ -507,24 +476,16 @@ const getResponseBodyInfo = (routeInfo, routeParams, parsedSchemas) => { responseInfos .map( (response) => `{ - data: ${response.type}, status: ${response.status}, statusCode: ${ - response.status - }, statusText: "${response.description}", ${handleResponseHeaders( - response.headers, - )} config: {} }`, + data: ${response.type}, status: ${response.status}, statusCode: ${response.status}, statusText: "${ + response.description + }", ${handleResponseHeaders(response.headers)} config: {} }`, ) .join(" | ") || TS_KEYWORDS.ANY, }, }; }; -const parseRoutes = ({ - usageSchema, - parsedSchemas, - moduleNameIndex, - moduleNameFirstTag, - extractRequestParams, -}) => { +const parseRoutes = ({ usageSchema, parsedSchemas, moduleNameIndex, moduleNameFirstTag, extractRequestParams }) => { const { paths, security: globalSecurity } = usageSchema; const pathsEntries = _.entries(paths); @@ -553,16 +514,13 @@ const parseRoutes = ({ } = routeInfo; const { route, pathParams } = parseRoute(rawRoute); - const routeId = nanoid(12); + const routeId = generateId(); const firstTag = tags && tags.length > 0 ? tags[0] : null; const moduleName = moduleNameFirstTag && firstTag ? _.camelCase(firstTag) : _.camelCase(_.compact(_.split(route, "/"))[moduleNameIndex]); - const hasSecurity = !!( - (globalSecurity && globalSecurity.length) || - (security && security.length) - ); + const hasSecurity = !!((globalSecurity && globalSecurity.length) || (security && security.length)); const routeParams = getRouteParams(routeInfo, pathParams); @@ -599,12 +557,7 @@ const parseRoutes = ({ const routeName = getRouteName(rawRouteInfo); - const requestBodyInfo = getRequestBodyInfo( - routeInfo, - routeParams, - parsedSchemas, - routeName, - ); + const requestBodyInfo = getRequestBodyInfo(routeInfo, routeParams, parsedSchemas, routeName); const requestParamsSchema = createRequestParamsSchema({ queryParams: routeParams.query, @@ -614,13 +567,12 @@ const parseRoutes = ({ routeName, }); - const queryType = routeParams.query.length - ? getInlineParseContent(queryObjectSchema) - : null; + extractResponseBodyIfItNeeded(routeInfo, responseBodyInfo, routeParams, rawRouteInfo, routeName); + extractResponseErrorIfItNeeded(routeInfo, responseBodyInfo, routeParams, rawRouteInfo, routeName); + + const queryType = routeParams.query.length ? getInlineParseContent(queryObjectSchema) : null; const pathType = routeParams.path.length ? getInlineParseContent(pathObjectSchema) : null; - const headersType = routeParams.header.length - ? getInlineParseContent(headersObjectSchema) - : null; + const headersType = routeParams.header.length ? getInlineParseContent(headersObjectSchema) : null; const nameResolver = new SpecificArgNameResolver(pathArgsNames); @@ -634,10 +586,7 @@ const parseRoutes = ({ : void 0, body: requestBodyInfo.type ? { - name: nameResolver.resolve([ - requestBodyInfo.paramName, - ...RESERVED_BODY_ARG_NAMES, - ]), + name: nameResolver.resolve([requestBodyInfo.paramName, ...RESERVED_BODY_ARG_NAMES]), optional: !requestBodyInfo.required, type: requestBodyInfo.type, } @@ -764,10 +713,7 @@ const groupRoutes = (routes) => { if ( packRoutes.length > 1 && usageName !== originalName && - !_.some( - packRoutes, - ({ routeName, id }) => id !== route.id && originalName === routeName.original, - ) + !_.some(packRoutes, ({ routeName, id }) => id !== route.id && originalName === routeName.original) ) { return { ...route, @@ -788,6 +734,72 @@ const groupRoutes = (routes) => { ); }; +const extractResponseBodyIfItNeeded = (routeInfo, responseBodyInfo, routeParams, rawRouteInfo, routeName) => { + if ( + config.extractResponseBody && + responseBodyInfo.responses.length && + responseBodyInfo.success && + responseBodyInfo.success.schema + ) { + const typeName = config.componentTypeNameResolver.resolve([ + classNameCase(`${routeName.usage} Data`), + classNameCase(`${routeName.usage} Result`), + classNameCase(`${routeName.usage} Output`), + ]); + + const idx = responseBodyInfo.responses.indexOf(responseBodyInfo.success.schema); + + let successResponse = responseBodyInfo.success; + + if (successResponse.schema && !successResponse.schema.$ref) { + const schema = getSchemaFromRequestType(successResponse.schema); + successResponse.schema = createComponent("schemas", typeName, { ...schema }); + successResponse.type = getInlineParseContent(successResponse.schema); + + if (idx > -1) { + responseBodyInfo.responses[idx] = successResponse.schema; + } + } + } +}; + +const extractResponseErrorIfItNeeded = (routeInfo, responseBodyInfo, routeParams, rawRouteInfo, routeName) => { + if ( + config.extractResponseError && + responseBodyInfo.responses.length && + responseBodyInfo.error.schemas && + responseBodyInfo.error.schemas.length + ) { + const typeName = config.componentTypeNameResolver.resolve([ + classNameCase(`${routeName.usage} Error`), + classNameCase(`${routeName.usage} Fail`), + classNameCase(`${routeName.usage} Fails`), + classNameCase(`${routeName.usage} ErrorData`), + classNameCase(`${routeName.usage} HttpError`), + classNameCase(`${routeName.usage} BadResponse`), + ]); + + const errorSchemas = responseBodyInfo.error.schemas.map(getSchemaFromRequestType).filter(Boolean); + + if (!errorSchemas.length) return; + + const schema = parseSchema({ + oneOf: errorSchemas, + title: errorSchemas + .map((schema) => schema.title) + .filter(Boolean) + .join(" "), + description: errorSchemas + .map((schema) => schema.description) + .filter(Boolean) + .join("\n"), + }); + const component = createComponent("schemas", typeName, { ...schema }); + responseBodyInfo.error.schemas = [component]; + responseBodyInfo.error.type = formatModelName(component.typeName); + } +}; + module.exports = { parseRoutes, groupRoutes, diff --git a/src/schema.js b/src/schema.js index 8bd40ce77..5b73eed7a 100644 --- a/src/schema.js +++ b/src/schema.js @@ -63,12 +63,7 @@ const getTypeAlias = (rawSchema) => { }; const getEnumNames = (schema) => { - return ( - schema["x-enumNames"] || - schema["xEnumNames"] || - schema["x-enumnames"] || - schema["x-enum-varnames"] - ); + return schema["x-enumNames"] || schema["xEnumNames"] || schema["x-enumnames"] || schema["x-enum-varnames"]; }; const getInternalSchemaType = (schema) => { @@ -137,9 +132,11 @@ const getObjectTypeContent = (schema) => { const nullable = !!(rawTypeData.nullable || property.nullable); const fieldName = isValidName(name) ? name : `"${name}"`; const fieldValue = getInlineParseContent(property); + const readOnly = property.readOnly; return { $$raw: property, + title: property.title, description: _.compact([ property.description || _.compact(_.map(property[getComplexType(property)], "description"))[0] || @@ -151,15 +148,19 @@ const getObjectTypeContent = (schema) => { !_.isUndefined(property.maximum) && `@max ${property.maximum}`, !_.isUndefined(property.pattern) && `@pattern ${property.pattern}`, !_.isUndefined(property.example) && - `@example ${ - _.isObject(property.example) ? JSON.stringify(property.example) : property.example - }`, + `@example ${_.isObject(property.example) ? JSON.stringify(property.example) : property.example}`, ]).join("\n"), isRequired: required, isNullable: nullable, name: fieldName, value: fieldValue, - field: _.compact([fieldName, !required && "?", ": ", fieldValue]).join(""), + field: _.compact([ + readOnly && config.addReadonly && "readonly ", + fieldName, + !required && "?", + ": ", + fieldValue, + ]).join(""), }; }); @@ -178,39 +179,73 @@ const getObjectTypeContent = (schema) => { const complexTypeGetter = (schema) => getInlineParseContent(schema); const filterContents = (contents, types) => _.filter(contents, (type) => !_.includes(types, type)); +const makeAddRequiredToChildSchema = (parentSchema) => (childSchema) => { + let required = childSchema.required || []; + let properties = childSchema.properties || {}; + + // Inherit all the required fields from the parent schema that are defined + // either on the parent schema or on the child schema + // TODO: any that are defined at grandparents or higher are ignored + required = required.concat( + (parentSchema.required || []).filter( + (key) => + !required.includes(key) && (_.keys(properties).includes(key) || _.keys(parentSchema.properties).includes(key)), + ), + ); + + // Identify properties that are required in the child schema, but + // defined only in the parent schema (TODO: this only works one level deep) + const parentPropertiesRequiredByChild = required.filter( + (key) => !_.keys(childSchema.properties).includes(key) && _.keys(parentSchema.properties).includes(key), + ); + + // Add such properties to the child so that they can be overriden and made required + properties = { + ...properties, + ...parentPropertiesRequiredByChild.reduce( + (additionalProperties, key) => ({ + ...additionalProperties, + [key]: (parentSchema.properties || {})[key], + }), + {}, + ), + }; + + return _.merge( + { + required: required, + properties: properties, + }, + childSchema, + ); +}; + const complexSchemaParsers = { [SCHEMA_TYPES.COMPLEX_ONE_OF]: (schema) => { // T1 | T2 - const combined = _.map(schema.oneOf, complexTypeGetter); + const combined = _.map(_.map(schema.oneOf, makeAddRequiredToChildSchema(schema)), complexTypeGetter); return checkAndAddNull(schema, filterContents(combined, [TS_KEYWORDS.ANY]).join(" | ")); }, [SCHEMA_TYPES.COMPLEX_ALL_OF]: (schema) => { // T1 & T2 - const combined = _.map(schema.allOf, complexTypeGetter); + const combined = _.map(_.map(schema.allOf, makeAddRequiredToChildSchema(schema)), complexTypeGetter); return checkAndAddNull( schema, - filterContents(combined, [...JS_EMPTY_TYPES, ...JS_PRIMITIVE_TYPES, TS_KEYWORDS.ANY]).join( - " & ", - ), + filterContents(combined, [...JS_EMPTY_TYPES, ...JS_PRIMITIVE_TYPES, TS_KEYWORDS.ANY]).join(" & "), ); }, [SCHEMA_TYPES.COMPLEX_ANY_OF]: (schema) => { // T1 | T2 | (T1 & T2) - const combined = _.map(schema.anyOf, complexTypeGetter); - const nonEmptyTypesCombined = filterContents(combined, [ - ...JS_EMPTY_TYPES, - ...JS_PRIMITIVE_TYPES, - TS_KEYWORDS.ANY, - ]); + const combined = _.map(_.map(schema.anyOf, makeAddRequiredToChildSchema(schema)), complexTypeGetter); + const nonEmptyTypesCombined = filterContents(combined, [...JS_EMPTY_TYPES, ...JS_PRIMITIVE_TYPES, TS_KEYWORDS.ANY]); return checkAndAddNull( schema, - `${combined.join(" | ")}` + - (nonEmptyTypesCombined.length > 1 ? ` | (${nonEmptyTypesCombined.join(" & ")})` : ""), + `${combined.join(" | ")}` + (nonEmptyTypesCombined.length > 1 ? ` | (${nonEmptyTypesCombined.join(" & ")})` : ""), ); }, // TODO - [SCHEMA_TYPES.COMPLEX_NOT_OF]: (schema) => { + [SCHEMA_TYPES.COMPLEX_NOT]: (schema) => { // TODO return TS_KEYWORDS.ANY; }, @@ -227,8 +262,7 @@ const getComplexType = (schema) => { }; const attachParsedRef = (originalSchema, parsedSchema) => { - const parsedSchemaAfterHook = - config.hooks.onParseSchema(originalSchema, parsedSchema) || parsedSchema; + const parsedSchemaAfterHook = config.hooks.onParseSchema(originalSchema, parsedSchema) || parsedSchema; if (originalSchema) { originalSchema.$parsed = parsedSchemaAfterHook; @@ -263,12 +297,7 @@ const schemaParsers = { return { key: formattedKey, type: keyType, - value: - enumValue === null - ? enumValue - : isIntegerOrBooleanEnum - ? `${enumValue}` - : `"${enumValue}"`, + value: enumValue === null ? enumValue : isIntegerOrBooleanEnum ? `${enumValue}` : `"${enumValue}"`, }; }); } else { @@ -290,9 +319,7 @@ const schemaParsers = { type: SCHEMA_TYPES.ENUM, keyType: keyType, typeIdentifier: - config.generateUnionEnums || (!enumNames && isIntegerOrBooleanEnum) - ? TS_KEYWORDS.TYPE - : TS_KEYWORDS.ENUM, + config.generateUnionEnums || (!enumNames && isIntegerOrBooleanEnum) ? TS_KEYWORDS.TYPE : TS_KEYWORDS.ENUM, name: typeName, description: formatDescription(schema.description), content, @@ -331,8 +358,7 @@ const schemaParsers = { content: _.compact([ complexSchemaContent && `(${complexSchemaContent})`, - getInternalSchemaType(simpleSchema) === TS_KEYWORDS.OBJECT && - getInlineParseContent(simpleSchema), + getInternalSchemaType(simpleSchema) === TS_KEYWORDS.OBJECT && getInlineParseContent(simpleSchema), ]).join(" & ") || TS_KEYWORDS.ANY, }); }, @@ -400,10 +426,7 @@ const parseSchema = (rawSchema, typeName, formattersMap) => { parsedSchema = schemaParsers[schemaType](fixedRawSchema, typeName); } - return ( - (formattersMap && formattersMap[schemaType] && formattersMap[schemaType](parsedSchema)) || - parsedSchema - ); + return (formattersMap && formattersMap[schemaType] && formattersMap[schemaType](parsedSchema)) || parsedSchema; }; const parseSchemas = (components) => @@ -412,8 +435,7 @@ const parseSchemas = (components) => const getInlineParseContent = (rawTypeData, typeName = null) => parseSchema(rawTypeData, typeName, inlineExtraFormatters).content; -const getParseContent = (rawTypeData, typeName = null) => - parseSchema(rawTypeData, typeName).content; +const getParseContent = (rawTypeData, typeName = null) => parseSchema(rawTypeData, typeName).content; module.exports = { types, diff --git a/src/swagger.js b/src/swagger.js index 80c16ba15..2fddaa710 100644 --- a/src/swagger.js +++ b/src/swagger.js @@ -17,8 +17,8 @@ const parseSwaggerFile = (file) => { } }; -const getSwaggerFile = (pathToSwagger, urlToSwagger, disableStrictSSL, disableProxy) => - new Promise((resolve) => { +const getSwaggerFile = (pathToSwagger, urlToSwagger, disableStrictSSL, disableProxy, authorizationToken) => + new Promise((resolve, reject) => { if (pathIsExist(pathToSwagger)) { logger.log(`try to get swagger by path "${pathToSwagger}"`); resolve(getFileContent(pathToSwagger)); @@ -33,21 +33,40 @@ const getSwaggerFile = (pathToSwagger, urlToSwagger, disableStrictSSL, disablePr }); } // + if (authorizationToken) { + axiosOptions.headers = { + Authorization: authorizationToken, + }; + } + // if (disableProxy) axiosOptions.proxy = false; // axios .get(urlToSwagger, axiosOptions) .then((res) => resolve(res.data)) - .catch((err) => logger.error(`error while getting swagger by URL ${urlToSwagger}:`, err)); + .catch((error) => { + const message = `error while getting swagger by URL ${urlToSwagger}`; + + logger.error(message, "response" in error ? error.response : error); + + reject(message); + }); } }); -const getSwaggerObject = (pathToSwagger, urlToSwagger, disableStrictSSL, disableProxy) => - getSwaggerFile(pathToSwagger, urlToSwagger, disableStrictSSL, disableProxy).then((file) => - convertSwaggerObject(parseSwaggerFile(file)), +const getSwaggerObject = ( + pathToSwagger, + urlToSwagger, + disableStrictSSL, + disableProxy, + authorizationToken, + converterOptions, +) => + getSwaggerFile(pathToSwagger, urlToSwagger, disableStrictSSL, disableProxy, authorizationToken).then((file) => + convertSwaggerObject(parseSwaggerFile(file), converterOptions), ); -const convertSwaggerObject = (swaggerSchema) => { +const convertSwaggerObject = (swaggerSchema, converterOptions) => { return new Promise((resolve) => { swaggerSchema.info = _.merge( { @@ -63,6 +82,7 @@ const convertSwaggerObject = (swaggerSchema) => { converter.convertObj( swaggerSchema, { + ...converterOptions, warnOnly: true, refSiblings: "preserve", rbname: "requestBodyName", diff --git a/src/typeFormatters.js b/src/typeFormatters.js index bca14db51..950c876ef 100644 --- a/src/typeFormatters.js +++ b/src/typeFormatters.js @@ -18,10 +18,10 @@ const formatters = { const extraSpace = " "; const result = `${extraSpace}${part.field};\n`; - const comments = _.compact([part.title, part.description]).reduce( + const comments = _.uniq(_.compact([part.title, part.description]).reduce( (acc, comment) => [...acc, ...comment.split(/\n/g)], [], - ); + )); const commonText = comments.length ? [ diff --git a/src/utils/id.js b/src/utils/id.js new file mode 100644 index 000000000..d4c6b30ea --- /dev/null +++ b/src/utils/id.js @@ -0,0 +1,9 @@ +const { customAlphabet } = require("nanoid"); + +const ALPHABET = "abcdefghijklmnopqrstuvwxyz0123456789"; + +const generateId = customAlphabet(ALPHABET, 12); + +module.exports = { + generateId, +}; diff --git a/templates/base/data-contracts.eta b/templates/base/data-contracts.eta index 7e3ef4aed..aa0d24e54 100644 --- a/templates/base/data-contracts.eta +++ b/templates/base/data-contracts.eta @@ -1,7 +1,7 @@ <% const { modelTypes, utils } = it; const { formatDescription, require, _ } = utils; - + const dataContractTemplates = { enum: (contract) => { diff --git a/templates/base/http-clients/axios-http-client.eta b/templates/base/http-clients/axios-http-client.eta index 54534d505..0db069984 100644 --- a/templates/base/http-clients/axios-http-client.eta +++ b/templates/base/http-clients/axios-http-client.eta @@ -2,7 +2,7 @@ const { apiConfig, generateResponses, config } = it; %> -import axios, { AxiosInstance, AxiosRequestConfig, AxiosResponse, ResponseType } from "axios"; +import axios, { AxiosInstance, AxiosRequestConfig, AxiosResponse, ResponseType, HeadersDefaults } from "axios"; export type QueryParamsType = Record; @@ -53,20 +53,44 @@ export class HttpClient { this.securityData = data } - private mergeRequestParams(params1: AxiosRequestConfig, params2?: AxiosRequestConfig): AxiosRequestConfig { - return { - ...this.instance.defaults, - ...params1, - ...(params2 || {}), - headers: { - ...(this.instance.defaults.headers || {}), - ...(params1.headers || {}), - ...((params2 && params2.headers) || {}), - }, - }; + protected mergeRequestParams(params1: AxiosRequestConfig, params2?: AxiosRequestConfig): AxiosRequestConfig { + const method = params1.method || (params2 && params2.method) + + return { + ...this.instance.defaults, + ...params1, + ...(params2 || {}), + headers: { + ...((method && this.instance.defaults.headers[method.toLowerCase() as keyof HeadersDefaults]) || {}), + ...(params1.headers || {}), + ...((params2 && params2.headers) || {}), + }, + }; } - private createFormData(input: Record): FormData { + protected stringifyFormItem(formItem: unknown) { + if (typeof formItem === "object" && formItem !== null) { + return JSON.stringify(formItem); + } else { + return `${formItem}`; + } + } + + protected createFormData(input: Record): FormData { + return Object.keys(input || {}).reduce((formData, key) => { + const property = input[key]; + const propertyContent: Iterable = (property instanceof Array) ? property : [property] + + for (const formItem of propertyContent) { + const isFileType = formItem instanceof Blob || formItem instanceof File; + formData.append( + key, + isFileType ? formItem : this.stringifyFormItem(formItem) + ); + } + + return formData; + }, new FormData()); return Object.keys(input || {}).reduce((formData, key) => { const property = input[key]; formData.append( @@ -96,13 +120,9 @@ export class HttpClient { <% } %> const secureParams = ((typeof secure === 'boolean' ? secure : this.secure) && this.securityWorker && (await this.securityWorker(this.securityData))) || {}; const requestParams = this.mergeRequestParams(params, secureParams); - const responseFormat = (format && this.format) || void 0; + const responseFormat = (format || this.format) || undefined; if (type === ContentType.FormData && body && body !== null && typeof body === "object") { - requestParams.headers.common = { Accept: "*/*" }; - requestParams.headers.post = {}; - requestParams.headers.put = {}; - body = this.createFormData(body as Record); } diff --git a/templates/base/http-clients/fetch-http-client.eta b/templates/base/http-clients/fetch-http-client.eta index 0477e0b70..11d039585 100644 --- a/templates/base/http-clients/fetch-http-client.eta +++ b/templates/base/http-clients/fetch-http-client.eta @@ -68,17 +68,17 @@ export class HttpClient { public setSecurityData = (data: SecurityDataType | null) => { this.securityData = data; } - - private encodeQueryParam(key: string, value: any) { + + protected encodeQueryParam(key: string, value: any) { const encodedKey = encodeURIComponent(key); return `${encodedKey}=${encodeURIComponent(typeof value === "number" ? value : `${value}`)}`; } - private addQueryParam(query: QueryParamsType, key: string) { + protected addQueryParam(query: QueryParamsType, key: string) { return this.encodeQueryParam(key, query[key]); } - private addArrayQueryParam(query: QueryParamsType, key: string) { + protected addArrayQueryParam(query: QueryParamsType, key: string) { const value = query[key]; return value.map((v: any) => this.encodeQueryParam(key, v)).join("&"); } @@ -118,7 +118,7 @@ export class HttpClient { [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), } - private mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { return { ...this.baseApiParams, ...params1, @@ -131,7 +131,7 @@ export class HttpClient { }; } - private createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { if (this.abortControllers.has(cancelToken)) { const abortController = this.abortControllers.get(cancelToken); if (abortController) { @@ -183,7 +183,7 @@ export class HttpClient { ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), ...(requestParams.headers || {}), }, - signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0, + signal: cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal, body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), } ).then(async (response) => { @@ -209,7 +209,9 @@ export class HttpClient { this.abortControllers.delete(cancelToken); } +<% if (!config.disableThrowOnError) { %> if (!response.ok) throw data; +<% } %> <% if (config.unwrapResponseData) { %> return data.data; <% } else { %> diff --git a/templates/default/api.eta b/templates/default/api.eta index 430e6a262..3f33d5d29 100644 --- a/templates/default/api.eta +++ b/templates/default/api.eta @@ -36,7 +36,7 @@ const descriptionLines = _.compact([ <% }) %> */ <% } %> -export class Api<% if (!config.singleHttpClient) { %> extends HttpClient <% } %> { +export class <%~ config.apiClassName %><% if (!config.singleHttpClient) { %> extends HttpClient <% } %> { <% if(config.singleHttpClient) { %> http: HttpClient; diff --git a/templates/modular/api.eta b/templates/modular/api.eta index 93bc74c57..ad70ad9c2 100644 --- a/templates/modular/api.eta +++ b/templates/modular/api.eta @@ -8,7 +8,7 @@ const dataContracts = _.map(modelTypes, "name"); <% if (config.httpClientType === config.constants.HTTP_CLIENT.AXIOS) { %> import { AxiosRequestConfig, AxiosResponse } from "axios"; <% } %> -import { HttpClient, RequestParams, ContentType } from "./<%~ config.fileNames.httpClient %>"; +import { HttpClient, RequestParams, ContentType, HttpResponse } from "./<%~ config.fileNames.httpClient %>"; <% if (dataContracts.length) { %> import { <%~ dataContracts.join(", ") %> } from "./<%~ config.fileNames.dataContracts %>" <% } %> diff --git a/tests/generated/v2.0/adafruit.ts b/tests/generated/v2.0/adafruit.ts index 55ea0308a..3366f2955 100644 --- a/tests/generated/v2.0/adafruit.ts +++ b/tests/generated/v2.0/adafruit.ts @@ -230,16 +230,16 @@ export class HttpClient { this.securityData = data; }; - private encodeQueryParam(key: string, value: any) { + protected encodeQueryParam(key: string, value: any) { const encodedKey = encodeURIComponent(key); return `${encodedKey}=${encodeURIComponent(typeof value === "number" ? value : `${value}`)}`; } - private addQueryParam(query: QueryParamsType, key: string) { + protected addQueryParam(query: QueryParamsType, key: string) { return this.encodeQueryParam(key, query[key]); } - private addArrayQueryParam(query: QueryParamsType, key: string) { + protected addArrayQueryParam(query: QueryParamsType, key: string) { const value = query[key]; return value.map((v: any) => this.encodeQueryParam(key, v)).join("&"); } @@ -276,7 +276,7 @@ export class HttpClient { [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), }; - private mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { return { ...this.baseApiParams, ...params1, @@ -289,7 +289,7 @@ export class HttpClient { }; } - private createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { if (this.abortControllers.has(cancelToken)) { const abortController = this.abortControllers.get(cancelToken); if (abortController) { @@ -339,12 +339,12 @@ export class HttpClient { ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), ...(requestParams.headers || {}), }, - signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0, + signal: cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal, body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), }).then(async (response) => { const r = response as HttpResponse; - r.data = (null as unknown) as T; - r.error = (null as unknown) as E; + r.data = null as unknown as T; + r.error = null as unknown as E; const data = !responseFormat ? r diff --git a/tests/generated/v2.0/another-example.ts b/tests/generated/v2.0/another-example.ts index a757df0d8..b1c6f7a44 100644 --- a/tests/generated/v2.0/another-example.ts +++ b/tests/generated/v2.0/another-example.ts @@ -206,16 +206,16 @@ export class HttpClient { this.securityData = data; }; - private encodeQueryParam(key: string, value: any) { + protected encodeQueryParam(key: string, value: any) { const encodedKey = encodeURIComponent(key); return `${encodedKey}=${encodeURIComponent(typeof value === "number" ? value : `${value}`)}`; } - private addQueryParam(query: QueryParamsType, key: string) { + protected addQueryParam(query: QueryParamsType, key: string) { return this.encodeQueryParam(key, query[key]); } - private addArrayQueryParam(query: QueryParamsType, key: string) { + protected addArrayQueryParam(query: QueryParamsType, key: string) { const value = query[key]; return value.map((v: any) => this.encodeQueryParam(key, v)).join("&"); } @@ -252,7 +252,7 @@ export class HttpClient { [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), }; - private mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { return { ...this.baseApiParams, ...params1, @@ -265,7 +265,7 @@ export class HttpClient { }; } - private createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { if (this.abortControllers.has(cancelToken)) { const abortController = this.abortControllers.get(cancelToken); if (abortController) { @@ -315,12 +315,12 @@ export class HttpClient { ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), ...(requestParams.headers || {}), }, - signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0, + signal: cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal, body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), }).then(async (response) => { const r = response as HttpResponse; - r.data = (null as unknown) as T; - r.error = (null as unknown) as E; + r.data = null as unknown as T; + r.error = null as unknown as E; const data = !responseFormat ? r diff --git a/tests/generated/v2.0/another-schema.ts b/tests/generated/v2.0/another-schema.ts index b8b3e9511..06e34867e 100644 --- a/tests/generated/v2.0/another-schema.ts +++ b/tests/generated/v2.0/another-schema.ts @@ -98,16 +98,16 @@ export class HttpClient { this.securityData = data; }; - private encodeQueryParam(key: string, value: any) { + protected encodeQueryParam(key: string, value: any) { const encodedKey = encodeURIComponent(key); return `${encodedKey}=${encodeURIComponent(typeof value === "number" ? value : `${value}`)}`; } - private addQueryParam(query: QueryParamsType, key: string) { + protected addQueryParam(query: QueryParamsType, key: string) { return this.encodeQueryParam(key, query[key]); } - private addArrayQueryParam(query: QueryParamsType, key: string) { + protected addArrayQueryParam(query: QueryParamsType, key: string) { const value = query[key]; return value.map((v: any) => this.encodeQueryParam(key, v)).join("&"); } @@ -144,7 +144,7 @@ export class HttpClient { [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), }; - private mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { return { ...this.baseApiParams, ...params1, @@ -157,7 +157,7 @@ export class HttpClient { }; } - private createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { if (this.abortControllers.has(cancelToken)) { const abortController = this.abortControllers.get(cancelToken); if (abortController) { @@ -207,12 +207,12 @@ export class HttpClient { ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), ...(requestParams.headers || {}), }, - signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0, + signal: cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal, body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), }).then(async (response) => { const r = response as HttpResponse; - r.data = (null as unknown) as T; - r.error = (null as unknown) as E; + r.data = null as unknown as T; + r.error = null as unknown as E; const data = !responseFormat ? r diff --git a/tests/generated/v2.0/api-with-examples.ts b/tests/generated/v2.0/api-with-examples.ts index f455ff72e..f1343f560 100644 --- a/tests/generated/v2.0/api-with-examples.ts +++ b/tests/generated/v2.0/api-with-examples.ts @@ -75,16 +75,16 @@ export class HttpClient { this.securityData = data; }; - private encodeQueryParam(key: string, value: any) { + protected encodeQueryParam(key: string, value: any) { const encodedKey = encodeURIComponent(key); return `${encodedKey}=${encodeURIComponent(typeof value === "number" ? value : `${value}`)}`; } - private addQueryParam(query: QueryParamsType, key: string) { + protected addQueryParam(query: QueryParamsType, key: string) { return this.encodeQueryParam(key, query[key]); } - private addArrayQueryParam(query: QueryParamsType, key: string) { + protected addArrayQueryParam(query: QueryParamsType, key: string) { const value = query[key]; return value.map((v: any) => this.encodeQueryParam(key, v)).join("&"); } @@ -121,7 +121,7 @@ export class HttpClient { [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), }; - private mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { return { ...this.baseApiParams, ...params1, @@ -134,7 +134,7 @@ export class HttpClient { }; } - private createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { if (this.abortControllers.has(cancelToken)) { const abortController = this.abortControllers.get(cancelToken); if (abortController) { @@ -184,12 +184,12 @@ export class HttpClient { ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), ...(requestParams.headers || {}), }, - signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0, + signal: cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal, body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), }).then(async (response) => { const r = response as HttpResponse; - r.data = (null as unknown) as T; - r.error = (null as unknown) as E; + r.data = null as unknown as T; + r.error = null as unknown as E; const data = !responseFormat ? r diff --git a/tests/generated/v2.0/authentiq.ts b/tests/generated/v2.0/authentiq.ts index d29c00b92..6c9f7c3fe 100644 --- a/tests/generated/v2.0/authentiq.ts +++ b/tests/generated/v2.0/authentiq.ts @@ -127,16 +127,16 @@ export class HttpClient { this.securityData = data; }; - private encodeQueryParam(key: string, value: any) { + protected encodeQueryParam(key: string, value: any) { const encodedKey = encodeURIComponent(key); return `${encodedKey}=${encodeURIComponent(typeof value === "number" ? value : `${value}`)}`; } - private addQueryParam(query: QueryParamsType, key: string) { + protected addQueryParam(query: QueryParamsType, key: string) { return this.encodeQueryParam(key, query[key]); } - private addArrayQueryParam(query: QueryParamsType, key: string) { + protected addArrayQueryParam(query: QueryParamsType, key: string) { const value = query[key]; return value.map((v: any) => this.encodeQueryParam(key, v)).join("&"); } @@ -173,7 +173,7 @@ export class HttpClient { [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), }; - private mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { return { ...this.baseApiParams, ...params1, @@ -186,7 +186,7 @@ export class HttpClient { }; } - private createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { if (this.abortControllers.has(cancelToken)) { const abortController = this.abortControllers.get(cancelToken); if (abortController) { @@ -236,12 +236,12 @@ export class HttpClient { ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), ...(requestParams.headers || {}), }, - signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0, + signal: cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal, body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), }).then(async (response) => { const r = response as HttpResponse; - r.data = (null as unknown) as T; - r.error = (null as unknown) as E; + r.data = null as unknown as T; + r.error = null as unknown as E; const data = !responseFormat ? r diff --git a/tests/generated/v2.0/enums.ts b/tests/generated/v2.0/enums.ts index 2cb773270..9a17d8a6f 100644 --- a/tests/generated/v2.0/enums.ts +++ b/tests/generated/v2.0/enums.ts @@ -140,16 +140,16 @@ export class HttpClient { this.securityData = data; }; - private encodeQueryParam(key: string, value: any) { + protected encodeQueryParam(key: string, value: any) { const encodedKey = encodeURIComponent(key); return `${encodedKey}=${encodeURIComponent(typeof value === "number" ? value : `${value}`)}`; } - private addQueryParam(query: QueryParamsType, key: string) { + protected addQueryParam(query: QueryParamsType, key: string) { return this.encodeQueryParam(key, query[key]); } - private addArrayQueryParam(query: QueryParamsType, key: string) { + protected addArrayQueryParam(query: QueryParamsType, key: string) { const value = query[key]; return value.map((v: any) => this.encodeQueryParam(key, v)).join("&"); } @@ -186,7 +186,7 @@ export class HttpClient { [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), }; - private mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { return { ...this.baseApiParams, ...params1, @@ -199,7 +199,7 @@ export class HttpClient { }; } - private createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { if (this.abortControllers.has(cancelToken)) { const abortController = this.abortControllers.get(cancelToken); if (abortController) { @@ -249,12 +249,12 @@ export class HttpClient { ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), ...(requestParams.headers || {}), }, - signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0, + signal: cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal, body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), }).then(async (response) => { const r = response as HttpResponse; - r.data = (null as unknown) as T; - r.error = (null as unknown) as E; + r.data = null as unknown as T; + r.error = null as unknown as E; const data = !responseFormat ? r diff --git a/tests/generated/v2.0/example1.ts b/tests/generated/v2.0/example1.ts index 1fca4cc8f..16ce06d99 100644 --- a/tests/generated/v2.0/example1.ts +++ b/tests/generated/v2.0/example1.ts @@ -102,16 +102,16 @@ export class HttpClient { this.securityData = data; }; - private encodeQueryParam(key: string, value: any) { + protected encodeQueryParam(key: string, value: any) { const encodedKey = encodeURIComponent(key); return `${encodedKey}=${encodeURIComponent(typeof value === "number" ? value : `${value}`)}`; } - private addQueryParam(query: QueryParamsType, key: string) { + protected addQueryParam(query: QueryParamsType, key: string) { return this.encodeQueryParam(key, query[key]); } - private addArrayQueryParam(query: QueryParamsType, key: string) { + protected addArrayQueryParam(query: QueryParamsType, key: string) { const value = query[key]; return value.map((v: any) => this.encodeQueryParam(key, v)).join("&"); } @@ -148,7 +148,7 @@ export class HttpClient { [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), }; - private mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { return { ...this.baseApiParams, ...params1, @@ -161,7 +161,7 @@ export class HttpClient { }; } - private createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { if (this.abortControllers.has(cancelToken)) { const abortController = this.abortControllers.get(cancelToken); if (abortController) { @@ -211,12 +211,12 @@ export class HttpClient { ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), ...(requestParams.headers || {}), }, - signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0, + signal: cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal, body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), }).then(async (response) => { const r = response as HttpResponse; - r.data = (null as unknown) as T; - r.error = (null as unknown) as E; + r.data = null as unknown as T; + r.error = null as unknown as E; const data = !responseFormat ? r diff --git a/tests/generated/v2.0/file-formdata-example.ts b/tests/generated/v2.0/file-formdata-example.ts index 207818b9b..b8d431fdc 100644 --- a/tests/generated/v2.0/file-formdata-example.ts +++ b/tests/generated/v2.0/file-formdata-example.ts @@ -75,16 +75,16 @@ export class HttpClient { this.securityData = data; }; - private encodeQueryParam(key: string, value: any) { + protected encodeQueryParam(key: string, value: any) { const encodedKey = encodeURIComponent(key); return `${encodedKey}=${encodeURIComponent(typeof value === "number" ? value : `${value}`)}`; } - private addQueryParam(query: QueryParamsType, key: string) { + protected addQueryParam(query: QueryParamsType, key: string) { return this.encodeQueryParam(key, query[key]); } - private addArrayQueryParam(query: QueryParamsType, key: string) { + protected addArrayQueryParam(query: QueryParamsType, key: string) { const value = query[key]; return value.map((v: any) => this.encodeQueryParam(key, v)).join("&"); } @@ -121,7 +121,7 @@ export class HttpClient { [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), }; - private mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { return { ...this.baseApiParams, ...params1, @@ -134,7 +134,7 @@ export class HttpClient { }; } - private createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { if (this.abortControllers.has(cancelToken)) { const abortController = this.abortControllers.get(cancelToken); if (abortController) { @@ -184,12 +184,12 @@ export class HttpClient { ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), ...(requestParams.headers || {}), }, - signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0, + signal: cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal, body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), }).then(async (response) => { const r = response as HttpResponse; - r.data = (null as unknown) as T; - r.error = (null as unknown) as E; + r.data = null as unknown as T; + r.error = null as unknown as E; const data = !responseFormat ? r diff --git a/tests/generated/v2.0/furkot-example.ts b/tests/generated/v2.0/furkot-example.ts index 75db3f3d7..5ece220e3 100644 --- a/tests/generated/v2.0/furkot-example.ts +++ b/tests/generated/v2.0/furkot-example.ts @@ -138,16 +138,16 @@ export class HttpClient { this.securityData = data; }; - private encodeQueryParam(key: string, value: any) { + protected encodeQueryParam(key: string, value: any) { const encodedKey = encodeURIComponent(key); return `${encodedKey}=${encodeURIComponent(typeof value === "number" ? value : `${value}`)}`; } - private addQueryParam(query: QueryParamsType, key: string) { + protected addQueryParam(query: QueryParamsType, key: string) { return this.encodeQueryParam(key, query[key]); } - private addArrayQueryParam(query: QueryParamsType, key: string) { + protected addArrayQueryParam(query: QueryParamsType, key: string) { const value = query[key]; return value.map((v: any) => this.encodeQueryParam(key, v)).join("&"); } @@ -184,7 +184,7 @@ export class HttpClient { [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), }; - private mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { return { ...this.baseApiParams, ...params1, @@ -197,7 +197,7 @@ export class HttpClient { }; } - private createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { if (this.abortControllers.has(cancelToken)) { const abortController = this.abortControllers.get(cancelToken); if (abortController) { @@ -247,12 +247,12 @@ export class HttpClient { ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), ...(requestParams.headers || {}), }, - signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0, + signal: cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal, body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), }).then(async (response) => { const r = response as HttpResponse; - r.data = (null as unknown) as T; - r.error = (null as unknown) as E; + r.data = null as unknown as T; + r.error = null as unknown as E; const data = !responseFormat ? r diff --git a/tests/generated/v2.0/giphy.ts b/tests/generated/v2.0/giphy.ts index 530e9d9d6..2441b6005 100644 --- a/tests/generated/v2.0/giphy.ts +++ b/tests/generated/v2.0/giphy.ts @@ -357,16 +357,16 @@ export class HttpClient { this.securityData = data; }; - private encodeQueryParam(key: string, value: any) { + protected encodeQueryParam(key: string, value: any) { const encodedKey = encodeURIComponent(key); return `${encodedKey}=${encodeURIComponent(typeof value === "number" ? value : `${value}`)}`; } - private addQueryParam(query: QueryParamsType, key: string) { + protected addQueryParam(query: QueryParamsType, key: string) { return this.encodeQueryParam(key, query[key]); } - private addArrayQueryParam(query: QueryParamsType, key: string) { + protected addArrayQueryParam(query: QueryParamsType, key: string) { const value = query[key]; return value.map((v: any) => this.encodeQueryParam(key, v)).join("&"); } @@ -403,7 +403,7 @@ export class HttpClient { [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), }; - private mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { return { ...this.baseApiParams, ...params1, @@ -416,7 +416,7 @@ export class HttpClient { }; } - private createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { if (this.abortControllers.has(cancelToken)) { const abortController = this.abortControllers.get(cancelToken); if (abortController) { @@ -466,12 +466,12 @@ export class HttpClient { ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), ...(requestParams.headers || {}), }, - signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0, + signal: cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal, body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), }).then(async (response) => { const r = response as HttpResponse; - r.data = (null as unknown) as T; - r.error = (null as unknown) as E; + r.data = null as unknown as T; + r.error = null as unknown as E; const data = !responseFormat ? r diff --git a/tests/generated/v2.0/github-swagger.ts b/tests/generated/v2.0/github-swagger.ts index 61f99d9d8..711d2386c 100644 --- a/tests/generated/v2.0/github-swagger.ts +++ b/tests/generated/v2.0/github-swagger.ts @@ -1510,16 +1510,16 @@ export class HttpClient { this.securityData = data; }; - private encodeQueryParam(key: string, value: any) { + protected encodeQueryParam(key: string, value: any) { const encodedKey = encodeURIComponent(key); return `${encodedKey}=${encodeURIComponent(typeof value === "number" ? value : `${value}`)}`; } - private addQueryParam(query: QueryParamsType, key: string) { + protected addQueryParam(query: QueryParamsType, key: string) { return this.encodeQueryParam(key, query[key]); } - private addArrayQueryParam(query: QueryParamsType, key: string) { + protected addArrayQueryParam(query: QueryParamsType, key: string) { const value = query[key]; return value.map((v: any) => this.encodeQueryParam(key, v)).join("&"); } @@ -1556,7 +1556,7 @@ export class HttpClient { [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), }; - private mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { return { ...this.baseApiParams, ...params1, @@ -1569,7 +1569,7 @@ export class HttpClient { }; } - private createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { if (this.abortControllers.has(cancelToken)) { const abortController = this.abortControllers.get(cancelToken); if (abortController) { @@ -1619,12 +1619,12 @@ export class HttpClient { ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), ...(requestParams.headers || {}), }, - signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0, + signal: cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal, body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), }).then(async (response) => { const r = response as HttpResponse; - r.data = (null as unknown) as T; - r.error = (null as unknown) as E; + r.data = null as unknown as T; + r.error = null as unknown as E; const data = !responseFormat ? r diff --git a/tests/generated/v2.0/path-args.ts b/tests/generated/v2.0/path-args.ts index 7e6a979b8..531c02605 100644 --- a/tests/generated/v2.0/path-args.ts +++ b/tests/generated/v2.0/path-args.ts @@ -75,16 +75,16 @@ export class HttpClient { this.securityData = data; }; - private encodeQueryParam(key: string, value: any) { + protected encodeQueryParam(key: string, value: any) { const encodedKey = encodeURIComponent(key); return `${encodedKey}=${encodeURIComponent(typeof value === "number" ? value : `${value}`)}`; } - private addQueryParam(query: QueryParamsType, key: string) { + protected addQueryParam(query: QueryParamsType, key: string) { return this.encodeQueryParam(key, query[key]); } - private addArrayQueryParam(query: QueryParamsType, key: string) { + protected addArrayQueryParam(query: QueryParamsType, key: string) { const value = query[key]; return value.map((v: any) => this.encodeQueryParam(key, v)).join("&"); } @@ -121,7 +121,7 @@ export class HttpClient { [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), }; - private mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { return { ...this.baseApiParams, ...params1, @@ -134,7 +134,7 @@ export class HttpClient { }; } - private createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { if (this.abortControllers.has(cancelToken)) { const abortController = this.abortControllers.get(cancelToken); if (abortController) { @@ -184,12 +184,12 @@ export class HttpClient { ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), ...(requestParams.headers || {}), }, - signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0, + signal: cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal, body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), }).then(async (response) => { const r = response as HttpResponse; - r.data = (null as unknown) as T; - r.error = (null as unknown) as E; + r.data = null as unknown as T; + r.error = null as unknown as E; const data = !responseFormat ? r diff --git a/tests/generated/v2.0/petstore-expanded.ts b/tests/generated/v2.0/petstore-expanded.ts index 826f1eb31..145067244 100644 --- a/tests/generated/v2.0/petstore-expanded.ts +++ b/tests/generated/v2.0/petstore-expanded.ts @@ -112,16 +112,16 @@ export class HttpClient { this.securityData = data; }; - private encodeQueryParam(key: string, value: any) { + protected encodeQueryParam(key: string, value: any) { const encodedKey = encodeURIComponent(key); return `${encodedKey}=${encodeURIComponent(typeof value === "number" ? value : `${value}`)}`; } - private addQueryParam(query: QueryParamsType, key: string) { + protected addQueryParam(query: QueryParamsType, key: string) { return this.encodeQueryParam(key, query[key]); } - private addArrayQueryParam(query: QueryParamsType, key: string) { + protected addArrayQueryParam(query: QueryParamsType, key: string) { const value = query[key]; return value.map((v: any) => this.encodeQueryParam(key, v)).join("&"); } @@ -158,7 +158,7 @@ export class HttpClient { [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), }; - private mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { return { ...this.baseApiParams, ...params1, @@ -171,7 +171,7 @@ export class HttpClient { }; } - private createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { if (this.abortControllers.has(cancelToken)) { const abortController = this.abortControllers.get(cancelToken); if (abortController) { @@ -221,12 +221,12 @@ export class HttpClient { ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), ...(requestParams.headers || {}), }, - signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0, + signal: cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal, body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), }).then(async (response) => { const r = response as HttpResponse; - r.data = (null as unknown) as T; - r.error = (null as unknown) as E; + r.data = null as unknown as T; + r.error = null as unknown as E; const data = !responseFormat ? r diff --git a/tests/generated/v2.0/petstore-minimal.ts b/tests/generated/v2.0/petstore-minimal.ts index ceea370c7..ebf743d51 100644 --- a/tests/generated/v2.0/petstore-minimal.ts +++ b/tests/generated/v2.0/petstore-minimal.ts @@ -83,16 +83,16 @@ export class HttpClient { this.securityData = data; }; - private encodeQueryParam(key: string, value: any) { + protected encodeQueryParam(key: string, value: any) { const encodedKey = encodeURIComponent(key); return `${encodedKey}=${encodeURIComponent(typeof value === "number" ? value : `${value}`)}`; } - private addQueryParam(query: QueryParamsType, key: string) { + protected addQueryParam(query: QueryParamsType, key: string) { return this.encodeQueryParam(key, query[key]); } - private addArrayQueryParam(query: QueryParamsType, key: string) { + protected addArrayQueryParam(query: QueryParamsType, key: string) { const value = query[key]; return value.map((v: any) => this.encodeQueryParam(key, v)).join("&"); } @@ -129,7 +129,7 @@ export class HttpClient { [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), }; - private mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { return { ...this.baseApiParams, ...params1, @@ -142,7 +142,7 @@ export class HttpClient { }; } - private createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { if (this.abortControllers.has(cancelToken)) { const abortController = this.abortControllers.get(cancelToken); if (abortController) { @@ -192,12 +192,12 @@ export class HttpClient { ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), ...(requestParams.headers || {}), }, - signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0, + signal: cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal, body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), }).then(async (response) => { const r = response as HttpResponse; - r.data = (null as unknown) as T; - r.error = (null as unknown) as E; + r.data = null as unknown as T; + r.error = null as unknown as E; const data = !responseFormat ? r diff --git a/tests/generated/v2.0/petstore-simple.ts b/tests/generated/v2.0/petstore-simple.ts index 1521df620..0f6601cb1 100644 --- a/tests/generated/v2.0/petstore-simple.ts +++ b/tests/generated/v2.0/petstore-simple.ts @@ -98,16 +98,16 @@ export class HttpClient { this.securityData = data; }; - private encodeQueryParam(key: string, value: any) { + protected encodeQueryParam(key: string, value: any) { const encodedKey = encodeURIComponent(key); return `${encodedKey}=${encodeURIComponent(typeof value === "number" ? value : `${value}`)}`; } - private addQueryParam(query: QueryParamsType, key: string) { + protected addQueryParam(query: QueryParamsType, key: string) { return this.encodeQueryParam(key, query[key]); } - private addArrayQueryParam(query: QueryParamsType, key: string) { + protected addArrayQueryParam(query: QueryParamsType, key: string) { const value = query[key]; return value.map((v: any) => this.encodeQueryParam(key, v)).join("&"); } @@ -144,7 +144,7 @@ export class HttpClient { [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), }; - private mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { return { ...this.baseApiParams, ...params1, @@ -157,7 +157,7 @@ export class HttpClient { }; } - private createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { if (this.abortControllers.has(cancelToken)) { const abortController = this.abortControllers.get(cancelToken); if (abortController) { @@ -207,12 +207,12 @@ export class HttpClient { ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), ...(requestParams.headers || {}), }, - signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0, + signal: cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal, body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), }).then(async (response) => { const r = response as HttpResponse; - r.data = (null as unknown) as T; - r.error = (null as unknown) as E; + r.data = null as unknown as T; + r.error = null as unknown as E; const data = !responseFormat ? r diff --git a/tests/generated/v2.0/petstore-swagger-io.ts b/tests/generated/v2.0/petstore-swagger-io.ts index 6fb5ccb94..be5039ae2 100644 --- a/tests/generated/v2.0/petstore-swagger-io.ts +++ b/tests/generated/v2.0/petstore-swagger-io.ts @@ -143,16 +143,16 @@ export class HttpClient { this.securityData = data; }; - private encodeQueryParam(key: string, value: any) { + protected encodeQueryParam(key: string, value: any) { const encodedKey = encodeURIComponent(key); return `${encodedKey}=${encodeURIComponent(typeof value === "number" ? value : `${value}`)}`; } - private addQueryParam(query: QueryParamsType, key: string) { + protected addQueryParam(query: QueryParamsType, key: string) { return this.encodeQueryParam(key, query[key]); } - private addArrayQueryParam(query: QueryParamsType, key: string) { + protected addArrayQueryParam(query: QueryParamsType, key: string) { const value = query[key]; return value.map((v: any) => this.encodeQueryParam(key, v)).join("&"); } @@ -189,7 +189,7 @@ export class HttpClient { [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), }; - private mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { return { ...this.baseApiParams, ...params1, @@ -202,7 +202,7 @@ export class HttpClient { }; } - private createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { if (this.abortControllers.has(cancelToken)) { const abortController = this.abortControllers.get(cancelToken); if (abortController) { @@ -252,12 +252,12 @@ export class HttpClient { ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), ...(requestParams.headers || {}), }, - signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0, + signal: cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal, body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), }).then(async (response) => { const r = response as HttpResponse; - r.data = (null as unknown) as T; - r.error = (null as unknown) as E; + r.data = null as unknown as T; + r.error = null as unknown as E; const data = !responseFormat ? r diff --git a/tests/generated/v2.0/petstore-with-external-docs.ts b/tests/generated/v2.0/petstore-with-external-docs.ts index 6d0b628ff..c7023ebbe 100644 --- a/tests/generated/v2.0/petstore-with-external-docs.ts +++ b/tests/generated/v2.0/petstore-with-external-docs.ts @@ -88,16 +88,16 @@ export class HttpClient { this.securityData = data; }; - private encodeQueryParam(key: string, value: any) { + protected encodeQueryParam(key: string, value: any) { const encodedKey = encodeURIComponent(key); return `${encodedKey}=${encodeURIComponent(typeof value === "number" ? value : `${value}`)}`; } - private addQueryParam(query: QueryParamsType, key: string) { + protected addQueryParam(query: QueryParamsType, key: string) { return this.encodeQueryParam(key, query[key]); } - private addArrayQueryParam(query: QueryParamsType, key: string) { + protected addArrayQueryParam(query: QueryParamsType, key: string) { const value = query[key]; return value.map((v: any) => this.encodeQueryParam(key, v)).join("&"); } @@ -134,7 +134,7 @@ export class HttpClient { [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), }; - private mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { return { ...this.baseApiParams, ...params1, @@ -147,7 +147,7 @@ export class HttpClient { }; } - private createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { if (this.abortControllers.has(cancelToken)) { const abortController = this.abortControllers.get(cancelToken); if (abortController) { @@ -197,12 +197,12 @@ export class HttpClient { ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), ...(requestParams.headers || {}), }, - signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0, + signal: cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal, body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), }).then(async (response) => { const r = response as HttpResponse; - r.data = (null as unknown) as T; - r.error = (null as unknown) as E; + r.data = null as unknown as T; + r.error = null as unknown as E; const data = !responseFormat ? r diff --git a/tests/generated/v2.0/petstore.ts b/tests/generated/v2.0/petstore.ts index e057145d6..01cfde72f 100644 --- a/tests/generated/v2.0/petstore.ts +++ b/tests/generated/v2.0/petstore.ts @@ -90,16 +90,16 @@ export class HttpClient { this.securityData = data; }; - private encodeQueryParam(key: string, value: any) { + protected encodeQueryParam(key: string, value: any) { const encodedKey = encodeURIComponent(key); return `${encodedKey}=${encodeURIComponent(typeof value === "number" ? value : `${value}`)}`; } - private addQueryParam(query: QueryParamsType, key: string) { + protected addQueryParam(query: QueryParamsType, key: string) { return this.encodeQueryParam(key, query[key]); } - private addArrayQueryParam(query: QueryParamsType, key: string) { + protected addArrayQueryParam(query: QueryParamsType, key: string) { const value = query[key]; return value.map((v: any) => this.encodeQueryParam(key, v)).join("&"); } @@ -136,7 +136,7 @@ export class HttpClient { [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), }; - private mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { return { ...this.baseApiParams, ...params1, @@ -149,7 +149,7 @@ export class HttpClient { }; } - private createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { if (this.abortControllers.has(cancelToken)) { const abortController = this.abortControllers.get(cancelToken); if (abortController) { @@ -199,12 +199,12 @@ export class HttpClient { ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), ...(requestParams.headers || {}), }, - signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0, + signal: cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal, body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), }).then(async (response) => { const r = response as HttpResponse; - r.data = (null as unknown) as T; - r.error = (null as unknown) as E; + r.data = null as unknown as T; + r.error = null as unknown as E; const data = !responseFormat ? r diff --git a/tests/generated/v2.0/query-path-param.ts b/tests/generated/v2.0/query-path-param.ts index 310bf3aad..8073ebff1 100644 --- a/tests/generated/v2.0/query-path-param.ts +++ b/tests/generated/v2.0/query-path-param.ts @@ -75,16 +75,16 @@ export class HttpClient { this.securityData = data; }; - private encodeQueryParam(key: string, value: any) { + protected encodeQueryParam(key: string, value: any) { const encodedKey = encodeURIComponent(key); return `${encodedKey}=${encodeURIComponent(typeof value === "number" ? value : `${value}`)}`; } - private addQueryParam(query: QueryParamsType, key: string) { + protected addQueryParam(query: QueryParamsType, key: string) { return this.encodeQueryParam(key, query[key]); } - private addArrayQueryParam(query: QueryParamsType, key: string) { + protected addArrayQueryParam(query: QueryParamsType, key: string) { const value = query[key]; return value.map((v: any) => this.encodeQueryParam(key, v)).join("&"); } @@ -121,7 +121,7 @@ export class HttpClient { [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), }; - private mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { return { ...this.baseApiParams, ...params1, @@ -134,7 +134,7 @@ export class HttpClient { }; } - private createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { if (this.abortControllers.has(cancelToken)) { const abortController = this.abortControllers.get(cancelToken); if (abortController) { @@ -184,12 +184,12 @@ export class HttpClient { ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), ...(requestParams.headers || {}), }, - signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0, + signal: cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal, body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), }).then(async (response) => { const r = response as HttpResponse; - r.data = (null as unknown) as T; - r.error = (null as unknown) as E; + r.data = null as unknown as T; + r.error = null as unknown as E; const data = !responseFormat ? r diff --git a/tests/generated/v2.0/uber.ts b/tests/generated/v2.0/uber.ts index 59e4b40d6..8a305116c 100644 --- a/tests/generated/v2.0/uber.ts +++ b/tests/generated/v2.0/uber.ts @@ -170,16 +170,16 @@ export class HttpClient { this.securityData = data; }; - private encodeQueryParam(key: string, value: any) { + protected encodeQueryParam(key: string, value: any) { const encodedKey = encodeURIComponent(key); return `${encodedKey}=${encodeURIComponent(typeof value === "number" ? value : `${value}`)}`; } - private addQueryParam(query: QueryParamsType, key: string) { + protected addQueryParam(query: QueryParamsType, key: string) { return this.encodeQueryParam(key, query[key]); } - private addArrayQueryParam(query: QueryParamsType, key: string) { + protected addArrayQueryParam(query: QueryParamsType, key: string) { const value = query[key]; return value.map((v: any) => this.encodeQueryParam(key, v)).join("&"); } @@ -216,7 +216,7 @@ export class HttpClient { [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), }; - private mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { return { ...this.baseApiParams, ...params1, @@ -229,7 +229,7 @@ export class HttpClient { }; } - private createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { if (this.abortControllers.has(cancelToken)) { const abortController = this.abortControllers.get(cancelToken); if (abortController) { @@ -279,12 +279,12 @@ export class HttpClient { ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), ...(requestParams.headers || {}), }, - signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0, + signal: cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal, body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), }).then(async (response) => { const r = response as HttpResponse; - r.data = (null as unknown) as T; - r.error = (null as unknown) as E; + r.data = null as unknown as T; + r.error = null as unknown as E; const data = !responseFormat ? r diff --git a/tests/generated/v3.0/additional-properties.ts b/tests/generated/v3.0/additional-properties.ts index 94399cf89..4f0c7df48 100644 --- a/tests/generated/v3.0/additional-properties.ts +++ b/tests/generated/v3.0/additional-properties.ts @@ -82,16 +82,16 @@ export class HttpClient { this.securityData = data; }; - private encodeQueryParam(key: string, value: any) { + protected encodeQueryParam(key: string, value: any) { const encodedKey = encodeURIComponent(key); return `${encodedKey}=${encodeURIComponent(typeof value === "number" ? value : `${value}`)}`; } - private addQueryParam(query: QueryParamsType, key: string) { + protected addQueryParam(query: QueryParamsType, key: string) { return this.encodeQueryParam(key, query[key]); } - private addArrayQueryParam(query: QueryParamsType, key: string) { + protected addArrayQueryParam(query: QueryParamsType, key: string) { const value = query[key]; return value.map((v: any) => this.encodeQueryParam(key, v)).join("&"); } @@ -128,7 +128,7 @@ export class HttpClient { [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), }; - private mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { return { ...this.baseApiParams, ...params1, @@ -141,7 +141,7 @@ export class HttpClient { }; } - private createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { if (this.abortControllers.has(cancelToken)) { const abortController = this.abortControllers.get(cancelToken); if (abortController) { @@ -191,12 +191,12 @@ export class HttpClient { ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), ...(requestParams.headers || {}), }, - signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0, + signal: cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal, body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), }).then(async (response) => { const r = response as HttpResponse; - r.data = (null as unknown) as T; - r.error = (null as unknown) as E; + r.data = null as unknown as T; + r.error = null as unknown as E; const data = !responseFormat ? r diff --git a/tests/generated/v3.0/additional-properties2.ts b/tests/generated/v3.0/additional-properties2.ts index 64c5d3f63..6f71bbd39 100644 --- a/tests/generated/v3.0/additional-properties2.ts +++ b/tests/generated/v3.0/additional-properties2.ts @@ -79,16 +79,16 @@ export class HttpClient { this.securityData = data; }; - private encodeQueryParam(key: string, value: any) { + protected encodeQueryParam(key: string, value: any) { const encodedKey = encodeURIComponent(key); return `${encodedKey}=${encodeURIComponent(typeof value === "number" ? value : `${value}`)}`; } - private addQueryParam(query: QueryParamsType, key: string) { + protected addQueryParam(query: QueryParamsType, key: string) { return this.encodeQueryParam(key, query[key]); } - private addArrayQueryParam(query: QueryParamsType, key: string) { + protected addArrayQueryParam(query: QueryParamsType, key: string) { const value = query[key]; return value.map((v: any) => this.encodeQueryParam(key, v)).join("&"); } @@ -125,7 +125,7 @@ export class HttpClient { [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), }; - private mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { return { ...this.baseApiParams, ...params1, @@ -138,7 +138,7 @@ export class HttpClient { }; } - private createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { if (this.abortControllers.has(cancelToken)) { const abortController = this.abortControllers.get(cancelToken); if (abortController) { @@ -188,12 +188,12 @@ export class HttpClient { ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), ...(requestParams.headers || {}), }, - signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0, + signal: cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal, body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), }).then(async (response) => { const r = response as HttpResponse; - r.data = (null as unknown) as T; - r.error = (null as unknown) as E; + r.data = null as unknown as T; + r.error = null as unknown as E; const data = !responseFormat ? r diff --git a/tests/generated/v3.0/allof-example.ts b/tests/generated/v3.0/allof-example.ts index 2c94a295c..db24ff594 100644 --- a/tests/generated/v3.0/allof-example.ts +++ b/tests/generated/v3.0/allof-example.ts @@ -13,7 +13,7 @@ export interface Pet { pet_type: string; } -export type Dog = Pet & { bark?: boolean; breed?: "Dingo" | "Husky" | "Retriever" | "Shepherd" }; +export type Dog = Pet & { bark?: boolean; breed: "Dingo" | "Husky" | "Retriever" | "Shepherd" }; export type Cat = Pet & { hunts?: boolean; age?: number }; @@ -83,16 +83,16 @@ export class HttpClient { this.securityData = data; }; - private encodeQueryParam(key: string, value: any) { + protected encodeQueryParam(key: string, value: any) { const encodedKey = encodeURIComponent(key); return `${encodedKey}=${encodeURIComponent(typeof value === "number" ? value : `${value}`)}`; } - private addQueryParam(query: QueryParamsType, key: string) { + protected addQueryParam(query: QueryParamsType, key: string) { return this.encodeQueryParam(key, query[key]); } - private addArrayQueryParam(query: QueryParamsType, key: string) { + protected addArrayQueryParam(query: QueryParamsType, key: string) { const value = query[key]; return value.map((v: any) => this.encodeQueryParam(key, v)).join("&"); } @@ -129,7 +129,7 @@ export class HttpClient { [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), }; - private mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { return { ...this.baseApiParams, ...params1, @@ -142,7 +142,7 @@ export class HttpClient { }; } - private createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { if (this.abortControllers.has(cancelToken)) { const abortController = this.abortControllers.get(cancelToken); if (abortController) { @@ -192,12 +192,12 @@ export class HttpClient { ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), ...(requestParams.headers || {}), }, - signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0, + signal: cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal, body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), }).then(async (response) => { const r = response as HttpResponse; - r.data = (null as unknown) as T; - r.error = (null as unknown) as E; + r.data = null as unknown as T; + r.error = null as unknown as E; const data = !responseFormat ? r diff --git a/tests/generated/v3.0/anyof-example.ts b/tests/generated/v3.0/anyof-example.ts index ddfc28a1e..e03ff97d1 100644 --- a/tests/generated/v3.0/anyof-example.ts +++ b/tests/generated/v3.0/anyof-example.ts @@ -85,16 +85,16 @@ export class HttpClient { this.securityData = data; }; - private encodeQueryParam(key: string, value: any) { + protected encodeQueryParam(key: string, value: any) { const encodedKey = encodeURIComponent(key); return `${encodedKey}=${encodeURIComponent(typeof value === "number" ? value : `${value}`)}`; } - private addQueryParam(query: QueryParamsType, key: string) { + protected addQueryParam(query: QueryParamsType, key: string) { return this.encodeQueryParam(key, query[key]); } - private addArrayQueryParam(query: QueryParamsType, key: string) { + protected addArrayQueryParam(query: QueryParamsType, key: string) { const value = query[key]; return value.map((v: any) => this.encodeQueryParam(key, v)).join("&"); } @@ -131,7 +131,7 @@ export class HttpClient { [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), }; - private mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { return { ...this.baseApiParams, ...params1, @@ -144,7 +144,7 @@ export class HttpClient { }; } - private createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { if (this.abortControllers.has(cancelToken)) { const abortController = this.abortControllers.get(cancelToken); if (abortController) { @@ -194,12 +194,12 @@ export class HttpClient { ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), ...(requestParams.headers || {}), }, - signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0, + signal: cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal, body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), }).then(async (response) => { const r = response as HttpResponse; - r.data = (null as unknown) as T; - r.error = (null as unknown) as E; + r.data = null as unknown as T; + r.error = null as unknown as E; const data = !responseFormat ? r diff --git a/tests/generated/v3.0/api-with-examples.ts b/tests/generated/v3.0/api-with-examples.ts index 326a709ad..e275d1b49 100644 --- a/tests/generated/v3.0/api-with-examples.ts +++ b/tests/generated/v3.0/api-with-examples.ts @@ -75,16 +75,16 @@ export class HttpClient { this.securityData = data; }; - private encodeQueryParam(key: string, value: any) { + protected encodeQueryParam(key: string, value: any) { const encodedKey = encodeURIComponent(key); return `${encodedKey}=${encodeURIComponent(typeof value === "number" ? value : `${value}`)}`; } - private addQueryParam(query: QueryParamsType, key: string) { + protected addQueryParam(query: QueryParamsType, key: string) { return this.encodeQueryParam(key, query[key]); } - private addArrayQueryParam(query: QueryParamsType, key: string) { + protected addArrayQueryParam(query: QueryParamsType, key: string) { const value = query[key]; return value.map((v: any) => this.encodeQueryParam(key, v)).join("&"); } @@ -121,7 +121,7 @@ export class HttpClient { [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), }; - private mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { return { ...this.baseApiParams, ...params1, @@ -134,7 +134,7 @@ export class HttpClient { }; } - private createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { if (this.abortControllers.has(cancelToken)) { const abortController = this.abortControllers.get(cancelToken); if (abortController) { @@ -184,12 +184,12 @@ export class HttpClient { ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), ...(requestParams.headers || {}), }, - signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0, + signal: cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal, body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), }).then(async (response) => { const r = response as HttpResponse; - r.data = (null as unknown) as T; - r.error = (null as unknown) as E; + r.data = null as unknown as T; + r.error = null as unknown as E; const data = !responseFormat ? r diff --git a/tests/generated/v3.0/callback-example.ts b/tests/generated/v3.0/callback-example.ts index 06714ae47..65abc1b66 100644 --- a/tests/generated/v3.0/callback-example.ts +++ b/tests/generated/v3.0/callback-example.ts @@ -75,16 +75,16 @@ export class HttpClient { this.securityData = data; }; - private encodeQueryParam(key: string, value: any) { + protected encodeQueryParam(key: string, value: any) { const encodedKey = encodeURIComponent(key); return `${encodedKey}=${encodeURIComponent(typeof value === "number" ? value : `${value}`)}`; } - private addQueryParam(query: QueryParamsType, key: string) { + protected addQueryParam(query: QueryParamsType, key: string) { return this.encodeQueryParam(key, query[key]); } - private addArrayQueryParam(query: QueryParamsType, key: string) { + protected addArrayQueryParam(query: QueryParamsType, key: string) { const value = query[key]; return value.map((v: any) => this.encodeQueryParam(key, v)).join("&"); } @@ -121,7 +121,7 @@ export class HttpClient { [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), }; - private mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { return { ...this.baseApiParams, ...params1, @@ -134,7 +134,7 @@ export class HttpClient { }; } - private createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { if (this.abortControllers.has(cancelToken)) { const abortController = this.abortControllers.get(cancelToken); if (abortController) { @@ -184,12 +184,12 @@ export class HttpClient { ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), ...(requestParams.headers || {}), }, - signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0, + signal: cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal, body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), }).then(async (response) => { const r = response as HttpResponse; - r.data = (null as unknown) as T; - r.error = (null as unknown) as E; + r.data = null as unknown as T; + r.error = null as unknown as E; const data = !responseFormat ? r diff --git a/tests/generated/v3.0/components-responses.ts b/tests/generated/v3.0/components-responses.ts index 59d057668..35ee09cd3 100644 --- a/tests/generated/v3.0/components-responses.ts +++ b/tests/generated/v3.0/components-responses.ts @@ -75,16 +75,16 @@ export class HttpClient { this.securityData = data; }; - private encodeQueryParam(key: string, value: any) { + protected encodeQueryParam(key: string, value: any) { const encodedKey = encodeURIComponent(key); return `${encodedKey}=${encodeURIComponent(typeof value === "number" ? value : `${value}`)}`; } - private addQueryParam(query: QueryParamsType, key: string) { + protected addQueryParam(query: QueryParamsType, key: string) { return this.encodeQueryParam(key, query[key]); } - private addArrayQueryParam(query: QueryParamsType, key: string) { + protected addArrayQueryParam(query: QueryParamsType, key: string) { const value = query[key]; return value.map((v: any) => this.encodeQueryParam(key, v)).join("&"); } @@ -121,7 +121,7 @@ export class HttpClient { [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), }; - private mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { return { ...this.baseApiParams, ...params1, @@ -134,7 +134,7 @@ export class HttpClient { }; } - private createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { if (this.abortControllers.has(cancelToken)) { const abortController = this.abortControllers.get(cancelToken); if (abortController) { @@ -184,12 +184,12 @@ export class HttpClient { ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), ...(requestParams.headers || {}), }, - signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0, + signal: cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal, body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), }).then(async (response) => { const r = response as HttpResponse; - r.data = (null as unknown) as T; - r.error = (null as unknown) as E; + r.data = null as unknown as T; + r.error = null as unknown as E; const data = !responseFormat ? r diff --git a/tests/generated/v3.0/explode-param-3.0.1.ts b/tests/generated/v3.0/explode-param-3.0.1.ts index 82004a926..93ab68e17 100644 --- a/tests/generated/v3.0/explode-param-3.0.1.ts +++ b/tests/generated/v3.0/explode-param-3.0.1.ts @@ -95,16 +95,16 @@ export class HttpClient { this.securityData = data; }; - private encodeQueryParam(key: string, value: any) { + protected encodeQueryParam(key: string, value: any) { const encodedKey = encodeURIComponent(key); return `${encodedKey}=${encodeURIComponent(typeof value === "number" ? value : `${value}`)}`; } - private addQueryParam(query: QueryParamsType, key: string) { + protected addQueryParam(query: QueryParamsType, key: string) { return this.encodeQueryParam(key, query[key]); } - private addArrayQueryParam(query: QueryParamsType, key: string) { + protected addArrayQueryParam(query: QueryParamsType, key: string) { const value = query[key]; return value.map((v: any) => this.encodeQueryParam(key, v)).join("&"); } @@ -141,7 +141,7 @@ export class HttpClient { [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), }; - private mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { return { ...this.baseApiParams, ...params1, @@ -154,7 +154,7 @@ export class HttpClient { }; } - private createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { if (this.abortControllers.has(cancelToken)) { const abortController = this.abortControllers.get(cancelToken); if (abortController) { @@ -204,12 +204,12 @@ export class HttpClient { ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), ...(requestParams.headers || {}), }, - signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0, + signal: cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal, body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), }).then(async (response) => { const r = response as HttpResponse; - r.data = (null as unknown) as T; - r.error = (null as unknown) as E; + r.data = null as unknown as T; + r.error = null as unknown as E; const data = !responseFormat ? r diff --git a/tests/generated/v3.0/full-swagger-scheme.ts b/tests/generated/v3.0/full-swagger-scheme.ts index 4d47f75ee..ccb30cdf4 100644 --- a/tests/generated/v3.0/full-swagger-scheme.ts +++ b/tests/generated/v3.0/full-swagger-scheme.ts @@ -1073,52 +1073,34 @@ export interface CodeOfConduct { * @example # Contributor Covenant Code of Conduct * * ## Our Pledge - * * In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation. - * * ## Our Standards - * * Examples of behavior that contributes to creating a positive environment include: - * * * Using welcoming and inclusive language * * Being respectful of differing viewpoints and experiences * * Gracefully accepting constructive criticism * * Focusing on what is best for the community * * Showing empathy towards other community members - * * Examples of unacceptable behavior by participants include: - * * * The use of sexualized language or imagery and unwelcome sexual attention or advances * * Trolling, insulting/derogatory comments, and personal or political attacks * * Public or private harassment * * Publishing others' private information, such as a physical or electronic address, without explicit permission * * Other conduct which could reasonably be considered inappropriate in a professional setting - * * ## Our Responsibilities - * * Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response * to any instances of unacceptable behavior. - * * Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. - * * ## Scope - * * This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, * posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers. - * * ## Enforcement - * * Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at [EMAIL]. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. - * * Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership. - * * ## Attribution - * * This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version] - * * [homepage]: http://contributor-covenant.org * [version]: http://contributor-covenant.org/version/1/4/ - * */ body?: string; @@ -1978,18 +1960,15 @@ export interface GitignoreTemplate { * # Libraries * *.lib * *.a - * * # Shared objects (inc. Windows DLLs) * *.dll * *.so * *.so.* * *.dylib - * * # Executables * *.exe * *.out * *.app - * */ source: string; } @@ -2147,19 +2126,15 @@ export interface License { * @example * * The MIT License (MIT) - * * Copyright (c) [year] [fullname] - * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: - * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. - * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE @@ -2167,7 +2142,6 @@ export interface License { * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. - * */ body: string; @@ -9019,16 +8993,16 @@ export class HttpClient { this.securityData = data; }; - private encodeQueryParam(key: string, value: any) { + protected encodeQueryParam(key: string, value: any) { const encodedKey = encodeURIComponent(key); return `${encodedKey}=${encodeURIComponent(typeof value === "number" ? value : `${value}`)}`; } - private addQueryParam(query: QueryParamsType, key: string) { + protected addQueryParam(query: QueryParamsType, key: string) { return this.encodeQueryParam(key, query[key]); } - private addArrayQueryParam(query: QueryParamsType, key: string) { + protected addArrayQueryParam(query: QueryParamsType, key: string) { const value = query[key]; return value.map((v: any) => this.encodeQueryParam(key, v)).join("&"); } @@ -9065,7 +9039,7 @@ export class HttpClient { [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), }; - private mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { return { ...this.baseApiParams, ...params1, @@ -9078,7 +9052,7 @@ export class HttpClient { }; } - private createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { if (this.abortControllers.has(cancelToken)) { const abortController = this.abortControllers.get(cancelToken); if (abortController) { @@ -9128,12 +9102,12 @@ export class HttpClient { ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), ...(requestParams.headers || {}), }, - signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0, + signal: cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal, body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), }).then(async (response) => { const r = response as HttpResponse; - r.data = (null as unknown) as T; - r.error = (null as unknown) as E; + r.data = null as unknown as T; + r.error = null as unknown as E; const data = !responseFormat ? r @@ -10636,9 +10610,41 @@ export class Api extends HttpClient; + } + | ({ description: string } & { + files: Record< + string, + ( + | { content: string } + | { filename: string | null } + | object + | ({ content: string } & { filename: string | null } & object) + ) & { content?: string; filename?: string | null } + >; + }) + ) & { description?: string; - files?: Record; + files?: Record< + string, + ( + | { content: string } + | { filename: string | null } + | object + | ({ content: string } & { filename: string | null } & object) + ) & { content?: string; filename?: string | null } + >; }, params: RequestParams = {}, ) => @@ -15943,9 +15949,21 @@ export class Api extends HttpClient extends HttpClient { this.securityData = data; }; - private encodeQueryParam(key: string, value: any) { + protected encodeQueryParam(key: string, value: any) { const encodedKey = encodeURIComponent(key); return `${encodedKey}=${encodeURIComponent(typeof value === "number" ? value : `${value}`)}`; } - private addQueryParam(query: QueryParamsType, key: string) { + protected addQueryParam(query: QueryParamsType, key: string) { return this.encodeQueryParam(key, query[key]); } - private addArrayQueryParam(query: QueryParamsType, key: string) { + protected addArrayQueryParam(query: QueryParamsType, key: string) { const value = query[key]; return value.map((v: any) => this.encodeQueryParam(key, v)).join("&"); } @@ -138,7 +138,7 @@ export class HttpClient { [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), }; - private mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { return { ...this.baseApiParams, ...params1, @@ -151,7 +151,7 @@ export class HttpClient { }; } - private createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { if (this.abortControllers.has(cancelToken)) { const abortController = this.abortControllers.get(cancelToken); if (abortController) { @@ -201,12 +201,12 @@ export class HttpClient { ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), ...(requestParams.headers || {}), }, - signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0, + signal: cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal, body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), }).then(async (response) => { const r = response as HttpResponse; - r.data = (null as unknown) as T; - r.error = (null as unknown) as E; + r.data = null as unknown as T; + r.error = null as unknown as E; const data = !responseFormat ? r diff --git a/tests/generated/v3.0/no-definitions-schema.ts b/tests/generated/v3.0/no-definitions-schema.ts index c4ac0215c..dc25bc15b 100644 --- a/tests/generated/v3.0/no-definitions-schema.ts +++ b/tests/generated/v3.0/no-definitions-schema.ts @@ -88,16 +88,16 @@ export class HttpClient { this.securityData = data; }; - private encodeQueryParam(key: string, value: any) { + protected encodeQueryParam(key: string, value: any) { const encodedKey = encodeURIComponent(key); return `${encodedKey}=${encodeURIComponent(typeof value === "number" ? value : `${value}`)}`; } - private addQueryParam(query: QueryParamsType, key: string) { + protected addQueryParam(query: QueryParamsType, key: string) { return this.encodeQueryParam(key, query[key]); } - private addArrayQueryParam(query: QueryParamsType, key: string) { + protected addArrayQueryParam(query: QueryParamsType, key: string) { const value = query[key]; return value.map((v: any) => this.encodeQueryParam(key, v)).join("&"); } @@ -134,7 +134,7 @@ export class HttpClient { [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), }; - private mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { return { ...this.baseApiParams, ...params1, @@ -147,7 +147,7 @@ export class HttpClient { }; } - private createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { if (this.abortControllers.has(cancelToken)) { const abortController = this.abortControllers.get(cancelToken); if (abortController) { @@ -197,12 +197,12 @@ export class HttpClient { ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), ...(requestParams.headers || {}), }, - signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0, + signal: cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal, body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), }).then(async (response) => { const r = response as HttpResponse; - r.data = (null as unknown) as T; - r.error = (null as unknown) as E; + r.data = null as unknown as T; + r.error = null as unknown as E; const data = !responseFormat ? r diff --git a/tests/generated/v3.0/nullable-refs.ts b/tests/generated/v3.0/nullable-refs.ts index de150083d..58ef6da16 100644 --- a/tests/generated/v3.0/nullable-refs.ts +++ b/tests/generated/v3.0/nullable-refs.ts @@ -89,16 +89,16 @@ export class HttpClient { this.securityData = data; }; - private encodeQueryParam(key: string, value: any) { + protected encodeQueryParam(key: string, value: any) { const encodedKey = encodeURIComponent(key); return `${encodedKey}=${encodeURIComponent(typeof value === "number" ? value : `${value}`)}`; } - private addQueryParam(query: QueryParamsType, key: string) { + protected addQueryParam(query: QueryParamsType, key: string) { return this.encodeQueryParam(key, query[key]); } - private addArrayQueryParam(query: QueryParamsType, key: string) { + protected addArrayQueryParam(query: QueryParamsType, key: string) { const value = query[key]; return value.map((v: any) => this.encodeQueryParam(key, v)).join("&"); } @@ -135,7 +135,7 @@ export class HttpClient { [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), }; - private mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { return { ...this.baseApiParams, ...params1, @@ -148,7 +148,7 @@ export class HttpClient { }; } - private createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { if (this.abortControllers.has(cancelToken)) { const abortController = this.abortControllers.get(cancelToken); if (abortController) { @@ -198,12 +198,12 @@ export class HttpClient { ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), ...(requestParams.headers || {}), }, - signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0, + signal: cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal, body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), }).then(async (response) => { const r = response as HttpResponse; - r.data = (null as unknown) as T; - r.error = (null as unknown) as E; + r.data = null as unknown as T; + r.error = null as unknown as E; const data = !responseFormat ? r diff --git a/tests/generated/v3.0/oneof-example.ts b/tests/generated/v3.0/oneof-example.ts index 40c40cddf..08129ec26 100644 --- a/tests/generated/v3.0/oneof-example.ts +++ b/tests/generated/v3.0/oneof-example.ts @@ -85,16 +85,16 @@ export class HttpClient { this.securityData = data; }; - private encodeQueryParam(key: string, value: any) { + protected encodeQueryParam(key: string, value: any) { const encodedKey = encodeURIComponent(key); return `${encodedKey}=${encodeURIComponent(typeof value === "number" ? value : `${value}`)}`; } - private addQueryParam(query: QueryParamsType, key: string) { + protected addQueryParam(query: QueryParamsType, key: string) { return this.encodeQueryParam(key, query[key]); } - private addArrayQueryParam(query: QueryParamsType, key: string) { + protected addArrayQueryParam(query: QueryParamsType, key: string) { const value = query[key]; return value.map((v: any) => this.encodeQueryParam(key, v)).join("&"); } @@ -131,7 +131,7 @@ export class HttpClient { [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), }; - private mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { return { ...this.baseApiParams, ...params1, @@ -144,7 +144,7 @@ export class HttpClient { }; } - private createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { if (this.abortControllers.has(cancelToken)) { const abortController = this.abortControllers.get(cancelToken); if (abortController) { @@ -194,12 +194,12 @@ export class HttpClient { ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), ...(requestParams.headers || {}), }, - signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0, + signal: cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal, body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), }).then(async (response) => { const r = response as HttpResponse; - r.data = (null as unknown) as T; - r.error = (null as unknown) as E; + r.data = null as unknown as T; + r.error = null as unknown as E; const data = !responseFormat ? r diff --git a/tests/generated/v3.0/personal-api-example.ts b/tests/generated/v3.0/personal-api-example.ts index d0896c7f7..630aca766 100644 --- a/tests/generated/v3.0/personal-api-example.ts +++ b/tests/generated/v3.0/personal-api-example.ts @@ -276,16 +276,16 @@ export class HttpClient { this.securityData = data; }; - private encodeQueryParam(key: string, value: any) { + protected encodeQueryParam(key: string, value: any) { const encodedKey = encodeURIComponent(key); return `${encodedKey}=${encodeURIComponent(typeof value === "number" ? value : `${value}`)}`; } - private addQueryParam(query: QueryParamsType, key: string) { + protected addQueryParam(query: QueryParamsType, key: string) { return this.encodeQueryParam(key, query[key]); } - private addArrayQueryParam(query: QueryParamsType, key: string) { + protected addArrayQueryParam(query: QueryParamsType, key: string) { const value = query[key]; return value.map((v: any) => this.encodeQueryParam(key, v)).join("&"); } @@ -322,7 +322,7 @@ export class HttpClient { [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), }; - private mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { return { ...this.baseApiParams, ...params1, @@ -335,7 +335,7 @@ export class HttpClient { }; } - private createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { if (this.abortControllers.has(cancelToken)) { const abortController = this.abortControllers.get(cancelToken); if (abortController) { @@ -385,12 +385,12 @@ export class HttpClient { ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), ...(requestParams.headers || {}), }, - signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0, + signal: cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal, body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), }).then(async (response) => { const r = response as HttpResponse; - r.data = (null as unknown) as T; - r.error = (null as unknown) as E; + r.data = null as unknown as T; + r.error = null as unknown as E; const data = !responseFormat ? r diff --git a/tests/generated/v3.0/petstore-expanded.ts b/tests/generated/v3.0/petstore-expanded.ts index 36e27429d..a233ccad6 100644 --- a/tests/generated/v3.0/petstore-expanded.ts +++ b/tests/generated/v3.0/petstore-expanded.ts @@ -88,16 +88,16 @@ export class HttpClient { this.securityData = data; }; - private encodeQueryParam(key: string, value: any) { + protected encodeQueryParam(key: string, value: any) { const encodedKey = encodeURIComponent(key); return `${encodedKey}=${encodeURIComponent(typeof value === "number" ? value : `${value}`)}`; } - private addQueryParam(query: QueryParamsType, key: string) { + protected addQueryParam(query: QueryParamsType, key: string) { return this.encodeQueryParam(key, query[key]); } - private addArrayQueryParam(query: QueryParamsType, key: string) { + protected addArrayQueryParam(query: QueryParamsType, key: string) { const value = query[key]; return value.map((v: any) => this.encodeQueryParam(key, v)).join("&"); } @@ -134,7 +134,7 @@ export class HttpClient { [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), }; - private mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { return { ...this.baseApiParams, ...params1, @@ -147,7 +147,7 @@ export class HttpClient { }; } - private createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { if (this.abortControllers.has(cancelToken)) { const abortController = this.abortControllers.get(cancelToken); if (abortController) { @@ -197,12 +197,12 @@ export class HttpClient { ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), ...(requestParams.headers || {}), }, - signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0, + signal: cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal, body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), }).then(async (response) => { const r = response as HttpResponse; - r.data = (null as unknown) as T; - r.error = (null as unknown) as E; + r.data = null as unknown as T; + r.error = null as unknown as E; const data = !responseFormat ? r diff --git a/tests/generated/v3.0/petstore.ts b/tests/generated/v3.0/petstore.ts index 93d03569a..4446d133a 100644 --- a/tests/generated/v3.0/petstore.ts +++ b/tests/generated/v3.0/petstore.ts @@ -92,16 +92,16 @@ export class HttpClient { this.securityData = data; }; - private encodeQueryParam(key: string, value: any) { + protected encodeQueryParam(key: string, value: any) { const encodedKey = encodeURIComponent(key); return `${encodedKey}=${encodeURIComponent(typeof value === "number" ? value : `${value}`)}`; } - private addQueryParam(query: QueryParamsType, key: string) { + protected addQueryParam(query: QueryParamsType, key: string) { return this.encodeQueryParam(key, query[key]); } - private addArrayQueryParam(query: QueryParamsType, key: string) { + protected addArrayQueryParam(query: QueryParamsType, key: string) { const value = query[key]; return value.map((v: any) => this.encodeQueryParam(key, v)).join("&"); } @@ -138,7 +138,7 @@ export class HttpClient { [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), }; - private mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { return { ...this.baseApiParams, ...params1, @@ -151,7 +151,7 @@ export class HttpClient { }; } - private createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { if (this.abortControllers.has(cancelToken)) { const abortController = this.abortControllers.get(cancelToken); if (abortController) { @@ -201,12 +201,12 @@ export class HttpClient { ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), ...(requestParams.headers || {}), }, - signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0, + signal: cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal, body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), }).then(async (response) => { const r = response as HttpResponse; - r.data = (null as unknown) as T; - r.error = (null as unknown) as E; + r.data = null as unknown as T; + r.error = null as unknown as E; const data = !responseFormat ? r diff --git a/tests/generated/v3.0/recursive-schema.ts b/tests/generated/v3.0/recursive-schema.ts index c7f62eafb..be0d87496 100644 --- a/tests/generated/v3.0/recursive-schema.ts +++ b/tests/generated/v3.0/recursive-schema.ts @@ -89,16 +89,16 @@ export class HttpClient { this.securityData = data; }; - private encodeQueryParam(key: string, value: any) { + protected encodeQueryParam(key: string, value: any) { const encodedKey = encodeURIComponent(key); return `${encodedKey}=${encodeURIComponent(typeof value === "number" ? value : `${value}`)}`; } - private addQueryParam(query: QueryParamsType, key: string) { + protected addQueryParam(query: QueryParamsType, key: string) { return this.encodeQueryParam(key, query[key]); } - private addArrayQueryParam(query: QueryParamsType, key: string) { + protected addArrayQueryParam(query: QueryParamsType, key: string) { const value = query[key]; return value.map((v: any) => this.encodeQueryParam(key, v)).join("&"); } @@ -135,7 +135,7 @@ export class HttpClient { [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), }; - private mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { return { ...this.baseApiParams, ...params1, @@ -148,7 +148,7 @@ export class HttpClient { }; } - private createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { if (this.abortControllers.has(cancelToken)) { const abortController = this.abortControllers.get(cancelToken); if (abortController) { @@ -198,12 +198,12 @@ export class HttpClient { ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), ...(requestParams.headers || {}), }, - signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0, + signal: cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal, body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), }).then(async (response) => { const r = response as HttpResponse; - r.data = (null as unknown) as T; - r.error = (null as unknown) as E; + r.data = null as unknown as T; + r.error = null as unknown as E; const data = !responseFormat ? r diff --git a/tests/generated/v3.0/responses.ts b/tests/generated/v3.0/responses.ts index 7cd03d178..1ea669851 100644 --- a/tests/generated/v3.0/responses.ts +++ b/tests/generated/v3.0/responses.ts @@ -75,16 +75,16 @@ export class HttpClient { this.securityData = data; }; - private encodeQueryParam(key: string, value: any) { + protected encodeQueryParam(key: string, value: any) { const encodedKey = encodeURIComponent(key); return `${encodedKey}=${encodeURIComponent(typeof value === "number" ? value : `${value}`)}`; } - private addQueryParam(query: QueryParamsType, key: string) { + protected addQueryParam(query: QueryParamsType, key: string) { return this.encodeQueryParam(key, query[key]); } - private addArrayQueryParam(query: QueryParamsType, key: string) { + protected addArrayQueryParam(query: QueryParamsType, key: string) { const value = query[key]; return value.map((v: any) => this.encodeQueryParam(key, v)).join("&"); } @@ -121,7 +121,7 @@ export class HttpClient { [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), }; - private mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { return { ...this.baseApiParams, ...params1, @@ -134,7 +134,7 @@ export class HttpClient { }; } - private createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { if (this.abortControllers.has(cancelToken)) { const abortController = this.abortControllers.get(cancelToken); if (abortController) { @@ -184,12 +184,12 @@ export class HttpClient { ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), ...(requestParams.headers || {}), }, - signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0, + signal: cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal, body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), }).then(async (response) => { const r = response as HttpResponse; - r.data = (null as unknown) as T; - r.error = (null as unknown) as E; + r.data = null as unknown as T; + r.error = null as unknown as E; const data = !responseFormat ? r diff --git a/tests/generated/v3.0/swaggerhub-template.ts b/tests/generated/v3.0/swaggerhub-template.ts index 31698d124..02bf1767a 100644 --- a/tests/generated/v3.0/swaggerhub-template.ts +++ b/tests/generated/v3.0/swaggerhub-template.ts @@ -75,16 +75,16 @@ export class HttpClient { this.securityData = data; }; - private encodeQueryParam(key: string, value: any) { + protected encodeQueryParam(key: string, value: any) { const encodedKey = encodeURIComponent(key); return `${encodedKey}=${encodeURIComponent(typeof value === "number" ? value : `${value}`)}`; } - private addQueryParam(query: QueryParamsType, key: string) { + protected addQueryParam(query: QueryParamsType, key: string) { return this.encodeQueryParam(key, query[key]); } - private addArrayQueryParam(query: QueryParamsType, key: string) { + protected addArrayQueryParam(query: QueryParamsType, key: string) { const value = query[key]; return value.map((v: any) => this.encodeQueryParam(key, v)).join("&"); } @@ -121,7 +121,7 @@ export class HttpClient { [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), }; - private mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { return { ...this.baseApiParams, ...params1, @@ -134,7 +134,7 @@ export class HttpClient { }; } - private createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { if (this.abortControllers.has(cancelToken)) { const abortController = this.abortControllers.get(cancelToken); if (abortController) { @@ -184,12 +184,12 @@ export class HttpClient { ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), ...(requestParams.headers || {}), }, - signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0, + signal: cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal, body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), }).then(async (response) => { const r = response as HttpResponse; - r.data = (null as unknown) as T; - r.error = (null as unknown) as E; + r.data = null as unknown as T; + r.error = null as unknown as E; const data = !responseFormat ? r diff --git a/tests/generated/v3.0/tsoa-odd-types-3.0.2.ts b/tests/generated/v3.0/tsoa-odd-types-3.0.2.ts index d8e65db1d..6910fe232 100644 --- a/tests/generated/v3.0/tsoa-odd-types-3.0.2.ts +++ b/tests/generated/v3.0/tsoa-odd-types-3.0.2.ts @@ -196,16 +196,16 @@ export class HttpClient { this.securityData = data; }; - private encodeQueryParam(key: string, value: any) { + protected encodeQueryParam(key: string, value: any) { const encodedKey = encodeURIComponent(key); return `${encodedKey}=${encodeURIComponent(typeof value === "number" ? value : `${value}`)}`; } - private addQueryParam(query: QueryParamsType, key: string) { + protected addQueryParam(query: QueryParamsType, key: string) { return this.encodeQueryParam(key, query[key]); } - private addArrayQueryParam(query: QueryParamsType, key: string) { + protected addArrayQueryParam(query: QueryParamsType, key: string) { const value = query[key]; return value.map((v: any) => this.encodeQueryParam(key, v)).join("&"); } @@ -242,7 +242,7 @@ export class HttpClient { [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), }; - private mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { return { ...this.baseApiParams, ...params1, @@ -255,7 +255,7 @@ export class HttpClient { }; } - private createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { if (this.abortControllers.has(cancelToken)) { const abortController = this.abortControllers.get(cancelToken); if (abortController) { @@ -305,12 +305,12 @@ export class HttpClient { ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), ...(requestParams.headers || {}), }, - signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0, + signal: cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal, body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), }).then(async (response) => { const r = response as HttpResponse; - r.data = (null as unknown) as T; - r.error = (null as unknown) as E; + r.data = null as unknown as T; + r.error = null as unknown as E; const data = !responseFormat ? r diff --git a/tests/generated/v3.0/up-banking.ts b/tests/generated/v3.0/up-banking.ts index 2ac143e40..c9a6c3cf4 100644 --- a/tests/generated/v3.0/up-banking.ts +++ b/tests/generated/v3.0/up-banking.ts @@ -613,16 +613,16 @@ export class HttpClient { this.securityData = data; }; - private encodeQueryParam(key: string, value: any) { + protected encodeQueryParam(key: string, value: any) { const encodedKey = encodeURIComponent(key); return `${encodedKey}=${encodeURIComponent(typeof value === "number" ? value : `${value}`)}`; } - private addQueryParam(query: QueryParamsType, key: string) { + protected addQueryParam(query: QueryParamsType, key: string) { return this.encodeQueryParam(key, query[key]); } - private addArrayQueryParam(query: QueryParamsType, key: string) { + protected addArrayQueryParam(query: QueryParamsType, key: string) { const value = query[key]; return value.map((v: any) => this.encodeQueryParam(key, v)).join("&"); } @@ -659,7 +659,7 @@ export class HttpClient { [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), }; - private mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { return { ...this.baseApiParams, ...params1, @@ -672,7 +672,7 @@ export class HttpClient { }; } - private createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { if (this.abortControllers.has(cancelToken)) { const abortController = this.abortControllers.get(cancelToken); if (abortController) { @@ -722,12 +722,12 @@ export class HttpClient { ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), ...(requestParams.headers || {}), }, - signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0, + signal: cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal, body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), }).then(async (response) => { const r = response as HttpResponse; - r.data = (null as unknown) as T; - r.error = (null as unknown) as E; + r.data = null as unknown as T; + r.error = null as unknown as E; const data = !responseFormat ? r diff --git a/tests/generated/v3.0/uspto.ts b/tests/generated/v3.0/uspto.ts index 71cca1d27..f49289a53 100644 --- a/tests/generated/v3.0/uspto.ts +++ b/tests/generated/v3.0/uspto.ts @@ -92,16 +92,16 @@ export class HttpClient { this.securityData = data; }; - private encodeQueryParam(key: string, value: any) { + protected encodeQueryParam(key: string, value: any) { const encodedKey = encodeURIComponent(key); return `${encodedKey}=${encodeURIComponent(typeof value === "number" ? value : `${value}`)}`; } - private addQueryParam(query: QueryParamsType, key: string) { + protected addQueryParam(query: QueryParamsType, key: string) { return this.encodeQueryParam(key, query[key]); } - private addArrayQueryParam(query: QueryParamsType, key: string) { + protected addArrayQueryParam(query: QueryParamsType, key: string) { const value = query[key]; return value.map((v: any) => this.encodeQueryParam(key, v)).join("&"); } @@ -138,7 +138,7 @@ export class HttpClient { [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), }; - private mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { return { ...this.baseApiParams, ...params1, @@ -151,7 +151,7 @@ export class HttpClient { }; } - private createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { if (this.abortControllers.has(cancelToken)) { const abortController = this.abortControllers.get(cancelToken); if (abortController) { @@ -201,12 +201,12 @@ export class HttpClient { ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), ...(requestParams.headers || {}), }, - signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0, + signal: cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal, body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), }).then(async (response) => { const r = response as HttpResponse; - r.data = (null as unknown) as T; - r.error = (null as unknown) as E; + r.data = null as unknown as T; + r.error = null as unknown as E; const data = !responseFormat ? r diff --git a/tests/generated/v3.0/wrong-enum-subtypes.ts b/tests/generated/v3.0/wrong-enum-subtypes.ts index 150ccea91..6f5d01652 100644 --- a/tests/generated/v3.0/wrong-enum-subtypes.ts +++ b/tests/generated/v3.0/wrong-enum-subtypes.ts @@ -77,16 +77,16 @@ export class HttpClient { this.securityData = data; }; - private encodeQueryParam(key: string, value: any) { + protected encodeQueryParam(key: string, value: any) { const encodedKey = encodeURIComponent(key); return `${encodedKey}=${encodeURIComponent(typeof value === "number" ? value : `${value}`)}`; } - private addQueryParam(query: QueryParamsType, key: string) { + protected addQueryParam(query: QueryParamsType, key: string) { return this.encodeQueryParam(key, query[key]); } - private addArrayQueryParam(query: QueryParamsType, key: string) { + protected addArrayQueryParam(query: QueryParamsType, key: string) { const value = query[key]; return value.map((v: any) => this.encodeQueryParam(key, v)).join("&"); } @@ -123,7 +123,7 @@ export class HttpClient { [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), }; - private mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { return { ...this.baseApiParams, ...params1, @@ -136,7 +136,7 @@ export class HttpClient { }; } - private createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { if (this.abortControllers.has(cancelToken)) { const abortController = this.abortControllers.get(cancelToken); if (abortController) { @@ -186,12 +186,12 @@ export class HttpClient { ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), ...(requestParams.headers || {}), }, - signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0, + signal: cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal, body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), }).then(async (response) => { const r = response as HttpResponse; - r.data = (null as unknown) as T; - r.error = (null as unknown) as E; + r.data = null as unknown as T; + r.error = null as unknown as E; const data = !responseFormat ? r diff --git a/tests/generated/v3.0/wrong-schema-names.ts b/tests/generated/v3.0/wrong-schema-names.ts index f755b7a23..ce93b38fa 100644 --- a/tests/generated/v3.0/wrong-schema-names.ts +++ b/tests/generated/v3.0/wrong-schema-names.ts @@ -99,16 +99,16 @@ export class HttpClient { this.securityData = data; }; - private encodeQueryParam(key: string, value: any) { + protected encodeQueryParam(key: string, value: any) { const encodedKey = encodeURIComponent(key); return `${encodedKey}=${encodeURIComponent(typeof value === "number" ? value : `${value}`)}`; } - private addQueryParam(query: QueryParamsType, key: string) { + protected addQueryParam(query: QueryParamsType, key: string) { return this.encodeQueryParam(key, query[key]); } - private addArrayQueryParam(query: QueryParamsType, key: string) { + protected addArrayQueryParam(query: QueryParamsType, key: string) { const value = query[key]; return value.map((v: any) => this.encodeQueryParam(key, v)).join("&"); } @@ -145,7 +145,7 @@ export class HttpClient { [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), }; - private mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { return { ...this.baseApiParams, ...params1, @@ -158,7 +158,7 @@ export class HttpClient { }; } - private createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { if (this.abortControllers.has(cancelToken)) { const abortController = this.abortControllers.get(cancelToken); if (abortController) { @@ -208,12 +208,12 @@ export class HttpClient { ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), ...(requestParams.headers || {}), }, - signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0, + signal: cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal, body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), }).then(async (response) => { const r = response as HttpResponse; - r.data = (null as unknown) as T; - r.error = (null as unknown) as E; + r.data = null as unknown as T; + r.error = null as unknown as E; const data = !responseFormat ? r diff --git a/tests/schemas/v3.0/allof-example.yaml b/tests/schemas/v3.0/allof-example.yaml index 20085b326..470f2c8a3 100644 --- a/tests/schemas/v3.0/allof-example.yaml +++ b/tests/schemas/v3.0/allof-example.yaml @@ -29,7 +29,9 @@ components: discriminator: propertyName: pet_type Dog: # "Dog" is a value for the pet_type property (the discriminator value) - allOf: # Combines the main `Pet` schema with `Dog`-specific properties + required: + - breed + allOf: # Combines the main `Pet` schema with `Dog`-specific properties - $ref: '#/components/schemas/Pet' - type: object # all other properties specific to a `Dog` @@ -48,4 +50,4 @@ components: hunts: type: boolean age: - type: integer \ No newline at end of file + type: integer diff --git a/tests/spec/axios/schema.ts b/tests/spec/axios/schema.ts index f68722ba9..e1d35171d 100644 --- a/tests/spec/axios/schema.ts +++ b/tests/spec/axios/schema.ts @@ -1444,7 +1444,7 @@ export interface UserUpdate { export type Users = User[]; -import axios, { AxiosInstance, AxiosRequestConfig, AxiosResponse, ResponseType } from "axios"; +import axios, { AxiosInstance, AxiosRequestConfig, AxiosResponse, HeadersDefaults, ResponseType } from "axios"; export type QueryParamsType = Record; @@ -1497,20 +1497,41 @@ export class HttpClient { this.securityData = data; }; - private mergeRequestParams(params1: AxiosRequestConfig, params2?: AxiosRequestConfig): AxiosRequestConfig { + protected mergeRequestParams(params1: AxiosRequestConfig, params2?: AxiosRequestConfig): AxiosRequestConfig { + const method = params1.method || (params2 && params2.method); + return { ...this.instance.defaults, ...params1, ...(params2 || {}), headers: { - ...(this.instance.defaults.headers || {}), + ...((method && this.instance.defaults.headers[method.toLowerCase() as keyof HeadersDefaults]) || {}), ...(params1.headers || {}), ...((params2 && params2.headers) || {}), }, }; } - private createFormData(input: Record): FormData { + protected stringifyFormItem(formItem: unknown) { + if (typeof formItem === "object" && formItem !== null) { + return JSON.stringify(formItem); + } else { + return `${formItem}`; + } + } + + protected createFormData(input: Record): FormData { + return Object.keys(input || {}).reduce((formData, key) => { + const property = input[key]; + const propertyContent: Iterable = property instanceof Array ? property : [property]; + + for (const formItem of propertyContent) { + const isFileType = formItem instanceof Blob || formItem instanceof File; + formData.append(key, isFileType ? formItem : this.stringifyFormItem(formItem)); + } + + return formData; + }, new FormData()); return Object.keys(input || {}).reduce((formData, key) => { const property = input[key]; formData.append( @@ -1540,13 +1561,9 @@ export class HttpClient { (await this.securityWorker(this.securityData))) || {}; const requestParams = this.mergeRequestParams(params, secureParams); - const responseFormat = (format && this.format) || void 0; + const responseFormat = format || this.format || undefined; if (type === ContentType.FormData && body && body !== null && typeof body === "object") { - requestParams.headers.common = { Accept: "*/*" }; - requestParams.headers.post = {}; - requestParams.headers.put = {}; - body = this.createFormData(body as Record); } diff --git a/tests/spec/axiosSingleHttpClient/schema.ts b/tests/spec/axiosSingleHttpClient/schema.ts index bf49250e8..f24e5f138 100644 --- a/tests/spec/axiosSingleHttpClient/schema.ts +++ b/tests/spec/axiosSingleHttpClient/schema.ts @@ -1444,7 +1444,7 @@ export interface UserUpdate { export type Users = User[]; -import axios, { AxiosInstance, AxiosRequestConfig, AxiosResponse, ResponseType } from "axios"; +import axios, { AxiosInstance, AxiosRequestConfig, AxiosResponse, HeadersDefaults, ResponseType } from "axios"; export type QueryParamsType = Record; @@ -1497,20 +1497,41 @@ export class HttpClient { this.securityData = data; }; - private mergeRequestParams(params1: AxiosRequestConfig, params2?: AxiosRequestConfig): AxiosRequestConfig { + protected mergeRequestParams(params1: AxiosRequestConfig, params2?: AxiosRequestConfig): AxiosRequestConfig { + const method = params1.method || (params2 && params2.method); + return { ...this.instance.defaults, ...params1, ...(params2 || {}), headers: { - ...(this.instance.defaults.headers || {}), + ...((method && this.instance.defaults.headers[method.toLowerCase() as keyof HeadersDefaults]) || {}), ...(params1.headers || {}), ...((params2 && params2.headers) || {}), }, }; } - private createFormData(input: Record): FormData { + protected stringifyFormItem(formItem: unknown) { + if (typeof formItem === "object" && formItem !== null) { + return JSON.stringify(formItem); + } else { + return `${formItem}`; + } + } + + protected createFormData(input: Record): FormData { + return Object.keys(input || {}).reduce((formData, key) => { + const property = input[key]; + const propertyContent: Iterable = property instanceof Array ? property : [property]; + + for (const formItem of propertyContent) { + const isFileType = formItem instanceof Blob || formItem instanceof File; + formData.append(key, isFileType ? formItem : this.stringifyFormItem(formItem)); + } + + return formData; + }, new FormData()); return Object.keys(input || {}).reduce((formData, key) => { const property = input[key]; formData.append( @@ -1540,13 +1561,9 @@ export class HttpClient { (await this.securityWorker(this.securityData))) || {}; const requestParams = this.mergeRequestParams(params, secureParams); - const responseFormat = (format && this.format) || void 0; + const responseFormat = format || this.format || undefined; if (type === ContentType.FormData && body && body !== null && typeof body === "object") { - requestParams.headers.common = { Accept: "*/*" }; - requestParams.headers.post = {}; - requestParams.headers.put = {}; - body = this.createFormData(body as Record); } diff --git a/tests/spec/defaultAsSuccess/schema.ts b/tests/spec/defaultAsSuccess/schema.ts index 9b881dee6..4b6b70a14 100644 --- a/tests/spec/defaultAsSuccess/schema.ts +++ b/tests/spec/defaultAsSuccess/schema.ts @@ -127,16 +127,16 @@ export class HttpClient { this.securityData = data; }; - private encodeQueryParam(key: string, value: any) { + protected encodeQueryParam(key: string, value: any) { const encodedKey = encodeURIComponent(key); return `${encodedKey}=${encodeURIComponent(typeof value === "number" ? value : `${value}`)}`; } - private addQueryParam(query: QueryParamsType, key: string) { + protected addQueryParam(query: QueryParamsType, key: string) { return this.encodeQueryParam(key, query[key]); } - private addArrayQueryParam(query: QueryParamsType, key: string) { + protected addArrayQueryParam(query: QueryParamsType, key: string) { const value = query[key]; return value.map((v: any) => this.encodeQueryParam(key, v)).join("&"); } @@ -173,7 +173,7 @@ export class HttpClient { [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), }; - private mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { return { ...this.baseApiParams, ...params1, @@ -186,7 +186,7 @@ export class HttpClient { }; } - private createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { if (this.abortControllers.has(cancelToken)) { const abortController = this.abortControllers.get(cancelToken); if (abortController) { @@ -236,12 +236,12 @@ export class HttpClient { ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), ...(requestParams.headers || {}), }, - signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0, + signal: cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal, body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), }).then(async (response) => { const r = response as HttpResponse; - r.data = (null as unknown) as T; - r.error = (null as unknown) as E; + r.data = null as unknown as T; + r.error = null as unknown as E; const data = !responseFormat ? r diff --git a/tests/spec/defaultResponse/schema.ts b/tests/spec/defaultResponse/schema.ts index 0ef85ba54..79cd9d365 100644 --- a/tests/spec/defaultResponse/schema.ts +++ b/tests/spec/defaultResponse/schema.ts @@ -75,16 +75,16 @@ export class HttpClient { this.securityData = data; }; - private encodeQueryParam(key: string, value: any) { + protected encodeQueryParam(key: string, value: any) { const encodedKey = encodeURIComponent(key); return `${encodedKey}=${encodeURIComponent(typeof value === "number" ? value : `${value}`)}`; } - private addQueryParam(query: QueryParamsType, key: string) { + protected addQueryParam(query: QueryParamsType, key: string) { return this.encodeQueryParam(key, query[key]); } - private addArrayQueryParam(query: QueryParamsType, key: string) { + protected addArrayQueryParam(query: QueryParamsType, key: string) { const value = query[key]; return value.map((v: any) => this.encodeQueryParam(key, v)).join("&"); } @@ -121,7 +121,7 @@ export class HttpClient { [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), }; - private mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { return { ...this.baseApiParams, ...params1, @@ -134,7 +134,7 @@ export class HttpClient { }; } - private createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { if (this.abortControllers.has(cancelToken)) { const abortController = this.abortControllers.get(cancelToken); if (abortController) { @@ -184,12 +184,12 @@ export class HttpClient { ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), ...(requestParams.headers || {}), }, - signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0, + signal: cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal, body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), }).then(async (response) => { const r = response as HttpResponse; - r.data = (null as unknown) as T; - r.error = (null as unknown) as E; + r.data = null as unknown as T; + r.error = null as unknown as E; const data = !responseFormat ? r diff --git a/tests/spec/enumNamesAsValues/schema.ts b/tests/spec/enumNamesAsValues/schema.ts index ce96b3607..b105e3db8 100644 --- a/tests/spec/enumNamesAsValues/schema.ts +++ b/tests/spec/enumNamesAsValues/schema.ts @@ -273,16 +273,16 @@ export class HttpClient { this.securityData = data; }; - private encodeQueryParam(key: string, value: any) { + protected encodeQueryParam(key: string, value: any) { const encodedKey = encodeURIComponent(key); return `${encodedKey}=${encodeURIComponent(typeof value === "number" ? value : `${value}`)}`; } - private addQueryParam(query: QueryParamsType, key: string) { + protected addQueryParam(query: QueryParamsType, key: string) { return this.encodeQueryParam(key, query[key]); } - private addArrayQueryParam(query: QueryParamsType, key: string) { + protected addArrayQueryParam(query: QueryParamsType, key: string) { const value = query[key]; return value.map((v: any) => this.encodeQueryParam(key, v)).join("&"); } @@ -319,7 +319,7 @@ export class HttpClient { [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), }; - private mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { return { ...this.baseApiParams, ...params1, @@ -332,7 +332,7 @@ export class HttpClient { }; } - private createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { if (this.abortControllers.has(cancelToken)) { const abortController = this.abortControllers.get(cancelToken); if (abortController) { @@ -382,12 +382,12 @@ export class HttpClient { ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), ...(requestParams.headers || {}), }, - signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0, + signal: cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal, body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), }).then(async (response) => { const r = response as HttpResponse; - r.data = (null as unknown) as T; - r.error = (null as unknown) as E; + r.data = null as unknown as T; + r.error = null as unknown as E; const data = !responseFormat ? r diff --git a/tests/spec/extractRequestBody/schema.ts b/tests/spec/extractRequestBody/schema.ts index 1470c6c83..59464830d 100644 --- a/tests/spec/extractRequestBody/schema.ts +++ b/tests/spec/extractRequestBody/schema.ts @@ -228,16 +228,16 @@ export class HttpClient { this.securityData = data; }; - private encodeQueryParam(key: string, value: any) { + protected encodeQueryParam(key: string, value: any) { const encodedKey = encodeURIComponent(key); return `${encodedKey}=${encodeURIComponent(typeof value === "number" ? value : `${value}`)}`; } - private addQueryParam(query: QueryParamsType, key: string) { + protected addQueryParam(query: QueryParamsType, key: string) { return this.encodeQueryParam(key, query[key]); } - private addArrayQueryParam(query: QueryParamsType, key: string) { + protected addArrayQueryParam(query: QueryParamsType, key: string) { const value = query[key]; return value.map((v: any) => this.encodeQueryParam(key, v)).join("&"); } @@ -274,7 +274,7 @@ export class HttpClient { [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), }; - private mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { return { ...this.baseApiParams, ...params1, @@ -287,7 +287,7 @@ export class HttpClient { }; } - private createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { if (this.abortControllers.has(cancelToken)) { const abortController = this.abortControllers.get(cancelToken); if (abortController) { @@ -337,12 +337,12 @@ export class HttpClient { ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), ...(requestParams.headers || {}), }, - signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0, + signal: cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal, body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), }).then(async (response) => { const r = response as HttpResponse; - r.data = (null as unknown) as T; - r.error = (null as unknown) as E; + r.data = null as unknown as T; + r.error = null as unknown as E; const data = !responseFormat ? r diff --git a/tests/spec/extractRequestParams/schema.ts b/tests/spec/extractRequestParams/schema.ts index 4400336c1..6e9c89c59 100644 --- a/tests/spec/extractRequestParams/schema.ts +++ b/tests/spec/extractRequestParams/schema.ts @@ -167,16 +167,16 @@ export class HttpClient { this.securityData = data; }; - private encodeQueryParam(key: string, value: any) { + protected encodeQueryParam(key: string, value: any) { const encodedKey = encodeURIComponent(key); return `${encodedKey}=${encodeURIComponent(typeof value === "number" ? value : `${value}`)}`; } - private addQueryParam(query: QueryParamsType, key: string) { + protected addQueryParam(query: QueryParamsType, key: string) { return this.encodeQueryParam(key, query[key]); } - private addArrayQueryParam(query: QueryParamsType, key: string) { + protected addArrayQueryParam(query: QueryParamsType, key: string) { const value = query[key]; return value.map((v: any) => this.encodeQueryParam(key, v)).join("&"); } @@ -213,7 +213,7 @@ export class HttpClient { [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), }; - private mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { return { ...this.baseApiParams, ...params1, @@ -226,7 +226,7 @@ export class HttpClient { }; } - private createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { if (this.abortControllers.has(cancelToken)) { const abortController = this.abortControllers.get(cancelToken); if (abortController) { @@ -276,12 +276,12 @@ export class HttpClient { ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), ...(requestParams.headers || {}), }, - signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0, + signal: cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal, body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), }).then(async (response) => { const r = response as HttpResponse; - r.data = (null as unknown) as T; - r.error = (null as unknown) as E; + r.data = null as unknown as T; + r.error = null as unknown as E; const data = !responseFormat ? r diff --git a/tests/spec/extractResponseBody/schema.json b/tests/spec/extractResponseBody/schema.json new file mode 100644 index 000000000..e305f9f2c --- /dev/null +++ b/tests/spec/extractResponseBody/schema.json @@ -0,0 +1,1121 @@ +{ + "swagger": "2.0", + "info": { + "description": "This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.", + "version": "1.0.0", + "title": "Swagger Petstore", + "termsOfService": "http://swagger.io/terms/", + "contact": { + "email": "apiteam@swagger.io" + }, + "license": { + "name": "Apache-2.0", + "url": "http://www.apache.org/licenses/LICENSE-2.0.html" + } + }, + "host": "petstore.swagger.io", + "basePath": "/v2", + "tags": [ + { + "name": "pet", + "description": "Everything about your Pets", + "externalDocs": { + "description": "Find out more", + "url": "http://swagger.io" + } + }, + { + "name": "store", + "description": "Access to Petstore orders" + }, + { + "name": "user", + "description": "Operations about user", + "externalDocs": { + "description": "Find out more about our store", + "url": "http://swagger.io" + } + } + ], + "schemes": ["http"], + "paths": { + "/pet": { + "post": { + "tags": ["pet"], + "summary": "Add a new pet to the store", + "description": "", + "operationId": "addPet", + "consumes": ["application/json", "application/xml"], + "produces": ["application/xml", "application/json"], + "parameters": [ + { + "in": "body", + "name": "body", + "description": "Pet object that needs to be added to the store", + "required": true, + "schema": { + "$ref": "#/definitions/Pet" + } + } + ], + "responses": { + "405": { + "description": "Invalid input" + } + }, + "security": [ + { + "petstore_auth": ["write:pets", "read:pets"] + } + ], + "x-contentType": "application/json", + "x-accepts": "application/json" + }, + "put": { + "tags": ["pet"], + "summary": "Update an existing pet", + "description": "", + "operationId": "updatePet", + "consumes": ["application/json", "application/xml"], + "produces": ["application/xml", "application/json"], + "parameters": [ + { + "in": "body", + "name": "body", + "description": "Pet object that needs to be added to the store", + "required": true, + "schema": { + "$ref": "#/definitions/Pet" + } + } + ], + "responses": { + "400": { + "description": "Invalid ID supplied" + }, + "404": { + "description": "Pet not found" + }, + "405": { + "description": "Validation exception" + } + }, + "security": [ + { + "petstore_auth": ["write:pets", "read:pets"] + } + ], + "x-contentType": "application/json", + "x-accepts": "application/json" + } + }, + "/pet/findByStatus": { + "get": { + "tags": ["pet"], + "summary": "Finds Pets by status", + "description": "Multiple status values can be provided with comma separated strings", + "operationId": "findPetsByStatus", + "produces": ["application/xml", "application/json"], + "parameters": [ + { + "name": "status", + "in": "query", + "description": "Status values that need to be considered for filter", + "required": true, + "type": "array", + "items": { + "type": "string", + "default": "available", + "enum": ["available", "pending", "sold"] + }, + "collectionFormat": "csv" + } + ], + "responses": { + "200": { + "description": "successful operation", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/Pet" + } + } + }, + "400": { + "description": "Invalid status value" + } + }, + "security": [ + { + "petstore_auth": ["write:pets", "read:pets"] + } + ], + "x-accepts": "application/json" + } + }, + "/pet/single-form-url-encoded": { + "post": { + "responses": { + "500": { + "description": "500" + }, + "400": { + "description": "400" + }, + "401": { + "description": "401" + }, + "200": { + "description": "200" + } + }, + "summary": "summary", + "operationId": "singleFormUrlEncodedRequest", + "parameters": [ + { + "name": "param1", + "in": "formData", + "type": "string", + "format": "string", + "required": true + }, + { + "name": "param2", + "in": "formData", + "type": "string", + "required": true + } + ], + "security": [], + "consumes": ["application/x-www-form-urlencoded"], + "tags": ["pet"] + } + }, + "/pet/form-url-encoded": { + "post": { + "responses": { + "500": { + "description": "500" + }, + "400": { + "description": "400" + }, + "401": { + "description": "401" + }, + "200": { + "description": "200" + } + }, + "summary": "summary", + "operationId": "formUrlEncodedRequest", + "parameters": [ + { + "name": "param1", + "in": "formData", + "type": "string", + "format": "string", + "required": true + }, + { + "name": "param2", + "in": "formData", + "type": "string", + "required": true + } + ], + "security": [], + "consumes": ["application/x-www-form-urlencoded", "multipart/form-data"], + "tags": ["pet"] + } + }, + "/pet/end-form-url-encoded": { + "post": { + "responses": { + "500": { + "description": "500" + }, + "400": { + "description": "400" + }, + "401": { + "description": "401" + }, + "200": { + "description": "200" + } + }, + "summary": "summary", + "operationId": "formUrlEncodedRequest", + "parameters": [ + { + "name": "param1", + "in": "formData", + "type": "string", + "format": "string", + "required": true + }, + { + "name": "param2", + "in": "formData", + "type": "string", + "required": true + } + ], + "security": [], + "consumes": ["multipart/form-data", "application/x-www-form-urlencoded"], + "tags": ["pet"] + } + }, + "/pet/findByTags": { + "get": { + "tags": ["pet"], + "summary": "Finds Pets by tags", + "description": "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", + "operationId": "findPetsByTags", + "produces": ["application/xml", "application/json"], + "parameters": [ + { + "name": "tags", + "in": "query", + "description": "Tags to filter by", + "required": true, + "type": "array", + "items": { + "type": "string" + }, + "collectionFormat": "csv" + } + ], + "responses": { + "200": { + "description": "successful operation", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/Pet" + } + } + }, + "400": { + "description": "Invalid tag value" + } + }, + "security": [ + { + "petstore_auth": ["write:pets", "read:pets"] + } + ], + "deprecated": true, + "x-accepts": "application/json" + } + }, + "/pet/{petId}": { + "get": { + "tags": ["pet"], + "summary": "Find pet by ID", + "description": "Returns a single pet", + "operationId": "getPetById", + "produces": ["application/xml", "application/json"], + "parameters": [ + { + "name": "petId", + "in": "path", + "description": "ID of pet to return", + "required": true, + "type": "integer", + "format": "int64" + } + ], + "responses": { + "200": { + "description": "successful operation", + "schema": { + "$ref": "#/definitions/Pet" + } + }, + "400": { + "description": "Invalid ID supplied" + }, + "404": { + "description": "Pet not found" + } + }, + "security": [ + { + "api_key": [] + } + ], + "x-accepts": "application/json" + }, + "post": { + "tags": ["pet"], + "summary": "Updates a pet in the store with form data", + "description": "", + "operationId": "updatePetWithForm", + "consumes": ["application/x-www-form-urlencoded"], + "produces": ["application/xml", "application/json"], + "parameters": [ + { + "name": "petId", + "in": "path", + "description": "ID of pet that needs to be updated", + "required": true, + "type": "integer", + "format": "int64" + }, + { + "name": "name", + "in": "formData", + "description": "Updated name of the pet", + "required": false, + "type": "string" + }, + { + "name": "status", + "in": "formData", + "description": "Updated status of the pet", + "required": false, + "type": "string" + } + ], + "responses": { + "405": { + "description": "Invalid input" + } + }, + "security": [ + { + "petstore_auth": ["write:pets", "read:pets"] + } + ], + "x-contentType": "application/x-www-form-urlencoded", + "x-accepts": "application/json" + }, + "delete": { + "tags": ["pet"], + "summary": "Deletes a pet", + "description": "", + "operationId": "deletePet", + "produces": ["application/xml", "application/json"], + "parameters": [ + { + "name": "api_key", + "in": "header", + "required": false, + "type": "string" + }, + { + "name": "petId", + "in": "path", + "description": "Pet id to delete", + "required": true, + "type": "integer", + "format": "int64" + } + ], + "responses": { + "400": { + "description": "Invalid pet value" + } + }, + "security": [ + { + "petstore_auth": ["write:pets", "read:pets"] + } + ], + "x-accepts": "application/json" + } + }, + "/pet/{petId}/uploadImage": { + "post": { + "tags": ["pet"], + "summary": "uploads an image", + "description": "", + "operationId": "uploadFile", + "consumes": ["multipart/form-data"], + "produces": ["application/json"], + "parameters": [ + { + "name": "petId", + "in": "path", + "description": "ID of pet to update", + "required": true, + "type": "integer", + "format": "int64" + }, + { + "name": "additionalMetadata", + "in": "formData", + "description": "Additional data to pass to server", + "required": false, + "type": "string" + }, + { + "name": "file", + "in": "formData", + "description": "file to upload", + "required": false, + "type": "file" + } + ], + "responses": { + "200": { + "description": "successful operation", + "schema": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "type": { + "type": "string" + }, + "message": { + "type": "string" + } + }, + "title": "An uploaded response", + "description": "Describes the result of uploading an image resource", + "example": { + "code": 0, + "type": "type", + "message": "message" + } + } + } + }, + "security": [ + { + "petstore_auth": ["write:pets", "read:pets"] + } + ], + "x-contentType": "multipart/form-data", + "x-accepts": "application/json" + } + }, + "/store/inventory": { + "get": { + "tags": ["store"], + "summary": "Returns pet inventories by status", + "description": "Returns a map of status codes to quantities", + "operationId": "getInventory", + "produces": ["application/json"], + "parameters": [], + "responses": { + "200": { + "description": "successful operation", + "schema": { + "type": "object", + "additionalProperties": { + "type": "integer", + "format": "int32" + } + } + } + }, + "security": [ + { + "api_key": [] + } + ], + "x-accepts": "application/json" + } + }, + "/store/order": { + "post": { + "tags": ["store"], + "summary": "Place an order for a pet", + "description": "", + "operationId": "placeOrder", + "produces": ["application/xml", "application/json"], + "parameters": [ + { + "in": "body", + "name": "body", + "description": "order placed for purchasing the pet", + "required": true, + "schema": { + "$ref": "#/definitions/Order" + } + } + ], + "responses": { + "200": { + "description": "successful operation", + "schema": { + "$ref": "#/definitions/Order" + } + }, + "400": { + "description": "Invalid Order" + } + }, + "x-contentType": "application/json", + "x-accepts": "application/json" + } + }, + "/store/order/{orderId}": { + "get": { + "tags": ["store"], + "summary": "Find purchase order by ID", + "description": "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", + "operationId": "getOrderById", + "produces": ["application/xml", "application/json"], + "parameters": [ + { + "name": "orderId", + "in": "path", + "description": "ID of pet that needs to be fetched", + "required": true, + "type": "integer", + "maximum": 5, + "minimum": 1, + "format": "int64" + } + ], + "responses": { + "200": { + "description": "successful operation", + "schema": { + "$ref": "#/definitions/Order" + } + }, + "400": { + "description": "Invalid ID supplied" + }, + "404": { + "description": "Order not found" + } + }, + "x-accepts": "application/json" + }, + "delete": { + "tags": ["store"], + "summary": "Delete purchase order by ID", + "description": "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors", + "operationId": "deleteOrder", + "produces": ["application/xml", "application/json"], + "parameters": [ + { + "name": "orderId", + "in": "path", + "description": "ID of the order that needs to be deleted", + "required": true, + "type": "string" + } + ], + "responses": { + "400": { + "description": "Invalid ID supplied" + }, + "404": { + "description": "Order not found" + } + }, + "x-accepts": "application/json" + } + }, + "/user": { + "post": { + "tags": ["user"], + "summary": "Create user", + "description": "This can only be done by the logged in user.", + "operationId": "createUser", + "produces": ["application/xml", "application/json"], + "parameters": [ + { + "in": "body", + "name": "body", + "description": "Created user object", + "required": true, + "schema": { + "$ref": "#/definitions/User" + } + } + ], + "responses": { + "default": { + "description": "successful operation" + } + }, + "x-contentType": "application/json", + "x-accepts": "application/json" + } + }, + "/user/createWithArray": { + "post": { + "tags": ["user"], + "summary": "Creates list of users with given input array", + "description": "", + "operationId": "createUsersWithArrayInput", + "produces": ["application/xml", "application/json"], + "parameters": [ + { + "in": "body", + "name": "body", + "description": "List of user object", + "required": true, + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/User" + } + } + } + ], + "responses": { + "default": { + "description": "successful operation" + } + }, + "x-contentType": "application/json", + "x-accepts": "application/json" + } + }, + "/user/createWithList": { + "post": { + "tags": ["user"], + "summary": "Creates list of users with given input array", + "description": "", + "operationId": "createUsersWithListInput", + "produces": ["application/xml", "application/json"], + "parameters": [ + { + "in": "body", + "name": "body", + "description": "List of user object", + "required": true, + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/User" + } + } + } + ], + "responses": { + "default": { + "description": "successful operation" + } + }, + "x-contentType": "application/json", + "x-accepts": "application/json" + } + }, + "/user/login": { + "get": { + "tags": ["user"], + "summary": "Logs user into the system", + "description": "", + "operationId": "loginUser", + "produces": ["application/xml", "application/json"], + "parameters": [ + { + "name": "username", + "in": "query", + "description": "The user name for login", + "required": true, + "type": "string" + }, + { + "name": "password", + "in": "query", + "description": "The password for login in clear text", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "successful operation", + "headers": { + "X-Rate-Limit": { + "type": "integer", + "format": "int32", + "description": "calls per hour allowed by the user" + }, + "X-Expires-After": { + "type": "string", + "format": "date-time", + "description": "date in UTC when toekn expires" + } + }, + "schema": { + "type": "string" + } + }, + "400": { + "description": "Invalid username/password supplied" + } + }, + "x-accepts": "application/json" + } + }, + "/user/logout": { + "get": { + "tags": ["user"], + "summary": "Logs out current logged in user session", + "description": "", + "operationId": "logoutUser", + "produces": ["application/xml", "application/json"], + "parameters": [], + "responses": { + "default": { + "description": "successful operation" + } + }, + "x-accepts": "application/json" + } + }, + "/user/{username}": { + "get": { + "tags": ["user"], + "summary": "Get user by user name", + "description": "", + "operationId": "getUserByName", + "produces": ["application/xml", "application/json"], + "parameters": [ + { + "name": "username", + "in": "path", + "description": "The name that needs to be fetched. Use user1 for testing.", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "successful operation", + "schema": { + "$ref": "#/definitions/User" + } + }, + "400": { + "description": "Invalid username supplied" + }, + "404": { + "description": "User not found" + } + }, + "x-accepts": "application/json" + }, + "put": { + "tags": ["user"], + "summary": "Updated user", + "description": "This can only be done by the logged in user.", + "operationId": "updateUser", + "produces": ["application/xml", "application/json"], + "parameters": [ + { + "name": "username", + "in": "path", + "description": "name that need to be deleted", + "required": true, + "type": "string" + }, + { + "in": "body", + "name": "body", + "description": "Updated user object", + "required": true, + "schema": { + "$ref": "#/definitions/User" + } + } + ], + "responses": { + "400": { + "description": "Invalid user supplied" + }, + "404": { + "description": "User not found" + } + }, + "x-contentType": "application/json", + "x-accepts": "application/json" + }, + "delete": { + "tags": ["user"], + "summary": "Delete user", + "description": "This can only be done by the logged in user.", + "operationId": "deleteUser", + "produces": ["application/xml", "application/json"], + "parameters": [ + { + "name": "username", + "in": "path", + "description": "The name that needs to be deleted", + "required": true, + "type": "string" + } + ], + "responses": { + "400": { + "description": "Invalid username supplied" + }, + "404": { + "description": "User not found" + } + }, + "x-accepts": "application/json" + } + } + }, + "securityDefinitions": { + "petstore_auth": { + "type": "oauth2", + "authorizationUrl": "http://petstore.swagger.io/api/oauth/dialog", + "flow": "implicit", + "scopes": { + "write:pets": "modify pets in your account", + "read:pets": "read your pets" + } + }, + "api_key": { + "type": "apiKey", + "name": "api_key", + "in": "header" + } + }, + "definitions": { + "Order": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "petId": { + "type": "integer", + "format": "int64" + }, + "quantity": { + "type": "integer", + "format": "int32" + }, + "shipDate": { + "type": "string", + "format": "date-time" + }, + "status": { + "type": "string", + "description": "Order Status", + "enum": ["placed", "approved", "delivered"], + "nullable": true + }, + "complete": { + "type": "boolean", + "default": false + } + }, + "title": "Pet Order", + "xml": { + "name": "Order" + }, + "description": "An order for a pets from the pet store", + "example": { + "petId": 6, + "quantity": 1, + "id": 0, + "shipDate": "2000-01-23T04:56:07.000+00:00", + "complete": false, + "status": "placed" + } + }, + "Category": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "name": { + "type": "string" + } + }, + "title": "Pet category", + "xml": { + "name": "Category" + }, + "description": "A category for a pet", + "example": { + "name": "name", + "id": 6 + } + }, + "User": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "username": { + "type": "string" + }, + "firstName": { + "type": "string" + }, + "lastName": { + "type": "string" + }, + "email": { + "type": "string" + }, + "password": { + "type": "string" + }, + "phone": { + "type": "string" + }, + "userStatus": { + "type": "integer", + "format": "int32", + "description": "User Status" + } + }, + "title": "a User", + "xml": { + "name": "User" + }, + "description": "A User who is purchasing from the pet store", + "example": { + "firstName": "firstName", + "lastName": "lastName", + "password": "password", + "userStatus": 6, + "phone": "phone", + "id": 0, + "email": "email", + "username": "username" + } + }, + "Tag": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "name": { + "type": "string" + } + }, + "title": "Pet Tag", + "xml": { + "name": "Tag" + }, + "description": "A tag for a pet", + "example": { + "name": "name", + "id": 1 + } + }, + "PetNames": { + "type": "string", + "enum": ["Fluffy Hero", "Piggy Po", "Swagger Typescript Api", "UPPER_CASE"] + }, + "PetIds": { + "type": "integer", + "enum": [10, 20, 30, 40] + }, + "PetIdsWithWrongEnum": { + "enum": [10, 20, 30, 40] + }, + "Pet": { + "type": "object", + "required": ["name", "photoUrls"], + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "category": { + "$ref": "#/definitions/Category" + }, + "name": { + "type": "string", + "example": "doggie" + }, + "photoUrls": { + "type": "array", + "xml": { + "name": "photoUrl", + "wrapped": true + }, + "items": { + "type": "string" + } + }, + "tags": { + "type": "array", + "xml": { + "name": "tag", + "wrapped": true + }, + "items": { + "$ref": "#/definitions/Tag" + } + }, + "status": { + "type": "string", + "description": "pet status in the store", + "enum": ["available", "pending", "sold"] + } + }, + "title": "a Pet", + "xml": { + "name": "Pet" + }, + "description": "A pet for sale in the pet store", + "example": { + "photoUrls": ["photoUrls", "photoUrls"], + "name": "doggie", + "id": 0, + "category": { + "name": "name", + "id": 6 + }, + "tags": [ + { + "name": "name", + "id": 1 + }, + { + "name": "name", + "id": 1 + } + ], + "status": "available" + } + }, + "Amount": { + "type": "object", + "required": ["currency", "value"], + "properties": { + "value": { + "type": "number", + "format": "double", + "description": "some description\n", + "minimum": 0.01, + "maximum": 1000000000000000 + }, + "currency": { + "$ref": "#/definitions/Currency" + } + }, + "description": "some description\n" + }, + "Currency": { + "type": "string", + "pattern": "^[A-Z]{3,3}$", + "description": "some description\n" + } + }, + "externalDocs": { + "description": "Find out more about Swagger", + "url": "http://swagger.io" + } +} diff --git a/tests/spec/extractResponseBody/schema.ts b/tests/spec/extractResponseBody/schema.ts new file mode 100644 index 000000000..5023dfec7 --- /dev/null +++ b/tests/spec/extractResponseBody/schema.ts @@ -0,0 +1,781 @@ +/* eslint-disable */ +/* tslint:disable */ +/* + * --------------------------------------------------------------- + * ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ## + * ## ## + * ## AUTHOR: acacode ## + * ## SOURCE: https://github.com/acacode/swagger-typescript-api ## + * --------------------------------------------------------------- + */ + +/** + * An order for a pets from the pet store + * @example {"petId":6,"quantity":1,"id":0,"shipDate":"2000-01-23T04:56:07.000+00:00","complete":false,"status":"placed"} + */ +export interface OrderTTT { + /** @format int64 */ + id?: number; + + /** @format int64 */ + petId?: number; + + /** @format int32 */ + quantity?: number; + + /** @format date-time */ + shipDate?: string; + + /** Order Status */ + status?: "placed" | "approved" | "delivered" | null; + complete?: boolean; +} + +/** + * A category for a pet + * @example {"name":"name","id":6} + */ +export interface CategoryTTT { + /** @format int64 */ + id?: number; + name?: string; +} + +/** + * A User who is purchasing from the pet store + * @example {"firstName":"firstName","lastName":"lastName","password":"password","userStatus":6,"phone":"phone","id":0,"email":"email","username":"username"} + */ +export interface UserTTT { + /** @format int64 */ + id?: number; + username?: string; + firstName?: string; + lastName?: string; + email?: string; + password?: string; + phone?: string; + + /** + * User Status + * @format int32 + */ + userStatus?: number; +} + +/** + * A tag for a pet + * @example {"name":"name","id":1} + */ +export interface TagTTT { + /** @format int64 */ + id?: number; + name?: string; +} + +export enum PetNamesTTT { + FluffyHero = "Fluffy Hero", + PiggyPo = "Piggy Po", + SwaggerTypescriptApi = "Swagger Typescript Api", + UPPER_CASE = "UPPER_CASE", +} + +export type PetIdsTTT = 10 | 20 | 30 | 40; + +export type PetIdsWithWrongEnumTTT = 10 | 20 | 30 | 40; + +/** + * A pet for sale in the pet store + * @example {"photoUrls":["photoUrls","photoUrls"],"name":"doggie","id":0,"category":{"name":"name","id":6},"tags":[{"name":"name","id":1},{"name":"name","id":1}],"status":"available"} + */ +export interface PetTTT { + /** @format int64 */ + id?: number; + + /** A category for a pet */ + category?: CategoryTTT; + + /** @example doggie */ + name: string; + photoUrls: string[]; + tags?: TagTTT[]; + + /** pet status in the store */ + status?: "available" | "pending" | "sold"; +} + +/** + * some description + */ +export interface AmountTTT { + /** + * some description + * + * @format double + * @min 0.01 + * @max 1000000000000000 + */ + value: number; + + /** + * some description + * + */ + currency: CurrencyTTT; +} + +/** + * some description + * @pattern ^[A-Z]{3,3}$ + */ +export type CurrencyTTT = string; + +export type FindPetsByStatusDataTTT = PetTTT[]; + +export type SingleFormUrlEncodedRequestDataTTT = any; + +export type FormUrlEncodedRequestDataTTT = any; + +export type FormUrlEncodedRequest2DataTTT = any; + +export type FindPetsByTagsDataTTT = PetTTT[]; + +export type GetPetByIdDataTTT = PetTTT; + +/** + * Describes the result of uploading an image resource + * @example {"code":0,"type":"type","message":"message"} + */ +export interface UploadFileDataTTT { + /** @format int32 */ + code?: number; + type?: string; + message?: string; +} + +export type GetInventoryDataTTT = Record; + +export type PlaceOrderDataTTT = OrderTTT; + +export type GetOrderByIdDataTTT = OrderTTT; + +export type LoginUserDataTTT = string; + +export type GetUserByNameDataTTT = UserTTT; + +export type QueryParamsType = Record; +export type ResponseFormat = keyof Omit; + +export interface FullRequestParams extends Omit { + /** set parameter to `true` for call `securityWorker` for this request */ + secure?: boolean; + /** request path */ + path: string; + /** content type of request body */ + type?: ContentType; + /** query params */ + query?: QueryParamsType; + /** format of response (i.e. response.json() -> format: "json") */ + format?: ResponseFormat; + /** request body */ + body?: unknown; + /** base url */ + baseUrl?: string; + /** request cancellation token */ + cancelToken?: CancelToken; +} + +export type RequestParams = Omit; + +export interface ApiConfig { + baseUrl?: string; + baseApiParams?: Omit; + securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; + customFetch?: typeof fetch; +} + +export interface HttpResponse extends Response { + data: D; + error: E; +} + +type CancelToken = Symbol | string | number; + +export enum ContentType { + Json = "application/json", + FormData = "multipart/form-data", + UrlEncoded = "application/x-www-form-urlencoded", +} + +export class HttpClient { + public baseUrl: string = "http://petstore.swagger.io/v2"; + private securityData: SecurityDataType | null = null; + private securityWorker?: ApiConfig["securityWorker"]; + private abortControllers = new Map(); + private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); + + private baseApiParams: RequestParams = { + credentials: "same-origin", + headers: {}, + redirect: "follow", + referrerPolicy: "no-referrer", + }; + + constructor(apiConfig: ApiConfig = {}) { + Object.assign(this, apiConfig); + } + + public setSecurityData = (data: SecurityDataType | null) => { + this.securityData = data; + }; + + protected encodeQueryParam(key: string, value: any) { + const encodedKey = encodeURIComponent(key); + return `${encodedKey}=${encodeURIComponent(typeof value === "number" ? value : `${value}`)}`; + } + + protected addQueryParam(query: QueryParamsType, key: string) { + return this.encodeQueryParam(key, query[key]); + } + + protected addArrayQueryParam(query: QueryParamsType, key: string) { + const value = query[key]; + return value.map((v: any) => this.encodeQueryParam(key, v)).join("&"); + } + + protected toQueryString(rawQuery?: QueryParamsType): string { + const query = rawQuery || {}; + const keys = Object.keys(query).filter((key) => "undefined" !== typeof query[key]); + return keys + .map((key) => (Array.isArray(query[key]) ? this.addArrayQueryParam(query, key) : this.addQueryParam(query, key))) + .join("&"); + } + + protected addQueryParams(rawQuery?: QueryParamsType): string { + const queryString = this.toQueryString(rawQuery); + return queryString ? `?${queryString}` : ""; + } + + private contentFormatters: Record any> = { + [ContentType.Json]: (input: any) => + input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, + [ContentType.FormData]: (input: any) => + Object.keys(input || {}).reduce((formData, key) => { + const property = input[key]; + formData.append( + key, + property instanceof Blob + ? property + : typeof property === "object" && property !== null + ? JSON.stringify(property) + : `${property}`, + ); + return formData; + }, new FormData()), + [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), + }; + + protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + return { + ...this.baseApiParams, + ...params1, + ...(params2 || {}), + headers: { + ...(this.baseApiParams.headers || {}), + ...(params1.headers || {}), + ...((params2 && params2.headers) || {}), + }, + }; + } + + protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + if (this.abortControllers.has(cancelToken)) { + const abortController = this.abortControllers.get(cancelToken); + if (abortController) { + return abortController.signal; + } + return void 0; + } + + const abortController = new AbortController(); + this.abortControllers.set(cancelToken, abortController); + return abortController.signal; + }; + + public abortRequest = (cancelToken: CancelToken) => { + const abortController = this.abortControllers.get(cancelToken); + + if (abortController) { + abortController.abort(); + this.abortControllers.delete(cancelToken); + } + }; + + public request = async ({ + body, + secure, + path, + type, + query, + format, + baseUrl, + cancelToken, + ...params + }: FullRequestParams): Promise> => { + const secureParams = + ((typeof secure === "boolean" ? secure : this.baseApiParams.secure) && + this.securityWorker && + (await this.securityWorker(this.securityData))) || + {}; + const requestParams = this.mergeRequestParams(params, secureParams); + const queryString = query && this.toQueryString(query); + const payloadFormatter = this.contentFormatters[type || ContentType.Json]; + const responseFormat = format || requestParams.format; + + return this.customFetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, { + ...requestParams, + headers: { + ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), + ...(requestParams.headers || {}), + }, + signal: cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal, + body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), + }).then(async (response) => { + const r = response as HttpResponse; + r.data = null as unknown as T; + r.error = null as unknown as E; + + const data = !responseFormat + ? r + : await response[responseFormat]() + .then((data) => { + if (r.ok) { + r.data = data; + } else { + r.error = data; + } + return r; + }) + .catch((e) => { + r.error = e; + return r; + }); + + if (cancelToken) { + this.abortControllers.delete(cancelToken); + } + + if (!response.ok) throw data; + return data; + }); + }; +} + +/** + * @title Swagger Petstore + * @version 1.0.0 + * @license Apache-2.0 (http://www.apache.org/licenses/LICENSE-2.0.html) + * @termsOfService http://swagger.io/terms/ + * @baseUrl http://petstore.swagger.io/v2 + * @externalDocs http://swagger.io + * @contact + * + * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + */ +export class Api extends HttpClient { + pet = { + /** + * No description + * + * @tags pet + * @name AddPet + * @summary Add a new pet to the store + * @request POST:/pet + * @secure + */ + addPet: (body: PetTTT, params: RequestParams = {}) => + this.request({ + path: `/pet`, + method: "POST", + body: body, + secure: true, + type: ContentType.Json, + ...params, + }), + + /** + * No description + * + * @tags pet + * @name UpdatePet + * @summary Update an existing pet + * @request PUT:/pet + * @secure + */ + updatePet: (body: PetTTT, params: RequestParams = {}) => + this.request({ + path: `/pet`, + method: "PUT", + body: body, + secure: true, + type: ContentType.Json, + ...params, + }), + + /** + * @description Multiple status values can be provided with comma separated strings + * + * @tags pet + * @name FindPetsByStatus + * @summary Finds Pets by status + * @request GET:/pet/findByStatus + * @secure + */ + findPetsByStatus: (query: { status: ("available" | "pending" | "sold")[] }, params: RequestParams = {}) => + this.request({ + path: `/pet/findByStatus`, + method: "GET", + query: query, + secure: true, + ...params, + }), + + /** + * No description + * + * @tags pet + * @name SingleFormUrlEncodedRequest + * @summary summary + * @request POST:/pet/single-form-url-encoded + */ + singleFormUrlEncodedRequest: (data: { param1: string; param2: string }, params: RequestParams = {}) => + this.request({ + path: `/pet/single-form-url-encoded`, + method: "POST", + body: data, + type: ContentType.UrlEncoded, + ...params, + }), + + /** + * No description + * + * @tags pet + * @name FormUrlEncodedRequest + * @summary summary + * @request POST:/pet/form-url-encoded + */ + formUrlEncodedRequest: (data: { param1: string; param2: string }, params: RequestParams = {}) => + this.request({ + path: `/pet/form-url-encoded`, + method: "POST", + body: data, + type: ContentType.UrlEncoded, + ...params, + }), + + /** + * No description + * + * @tags pet + * @name FormUrlEncodedRequest2 + * @summary summary + * @request POST:/pet/end-form-url-encoded + * @originalName formUrlEncodedRequest + * @duplicate + */ + formUrlEncodedRequest2: (data: { param1: string; param2: string }, params: RequestParams = {}) => + this.request({ + path: `/pet/end-form-url-encoded`, + method: "POST", + body: data, + type: ContentType.UrlEncoded, + ...params, + }), + + /** + * @description Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * + * @tags pet + * @name FindPetsByTags + * @summary Finds Pets by tags + * @request GET:/pet/findByTags + * @deprecated + * @secure + */ + findPetsByTags: (query: { tags: string[] }, params: RequestParams = {}) => + this.request({ + path: `/pet/findByTags`, + method: "GET", + query: query, + secure: true, + ...params, + }), + + /** + * @description Returns a single pet + * + * @tags pet + * @name GetPetById + * @summary Find pet by ID + * @request GET:/pet/{petId} + * @secure + */ + getPetById: (petId: number, params: RequestParams = {}) => + this.request({ + path: `/pet/${petId}`, + method: "GET", + secure: true, + ...params, + }), + + /** + * No description + * + * @tags pet + * @name UpdatePetWithForm + * @summary Updates a pet in the store with form data + * @request POST:/pet/{petId} + * @secure + */ + updatePetWithForm: (petId: number, data: { name?: string; status?: string }, params: RequestParams = {}) => + this.request({ + path: `/pet/${petId}`, + method: "POST", + body: data, + secure: true, + type: ContentType.FormData, + ...params, + }), + + /** + * No description + * + * @tags pet + * @name DeletePet + * @summary Deletes a pet + * @request DELETE:/pet/{petId} + * @secure + */ + deletePet: (petId: number, params: RequestParams = {}) => + this.request({ + path: `/pet/${petId}`, + method: "DELETE", + secure: true, + ...params, + }), + + /** + * No description + * + * @tags pet + * @name UploadFile + * @summary uploads an image + * @request POST:/pet/{petId}/uploadImage + * @secure + */ + uploadFile: (petId: number, data: { additionalMetadata?: string; file?: File }, params: RequestParams = {}) => + this.request({ + path: `/pet/${petId}/uploadImage`, + method: "POST", + body: data, + secure: true, + type: ContentType.FormData, + ...params, + }), + }; + store = { + /** + * @description Returns a map of status codes to quantities + * + * @tags store + * @name GetInventory + * @summary Returns pet inventories by status + * @request GET:/store/inventory + * @secure + */ + getInventory: (params: RequestParams = {}) => + this.request({ + path: `/store/inventory`, + method: "GET", + secure: true, + ...params, + }), + + /** + * No description + * + * @tags store + * @name PlaceOrder + * @summary Place an order for a pet + * @request POST:/store/order + */ + placeOrder: (body: OrderTTT, params: RequestParams = {}) => + this.request({ + path: `/store/order`, + method: "POST", + body: body, + type: ContentType.Json, + ...params, + }), + + /** + * @description For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * + * @tags store + * @name GetOrderById + * @summary Find purchase order by ID + * @request GET:/store/order/{orderId} + */ + getOrderById: (orderId: number, params: RequestParams = {}) => + this.request({ + path: `/store/order/${orderId}`, + method: "GET", + ...params, + }), + + /** + * @description For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * + * @tags store + * @name DeleteOrder + * @summary Delete purchase order by ID + * @request DELETE:/store/order/{orderId} + */ + deleteOrder: (orderId: string, params: RequestParams = {}) => + this.request({ + path: `/store/order/${orderId}`, + method: "DELETE", + ...params, + }), + }; + user = { + /** + * @description This can only be done by the logged in user. + * + * @tags user + * @name CreateUser + * @summary Create user + * @request POST:/user + */ + createUser: (body: UserTTT, params: RequestParams = {}) => + this.request({ + path: `/user`, + method: "POST", + body: body, + type: ContentType.Json, + ...params, + }), + + /** + * No description + * + * @tags user + * @name CreateUsersWithArrayInput + * @summary Creates list of users with given input array + * @request POST:/user/createWithArray + */ + createUsersWithArrayInput: (body: UserTTT[], params: RequestParams = {}) => + this.request({ + path: `/user/createWithArray`, + method: "POST", + body: body, + type: ContentType.Json, + ...params, + }), + + /** + * No description + * + * @tags user + * @name CreateUsersWithListInput + * @summary Creates list of users with given input array + * @request POST:/user/createWithList + */ + createUsersWithListInput: (body: UserTTT[], params: RequestParams = {}) => + this.request({ + path: `/user/createWithList`, + method: "POST", + body: body, + type: ContentType.Json, + ...params, + }), + + /** + * No description + * + * @tags user + * @name LoginUser + * @summary Logs user into the system + * @request GET:/user/login + */ + loginUser: (query: { username: string; password: string }, params: RequestParams = {}) => + this.request({ + path: `/user/login`, + method: "GET", + query: query, + ...params, + }), + + /** + * No description + * + * @tags user + * @name LogoutUser + * @summary Logs out current logged in user session + * @request GET:/user/logout + */ + logoutUser: (params: RequestParams = {}) => + this.request({ + path: `/user/logout`, + method: "GET", + ...params, + }), + + /** + * No description + * + * @tags user + * @name GetUserByName + * @summary Get user by user name + * @request GET:/user/{username} + */ + getUserByName: (username: string, params: RequestParams = {}) => + this.request({ + path: `/user/${username}`, + method: "GET", + ...params, + }), + + /** + * @description This can only be done by the logged in user. + * + * @tags user + * @name UpdateUser + * @summary Updated user + * @request PUT:/user/{username} + */ + updateUser: (username: string, body: UserTTT, params: RequestParams = {}) => + this.request({ + path: `/user/${username}`, + method: "PUT", + body: body, + type: ContentType.Json, + ...params, + }), + + /** + * @description This can only be done by the logged in user. + * + * @tags user + * @name DeleteUser + * @summary Delete user + * @request DELETE:/user/{username} + */ + deleteUser: (username: string, params: RequestParams = {}) => + this.request({ + path: `/user/${username}`, + method: "DELETE", + ...params, + }), + }; +} diff --git a/tests/spec/extractResponseBody/test.js b/tests/spec/extractResponseBody/test.js new file mode 100644 index 000000000..5017c6df0 --- /dev/null +++ b/tests/spec/extractResponseBody/test.js @@ -0,0 +1,20 @@ +const { generateApiForTest } = require("../../helpers/generateApiForTest"); +const { resolve } = require("path"); +const validateGeneratedModule = require("../../helpers/validateGeneratedModule"); +const createSchemaInfos = require("../../helpers/createSchemaInfos"); + +const schemas = createSchemaInfos({ absolutePathToSchemas: resolve(__dirname, "./") }); + +schemas.forEach(({ absolutePath, apiFileName }) => { + generateApiForTest({ + testName: "--extract-response-body option test", + silent: true, + name: apiFileName, + input: absolutePath, + output: resolve(__dirname, "./"), + extractResponseBody: true, + typeSuffix: "TTT", + }).then(() => { + validateGeneratedModule(resolve(__dirname, `./${apiFileName}`)); + }); +}); diff --git a/tests/spec/extractResponseError/schema.json b/tests/spec/extractResponseError/schema.json new file mode 100644 index 000000000..0d4ccdbc5 --- /dev/null +++ b/tests/spec/extractResponseError/schema.json @@ -0,0 +1,1233 @@ +{ + "swagger": "2.0", + "info": { + "description": "This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.", + "version": "1.0.0", + "title": "Swagger Petstore", + "termsOfService": "http://swagger.io/terms/", + "contact": { + "email": "apiteam@swagger.io" + }, + "license": { + "name": "Apache-2.0", + "url": "http://www.apache.org/licenses/LICENSE-2.0.html" + } + }, + "host": "petstore.swagger.io", + "basePath": "/v2", + "tags": [ + { + "name": "pet", + "description": "Everything about your Pets", + "externalDocs": { + "description": "Find out more", + "url": "http://swagger.io" + } + }, + { + "name": "store", + "description": "Access to Petstore orders" + }, + { + "name": "user", + "description": "Operations about user", + "externalDocs": { + "description": "Find out more about our store", + "url": "http://swagger.io" + } + } + ], + "schemes": ["http"], + "paths": { + "/pet": { + "post": { + "tags": ["pet"], + "summary": "Add a new pet to the store", + "description": "", + "operationId": "addPet", + "consumes": ["application/json", "application/xml"], + "produces": ["application/xml", "application/json"], + "parameters": [ + { + "in": "body", + "name": "body", + "description": "Pet object that needs to be added to the store", + "required": true, + "schema": { + "$ref": "#/definitions/Pet" + } + } + ], + "responses": { + "405": { + "description": "Invalid input" + } + }, + "security": [ + { + "petstore_auth": ["write:pets", "read:pets"] + } + ], + "x-contentType": "application/json", + "x-accepts": "application/json" + }, + "put": { + "tags": ["pet"], + "summary": "Update an existing pet", + "description": "", + "operationId": "updatePet", + "consumes": ["application/json", "application/xml"], + "produces": ["application/xml", "application/json"], + "parameters": [ + { + "in": "body", + "name": "body", + "description": "Pet object that needs to be added to the store", + "required": true, + "schema": { + "$ref": "#/definitions/Pet" + } + } + ], + "responses": { + "400": { + "description": "Invalid ID supplied" + }, + "404": { + "description": "Pet not found" + }, + "405": { + "description": "Validation exception" + } + }, + "security": [ + { + "petstore_auth": ["write:pets", "read:pets"] + } + ], + "x-contentType": "application/json", + "x-accepts": "application/json" + } + }, + "/pet/findByStatus": { + "get": { + "tags": ["pet"], + "summary": "Finds Pets by status", + "description": "Multiple status values can be provided with comma separated strings", + "operationId": "findPetsByStatus", + "produces": ["application/xml", "application/json"], + "parameters": [ + { + "name": "status", + "in": "query", + "description": "Status values that need to be considered for filter", + "required": true, + "type": "array", + "items": { + "type": "string", + "default": "available", + "enum": ["available", "pending", "sold"] + }, + "collectionFormat": "csv" + } + ], + "responses": { + "200": { + "description": "successful operation", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/Pet" + } + } + }, + "400": { + "description": "Invalid status value" + } + }, + "security": [ + { + "petstore_auth": ["write:pets", "read:pets"] + } + ], + "x-accepts": "application/json" + } + }, + "/pet/single-form-url-encoded": { + "post": { + "responses": { + "500": { + "description": "500" + }, + "400": { + "description": "400" + }, + "401": { + "description": "401" + }, + "200": { + "description": "200" + } + }, + "summary": "summary", + "operationId": "singleFormUrlEncodedRequest", + "parameters": [ + { + "name": "param1", + "in": "formData", + "type": "string", + "format": "string", + "required": true + }, + { + "name": "param2", + "in": "formData", + "type": "string", + "required": true + } + ], + "security": [], + "consumes": ["application/x-www-form-urlencoded"], + "tags": ["pet"] + } + }, + "/pet/form-url-encoded": { + "post": { + "responses": { + "500": { + "description": "500" + }, + "400": { + "description": "400" + }, + "401": { + "description": "401" + }, + "200": { + "description": "200" + } + }, + "summary": "summary", + "operationId": "formUrlEncodedRequest", + "parameters": [ + { + "name": "param1", + "in": "formData", + "type": "string", + "format": "string", + "required": true + }, + { + "name": "param2", + "in": "formData", + "type": "string", + "required": true + } + ], + "security": [], + "consumes": ["application/x-www-form-urlencoded", "multipart/form-data"], + "tags": ["pet"] + } + }, + "/pet/end-form-url-encoded": { + "post": { + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "title": "ASdsddSAdsdasd", + "description": "asdsa as dasdsadas", + "type": "object", + "properties": { + "id": { + "title": "Id", + "description": "asd asdsad asd as", + "type": "string" + } + }, + "required": ["id"] + } + } + } + }, + "400": { + "description": "", + "content": { + "application/json": { + "schema": { + "title": "HttpError", + "type": "object", + "properties": { + "detail": { + "title": "Detail", + "description": "asdsad asd asd sa dsa", + "example": "asdasd sad sa dsad", + "type": "string" + } + }, + "required": ["detail"] + } + } + } + }, + "404": { + "description": "", + "content": { + "application/json": { + "schema": { + "title": "HttpError", + "type": "object", + "properties": { + "detail": { + "title": "Detail", + "description": "asdsad asd asd sa dsa", + "example": "asdasd sad sa dsad", + "type": "string" + } + }, + "required": ["detail"] + } + } + } + }, + "406": { + "description": "", + "content": { + "application/json": { + "schema": { + "title": "HttpErrorRetry", + "type": "object", + "properties": { + "detail": { + "title": "Detail", + "description": "sadas das dasd asd", + "example": "sadasd sads adsad asd ", + "type": "string" + }, + "retry_after": { + "title": "sadsa dsa dsa das", + "description": "sadas dasd as dasd asd", + "example": 600, + "type": "integer" + } + }, + "required": ["detail", "retry_after"] + } + } + } + }, + "422": { + "description": "", + "content": { + "application/json": { + "schema": { + "title": "HttpValidationError", + "description": "asd asd asd asd asd ", + "type": "object", + "additionalProperties": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + }, + "500": { + "description": "", + "content": { + "application/json": { + "schema": { + "title": "HttpError", + "type": "object", + "properties": { + "detail": { + "title": "Detail", + "description": "asdsad asd asd sa dsa", + "example": "asdasd sad sa dsad", + "type": "string" + } + }, + "required": ["detail"] + } + } + } + } + }, + "summary": "summary", + "operationId": "formUrlEncodedRequest", + "parameters": [ + { + "name": "param1", + "in": "formData", + "type": "string", + "format": "string", + "required": true + }, + { + "name": "param2", + "in": "formData", + "type": "string", + "required": true + } + ], + "security": [], + "consumes": ["multipart/form-data", "application/x-www-form-urlencoded"], + "tags": ["pet"] + } + }, + "/pet/findByTags": { + "get": { + "tags": ["pet"], + "summary": "Finds Pets by tags", + "description": "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", + "operationId": "findPetsByTags", + "produces": ["application/xml", "application/json"], + "parameters": [ + { + "name": "tags", + "in": "query", + "description": "Tags to filter by", + "required": true, + "type": "array", + "items": { + "type": "string" + }, + "collectionFormat": "csv" + } + ], + "responses": { + "200": { + "description": "successful operation", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/Pet" + } + } + }, + "400": { + "description": "Invalid tag value" + } + }, + "security": [ + { + "petstore_auth": ["write:pets", "read:pets"] + } + ], + "deprecated": true, + "x-accepts": "application/json" + } + }, + "/pet/{petId}": { + "get": { + "tags": ["pet"], + "summary": "Find pet by ID", + "description": "Returns a single pet", + "operationId": "getPetById", + "produces": ["application/xml", "application/json"], + "parameters": [ + { + "name": "petId", + "in": "path", + "description": "ID of pet to return", + "required": true, + "type": "integer", + "format": "int64" + } + ], + "responses": { + "200": { + "description": "successful operation", + "schema": { + "$ref": "#/definitions/Pet" + } + }, + "400": { + "description": "Invalid ID supplied" + }, + "404": { + "description": "Pet not found" + } + }, + "security": [ + { + "api_key": [] + } + ], + "x-accepts": "application/json" + }, + "post": { + "tags": ["pet"], + "summary": "Updates a pet in the store with form data", + "description": "", + "operationId": "updatePetWithForm", + "consumes": ["application/x-www-form-urlencoded"], + "produces": ["application/xml", "application/json"], + "parameters": [ + { + "name": "petId", + "in": "path", + "description": "ID of pet that needs to be updated", + "required": true, + "type": "integer", + "format": "int64" + }, + { + "name": "name", + "in": "formData", + "description": "Updated name of the pet", + "required": false, + "type": "string" + }, + { + "name": "status", + "in": "formData", + "description": "Updated status of the pet", + "required": false, + "type": "string" + } + ], + "responses": { + "405": { + "description": "Invalid input" + } + }, + "security": [ + { + "petstore_auth": ["write:pets", "read:pets"] + } + ], + "x-contentType": "application/x-www-form-urlencoded", + "x-accepts": "application/json" + }, + "delete": { + "tags": ["pet"], + "summary": "Deletes a pet", + "description": "", + "operationId": "deletePet", + "produces": ["application/xml", "application/json"], + "parameters": [ + { + "name": "api_key", + "in": "header", + "required": false, + "type": "string" + }, + { + "name": "petId", + "in": "path", + "description": "Pet id to delete", + "required": true, + "type": "integer", + "format": "int64" + } + ], + "responses": { + "400": { + "description": "Invalid pet value" + } + }, + "security": [ + { + "petstore_auth": ["write:pets", "read:pets"] + } + ], + "x-accepts": "application/json" + } + }, + "/pet/{petId}/uploadImage": { + "post": { + "tags": ["pet"], + "summary": "uploads an image", + "description": "", + "operationId": "uploadFile", + "consumes": ["multipart/form-data"], + "produces": ["application/json"], + "parameters": [ + { + "name": "petId", + "in": "path", + "description": "ID of pet to update", + "required": true, + "type": "integer", + "format": "int64" + }, + { + "name": "additionalMetadata", + "in": "formData", + "description": "Additional data to pass to server", + "required": false, + "type": "string" + }, + { + "name": "file", + "in": "formData", + "description": "file to upload", + "required": false, + "type": "file" + } + ], + "responses": { + "200": { + "description": "successful operation", + "schema": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "type": { + "type": "string" + }, + "message": { + "type": "string" + } + }, + "title": "An uploaded response", + "description": "Describes the result of uploading an image resource", + "example": { + "code": 0, + "type": "type", + "message": "message" + } + } + } + }, + "security": [ + { + "petstore_auth": ["write:pets", "read:pets"] + } + ], + "x-contentType": "multipart/form-data", + "x-accepts": "application/json" + } + }, + "/store/inventory": { + "get": { + "tags": ["store"], + "summary": "Returns pet inventories by status", + "description": "Returns a map of status codes to quantities", + "operationId": "getInventory", + "produces": ["application/json"], + "parameters": [], + "responses": { + "200": { + "description": "successful operation", + "schema": { + "type": "object", + "additionalProperties": { + "type": "integer", + "format": "int32" + } + } + } + }, + "security": [ + { + "api_key": [] + } + ], + "x-accepts": "application/json" + } + }, + "/store/order": { + "post": { + "tags": ["store"], + "summary": "Place an order for a pet", + "description": "", + "operationId": "placeOrder", + "produces": ["application/xml", "application/json"], + "parameters": [ + { + "in": "body", + "name": "body", + "description": "order placed for purchasing the pet", + "required": true, + "schema": { + "$ref": "#/definitions/Order" + } + } + ], + "responses": { + "200": { + "description": "successful operation", + "schema": { + "$ref": "#/definitions/Order" + } + }, + "400": { + "description": "Invalid Order" + } + }, + "x-contentType": "application/json", + "x-accepts": "application/json" + } + }, + "/store/order/{orderId}": { + "get": { + "tags": ["store"], + "summary": "Find purchase order by ID", + "description": "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", + "operationId": "getOrderById", + "produces": ["application/xml", "application/json"], + "parameters": [ + { + "name": "orderId", + "in": "path", + "description": "ID of pet that needs to be fetched", + "required": true, + "type": "integer", + "maximum": 5, + "minimum": 1, + "format": "int64" + } + ], + "responses": { + "200": { + "description": "successful operation", + "schema": { + "$ref": "#/definitions/Order" + } + }, + "400": { + "description": "Invalid ID supplied" + }, + "404": { + "description": "Order not found" + } + }, + "x-accepts": "application/json" + }, + "delete": { + "tags": ["store"], + "summary": "Delete purchase order by ID", + "description": "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors", + "operationId": "deleteOrder", + "produces": ["application/xml", "application/json"], + "parameters": [ + { + "name": "orderId", + "in": "path", + "description": "ID of the order that needs to be deleted", + "required": true, + "type": "string" + } + ], + "responses": { + "400": { + "description": "Invalid ID supplied" + }, + "404": { + "description": "Order not found" + } + }, + "x-accepts": "application/json" + } + }, + "/user": { + "post": { + "tags": ["user"], + "summary": "Create user", + "description": "This can only be done by the logged in user.", + "operationId": "createUser", + "produces": ["application/xml", "application/json"], + "parameters": [ + { + "in": "body", + "name": "body", + "description": "Created user object", + "required": true, + "schema": { + "$ref": "#/definitions/User" + } + } + ], + "responses": { + "default": { + "description": "successful operation" + } + }, + "x-contentType": "application/json", + "x-accepts": "application/json" + } + }, + "/user/createWithArray": { + "post": { + "tags": ["user"], + "summary": "Creates list of users with given input array", + "description": "", + "operationId": "createUsersWithArrayInput", + "produces": ["application/xml", "application/json"], + "parameters": [ + { + "in": "body", + "name": "body", + "description": "List of user object", + "required": true, + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/User" + } + } + } + ], + "responses": { + "default": { + "description": "successful operation" + } + }, + "x-contentType": "application/json", + "x-accepts": "application/json" + } + }, + "/user/createWithList": { + "post": { + "tags": ["user"], + "summary": "Creates list of users with given input array", + "description": "", + "operationId": "createUsersWithListInput", + "produces": ["application/xml", "application/json"], + "parameters": [ + { + "in": "body", + "name": "body", + "description": "List of user object", + "required": true, + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/User" + } + } + } + ], + "responses": { + "default": { + "description": "successful operation" + } + }, + "x-contentType": "application/json", + "x-accepts": "application/json" + } + }, + "/user/login": { + "get": { + "tags": ["user"], + "summary": "Logs user into the system", + "description": "", + "operationId": "loginUser", + "produces": ["application/xml", "application/json"], + "parameters": [ + { + "name": "username", + "in": "query", + "description": "The user name for login", + "required": true, + "type": "string" + }, + { + "name": "password", + "in": "query", + "description": "The password for login in clear text", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "successful operation", + "headers": { + "X-Rate-Limit": { + "type": "integer", + "format": "int32", + "description": "calls per hour allowed by the user" + }, + "X-Expires-After": { + "type": "string", + "format": "date-time", + "description": "date in UTC when toekn expires" + } + }, + "schema": { + "type": "string" + } + }, + "400": { + "description": "Invalid username/password supplied" + } + }, + "x-accepts": "application/json" + } + }, + "/user/logout": { + "get": { + "tags": ["user"], + "summary": "Logs out current logged in user session", + "description": "", + "operationId": "logoutUser", + "produces": ["application/xml", "application/json"], + "parameters": [], + "responses": { + "default": { + "description": "successful operation" + } + }, + "x-accepts": "application/json" + } + }, + "/user/{username}": { + "get": { + "tags": ["user"], + "summary": "Get user by user name", + "description": "", + "operationId": "getUserByName", + "produces": ["application/xml", "application/json"], + "parameters": [ + { + "name": "username", + "in": "path", + "description": "The name that needs to be fetched. Use user1 for testing.", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "successful operation", + "schema": { + "$ref": "#/definitions/User" + } + }, + "400": { + "description": "Invalid username supplied" + }, + "404": { + "description": "User not found" + } + }, + "x-accepts": "application/json" + }, + "put": { + "tags": ["user"], + "summary": "Updated user", + "description": "This can only be done by the logged in user.", + "operationId": "updateUser", + "produces": ["application/xml", "application/json"], + "parameters": [ + { + "name": "username", + "in": "path", + "description": "name that need to be deleted", + "required": true, + "type": "string" + }, + { + "in": "body", + "name": "body", + "description": "Updated user object", + "required": true, + "schema": { + "$ref": "#/definitions/User" + } + } + ], + "responses": { + "400": { + "description": "Invalid user supplied" + }, + "404": { + "description": "User not found" + } + }, + "x-contentType": "application/json", + "x-accepts": "application/json" + }, + "delete": { + "tags": ["user"], + "summary": "Delete user", + "description": "This can only be done by the logged in user.", + "operationId": "deleteUser", + "produces": ["application/xml", "application/json"], + "parameters": [ + { + "name": "username", + "in": "path", + "description": "The name that needs to be deleted", + "required": true, + "type": "string" + } + ], + "responses": { + "400": { + "description": "Invalid username supplied" + }, + "404": { + "description": "User not found" + } + }, + "x-accepts": "application/json" + } + } + }, + "securityDefinitions": { + "petstore_auth": { + "type": "oauth2", + "authorizationUrl": "http://petstore.swagger.io/api/oauth/dialog", + "flow": "implicit", + "scopes": { + "write:pets": "modify pets in your account", + "read:pets": "read your pets" + } + }, + "api_key": { + "type": "apiKey", + "name": "api_key", + "in": "header" + } + }, + "definitions": { + "Order": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "petId": { + "type": "integer", + "format": "int64" + }, + "quantity": { + "type": "integer", + "format": "int32" + }, + "shipDate": { + "type": "string", + "format": "date-time" + }, + "status": { + "type": "string", + "description": "Order Status", + "enum": ["placed", "approved", "delivered"], + "nullable": true + }, + "complete": { + "type": "boolean", + "default": false + } + }, + "title": "Pet Order", + "xml": { + "name": "Order" + }, + "description": "An order for a pets from the pet store", + "example": { + "petId": 6, + "quantity": 1, + "id": 0, + "shipDate": "2000-01-23T04:56:07.000+00:00", + "complete": false, + "status": "placed" + } + }, + "Category": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "name": { + "type": "string" + } + }, + "title": "Pet category", + "xml": { + "name": "Category" + }, + "description": "A category for a pet", + "example": { + "name": "name", + "id": 6 + } + }, + "User": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "username": { + "type": "string" + }, + "firstName": { + "type": "string" + }, + "lastName": { + "type": "string" + }, + "email": { + "type": "string" + }, + "password": { + "type": "string" + }, + "phone": { + "type": "string" + }, + "userStatus": { + "type": "integer", + "format": "int32", + "description": "User Status" + } + }, + "title": "a User", + "xml": { + "name": "User" + }, + "description": "A User who is purchasing from the pet store", + "example": { + "firstName": "firstName", + "lastName": "lastName", + "password": "password", + "userStatus": 6, + "phone": "phone", + "id": 0, + "email": "email", + "username": "username" + } + }, + "Tag": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "name": { + "type": "string" + } + }, + "title": "Pet Tag", + "xml": { + "name": "Tag" + }, + "description": "A tag for a pet", + "example": { + "name": "name", + "id": 1 + } + }, + "PetNames": { + "type": "string", + "enum": ["Fluffy Hero", "Piggy Po", "Swagger Typescript Api", "UPPER_CASE"] + }, + "PetIds": { + "type": "integer", + "enum": [10, 20, 30, 40] + }, + "PetIdsWithWrongEnum": { + "enum": [10, 20, 30, 40] + }, + "Pet": { + "type": "object", + "required": ["name", "photoUrls"], + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "category": { + "$ref": "#/definitions/Category" + }, + "name": { + "type": "string", + "example": "doggie" + }, + "photoUrls": { + "type": "array", + "xml": { + "name": "photoUrl", + "wrapped": true + }, + "items": { + "type": "string" + } + }, + "tags": { + "type": "array", + "xml": { + "name": "tag", + "wrapped": true + }, + "items": { + "$ref": "#/definitions/Tag" + } + }, + "status": { + "type": "string", + "description": "pet status in the store", + "enum": ["available", "pending", "sold"] + } + }, + "title": "a Pet", + "xml": { + "name": "Pet" + }, + "description": "A pet for sale in the pet store", + "example": { + "photoUrls": ["photoUrls", "photoUrls"], + "name": "doggie", + "id": 0, + "category": { + "name": "name", + "id": 6 + }, + "tags": [ + { + "name": "name", + "id": 1 + }, + { + "name": "name", + "id": 1 + } + ], + "status": "available" + } + }, + "Amount": { + "type": "object", + "required": ["currency", "value"], + "properties": { + "value": { + "type": "number", + "format": "double", + "description": "some description\n", + "minimum": 0.01, + "maximum": 1000000000000000 + }, + "currency": { + "$ref": "#/definitions/Currency" + } + }, + "description": "some description\n" + }, + "Currency": { + "type": "string", + "pattern": "^[A-Z]{3,3}$", + "description": "some description\n" + } + }, + "externalDocs": { + "description": "Find out more about Swagger", + "url": "http://swagger.io" + } +} diff --git a/tests/spec/extractResponseError/schema.ts b/tests/spec/extractResponseError/schema.ts new file mode 100644 index 000000000..bde801cbb --- /dev/null +++ b/tests/spec/extractResponseError/schema.ts @@ -0,0 +1,768 @@ +/* eslint-disable */ +/* tslint:disable */ +/* + * --------------------------------------------------------------- + * ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ## + * ## ## + * ## AUTHOR: acacode ## + * ## SOURCE: https://github.com/acacode/swagger-typescript-api ## + * --------------------------------------------------------------- + */ + +/** + * An order for a pets from the pet store + * @example {"petId":6,"quantity":1,"id":0,"shipDate":"2000-01-23T04:56:07.000+00:00","complete":false,"status":"placed"} + */ +export interface OrderTTT { + /** @format int64 */ + id?: number; + + /** @format int64 */ + petId?: number; + + /** @format int32 */ + quantity?: number; + + /** @format date-time */ + shipDate?: string; + + /** Order Status */ + status?: "placed" | "approved" | "delivered" | null; + complete?: boolean; +} + +/** + * A category for a pet + * @example {"name":"name","id":6} + */ +export interface CategoryTTT { + /** @format int64 */ + id?: number; + name?: string; +} + +/** + * A User who is purchasing from the pet store + * @example {"firstName":"firstName","lastName":"lastName","password":"password","userStatus":6,"phone":"phone","id":0,"email":"email","username":"username"} + */ +export interface UserTTT { + /** @format int64 */ + id?: number; + username?: string; + firstName?: string; + lastName?: string; + email?: string; + password?: string; + phone?: string; + + /** + * User Status + * @format int32 + */ + userStatus?: number; +} + +/** + * A tag for a pet + * @example {"name":"name","id":1} + */ +export interface TagTTT { + /** @format int64 */ + id?: number; + name?: string; +} + +export enum PetNamesTTT { + FluffyHero = "Fluffy Hero", + PiggyPo = "Piggy Po", + SwaggerTypescriptApi = "Swagger Typescript Api", + UPPER_CASE = "UPPER_CASE", +} + +export type PetIdsTTT = 10 | 20 | 30 | 40; + +export type PetIdsWithWrongEnumTTT = 10 | 20 | 30 | 40; + +/** + * A pet for sale in the pet store + * @example {"photoUrls":["photoUrls","photoUrls"],"name":"doggie","id":0,"category":{"name":"name","id":6},"tags":[{"name":"name","id":1},{"name":"name","id":1}],"status":"available"} + */ +export interface PetTTT { + /** @format int64 */ + id?: number; + + /** A category for a pet */ + category?: CategoryTTT; + + /** @example doggie */ + name: string; + photoUrls: string[]; + tags?: TagTTT[]; + + /** pet status in the store */ + status?: "available" | "pending" | "sold"; +} + +/** + * some description + */ +export interface AmountTTT { + /** + * some description + * + * @format double + * @min 0.01 + * @max 1000000000000000 + */ + value: number; + + /** + * some description + * + */ + currency: CurrencyTTT; +} + +/** + * some description + * @pattern ^[A-Z]{3,3}$ + */ +export type CurrencyTTT = string; + +/** + * asd asd asd asd asd + */ +export type FormUrlEncodedRequest2ErrorTTT = + | { detail: string } + | { detail: string } + | { detail: string; retry_after: number } + | Record + | { detail: string }; + +export type QueryParamsType = Record; +export type ResponseFormat = keyof Omit; + +export interface FullRequestParams extends Omit { + /** set parameter to `true` for call `securityWorker` for this request */ + secure?: boolean; + /** request path */ + path: string; + /** content type of request body */ + type?: ContentType; + /** query params */ + query?: QueryParamsType; + /** format of response (i.e. response.json() -> format: "json") */ + format?: ResponseFormat; + /** request body */ + body?: unknown; + /** base url */ + baseUrl?: string; + /** request cancellation token */ + cancelToken?: CancelToken; +} + +export type RequestParams = Omit; + +export interface ApiConfig { + baseUrl?: string; + baseApiParams?: Omit; + securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; + customFetch?: typeof fetch; +} + +export interface HttpResponse extends Response { + data: D; + error: E; +} + +type CancelToken = Symbol | string | number; + +export enum ContentType { + Json = "application/json", + FormData = "multipart/form-data", + UrlEncoded = "application/x-www-form-urlencoded", +} + +export class HttpClient { + public baseUrl: string = "http://petstore.swagger.io/v2"; + private securityData: SecurityDataType | null = null; + private securityWorker?: ApiConfig["securityWorker"]; + private abortControllers = new Map(); + private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); + + private baseApiParams: RequestParams = { + credentials: "same-origin", + headers: {}, + redirect: "follow", + referrerPolicy: "no-referrer", + }; + + constructor(apiConfig: ApiConfig = {}) { + Object.assign(this, apiConfig); + } + + public setSecurityData = (data: SecurityDataType | null) => { + this.securityData = data; + }; + + protected encodeQueryParam(key: string, value: any) { + const encodedKey = encodeURIComponent(key); + return `${encodedKey}=${encodeURIComponent(typeof value === "number" ? value : `${value}`)}`; + } + + protected addQueryParam(query: QueryParamsType, key: string) { + return this.encodeQueryParam(key, query[key]); + } + + protected addArrayQueryParam(query: QueryParamsType, key: string) { + const value = query[key]; + return value.map((v: any) => this.encodeQueryParam(key, v)).join("&"); + } + + protected toQueryString(rawQuery?: QueryParamsType): string { + const query = rawQuery || {}; + const keys = Object.keys(query).filter((key) => "undefined" !== typeof query[key]); + return keys + .map((key) => (Array.isArray(query[key]) ? this.addArrayQueryParam(query, key) : this.addQueryParam(query, key))) + .join("&"); + } + + protected addQueryParams(rawQuery?: QueryParamsType): string { + const queryString = this.toQueryString(rawQuery); + return queryString ? `?${queryString}` : ""; + } + + private contentFormatters: Record any> = { + [ContentType.Json]: (input: any) => + input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, + [ContentType.FormData]: (input: any) => + Object.keys(input || {}).reduce((formData, key) => { + const property = input[key]; + formData.append( + key, + property instanceof Blob + ? property + : typeof property === "object" && property !== null + ? JSON.stringify(property) + : `${property}`, + ); + return formData; + }, new FormData()), + [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), + }; + + protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + return { + ...this.baseApiParams, + ...params1, + ...(params2 || {}), + headers: { + ...(this.baseApiParams.headers || {}), + ...(params1.headers || {}), + ...((params2 && params2.headers) || {}), + }, + }; + } + + protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + if (this.abortControllers.has(cancelToken)) { + const abortController = this.abortControllers.get(cancelToken); + if (abortController) { + return abortController.signal; + } + return void 0; + } + + const abortController = new AbortController(); + this.abortControllers.set(cancelToken, abortController); + return abortController.signal; + }; + + public abortRequest = (cancelToken: CancelToken) => { + const abortController = this.abortControllers.get(cancelToken); + + if (abortController) { + abortController.abort(); + this.abortControllers.delete(cancelToken); + } + }; + + public request = async ({ + body, + secure, + path, + type, + query, + format, + baseUrl, + cancelToken, + ...params + }: FullRequestParams): Promise> => { + const secureParams = + ((typeof secure === "boolean" ? secure : this.baseApiParams.secure) && + this.securityWorker && + (await this.securityWorker(this.securityData))) || + {}; + const requestParams = this.mergeRequestParams(params, secureParams); + const queryString = query && this.toQueryString(query); + const payloadFormatter = this.contentFormatters[type || ContentType.Json]; + const responseFormat = format || requestParams.format; + + return this.customFetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, { + ...requestParams, + headers: { + ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), + ...(requestParams.headers || {}), + }, + signal: cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal, + body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), + }).then(async (response) => { + const r = response as HttpResponse; + r.data = null as unknown as T; + r.error = null as unknown as E; + + const data = !responseFormat + ? r + : await response[responseFormat]() + .then((data) => { + if (r.ok) { + r.data = data; + } else { + r.error = data; + } + return r; + }) + .catch((e) => { + r.error = e; + return r; + }); + + if (cancelToken) { + this.abortControllers.delete(cancelToken); + } + + if (!response.ok) throw data; + return data; + }); + }; +} + +/** + * @title Swagger Petstore + * @version 1.0.0 + * @license Apache-2.0 (http://www.apache.org/licenses/LICENSE-2.0.html) + * @termsOfService http://swagger.io/terms/ + * @baseUrl http://petstore.swagger.io/v2 + * @externalDocs http://swagger.io + * @contact + * + * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + */ +export class Api extends HttpClient { + pet = { + /** + * No description + * + * @tags pet + * @name AddPet + * @summary Add a new pet to the store + * @request POST:/pet + * @secure + */ + addPet: (body: PetTTT, params: RequestParams = {}) => + this.request({ + path: `/pet`, + method: "POST", + body: body, + secure: true, + type: ContentType.Json, + ...params, + }), + + /** + * No description + * + * @tags pet + * @name UpdatePet + * @summary Update an existing pet + * @request PUT:/pet + * @secure + */ + updatePet: (body: PetTTT, params: RequestParams = {}) => + this.request({ + path: `/pet`, + method: "PUT", + body: body, + secure: true, + type: ContentType.Json, + ...params, + }), + + /** + * @description Multiple status values can be provided with comma separated strings + * + * @tags pet + * @name FindPetsByStatus + * @summary Finds Pets by status + * @request GET:/pet/findByStatus + * @secure + */ + findPetsByStatus: (query: { status: ("available" | "pending" | "sold")[] }, params: RequestParams = {}) => + this.request({ + path: `/pet/findByStatus`, + method: "GET", + query: query, + secure: true, + format: "json", + ...params, + }), + + /** + * No description + * + * @tags pet + * @name SingleFormUrlEncodedRequest + * @summary summary + * @request POST:/pet/single-form-url-encoded + */ + singleFormUrlEncodedRequest: (data: { param1: string; param2: string }, params: RequestParams = {}) => + this.request({ + path: `/pet/single-form-url-encoded`, + method: "POST", + body: data, + type: ContentType.UrlEncoded, + ...params, + }), + + /** + * No description + * + * @tags pet + * @name FormUrlEncodedRequest + * @summary summary + * @request POST:/pet/form-url-encoded + */ + formUrlEncodedRequest: (data: { param1: string; param2: string }, params: RequestParams = {}) => + this.request({ + path: `/pet/form-url-encoded`, + method: "POST", + body: data, + type: ContentType.UrlEncoded, + ...params, + }), + + /** + * No description + * + * @tags pet + * @name FormUrlEncodedRequest2 + * @summary summary + * @request POST:/pet/end-form-url-encoded + * @originalName formUrlEncodedRequest + * @duplicate + */ + formUrlEncodedRequest2: (data: { param1: string; param2: string }, params: RequestParams = {}) => + this.request<{ id: string }, FormUrlEncodedRequest2ErrorTTT>({ + path: `/pet/end-form-url-encoded`, + method: "POST", + body: data, + type: ContentType.UrlEncoded, + format: "json", + ...params, + }), + + /** + * @description Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * + * @tags pet + * @name FindPetsByTags + * @summary Finds Pets by tags + * @request GET:/pet/findByTags + * @deprecated + * @secure + */ + findPetsByTags: (query: { tags: string[] }, params: RequestParams = {}) => + this.request({ + path: `/pet/findByTags`, + method: "GET", + query: query, + secure: true, + format: "json", + ...params, + }), + + /** + * @description Returns a single pet + * + * @tags pet + * @name GetPetById + * @summary Find pet by ID + * @request GET:/pet/{petId} + * @secure + */ + getPetById: (petId: number, params: RequestParams = {}) => + this.request({ + path: `/pet/${petId}`, + method: "GET", + secure: true, + format: "json", + ...params, + }), + + /** + * No description + * + * @tags pet + * @name UpdatePetWithForm + * @summary Updates a pet in the store with form data + * @request POST:/pet/{petId} + * @secure + */ + updatePetWithForm: (petId: number, data: { name?: string; status?: string }, params: RequestParams = {}) => + this.request({ + path: `/pet/${petId}`, + method: "POST", + body: data, + secure: true, + type: ContentType.FormData, + ...params, + }), + + /** + * No description + * + * @tags pet + * @name DeletePet + * @summary Deletes a pet + * @request DELETE:/pet/{petId} + * @secure + */ + deletePet: (petId: number, params: RequestParams = {}) => + this.request({ + path: `/pet/${petId}`, + method: "DELETE", + secure: true, + ...params, + }), + + /** + * No description + * + * @tags pet + * @name UploadFile + * @summary uploads an image + * @request POST:/pet/{petId}/uploadImage + * @secure + */ + uploadFile: (petId: number, data: { additionalMetadata?: string; file?: File }, params: RequestParams = {}) => + this.request<{ code?: number; type?: string; message?: string }, any>({ + path: `/pet/${petId}/uploadImage`, + method: "POST", + body: data, + secure: true, + type: ContentType.FormData, + format: "json", + ...params, + }), + }; + store = { + /** + * @description Returns a map of status codes to quantities + * + * @tags store + * @name GetInventory + * @summary Returns pet inventories by status + * @request GET:/store/inventory + * @secure + */ + getInventory: (params: RequestParams = {}) => + this.request, any>({ + path: `/store/inventory`, + method: "GET", + secure: true, + format: "json", + ...params, + }), + + /** + * No description + * + * @tags store + * @name PlaceOrder + * @summary Place an order for a pet + * @request POST:/store/order + */ + placeOrder: (body: OrderTTT, params: RequestParams = {}) => + this.request({ + path: `/store/order`, + method: "POST", + body: body, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * + * @tags store + * @name GetOrderById + * @summary Find purchase order by ID + * @request GET:/store/order/{orderId} + */ + getOrderById: (orderId: number, params: RequestParams = {}) => + this.request({ + path: `/store/order/${orderId}`, + method: "GET", + format: "json", + ...params, + }), + + /** + * @description For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * + * @tags store + * @name DeleteOrder + * @summary Delete purchase order by ID + * @request DELETE:/store/order/{orderId} + */ + deleteOrder: (orderId: string, params: RequestParams = {}) => + this.request({ + path: `/store/order/${orderId}`, + method: "DELETE", + ...params, + }), + }; + user = { + /** + * @description This can only be done by the logged in user. + * + * @tags user + * @name CreateUser + * @summary Create user + * @request POST:/user + */ + createUser: (body: UserTTT, params: RequestParams = {}) => + this.request({ + path: `/user`, + method: "POST", + body: body, + type: ContentType.Json, + ...params, + }), + + /** + * No description + * + * @tags user + * @name CreateUsersWithArrayInput + * @summary Creates list of users with given input array + * @request POST:/user/createWithArray + */ + createUsersWithArrayInput: (body: UserTTT[], params: RequestParams = {}) => + this.request({ + path: `/user/createWithArray`, + method: "POST", + body: body, + type: ContentType.Json, + ...params, + }), + + /** + * No description + * + * @tags user + * @name CreateUsersWithListInput + * @summary Creates list of users with given input array + * @request POST:/user/createWithList + */ + createUsersWithListInput: (body: UserTTT[], params: RequestParams = {}) => + this.request({ + path: `/user/createWithList`, + method: "POST", + body: body, + type: ContentType.Json, + ...params, + }), + + /** + * No description + * + * @tags user + * @name LoginUser + * @summary Logs user into the system + * @request GET:/user/login + */ + loginUser: (query: { username: string; password: string }, params: RequestParams = {}) => + this.request({ + path: `/user/login`, + method: "GET", + query: query, + format: "json", + ...params, + }), + + /** + * No description + * + * @tags user + * @name LogoutUser + * @summary Logs out current logged in user session + * @request GET:/user/logout + */ + logoutUser: (params: RequestParams = {}) => + this.request({ + path: `/user/logout`, + method: "GET", + ...params, + }), + + /** + * No description + * + * @tags user + * @name GetUserByName + * @summary Get user by user name + * @request GET:/user/{username} + */ + getUserByName: (username: string, params: RequestParams = {}) => + this.request({ + path: `/user/${username}`, + method: "GET", + format: "json", + ...params, + }), + + /** + * @description This can only be done by the logged in user. + * + * @tags user + * @name UpdateUser + * @summary Updated user + * @request PUT:/user/{username} + */ + updateUser: (username: string, body: UserTTT, params: RequestParams = {}) => + this.request({ + path: `/user/${username}`, + method: "PUT", + body: body, + type: ContentType.Json, + ...params, + }), + + /** + * @description This can only be done by the logged in user. + * + * @tags user + * @name DeleteUser + * @summary Delete user + * @request DELETE:/user/{username} + */ + deleteUser: (username: string, params: RequestParams = {}) => + this.request({ + path: `/user/${username}`, + method: "DELETE", + ...params, + }), + }; +} diff --git a/tests/spec/extractResponseError/test.js b/tests/spec/extractResponseError/test.js new file mode 100644 index 000000000..e0821fe4b --- /dev/null +++ b/tests/spec/extractResponseError/test.js @@ -0,0 +1,20 @@ +const { generateApiForTest } = require("../../helpers/generateApiForTest"); +const { resolve } = require("path"); +const validateGeneratedModule = require("../../helpers/validateGeneratedModule"); +const createSchemaInfos = require("../../helpers/createSchemaInfos"); + +const schemas = createSchemaInfos({ absolutePathToSchemas: resolve(__dirname, "./") }); + +schemas.forEach(({ absolutePath, apiFileName }) => { + generateApiForTest({ + testName: "--extract-response-body option test", + silent: true, + name: apiFileName, + input: absolutePath, + output: resolve(__dirname, "./"), + extractResponseError: true, + typeSuffix: "TTT", + }).then(() => { + validateGeneratedModule(resolve(__dirname, `./${apiFileName}`)); + }); +}); diff --git a/tests/spec/js/schema.d.ts b/tests/spec/js/schema.d.ts index 7226f6561..272d4dfc5 100644 --- a/tests/spec/js/schema.d.ts +++ b/tests/spec/js/schema.d.ts @@ -1748,14 +1748,14 @@ export declare class HttpClient { private baseApiParams; constructor(apiConfig?: ApiConfig); setSecurityData: (data: SecurityDataType | null) => void; - private encodeQueryParam; - private addQueryParam; - private addArrayQueryParam; + protected encodeQueryParam(key: string, value: any): string; + protected addQueryParam(query: QueryParamsType, key: string): string; + protected addArrayQueryParam(query: QueryParamsType, key: string): any; protected toQueryString(rawQuery?: QueryParamsType): string; protected addQueryParams(rawQuery?: QueryParamsType): string; private contentFormatters; - private mergeRequestParams; - private createAbortSignal; + protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams; + protected createAbortSignal: (cancelToken: CancelToken) => AbortSignal | undefined; abortRequest: (cancelToken: CancelToken) => void; request: ({ body, diff --git a/tests/spec/js/schema.js b/tests/spec/js/schema.js index 96405b2de..f50279fdd 100644 --- a/tests/spec/js/schema.js +++ b/tests/spec/js/schema.js @@ -16,103 +16,23 @@ export var ContentType; ContentType["UrlEncoded"] = "application/x-www-form-urlencoded"; })(ContentType || (ContentType = {})); export class HttpClient { + baseUrl = "https://api.github.com"; + securityData = null; + securityWorker; + abortControllers = new Map(); + customFetch = (...fetchParams) => fetch(...fetchParams); + baseApiParams = { + credentials: "same-origin", + headers: {}, + redirect: "follow", + referrerPolicy: "no-referrer", + }; constructor(apiConfig = {}) { - this.baseUrl = "https://api.github.com"; - this.securityData = null; - this.abortControllers = new Map(); - this.customFetch = (...fetchParams) => fetch(...fetchParams); - this.baseApiParams = { - credentials: "same-origin", - headers: {}, - redirect: "follow", - referrerPolicy: "no-referrer", - }; - this.setSecurityData = (data) => { - this.securityData = data; - }; - this.contentFormatters = { - [ContentType.Json]: (input) => - input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, - [ContentType.FormData]: (input) => - Object.keys(input || {}).reduce((formData, key) => { - const property = input[key]; - formData.append( - key, - property instanceof Blob - ? property - : typeof property === "object" && property !== null - ? JSON.stringify(property) - : `${property}`, - ); - return formData; - }, new FormData()), - [ContentType.UrlEncoded]: (input) => this.toQueryString(input), - }; - this.createAbortSignal = (cancelToken) => { - if (this.abortControllers.has(cancelToken)) { - const abortController = this.abortControllers.get(cancelToken); - if (abortController) { - return abortController.signal; - } - return void 0; - } - const abortController = new AbortController(); - this.abortControllers.set(cancelToken, abortController); - return abortController.signal; - }; - this.abortRequest = (cancelToken) => { - const abortController = this.abortControllers.get(cancelToken); - if (abortController) { - abortController.abort(); - this.abortControllers.delete(cancelToken); - } - }; - this.request = async ({ body, secure, path, type, query, format, baseUrl, cancelToken, ...params }) => { - const secureParams = - ((typeof secure === "boolean" ? secure : this.baseApiParams.secure) && - this.securityWorker && - (await this.securityWorker(this.securityData))) || - {}; - const requestParams = this.mergeRequestParams(params, secureParams); - const queryString = query && this.toQueryString(query); - const payloadFormatter = this.contentFormatters[type || ContentType.Json]; - const responseFormat = format || requestParams.format; - return this.customFetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, { - ...requestParams, - headers: { - ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), - ...(requestParams.headers || {}), - }, - signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0, - body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), - }).then(async (response) => { - const r = response; - r.data = null; - r.error = null; - const data = !responseFormat - ? r - : await response[responseFormat]() - .then((data) => { - if (r.ok) { - r.data = data; - } else { - r.error = data; - } - return r; - }) - .catch((e) => { - r.error = e; - return r; - }); - if (cancelToken) { - this.abortControllers.delete(cancelToken); - } - if (!response.ok) throw data; - return data; - }); - }; Object.assign(this, apiConfig); } + setSecurityData = (data) => { + this.securityData = data; + }; encodeQueryParam(key, value) { const encodedKey = encodeURIComponent(key); return `${encodedKey}=${encodeURIComponent(typeof value === "number" ? value : `${value}`)}`; @@ -135,6 +55,24 @@ export class HttpClient { const queryString = this.toQueryString(rawQuery); return queryString ? `?${queryString}` : ""; } + contentFormatters = { + [ContentType.Json]: (input) => + input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, + [ContentType.FormData]: (input) => + Object.keys(input || {}).reduce((formData, key) => { + const property = input[key]; + formData.append( + key, + property instanceof Blob + ? property + : typeof property === "object" && property !== null + ? JSON.stringify(property) + : `${property}`, + ); + return formData; + }, new FormData()), + [ContentType.UrlEncoded]: (input) => this.toQueryString(input), + }; mergeRequestParams(params1, params2) { return { ...this.baseApiParams, @@ -147,6 +85,69 @@ export class HttpClient { }, }; } + createAbortSignal = (cancelToken) => { + if (this.abortControllers.has(cancelToken)) { + const abortController = this.abortControllers.get(cancelToken); + if (abortController) { + return abortController.signal; + } + return void 0; + } + const abortController = new AbortController(); + this.abortControllers.set(cancelToken, abortController); + return abortController.signal; + }; + abortRequest = (cancelToken) => { + const abortController = this.abortControllers.get(cancelToken); + if (abortController) { + abortController.abort(); + this.abortControllers.delete(cancelToken); + } + }; + request = async ({ body, secure, path, type, query, format, baseUrl, cancelToken, ...params }) => { + const secureParams = + ((typeof secure === "boolean" ? secure : this.baseApiParams.secure) && + this.securityWorker && + (await this.securityWorker(this.securityData))) || + {}; + const requestParams = this.mergeRequestParams(params, secureParams); + const queryString = query && this.toQueryString(query); + const payloadFormatter = this.contentFormatters[type || ContentType.Json]; + const responseFormat = format || requestParams.format; + return this.customFetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, { + ...requestParams, + headers: { + ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), + ...(requestParams.headers || {}), + }, + signal: cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal, + body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), + }).then(async (response) => { + const r = response; + r.data = null; + r.error = null; + const data = !responseFormat + ? r + : await response[responseFormat]() + .then((data) => { + if (r.ok) { + r.data = data; + } else { + r.error = data; + } + return r; + }) + .catch((e) => { + r.error = e; + return r; + }); + if (cancelToken) { + this.abortControllers.delete(cancelToken); + } + if (!response.ok) throw data; + return data; + }); + }; } /** * @title GitHub @@ -158,3336 +159,3333 @@ export class HttpClient { * Powerful collaboration, code review, and code management for open source and private projects. */ export class Api extends HttpClient { - constructor() { - super(...arguments); - this.emojis = { - /** - * @description Lists all the emojis available to use on GitHub. - * - * @name EmojisList - * @request GET:/emojis - */ - emojisList: (params = {}) => - this.request({ - path: `/emojis`, - method: "GET", - format: "json", - ...params, - }), - }; - this.events = { - /** - * @description List public events. - * - * @name EventsList - * @request GET:/events - */ - eventsList: (params = {}) => - this.request({ - path: `/events`, - method: "GET", - format: "json", - ...params, - }), - }; - this.feeds = { - /** - * @description List Feeds. GitHub provides several timeline resources in Atom format. The Feeds API lists all the feeds available to the authenticating user. - * - * @name FeedsList - * @request GET:/feeds - */ - feedsList: (params = {}) => - this.request({ - path: `/feeds`, - method: "GET", - format: "json", - ...params, - }), - }; - this.gists = { - /** - * @description List the authenticated user's gists or if called anonymously, this will return all public gists. - * - * @name GistsList - * @request GET:/gists - */ - gistsList: (query, params = {}) => - this.request({ - path: `/gists`, - method: "GET", - query: query, - format: "json", - ...params, - }), - /** - * @description Create a gist. - * - * @name GistsCreate - * @request POST:/gists - */ - gistsCreate: (body, params = {}) => - this.request({ - path: `/gists`, - method: "POST", - body: body, - type: ContentType.Json, - format: "json", - ...params, - }), - /** - * @description List all public gists. - * - * @name PublicList - * @request GET:/gists/public - */ - publicList: (query, params = {}) => - this.request({ - path: `/gists/public`, - method: "GET", - query: query, - format: "json", - ...params, - }), - /** - * @description List the authenticated user's starred gists. - * - * @name StarredList - * @request GET:/gists/starred - */ - starredList: (query, params = {}) => - this.request({ - path: `/gists/starred`, - method: "GET", - query: query, - format: "json", - ...params, - }), - /** - * @description Delete a gist. - * - * @name GistsDelete - * @request DELETE:/gists/{id} - */ - gistsDelete: (id, params = {}) => - this.request({ - path: `/gists/${id}`, - method: "DELETE", - ...params, - }), - /** - * @description Get a single gist. - * - * @name GistsDetail - * @request GET:/gists/{id} - */ - gistsDetail: (id, params = {}) => - this.request({ - path: `/gists/${id}`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description Edit a gist. - * - * @name GistsPartialUpdate - * @request PATCH:/gists/{id} - */ - gistsPartialUpdate: (id, body, params = {}) => - this.request({ - path: `/gists/${id}`, - method: "PATCH", - body: body, - type: ContentType.Json, - format: "json", - ...params, - }), - /** - * @description List comments on a gist. - * - * @name CommentsDetail - * @request GET:/gists/{id}/comments - */ - commentsDetail: (id, params = {}) => - this.request({ - path: `/gists/${id}/comments`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description Create a commen - * - * @name CommentsCreate - * @request POST:/gists/{id}/comments - */ - commentsCreate: (id, body, params = {}) => - this.request({ - path: `/gists/${id}/comments`, - method: "POST", - body: body, - format: "json", - ...params, - }), - /** - * @description Delete a comment. - * - * @name CommentsDelete - * @request DELETE:/gists/{id}/comments/{commentId} - */ - commentsDelete: (id, commentId, params = {}) => - this.request({ - path: `/gists/${id}/comments/${commentId}`, - method: "DELETE", - ...params, - }), - /** - * @description Get a single comment. - * - * @name CommentsDetail2 - * @request GET:/gists/{id}/comments/{commentId} - * @originalName commentsDetail - * @duplicate - */ - commentsDetail2: (id, commentId, params = {}) => - this.request({ - path: `/gists/${id}/comments/${commentId}`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description Edit a comment. - * - * @name CommentsPartialUpdate - * @request PATCH:/gists/{id}/comments/{commentId} - */ - commentsPartialUpdate: (id, commentId, body, params = {}) => - this.request({ - path: `/gists/${id}/comments/${commentId}`, - method: "PATCH", - body: body, - type: ContentType.Json, - format: "json", - ...params, - }), - /** - * @description Fork a gist. - * - * @name ForksCreate - * @request POST:/gists/{id}/forks - */ - forksCreate: (id, params = {}) => - this.request({ - path: `/gists/${id}/forks`, - method: "POST", - ...params, - }), - /** - * @description Unstar a gist. - * - * @name StarDelete - * @request DELETE:/gists/{id}/star - */ - starDelete: (id, params = {}) => - this.request({ - path: `/gists/${id}/star`, - method: "DELETE", - ...params, - }), - /** - * @description Check if a gist is starred. - * - * @name StarDetail - * @request GET:/gists/{id}/star - */ - starDetail: (id, params = {}) => - this.request({ - path: `/gists/${id}/star`, - method: "GET", - ...params, - }), - /** - * @description Star a gist. - * - * @name StarUpdate - * @request PUT:/gists/{id}/star - */ - starUpdate: (id, params = {}) => - this.request({ - path: `/gists/${id}/star`, - method: "PUT", - ...params, - }), - }; - this.gitignore = { - /** - * @description Listing available templates. List all templates available to pass as an option when creating a repository. - * - * @name TemplatesList - * @request GET:/gitignore/templates - */ - templatesList: (params = {}) => - this.request({ - path: `/gitignore/templates`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description Get a single template. - * - * @name TemplatesDetail - * @request GET:/gitignore/templates/{language} - */ - templatesDetail: (language, params = {}) => - this.request({ - path: `/gitignore/templates/${language}`, - method: "GET", - format: "json", - ...params, - }), - }; - this.issues = { - /** - * @description List issues. List all issues across all the authenticated user's visible repositories. - * - * @name IssuesList - * @request GET:/issues - */ - issuesList: (query, params = {}) => - this.request({ - path: `/issues`, - method: "GET", - query: query, - format: "json", - ...params, - }), - }; - this.legacy = { - /** - * @description Find issues by state and keyword. - * - * @name IssuesSearchDetail - * @request GET:/legacy/issues/search/{owner}/{repository}/{state}/{keyword} - * @deprecated - */ - issuesSearchDetail: (keyword, state, owner, repository, params = {}) => - this.request({ - path: `/legacy/issues/search/${owner}/${repository}/${state}/${keyword}`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description Find repositories by keyword. Note, this legacy method does not follow the v3 pagination pattern. This method returns up to 100 results per page and pages can be fetched using the start_page parameter. - * - * @name ReposSearchDetail - * @request GET:/legacy/repos/search/{keyword} - * @deprecated - */ - reposSearchDetail: (keyword, query, params = {}) => - this.request({ - path: `/legacy/repos/search/${keyword}`, - method: "GET", - query: query, - format: "json", - ...params, - }), - /** - * @description This API call is added for compatibility reasons only. - * - * @name UserEmailDetail - * @request GET:/legacy/user/email/{email} - * @deprecated - */ - userEmailDetail: (email, params = {}) => - this.request({ - path: `/legacy/user/email/${email}`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description Find users by keyword. - * - * @name UserSearchDetail - * @request GET:/legacy/user/search/{keyword} - * @deprecated - */ - userSearchDetail: (keyword, query, params = {}) => - this.request({ - path: `/legacy/user/search/${keyword}`, - method: "GET", - query: query, - format: "json", - ...params, - }), - }; - this.markdown = { - /** - * @description Render an arbitrary Markdown document - * - * @name MarkdownCreate - * @request POST:/markdown - */ - markdownCreate: (body, params = {}) => - this.request({ - path: `/markdown`, - method: "POST", - body: body, - type: ContentType.Json, - ...params, - }), - /** - * @description Render a Markdown document in raw mode - * - * @name PostMarkdown - * @request POST:/markdown/raw - */ - postMarkdown: (params = {}) => - this.request({ - path: `/markdown/raw`, - method: "POST", - ...params, - }), - }; - this.meta = { - /** - * @description This gives some information about GitHub.com, the service. - * - * @name MetaList - * @request GET:/meta - */ - metaList: (params = {}) => - this.request({ - path: `/meta`, - method: "GET", - format: "json", - ...params, - }), - }; - this.networks = { - /** - * @description List public events for a network of repositories. - * - * @name EventsDetail - * @request GET:/networks/{owner}/{repo}/events - */ - eventsDetail: (owner, repo, params = {}) => - this.request({ - path: `/networks/${owner}/${repo}/events`, - method: "GET", - format: "json", - ...params, - }), - }; - this.notifications = { - /** - * @description List your notifications. List all notifications for the current user, grouped by repository. - * - * @name NotificationsList - * @request GET:/notifications - */ - notificationsList: (query, params = {}) => - this.request({ - path: `/notifications`, - method: "GET", - query: query, - format: "json", - ...params, - }), - /** - * @description Mark as read. Marking a notification as "read" removes it from the default view on GitHub.com. - * - * @name NotificationsUpdate - * @request PUT:/notifications - */ - notificationsUpdate: (body, params = {}) => - this.request({ - path: `/notifications`, - method: "PUT", - body: body, - ...params, - }), - /** - * @description View a single thread. - * - * @name ThreadsDetail - * @request GET:/notifications/threads/{id} - */ - threadsDetail: (id, params = {}) => - this.request({ - path: `/notifications/threads/${id}`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description Mark a thread as read - * - * @name ThreadsPartialUpdate - * @request PATCH:/notifications/threads/{id} - */ - threadsPartialUpdate: (id, params = {}) => - this.request({ - path: `/notifications/threads/${id}`, - method: "PATCH", - ...params, - }), - /** - * @description Delete a Thread Subscription. - * - * @name ThreadsSubscriptionDelete - * @request DELETE:/notifications/threads/{id}/subscription - */ - threadsSubscriptionDelete: (id, params = {}) => - this.request({ - path: `/notifications/threads/${id}/subscription`, - method: "DELETE", - ...params, - }), - /** - * @description Get a Thread Subscription. - * - * @name ThreadsSubscriptionDetail - * @request GET:/notifications/threads/{id}/subscription - */ - threadsSubscriptionDetail: (id, params = {}) => - this.request({ - path: `/notifications/threads/${id}/subscription`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description Set a Thread Subscription. This lets you subscribe to a thread, or ignore it. Subscribing to a thread is unnecessary if the user is already subscribed to the repository. Ignoring a thread will mute all future notifications (until you comment or get @mentioned). - * - * @name ThreadsSubscriptionUpdate - * @request PUT:/notifications/threads/{id}/subscription - */ - threadsSubscriptionUpdate: (id, body, params = {}) => - this.request({ - path: `/notifications/threads/${id}/subscription`, - method: "PUT", - body: body, - type: ContentType.Json, - format: "json", - ...params, - }), - }; - this.orgs = { - /** - * @description Get an Organization. - * - * @name OrgsDetail - * @request GET:/orgs/{org} - */ - orgsDetail: (org, params = {}) => - this.request({ - path: `/orgs/${org}`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description Edit an Organization. - * - * @name OrgsPartialUpdate - * @request PATCH:/orgs/{org} - */ - orgsPartialUpdate: (org, body, params = {}) => - this.request({ - path: `/orgs/${org}`, - method: "PATCH", - body: body, - type: ContentType.Json, - format: "json", - ...params, - }), - /** - * @description List public events for an organization. - * - * @name EventsDetail - * @request GET:/orgs/{org}/events - */ - eventsDetail: (org, params = {}) => - this.request({ - path: `/orgs/${org}/events`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description List issues. List all issues for a given organization for the authenticated user. - * - * @name IssuesDetail - * @request GET:/orgs/{org}/issues - */ - issuesDetail: (org, query, params = {}) => - this.request({ - path: `/orgs/${org}/issues`, - method: "GET", - query: query, - format: "json", - ...params, - }), - /** - * @description Members list. List all users who are members of an organization. A member is a user tha belongs to at least 1 team in the organization. If the authenticated user is also an owner of this organization then both concealed and public members will be returned. If the requester is not an owner of the organization the query will be redirected to the public members list. - * - * @name MembersDetail - * @request GET:/orgs/{org}/members - */ - membersDetail: (org, params = {}) => - this.request({ - path: `/orgs/${org}/members`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description Remove a member. Removing a user from this list will remove them from all teams and they will no longer have any access to the organization's repositories. - * - * @name MembersDelete - * @request DELETE:/orgs/{org}/members/{username} - */ - membersDelete: (org, username, params = {}) => - this.request({ - path: `/orgs/${org}/members/${username}`, - method: "DELETE", - ...params, - }), - /** - * @description Check if a user is, publicly or privately, a member of the organization. - * - * @name MembersDetail2 - * @request GET:/orgs/{org}/members/{username} - * @originalName membersDetail - * @duplicate - */ - membersDetail2: (org, username, params = {}) => - this.request({ - path: `/orgs/${org}/members/${username}`, - method: "GET", - ...params, - }), - /** - * @description Public members list. Members of an organization can choose to have their membership publicized or not. - * - * @name PublicMembersDetail - * @request GET:/orgs/{org}/public_members - */ - publicMembersDetail: (org, params = {}) => - this.request({ - path: `/orgs/${org}/public_members`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description Conceal a user's membership. - * - * @name PublicMembersDelete - * @request DELETE:/orgs/{org}/public_members/{username} - */ - publicMembersDelete: (org, username, params = {}) => - this.request({ - path: `/orgs/${org}/public_members/${username}`, - method: "DELETE", - ...params, - }), - /** - * @description Check public membership. - * - * @name PublicMembersDetail2 - * @request GET:/orgs/{org}/public_members/{username} - * @originalName publicMembersDetail - * @duplicate - */ - publicMembersDetail2: (org, username, params = {}) => - this.request({ - path: `/orgs/${org}/public_members/${username}`, - method: "GET", - ...params, - }), - /** - * @description Publicize a user's membership. - * - * @name PublicMembersUpdate - * @request PUT:/orgs/{org}/public_members/{username} - */ - publicMembersUpdate: (org, username, params = {}) => - this.request({ - path: `/orgs/${org}/public_members/${username}`, - method: "PUT", - ...params, - }), - /** - * @description List repositories for the specified org. - * - * @name ReposDetail - * @request GET:/orgs/{org}/repos - */ - reposDetail: (org, query, params = {}) => - this.request({ - path: `/orgs/${org}/repos`, - method: "GET", - query: query, - format: "json", - ...params, - }), - /** - * @description Create a new repository for the authenticated user. OAuth users must supply repo scope. - * - * @name ReposCreate - * @request POST:/orgs/{org}/repos - */ - reposCreate: (org, body, params = {}) => - this.request({ - path: `/orgs/${org}/repos`, - method: "POST", - body: body, - format: "json", - ...params, - }), - /** - * @description List teams. - * - * @name TeamsDetail - * @request GET:/orgs/{org}/teams - */ - teamsDetail: (org, params = {}) => - this.request({ - path: `/orgs/${org}/teams`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description Create team. In order to create a team, the authenticated user must be an owner of organization. - * - * @name TeamsCreate - * @request POST:/orgs/{org}/teams - */ - teamsCreate: (org, body, params = {}) => - this.request({ - path: `/orgs/${org}/teams`, - method: "POST", - body: body, - type: ContentType.Json, - format: "json", - ...params, - }), - }; - this.rateLimit = { - /** - * @description Get your current rate limit status Note: Accessing this endpoint does not count against your rate limit. - * - * @name RateLimitList - * @request GET:/rate_limit - */ - rateLimitList: (params = {}) => - this.request({ - path: `/rate_limit`, - method: "GET", - format: "json", - ...params, - }), - }; - this.repos = { - /** - * @description Delete a Repository. Deleting a repository requires admin access. If OAuth is used, the delete_repo scope is required. - * - * @name ReposDelete - * @request DELETE:/repos/{owner}/{repo} - */ - reposDelete: (owner, repo, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}`, - method: "DELETE", - ...params, - }), - /** - * @description Get repository. - * - * @name ReposDetail - * @request GET:/repos/{owner}/{repo} - */ - reposDetail: (owner, repo, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description Edit repository. - * - * @name ReposPartialUpdate - * @request PATCH:/repos/{owner}/{repo} - */ - reposPartialUpdate: (owner, repo, body, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}`, - method: "PATCH", - body: body, - type: ContentType.Json, - format: "json", - ...params, - }), - /** - * @description List assignees. This call lists all the available assignees (owner + collaborators) to which issues may be assigned. - * - * @name AssigneesDetail - * @request GET:/repos/{owner}/{repo}/assignees - */ - assigneesDetail: (owner, repo, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/assignees`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description Check assignee. You may also check to see if a particular user is an assignee for a repository. - * - * @name AssigneesDetail2 - * @request GET:/repos/{owner}/{repo}/assignees/{assignee} - * @originalName assigneesDetail - * @duplicate - */ - assigneesDetail2: (owner, repo, assignee, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/assignees/${assignee}`, - method: "GET", - ...params, - }), - /** - * @description Get list of branches - * - * @name BranchesDetail - * @request GET:/repos/{owner}/{repo}/branches - */ - branchesDetail: (owner, repo, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/branches`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description Get Branch - * - * @name BranchesDetail2 - * @request GET:/repos/{owner}/{repo}/branches/{branch} - * @originalName branchesDetail - * @duplicate - */ - branchesDetail2: (owner, repo, branch, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/branches/${branch}`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description List. When authenticating as an organization owner of an organization-owned repository, all organization owners are included in the list of collaborators. Otherwise, only users with access to the repository are returned in the collaborators list. - * - * @name CollaboratorsDetail - * @request GET:/repos/{owner}/{repo}/collaborators - */ - collaboratorsDetail: (owner, repo, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/collaborators`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description Remove collaborator. - * - * @name CollaboratorsDelete - * @request DELETE:/repos/{owner}/{repo}/collaborators/{user} - */ - collaboratorsDelete: (owner, repo, user, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/collaborators/${user}`, - method: "DELETE", - ...params, - }), - /** - * @description Check if user is a collaborator - * - * @name CollaboratorsDetail2 - * @request GET:/repos/{owner}/{repo}/collaborators/{user} - * @originalName collaboratorsDetail - * @duplicate - */ - collaboratorsDetail2: (owner, repo, user, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/collaborators/${user}`, - method: "GET", - ...params, - }), - /** - * @description Add collaborator. - * - * @name CollaboratorsUpdate - * @request PUT:/repos/{owner}/{repo}/collaborators/{user} - */ - collaboratorsUpdate: (owner, repo, user, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/collaborators/${user}`, - method: "PUT", - ...params, - }), - /** - * @description List commit comments for a repository. Comments are ordered by ascending ID. - * - * @name CommentsDetail - * @request GET:/repos/{owner}/{repo}/comments - */ - commentsDetail: (owner, repo, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/comments`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description Delete a commit comment - * - * @name CommentsDelete - * @request DELETE:/repos/{owner}/{repo}/comments/{commentId} - */ - commentsDelete: (owner, repo, commentId, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/comments/${commentId}`, - method: "DELETE", - ...params, - }), - /** - * @description Get a single commit comment. - * - * @name CommentsDetail2 - * @request GET:/repos/{owner}/{repo}/comments/{commentId} - * @originalName commentsDetail - * @duplicate - */ - commentsDetail2: (owner, repo, commentId, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/comments/${commentId}`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description Update a commit comment. - * - * @name CommentsPartialUpdate - * @request PATCH:/repos/{owner}/{repo}/comments/{commentId} - */ - commentsPartialUpdate: (owner, repo, commentId, body, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/comments/${commentId}`, - method: "PATCH", - body: body, - format: "json", - ...params, - }), - /** - * @description List commits on a repository. - * - * @name CommitsDetail - * @request GET:/repos/{owner}/{repo}/commits - */ - commitsDetail: (owner, repo, query, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/commits`, - method: "GET", - query: query, - format: "json", - ...params, - }), - /** - * @description Get the combined Status for a specific Ref The Combined status endpoint is currently available for developers to preview. During the preview period, the API may change without advance notice. Please see the blog post for full details. To access this endpoint during the preview period, you must provide a custom media type in the Accept header: application/vnd.github.she-hulk-preview+json - * - * @name CommitsStatusDetail - * @request GET:/repos/{owner}/{repo}/commits/{ref}/status - */ - commitsStatusDetail: (owner, repo, ref, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/commits/${ref}/status`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description Get a single commit. - * - * @name CommitsDetail2 - * @request GET:/repos/{owner}/{repo}/commits/{shaCode} - * @originalName commitsDetail - * @duplicate - */ - commitsDetail2: (owner, repo, shaCode, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/commits/${shaCode}`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description List comments for a single commitList comments for a single commit. - * - * @name CommitsCommentsDetail - * @request GET:/repos/{owner}/{repo}/commits/{shaCode}/comments - */ - commitsCommentsDetail: (owner, repo, shaCode, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/commits/${shaCode}/comments`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description Create a commit comment. - * - * @name CommitsCommentsCreate - * @request POST:/repos/{owner}/{repo}/commits/{shaCode}/comments - */ - commitsCommentsCreate: (owner, repo, shaCode, body, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/commits/${shaCode}/comments`, - method: "POST", - body: body, - type: ContentType.Json, - format: "json", - ...params, - }), - /** - * @description Compare two commits - * - * @name CompareDetail - * @request GET:/repos/{owner}/{repo}/compare/{baseId}...{headId} - */ - compareDetail: (owner, repo, baseId, headId, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/compare/${baseId}...${headId}`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description Delete a file. This method deletes a file in a repository. - * - * @name ContentsDelete - * @request DELETE:/repos/{owner}/{repo}/contents/{path} - */ - contentsDelete: (owner, repo, path, body, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/contents/${path}`, - method: "DELETE", - body: body, - type: ContentType.Json, - format: "json", - ...params, - }), - /** - * @description Get contents. This method returns the contents of a file or directory in a repository. Files and symlinks support a custom media type for getting the raw content. Directories and submodules do not support custom media types. Note: This API supports files up to 1 megabyte in size. Here can be many outcomes. For details see "http://developer.github.com/v3/repos/contents/" - * - * @name ContentsDetail - * @request GET:/repos/{owner}/{repo}/contents/{path} - */ - contentsDetail: (owner, repo, path, query, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/contents/${path}`, - method: "GET", - query: query, - format: "json", - ...params, - }), - /** - * @description Create a file. - * - * @name ContentsUpdate - * @request PUT:/repos/{owner}/{repo}/contents/{path} - */ - contentsUpdate: (owner, repo, path, body, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/contents/${path}`, - method: "PUT", - body: body, - type: ContentType.Json, - format: "json", - ...params, - }), - /** - * @description Get list of contributors. - * - * @name ContributorsDetail - * @request GET:/repos/{owner}/{repo}/contributors - */ - contributorsDetail: (owner, repo, query, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/contributors`, - method: "GET", - query: query, - format: "json", - ...params, - }), - /** - * @description Users with pull access can view deployments for a repository - * - * @name DeploymentsDetail - * @request GET:/repos/{owner}/{repo}/deployments - */ - deploymentsDetail: (owner, repo, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/deployments`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description Users with push access can create a deployment for a given ref - * - * @name DeploymentsCreate - * @request POST:/repos/{owner}/{repo}/deployments - */ - deploymentsCreate: (owner, repo, body, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/deployments`, - method: "POST", - body: body, - type: ContentType.Json, - format: "json", - ...params, - }), - /** - * @description Users with pull access can view deployment statuses for a deployment - * - * @name DeploymentsStatusesDetail - * @request GET:/repos/{owner}/{repo}/deployments/{id}/statuses - */ - deploymentsStatusesDetail: (owner, repo, id, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/deployments/${id}/statuses`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description Create a Deployment Status Users with push access can create deployment statuses for a given deployment: - * - * @name DeploymentsStatusesCreate - * @request POST:/repos/{owner}/{repo}/deployments/{id}/statuses - */ - deploymentsStatusesCreate: (owner, repo, id, body, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/deployments/${id}/statuses`, - method: "POST", - body: body, - type: ContentType.Json, - ...params, - }), - /** - * @description Deprecated. List downloads for a repository. - * - * @name DownloadsDetail - * @request GET:/repos/{owner}/{repo}/downloads - * @deprecated - */ - downloadsDetail: (owner, repo, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/downloads`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description Deprecated. Delete a download. - * - * @name DownloadsDelete - * @request DELETE:/repos/{owner}/{repo}/downloads/{downloadId} - * @deprecated - */ - downloadsDelete: (owner, repo, downloadId, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/downloads/${downloadId}`, - method: "DELETE", - ...params, - }), - /** - * @description Deprecated. Get a single download. - * - * @name DownloadsDetail2 - * @request GET:/repos/{owner}/{repo}/downloads/{downloadId} - * @deprecated - * @originalName downloadsDetail - * @duplicate - */ - downloadsDetail2: (owner, repo, downloadId, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/downloads/${downloadId}`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description Get list of repository events. - * - * @name EventsDetail - * @request GET:/repos/{owner}/{repo}/events - */ - eventsDetail: (owner, repo, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/events`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description List forks. - * - * @name ForksDetail - * @request GET:/repos/{owner}/{repo}/forks - */ - forksDetail: (owner, repo, query, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/forks`, - method: "GET", - query: query, - format: "json", - ...params, - }), - /** - * @description Create a fork. Forking a Repository happens asynchronously. Therefore, you may have to wai a short period before accessing the git objects. If this takes longer than 5 minutes, be sure to contact Support. - * - * @name ForksCreate - * @request POST:/repos/{owner}/{repo}/forks - */ - forksCreate: (owner, repo, body, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/forks`, - method: "POST", - body: body, - type: ContentType.Json, - format: "json", - ...params, - }), - /** - * @description Create a Blob. - * - * @name GitBlobsCreate - * @request POST:/repos/{owner}/{repo}/git/blobs - */ - gitBlobsCreate: (owner, repo, body, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/git/blobs`, - method: "POST", - body: body, - type: ContentType.Json, - format: "json", - ...params, - }), - /** - * @description Get a Blob. Since blobs can be any arbitrary binary data, the input and responses for the blob API takes an encoding parameter that can be either utf-8 or base64. If your data cannot be losslessly sent as a UTF-8 string, you can base64 encode it. - * - * @name GitBlobsDetail - * @request GET:/repos/{owner}/{repo}/git/blobs/{shaCode} - */ - gitBlobsDetail: (owner, repo, shaCode, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/git/blobs/${shaCode}`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description Create a Commit. - * - * @name GitCommitsCreate - * @request POST:/repos/{owner}/{repo}/git/commits - */ - gitCommitsCreate: (owner, repo, body, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/git/commits`, - method: "POST", - body: body, - type: ContentType.Json, - format: "json", - ...params, - }), - /** - * @description Get a Commit. - * - * @name GitCommitsDetail - * @request GET:/repos/{owner}/{repo}/git/commits/{shaCode} - */ - gitCommitsDetail: (owner, repo, shaCode, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/git/commits/${shaCode}`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description Get all References - * - * @name GitRefsDetail - * @request GET:/repos/{owner}/{repo}/git/refs - */ - gitRefsDetail: (owner, repo, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/git/refs`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description Create a Reference - * - * @name GitRefsCreate - * @request POST:/repos/{owner}/{repo}/git/refs - */ - gitRefsCreate: (owner, repo, body, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/git/refs`, - method: "POST", - body: body, - type: ContentType.Json, - format: "json", - ...params, - }), - /** - * @description Delete a Reference Example: Deleting a branch: DELETE /repos/octocat/Hello-World/git/refs/heads/feature-a Example: Deleting a tag: DELETE /repos/octocat/Hello-World/git/refs/tags/v1.0 - * - * @name GitRefsDelete - * @request DELETE:/repos/{owner}/{repo}/git/refs/{ref} - */ - gitRefsDelete: (owner, repo, ref, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/git/refs/${ref}`, - method: "DELETE", - ...params, - }), - /** - * @description Get a Reference - * - * @name GitRefsDetail2 - * @request GET:/repos/{owner}/{repo}/git/refs/{ref} - * @originalName gitRefsDetail - * @duplicate - */ - gitRefsDetail2: (owner, repo, ref, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/git/refs/${ref}`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description Update a Reference - * - * @name GitRefsPartialUpdate - * @request PATCH:/repos/{owner}/{repo}/git/refs/{ref} - */ - gitRefsPartialUpdate: (owner, repo, ref, body, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/git/refs/${ref}`, - method: "PATCH", - body: body, - type: ContentType.Json, - format: "json", - ...params, - }), - /** - * @description Create a Tag Object. Note that creating a tag object does not create the reference that makes a tag in Git. If you want to create an annotated tag in Git, you have to do this call to create the tag object, and then create the refs/tags/[tag] reference. If you want to create a lightweight tag, you only have to create the tag reference - this call would be unnecessary. - * - * @name GitTagsCreate - * @request POST:/repos/{owner}/{repo}/git/tags - */ - gitTagsCreate: (owner, repo, body, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/git/tags`, - method: "POST", - body: body, - type: ContentType.Json, - format: "json", - ...params, - }), - /** - * @description Get a Tag. - * - * @name GitTagsDetail - * @request GET:/repos/{owner}/{repo}/git/tags/{shaCode} - */ - gitTagsDetail: (owner, repo, shaCode, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/git/tags/${shaCode}`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description Create a Tree. The tree creation API will take nested entries as well. If both a tree and a nested path modifying that tree are specified, it will overwrite the contents of that tree with the new path contents and write a new tree out. - * - * @name GitTreesCreate - * @request POST:/repos/{owner}/{repo}/git/trees - */ - gitTreesCreate: (owner, repo, body, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/git/trees`, - method: "POST", - body: body, - type: ContentType.Json, - format: "json", - ...params, - }), - /** - * @description Get a Tree. - * - * @name GitTreesDetail - * @request GET:/repos/{owner}/{repo}/git/trees/{shaCode} - */ - gitTreesDetail: (owner, repo, shaCode, query, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/git/trees/${shaCode}`, - method: "GET", - query: query, - format: "json", - ...params, - }), - /** - * @description Get list of hooks. - * - * @name HooksDetail - * @request GET:/repos/{owner}/{repo}/hooks - */ - hooksDetail: (owner, repo, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/hooks`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description Create a hook. - * - * @name HooksCreate - * @request POST:/repos/{owner}/{repo}/hooks - */ - hooksCreate: (owner, repo, body, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/hooks`, - method: "POST", - body: body, - format: "json", - ...params, - }), - /** - * @description Delete a hook. - * - * @name HooksDelete - * @request DELETE:/repos/{owner}/{repo}/hooks/{hookId} - */ - hooksDelete: (owner, repo, hookId, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/hooks/${hookId}`, - method: "DELETE", - ...params, - }), - /** - * @description Get single hook. - * - * @name HooksDetail2 - * @request GET:/repos/{owner}/{repo}/hooks/{hookId} - * @originalName hooksDetail - * @duplicate - */ - hooksDetail2: (owner, repo, hookId, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/hooks/${hookId}`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description Edit a hook. - * - * @name HooksPartialUpdate - * @request PATCH:/repos/{owner}/{repo}/hooks/{hookId} - */ - hooksPartialUpdate: (owner, repo, hookId, body, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/hooks/${hookId}`, - method: "PATCH", - body: body, - format: "json", - ...params, - }), - /** - * @description Test a push hook. This will trigger the hook with the latest push to the current repository if the hook is subscribed to push events. If the hook is not subscribed to push events, the server will respond with 204 but no test POST will be generated. Note: Previously /repos/:owner/:repo/hooks/:id/tes - * - * @name HooksTestsCreate - * @request POST:/repos/{owner}/{repo}/hooks/{hookId}/tests - */ - hooksTestsCreate: (owner, repo, hookId, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/hooks/${hookId}/tests`, - method: "POST", - ...params, - }), - /** - * @description List issues for a repository. - * - * @name IssuesDetail - * @request GET:/repos/{owner}/{repo}/issues - */ - issuesDetail: (owner, repo, query, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/issues`, - method: "GET", - query: query, - format: "json", - ...params, - }), - /** - * @description Create an issue. Any user with pull access to a repository can create an issue. - * - * @name IssuesCreate - * @request POST:/repos/{owner}/{repo}/issues - */ - issuesCreate: (owner, repo, body, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/issues`, - method: "POST", - body: body, - format: "json", - ...params, - }), - /** - * @description List comments in a repository. - * - * @name IssuesCommentsDetail - * @request GET:/repos/{owner}/{repo}/issues/comments - */ - issuesCommentsDetail: (owner, repo, query, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/issues/comments`, - method: "GET", - query: query, - format: "json", - ...params, - }), - /** - * @description Delete a comment. - * - * @name IssuesCommentsDelete - * @request DELETE:/repos/{owner}/{repo}/issues/comments/{commentId} - */ - issuesCommentsDelete: (owner, repo, commentId, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/issues/comments/${commentId}`, - method: "DELETE", - ...params, - }), - /** - * @description Get a single comment. - * - * @name IssuesCommentsDetail2 - * @request GET:/repos/{owner}/{repo}/issues/comments/{commentId} - * @originalName issuesCommentsDetail - * @duplicate - */ - issuesCommentsDetail2: (owner, repo, commentId, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/issues/comments/${commentId}`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description Edit a comment. - * - * @name IssuesCommentsPartialUpdate - * @request PATCH:/repos/{owner}/{repo}/issues/comments/{commentId} - */ - issuesCommentsPartialUpdate: (owner, repo, commentId, body, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/issues/comments/${commentId}`, - method: "PATCH", - body: body, - format: "json", - ...params, - }), - /** - * @description List issue events for a repository. - * - * @name IssuesEventsDetail - * @request GET:/repos/{owner}/{repo}/issues/events - */ - issuesEventsDetail: (owner, repo, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/issues/events`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description Get a single event. - * - * @name IssuesEventsDetail2 - * @request GET:/repos/{owner}/{repo}/issues/events/{eventId} - * @originalName issuesEventsDetail - * @duplicate - */ - issuesEventsDetail2: (owner, repo, eventId, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/issues/events/${eventId}`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description Get a single issue - * - * @name IssuesDetail2 - * @request GET:/repos/{owner}/{repo}/issues/{number} - * @originalName issuesDetail - * @duplicate - */ - issuesDetail2: (owner, repo, number, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/issues/${number}`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description Edit an issue. Issue owners and users with push access can edit an issue. - * - * @name IssuesPartialUpdate - * @request PATCH:/repos/{owner}/{repo}/issues/{number} - */ - issuesPartialUpdate: (owner, repo, number, body, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/issues/${number}`, - method: "PATCH", - body: body, - format: "json", - ...params, - }), - /** - * @description List comments on an issue. - * - * @name IssuesCommentsDetail3 - * @request GET:/repos/{owner}/{repo}/issues/{number}/comments - * @originalName issuesCommentsDetail - * @duplicate - */ - issuesCommentsDetail3: (owner, repo, number, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/issues/${number}/comments`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description Create a comment. - * - * @name IssuesCommentsCreate - * @request POST:/repos/{owner}/{repo}/issues/{number}/comments - */ - issuesCommentsCreate: (owner, repo, number, body, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/issues/${number}/comments`, - method: "POST", - body: body, - format: "json", - ...params, - }), - /** - * @description List events for an issue. - * - * @name IssuesEventsDetail3 - * @request GET:/repos/{owner}/{repo}/issues/{number}/events - * @originalName issuesEventsDetail - * @duplicate - */ - issuesEventsDetail3: (owner, repo, number, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/issues/${number}/events`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description Remove all labels from an issue. - * - * @name IssuesLabelsDelete - * @request DELETE:/repos/{owner}/{repo}/issues/{number}/labels - */ - issuesLabelsDelete: (owner, repo, number, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/issues/${number}/labels`, - method: "DELETE", - ...params, - }), - /** - * @description List labels on an issue. - * - * @name IssuesLabelsDetail - * @request GET:/repos/{owner}/{repo}/issues/{number}/labels - */ - issuesLabelsDetail: (owner, repo, number, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/issues/${number}/labels`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description Add labels to an issue. - * - * @name IssuesLabelsCreate - * @request POST:/repos/{owner}/{repo}/issues/{number}/labels - */ - issuesLabelsCreate: (owner, repo, number, body, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/issues/${number}/labels`, - method: "POST", - body: body, - format: "json", - ...params, - }), - /** - * @description Replace all labels for an issue. Sending an empty array ([]) will remove all Labels from the Issue. - * - * @name IssuesLabelsUpdate - * @request PUT:/repos/{owner}/{repo}/issues/{number}/labels - */ - issuesLabelsUpdate: (owner, repo, number, body, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/issues/${number}/labels`, - method: "PUT", - body: body, - format: "json", - ...params, - }), - /** - * @description Remove a label from an issue. - * - * @name IssuesLabelsDelete2 - * @request DELETE:/repos/{owner}/{repo}/issues/{number}/labels/{name} - * @originalName issuesLabelsDelete - * @duplicate - */ - issuesLabelsDelete2: (owner, repo, number, name, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/issues/${number}/labels/${name}`, - method: "DELETE", - ...params, - }), - /** - * @description Get list of keys. - * - * @name KeysDetail - * @request GET:/repos/{owner}/{repo}/keys - */ - keysDetail: (owner, repo, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/keys`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description Create a key. - * - * @name KeysCreate - * @request POST:/repos/{owner}/{repo}/keys - */ - keysCreate: (owner, repo, body, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/keys`, - method: "POST", - body: body, - format: "json", - ...params, - }), - /** - * @description Delete a key. - * - * @name KeysDelete - * @request DELETE:/repos/{owner}/{repo}/keys/{keyId} - */ - keysDelete: (owner, repo, keyId, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/keys/${keyId}`, - method: "DELETE", - ...params, - }), - /** - * @description Get a key - * - * @name KeysDetail2 - * @request GET:/repos/{owner}/{repo}/keys/{keyId} - * @originalName keysDetail - * @duplicate - */ - keysDetail2: (owner, repo, keyId, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/keys/${keyId}`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description List all labels for this repository. - * - * @name LabelsDetail - * @request GET:/repos/{owner}/{repo}/labels - */ - labelsDetail: (owner, repo, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/labels`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description Create a label. - * - * @name LabelsCreate - * @request POST:/repos/{owner}/{repo}/labels - */ - labelsCreate: (owner, repo, body, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/labels`, - method: "POST", - body: body, - format: "json", - ...params, - }), - /** - * @description Delete a label. - * - * @name LabelsDelete - * @request DELETE:/repos/{owner}/{repo}/labels/{name} - */ - labelsDelete: (owner, repo, name, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/labels/${name}`, - method: "DELETE", - ...params, - }), - /** - * @description Get a single label. - * - * @name LabelsDetail2 - * @request GET:/repos/{owner}/{repo}/labels/{name} - * @originalName labelsDetail - * @duplicate - */ - labelsDetail2: (owner, repo, name, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/labels/${name}`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description Update a label. - * - * @name LabelsPartialUpdate - * @request PATCH:/repos/{owner}/{repo}/labels/{name} - */ - labelsPartialUpdate: (owner, repo, name, body, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/labels/${name}`, - method: "PATCH", - body: body, - format: "json", - ...params, - }), - /** - * @description List languages. List languages for the specified repository. The value on the right of a language is the number of bytes of code written in that language. - * - * @name LanguagesDetail - * @request GET:/repos/{owner}/{repo}/languages - */ - languagesDetail: (owner, repo, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/languages`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description Perform a merge. - * - * @name MergesCreate - * @request POST:/repos/{owner}/{repo}/merges - */ - mergesCreate: (owner, repo, body, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/merges`, - method: "POST", - body: body, - type: ContentType.Json, - format: "json", - ...params, - }), - /** - * @description List milestones for a repository. - * - * @name MilestonesDetail - * @request GET:/repos/{owner}/{repo}/milestones - */ - milestonesDetail: (owner, repo, query, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/milestones`, - method: "GET", - query: query, - format: "json", - ...params, - }), - /** - * @description Create a milestone. - * - * @name MilestonesCreate - * @request POST:/repos/{owner}/{repo}/milestones - */ - milestonesCreate: (owner, repo, body, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/milestones`, - method: "POST", - body: body, - format: "json", - ...params, - }), - /** - * @description Delete a milestone. - * - * @name MilestonesDelete - * @request DELETE:/repos/{owner}/{repo}/milestones/{number} - */ - milestonesDelete: (owner, repo, number, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/milestones/${number}`, - method: "DELETE", - ...params, - }), - /** - * @description Get a single milestone. - * - * @name MilestonesDetail2 - * @request GET:/repos/{owner}/{repo}/milestones/{number} - * @originalName milestonesDetail - * @duplicate - */ - milestonesDetail2: (owner, repo, number, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/milestones/${number}`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description Update a milestone. - * - * @name MilestonesPartialUpdate - * @request PATCH:/repos/{owner}/{repo}/milestones/{number} - */ - milestonesPartialUpdate: (owner, repo, number, body, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/milestones/${number}`, - method: "PATCH", - body: body, - format: "json", - ...params, - }), - /** - * @description Get labels for every issue in a milestone. - * - * @name MilestonesLabelsDetail - * @request GET:/repos/{owner}/{repo}/milestones/{number}/labels - */ - milestonesLabelsDetail: (owner, repo, number, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/milestones/${number}/labels`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description List your notifications in a repository List all notifications for the current user. - * - * @name NotificationsDetail - * @request GET:/repos/{owner}/{repo}/notifications - */ - notificationsDetail: (owner, repo, query, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/notifications`, - method: "GET", - query: query, - format: "json", - ...params, - }), - /** - * @description Mark notifications as read in a repository. Marking all notifications in a repository as "read" removes them from the default view on GitHub.com. - * - * @name NotificationsUpdate - * @request PUT:/repos/{owner}/{repo}/notifications - */ - notificationsUpdate: (owner, repo, body, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/notifications`, - method: "PUT", - body: body, - ...params, - }), - /** - * @description List pull requests. - * - * @name PullsDetail - * @request GET:/repos/{owner}/{repo}/pulls - */ - pullsDetail: (owner, repo, query, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/pulls`, - method: "GET", - query: query, - format: "json", - ...params, - }), - /** - * @description Create a pull request. - * - * @name PullsCreate - * @request POST:/repos/{owner}/{repo}/pulls - */ - pullsCreate: (owner, repo, body, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/pulls`, - method: "POST", - body: body, - type: ContentType.Json, - format: "json", - ...params, - }), - /** - * @description List comments in a repository. By default, Review Comments are ordered by ascending ID. - * - * @name PullsCommentsDetail - * @request GET:/repos/{owner}/{repo}/pulls/comments - */ - pullsCommentsDetail: (owner, repo, query, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/pulls/comments`, - method: "GET", - query: query, - format: "json", - ...params, - }), - /** - * @description Delete a comment. - * - * @name PullsCommentsDelete - * @request DELETE:/repos/{owner}/{repo}/pulls/comments/{commentId} - */ - pullsCommentsDelete: (owner, repo, commentId, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/pulls/comments/${commentId}`, - method: "DELETE", - ...params, - }), - /** - * @description Get a single comment. - * - * @name PullsCommentsDetail2 - * @request GET:/repos/{owner}/{repo}/pulls/comments/{commentId} - * @originalName pullsCommentsDetail - * @duplicate - */ - pullsCommentsDetail2: (owner, repo, commentId, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/pulls/comments/${commentId}`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description Edit a comment. - * - * @name PullsCommentsPartialUpdate - * @request PATCH:/repos/{owner}/{repo}/pulls/comments/{commentId} - */ - pullsCommentsPartialUpdate: (owner, repo, commentId, body, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/pulls/comments/${commentId}`, - method: "PATCH", - body: body, - format: "json", - ...params, - }), - /** - * @description Get a single pull request. - * - * @name PullsDetail2 - * @request GET:/repos/{owner}/{repo}/pulls/{number} - * @originalName pullsDetail - * @duplicate - */ - pullsDetail2: (owner, repo, number, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/pulls/${number}`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description Update a pull request. - * - * @name PullsPartialUpdate - * @request PATCH:/repos/{owner}/{repo}/pulls/{number} - */ - pullsPartialUpdate: (owner, repo, number, body, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/pulls/${number}`, - method: "PATCH", - body: body, - type: ContentType.Json, - format: "json", - ...params, - }), - /** - * @description List comments on a pull request. - * - * @name PullsCommentsDetail3 - * @request GET:/repos/{owner}/{repo}/pulls/{number}/comments - * @originalName pullsCommentsDetail - * @duplicate - */ - pullsCommentsDetail3: (owner, repo, number, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/pulls/${number}/comments`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description Create a comment. #TODO Alternative input ( http://developer.github.com/v3/pulls/comments/ ) description: | Alternative Input. Instead of passing commit_id, path, and position you can reply to an existing Pull Request Comment like this: body Required string in_reply_to Required number - Comment id to reply to. - * - * @name PullsCommentsCreate - * @request POST:/repos/{owner}/{repo}/pulls/{number}/comments - */ - pullsCommentsCreate: (owner, repo, number, body, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/pulls/${number}/comments`, - method: "POST", - body: body, - type: ContentType.Json, - format: "json", - ...params, - }), - /** - * @description List commits on a pull request. - * - * @name PullsCommitsDetail - * @request GET:/repos/{owner}/{repo}/pulls/{number}/commits - */ - pullsCommitsDetail: (owner, repo, number, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/pulls/${number}/commits`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description List pull requests files. - * - * @name PullsFilesDetail - * @request GET:/repos/{owner}/{repo}/pulls/{number}/files - */ - pullsFilesDetail: (owner, repo, number, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/pulls/${number}/files`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description Get if a pull request has been merged. - * - * @name PullsMergeDetail - * @request GET:/repos/{owner}/{repo}/pulls/{number}/merge - */ - pullsMergeDetail: (owner, repo, number, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/pulls/${number}/merge`, - method: "GET", - ...params, - }), - /** - * @description Merge a pull request (Merge Button's) - * - * @name PullsMergeUpdate - * @request PUT:/repos/{owner}/{repo}/pulls/{number}/merge - */ - pullsMergeUpdate: (owner, repo, number, body, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/pulls/${number}/merge`, - method: "PUT", - body: body, - type: ContentType.Json, - format: "json", - ...params, - }), - /** - * @description Get the README. This method returns the preferred README for a repository. - * - * @name ReadmeDetail - * @request GET:/repos/{owner}/{repo}/readme - */ - readmeDetail: (owner, repo, query, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/readme`, - method: "GET", - query: query, - format: "json", - ...params, - }), - /** - * @description Users with push access to the repository will receive all releases (i.e., published releases and draft releases). Users with pull access will receive published releases only - * - * @name ReleasesDetail - * @request GET:/repos/{owner}/{repo}/releases - */ - releasesDetail: (owner, repo, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/releases`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description Create a release Users with push access to the repository can create a release. - * - * @name ReleasesCreate - * @request POST:/repos/{owner}/{repo}/releases - */ - releasesCreate: (owner, repo, body, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/releases`, - method: "POST", - body: body, - format: "json", - ...params, - }), - /** - * @description Delete a release asset - * - * @name ReleasesAssetsDelete - * @request DELETE:/repos/{owner}/{repo}/releases/assets/{id} - */ - releasesAssetsDelete: (owner, repo, id, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/releases/assets/${id}`, - method: "DELETE", - ...params, - }), - /** - * @description Get a single release asset - * - * @name ReleasesAssetsDetail - * @request GET:/repos/{owner}/{repo}/releases/assets/{id} - */ - releasesAssetsDetail: (owner, repo, id, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/releases/assets/${id}`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description Edit a release asset Users with push access to the repository can edit a release asset. - * - * @name ReleasesAssetsPartialUpdate - * @request PATCH:/repos/{owner}/{repo}/releases/assets/{id} - */ - releasesAssetsPartialUpdate: (owner, repo, id, body, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/releases/assets/${id}`, - method: "PATCH", - body: body, - type: ContentType.Json, - format: "json", - ...params, - }), - /** - * @description Users with push access to the repository can delete a release. - * - * @name ReleasesDelete - * @request DELETE:/repos/{owner}/{repo}/releases/{id} - */ - releasesDelete: (owner, repo, id, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/releases/${id}`, - method: "DELETE", - ...params, - }), - /** - * @description Get a single release - * - * @name ReleasesDetail2 - * @request GET:/repos/{owner}/{repo}/releases/{id} - * @originalName releasesDetail - * @duplicate - */ - releasesDetail2: (owner, repo, id, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/releases/${id}`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description Users with push access to the repository can edit a release - * - * @name ReleasesPartialUpdate - * @request PATCH:/repos/{owner}/{repo}/releases/{id} - */ - releasesPartialUpdate: (owner, repo, id, body, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/releases/${id}`, - method: "PATCH", - body: body, - format: "json", - ...params, - }), - /** - * @description List assets for a release - * - * @name ReleasesAssetsDetail2 - * @request GET:/repos/{owner}/{repo}/releases/{id}/assets - * @originalName releasesAssetsDetail - * @duplicate - */ - releasesAssetsDetail2: (owner, repo, id, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/releases/${id}/assets`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description List Stargazers. - * - * @name StargazersDetail - * @request GET:/repos/{owner}/{repo}/stargazers - */ - stargazersDetail: (owner, repo, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/stargazers`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description Get the number of additions and deletions per week. Returns a weekly aggregate of the number of additions and deletions pushed to a repository. - * - * @name StatsCodeFrequencyDetail - * @request GET:/repos/{owner}/{repo}/stats/code_frequency - */ - statsCodeFrequencyDetail: (owner, repo, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/stats/code_frequency`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description Get the last year of commit activity data. Returns the last year of commit activity grouped by week. The days array is a group of commits per day, starting on Sunday. - * - * @name StatsCommitActivityDetail - * @request GET:/repos/{owner}/{repo}/stats/commit_activity - */ - statsCommitActivityDetail: (owner, repo, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/stats/commit_activity`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description Get contributors list with additions, deletions, and commit counts. - * - * @name StatsContributorsDetail - * @request GET:/repos/{owner}/{repo}/stats/contributors - */ - statsContributorsDetail: (owner, repo, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/stats/contributors`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description Get the weekly commit count for the repo owner and everyone else. - * - * @name StatsParticipationDetail - * @request GET:/repos/{owner}/{repo}/stats/participation - */ - statsParticipationDetail: (owner, repo, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/stats/participation`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description Get the number of commits per hour in each day. Each array contains the day number, hour number, and number of commits 0-6 Sunday - Saturday 0-23 Hour of day Number of commits For example, [2, 14, 25] indicates that there were 25 total commits, during the 2.00pm hour on Tuesdays. All times are based on the time zone of individual commits. - * - * @name StatsPunchCardDetail - * @request GET:/repos/{owner}/{repo}/stats/punch_card - */ - statsPunchCardDetail: (owner, repo, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/stats/punch_card`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description List Statuses for a specific Ref. - * - * @name StatusesDetail - * @request GET:/repos/{owner}/{repo}/statuses/{ref} - */ - statusesDetail: (owner, repo, ref, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/statuses/${ref}`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description Create a Status. - * - * @name StatusesCreate - * @request POST:/repos/{owner}/{repo}/statuses/{ref} - */ - statusesCreate: (owner, repo, ref, body, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/statuses/${ref}`, - method: "POST", - body: body, - type: ContentType.Json, - format: "json", - ...params, - }), - /** - * @description List watchers. - * - * @name SubscribersDetail - * @request GET:/repos/{owner}/{repo}/subscribers - */ - subscribersDetail: (owner, repo, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/subscribers`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description Delete a Repository Subscription. - * - * @name SubscriptionDelete - * @request DELETE:/repos/{owner}/{repo}/subscription - */ - subscriptionDelete: (owner, repo, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/subscription`, - method: "DELETE", - ...params, - }), - /** - * @description Get a Repository Subscription. - * - * @name SubscriptionDetail - * @request GET:/repos/{owner}/{repo}/subscription - */ - subscriptionDetail: (owner, repo, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/subscription`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description Set a Repository Subscription - * - * @name SubscriptionUpdate - * @request PUT:/repos/{owner}/{repo}/subscription - */ - subscriptionUpdate: (owner, repo, body, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/subscription`, - method: "PUT", - body: body, - type: ContentType.Json, - format: "json", - ...params, - }), - /** - * @description Get list of tags. - * - * @name TagsDetail - * @request GET:/repos/{owner}/{repo}/tags - */ - tagsDetail: (owner, repo, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/tags`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description Get list of teams - * - * @name TeamsDetail - * @request GET:/repos/{owner}/{repo}/teams - */ - teamsDetail: (owner, repo, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/teams`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description List Stargazers. New implementation. - * - * @name WatchersDetail - * @request GET:/repos/{owner}/{repo}/watchers - */ - watchersDetail: (owner, repo, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/watchers`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description Get archive link. This method will return a 302 to a URL to download a tarball or zipball archive for a repository. Please make sure your HTTP framework is configured to follow redirects or you will need to use the Location header to make a second GET request. Note: For private repositories, these links are temporary and expire quickly. - * - * @name ReposDetail2 - * @request GET:/repos/{owner}/{repo}/{archive_format}/{path} - * @originalName reposDetail - * @duplicate - */ - reposDetail2: (owner, repo, archiveFormat, path, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/${archiveFormat}/${path}`, - method: "GET", - ...params, - }), - }; - this.repositories = { - /** - * @description List all public repositories. This provides a dump of every public repository, in the order that they were created. Note: Pagination is powered exclusively by the since parameter. is the Link header to get the URL for the next page of repositories. - * - * @name RepositoriesList - * @request GET:/repositories - */ - repositoriesList: (query, params = {}) => - this.request({ - path: `/repositories`, - method: "GET", - query: query, - format: "json", - ...params, - }), - }; - this.search = { - /** - * @description Search code. - * - * @name CodeList - * @request GET:/search/code - */ - codeList: (query, params = {}) => - this.request({ - path: `/search/code`, - method: "GET", - query: query, - format: "json", - ...params, - }), - /** - * @description Find issues by state and keyword. (This method returns up to 100 results per page.) - * - * @name IssuesList - * @request GET:/search/issues - */ - issuesList: (query, params = {}) => - this.request({ - path: `/search/issues`, - method: "GET", - query: query, - format: "json", - ...params, - }), - /** - * @description Search repositories. - * - * @name RepositoriesList - * @request GET:/search/repositories - */ - repositoriesList: (query, params = {}) => - this.request({ - path: `/search/repositories`, - method: "GET", - query: query, - format: "json", - ...params, - }), - /** - * @description Search users. - * - * @name UsersList - * @request GET:/search/users - */ - usersList: (query, params = {}) => - this.request({ - path: `/search/users`, - method: "GET", - query: query, - format: "json", - ...params, - }), - }; - this.teams = { - /** - * @description Delete team. In order to delete a team, the authenticated user must be an owner of the org that the team is associated with. - * - * @name TeamsDelete - * @request DELETE:/teams/{teamId} - */ - teamsDelete: (teamId, params = {}) => - this.request({ - path: `/teams/${teamId}`, - method: "DELETE", - ...params, - }), - /** - * @description Get team. - * - * @name TeamsDetail - * @request GET:/teams/{teamId} - */ - teamsDetail: (teamId, params = {}) => - this.request({ - path: `/teams/${teamId}`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description Edit team. In order to edit a team, the authenticated user must be an owner of the org that the team is associated with. - * - * @name TeamsPartialUpdate - * @request PATCH:/teams/{teamId} - */ - teamsPartialUpdate: (teamId, body, params = {}) => - this.request({ - path: `/teams/${teamId}`, - method: "PATCH", - body: body, - type: ContentType.Json, - format: "json", - ...params, - }), - /** - * @description List team members. In order to list members in a team, the authenticated user must be a member of the team. - * - * @name MembersDetail - * @request GET:/teams/{teamId}/members - */ - membersDetail: (teamId, params = {}) => - this.request({ - path: `/teams/${teamId}/members`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description The "Remove team member" API is deprecated and is scheduled for removal in the next major version of the API. We recommend using the Remove team membership API instead. It allows you to remove both active and pending memberships. Remove team member. In order to remove a user from a team, the authenticated user must have 'admin' permissions to the team or be an owner of the org that the team is associated with. NOTE This does not delete the user, it just remove them from the team. - * - * @name MembersDelete - * @request DELETE:/teams/{teamId}/members/{username} - * @deprecated - */ - membersDelete: (teamId, username, params = {}) => - this.request({ - path: `/teams/${teamId}/members/${username}`, - method: "DELETE", - ...params, - }), - /** - * @description The "Get team member" API is deprecated and is scheduled for removal in the next major version of the API. We recommend using the Get team membership API instead. It allows you to get both active and pending memberships. Get team member. In order to get if a user is a member of a team, the authenticated user mus be a member of the team. - * - * @name MembersDetail2 - * @request GET:/teams/{teamId}/members/{username} - * @deprecated - * @originalName membersDetail - * @duplicate - */ - membersDetail2: (teamId, username, params = {}) => - this.request({ - path: `/teams/${teamId}/members/${username}`, - method: "GET", - ...params, - }), - /** - * @description The API (described below) is deprecated and is scheduled for removal in the next major version of the API. We recommend using the Add team membership API instead. It allows you to invite new organization members to your teams. Add team member. In order to add a user to a team, the authenticated user must have 'admin' permissions to the team or be an owner of the org that the team is associated with. - * - * @name MembersUpdate - * @request PUT:/teams/{teamId}/members/{username} - * @deprecated - */ - membersUpdate: (teamId, username, params = {}) => - this.request({ - path: `/teams/${teamId}/members/${username}`, - method: "PUT", - ...params, - }), - /** - * @description Remove team membership. In order to remove a membership between a user and a team, the authenticated user must have 'admin' permissions to the team or be an owner of the organization that the team is associated with. NOTE: This does not delete the user, it just removes their membership from the team. - * - * @name MembershipsDelete - * @request DELETE:/teams/{teamId}/memberships/{username} - */ - membershipsDelete: (teamId, username, params = {}) => - this.request({ - path: `/teams/${teamId}/memberships/${username}`, - method: "DELETE", - ...params, - }), - /** - * @description Get team membership. In order to get a user's membership with a team, the authenticated user must be a member of the team or an owner of the team's organization. - * - * @name MembershipsDetail - * @request GET:/teams/{teamId}/memberships/{username} - */ - membershipsDetail: (teamId, username, params = {}) => - this.request({ - path: `/teams/${teamId}/memberships/${username}`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description Add team membership. In order to add a membership between a user and a team, the authenticated user must have 'admin' permissions to the team or be an owner of the organization that the team is associated with. If the user is already a part of the team's organization (meaning they're on at least one other team in the organization), this endpoint will add the user to the team. If the user is completely unaffiliated with the team's organization (meaning they're on none of the organization's teams), this endpoint will send an invitation to the user via email. This newly-created membership will be in the 'pending' state until the user accepts the invitation, at which point the membership will transition to the 'active' state and the user will be added as a member of the team. - * - * @name MembershipsUpdate - * @request PUT:/teams/{teamId}/memberships/{username} - */ - membershipsUpdate: (teamId, username, params = {}) => - this.request({ - path: `/teams/${teamId}/memberships/${username}`, - method: "PUT", - format: "json", - ...params, - }), - /** - * @description List team repos - * - * @name ReposDetail - * @request GET:/teams/{teamId}/repos - */ - reposDetail: (teamId, params = {}) => - this.request({ - path: `/teams/${teamId}/repos`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description In order to remove a repository from a team, the authenticated user must be an owner of the org that the team is associated with. NOTE: This does not delete the repository, it just removes it from the team. - * - * @name ReposDelete - * @request DELETE:/teams/{teamId}/repos/{owner}/{repo} - */ - reposDelete: (teamId, owner, repo, params = {}) => - this.request({ - path: `/teams/${teamId}/repos/${owner}/${repo}`, - method: "DELETE", - ...params, - }), - /** - * @description Check if a team manages a repository - * - * @name ReposDetail2 - * @request GET:/teams/{teamId}/repos/{owner}/{repo} - * @originalName reposDetail - * @duplicate - */ - reposDetail2: (teamId, owner, repo, params = {}) => - this.request({ - path: `/teams/${teamId}/repos/${owner}/${repo}`, - method: "GET", - ...params, - }), - /** - * @description In order to add a repository to a team, the authenticated user must be an owner of the org that the team is associated with. Also, the repository must be owned by the organization, or a direct fork of a repository owned by the organization. - * - * @name ReposUpdate - * @request PUT:/teams/{teamId}/repos/{owner}/{repo} - */ - reposUpdate: (teamId, owner, repo, params = {}) => - this.request({ - path: `/teams/${teamId}/repos/${owner}/${repo}`, - method: "PUT", - ...params, - }), - }; - this.user = { - /** - * @description Get the authenticated user. - * - * @name UserList - * @request GET:/user - */ - userList: (params = {}) => - this.request({ - path: `/user`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description Update the authenticated user. - * - * @name UserPartialUpdate - * @request PATCH:/user - */ - userPartialUpdate: (body, params = {}) => - this.request({ - path: `/user`, - method: "PATCH", - body: body, - type: ContentType.Json, - format: "json", - ...params, - }), - /** - * @description Delete email address(es). You can include a single email address or an array of addresses. - * - * @name EmailsDelete - * @request DELETE:/user/emails - */ - emailsDelete: (body, params = {}) => - this.request({ - path: `/user/emails`, - method: "DELETE", - body: body, - type: ContentType.Json, - ...params, - }), - /** - * @description List email addresses for a user. In the final version of the API, this method will return an array of hashes with extended information for each email address indicating if the address has been verified and if it's primary email address for GitHub. Until API v3 is finalized, use the application/vnd.github.v3 media type to get other response format. - * - * @name EmailsList - * @request GET:/user/emails - */ - emailsList: (params = {}) => - this.request({ - path: `/user/emails`, - method: "GET", - ...params, - }), - /** - * @description Add email address(es). You can post a single email address or an array of addresses. - * - * @name EmailsCreate - * @request POST:/user/emails - */ - emailsCreate: (body, params = {}) => - this.request({ - path: `/user/emails`, - method: "POST", - body: body, - ...params, - }), - /** - * @description List the authenticated user's followers - * - * @name FollowersList - * @request GET:/user/followers - */ - followersList: (params = {}) => - this.request({ - path: `/user/followers`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description List who the authenticated user is following. - * - * @name FollowingList - * @request GET:/user/following - */ - followingList: (params = {}) => - this.request({ - path: `/user/following`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description Unfollow a user. Unfollowing a user requires the user to be logged in and authenticated with basic auth or OAuth with the user:follow scope. - * - * @name FollowingDelete - * @request DELETE:/user/following/{username} - */ - followingDelete: (username, params = {}) => - this.request({ - path: `/user/following/${username}`, - method: "DELETE", - ...params, - }), - /** - * @description Check if you are following a user. - * - * @name FollowingDetail - * @request GET:/user/following/{username} - */ - followingDetail: (username, params = {}) => - this.request({ - path: `/user/following/${username}`, - method: "GET", - ...params, - }), - /** - * @description Follow a user. Following a user requires the user to be logged in and authenticated with basic auth or OAuth with the user:follow scope. - * - * @name FollowingUpdate - * @request PUT:/user/following/{username} - */ - followingUpdate: (username, params = {}) => - this.request({ - path: `/user/following/${username}`, - method: "PUT", - ...params, - }), - /** - * @description List issues. List all issues across owned and member repositories for the authenticated user. - * - * @name IssuesList - * @request GET:/user/issues - */ - issuesList: (query, params = {}) => - this.request({ - path: `/user/issues`, - method: "GET", - query: query, - format: "json", - ...params, - }), - /** - * @description List your public keys. Lists the current user's keys. Management of public keys via the API requires that you are authenticated through basic auth, or OAuth with the 'user', 'write:public_key' scopes. - * - * @name KeysList - * @request GET:/user/keys - */ - keysList: (params = {}) => - this.request({ - path: `/user/keys`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description Create a public key. - * - * @name KeysCreate - * @request POST:/user/keys - */ - keysCreate: (body, params = {}) => - this.request({ - path: `/user/keys`, - method: "POST", - body: body, - format: "json", - ...params, - }), - /** - * @description Delete a public key. Removes a public key. Requires that you are authenticated via Basic Auth or via OAuth with at least admin:public_key scope. - * - * @name KeysDelete - * @request DELETE:/user/keys/{keyId} - */ - keysDelete: (keyId, params = {}) => - this.request({ - path: `/user/keys/${keyId}`, - method: "DELETE", - ...params, - }), - /** - * @description Get a single public key. - * - * @name KeysDetail - * @request GET:/user/keys/{keyId} - */ - keysDetail: (keyId, params = {}) => - this.request({ - path: `/user/keys/${keyId}`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description List public and private organizations for the authenticated user. - * - * @name OrgsList - * @request GET:/user/orgs - */ - orgsList: (params = {}) => - this.request({ - path: `/user/orgs`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description List repositories for the authenticated user. Note that this does not include repositories owned by organizations which the user can access. You can lis user organizations and list organization repositories separately. - * - * @name ReposList - * @request GET:/user/repos - */ - reposList: (query, params = {}) => - this.request({ - path: `/user/repos`, - method: "GET", - query: query, - format: "json", - ...params, - }), - /** - * @description Create a new repository for the authenticated user. OAuth users must supply repo scope. - * - * @name ReposCreate - * @request POST:/user/repos - */ - reposCreate: (body, params = {}) => - this.request({ - path: `/user/repos`, - method: "POST", - body: body, - format: "json", - ...params, - }), - /** - * @description List repositories being starred by the authenticated user. - * - * @name StarredList - * @request GET:/user/starred - */ - starredList: (query, params = {}) => - this.request({ - path: `/user/starred`, - method: "GET", - query: query, - format: "json", - ...params, - }), - /** - * @description Unstar a repository - * - * @name StarredDelete - * @request DELETE:/user/starred/{owner}/{repo} - */ - starredDelete: (owner, repo, params = {}) => - this.request({ - path: `/user/starred/${owner}/${repo}`, - method: "DELETE", - ...params, - }), - /** - * @description Check if you are starring a repository. - * - * @name StarredDetail - * @request GET:/user/starred/{owner}/{repo} - */ - starredDetail: (owner, repo, params = {}) => - this.request({ - path: `/user/starred/${owner}/${repo}`, - method: "GET", - ...params, - }), - /** - * @description Star a repository. - * - * @name StarredUpdate - * @request PUT:/user/starred/{owner}/{repo} - */ - starredUpdate: (owner, repo, params = {}) => - this.request({ - path: `/user/starred/${owner}/${repo}`, - method: "PUT", - ...params, - }), - /** - * @description List repositories being watched by the authenticated user. - * - * @name SubscriptionsList - * @request GET:/user/subscriptions - */ - subscriptionsList: (params = {}) => - this.request({ - path: `/user/subscriptions`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description Stop watching a repository - * - * @name SubscriptionsDelete - * @request DELETE:/user/subscriptions/{owner}/{repo} - * @deprecated - */ - subscriptionsDelete: (owner, repo, params = {}) => - this.request({ - path: `/user/subscriptions/${owner}/${repo}`, - method: "DELETE", - ...params, - }), - /** - * @description Check if you are watching a repository. - * - * @name SubscriptionsDetail - * @request GET:/user/subscriptions/{owner}/{repo} - * @deprecated - */ - subscriptionsDetail: (owner, repo, params = {}) => - this.request({ - path: `/user/subscriptions/${owner}/${repo}`, - method: "GET", - ...params, - }), - /** - * @description Watch a repository. - * - * @name SubscriptionsUpdate - * @request PUT:/user/subscriptions/{owner}/{repo} - * @deprecated - */ - subscriptionsUpdate: (owner, repo, params = {}) => - this.request({ - path: `/user/subscriptions/${owner}/${repo}`, - method: "PUT", - ...params, - }), - /** - * @description List all of the teams across all of the organizations to which the authenticated user belongs. This method requires user or repo scope when authenticating via OAuth. - * - * @name TeamsList - * @request GET:/user/teams - */ - teamsList: (params = {}) => - this.request({ - path: `/user/teams`, - method: "GET", - format: "json", - ...params, - }), - }; - this.users = { - /** - * @description Get all users. This provides a dump of every user, in the order that they signed up for GitHub. Note: Pagination is powered exclusively by the since parameter. Use the Link header to get the URL for the next page of users. - * - * @name UsersList - * @request GET:/users - */ - usersList: (query, params = {}) => - this.request({ - path: `/users`, - method: "GET", - query: query, - format: "json", - ...params, - }), - /** - * @description Get a single user. - * - * @name UsersDetail - * @request GET:/users/{username} - */ - usersDetail: (username, params = {}) => - this.request({ - path: `/users/${username}`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description If you are authenticated as the given user, you will see your private events. Otherwise, you'll only see public events. - * - * @name EventsDetail - * @request GET:/users/{username}/events - */ - eventsDetail: (username, params = {}) => - this.request({ - path: `/users/${username}/events`, - method: "GET", - ...params, - }), - /** - * @description This is the user's organization dashboard. You must be authenticated as the user to view this. - * - * @name EventsOrgsDetail - * @request GET:/users/{username}/events/orgs/{org} - */ - eventsOrgsDetail: (username, org, params = {}) => - this.request({ - path: `/users/${username}/events/orgs/${org}`, - method: "GET", - ...params, - }), - /** - * @description List a user's followers - * - * @name FollowersDetail - * @request GET:/users/{username}/followers - */ - followersDetail: (username, params = {}) => - this.request({ - path: `/users/${username}/followers`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description Check if one user follows another. - * - * @name FollowingDetail - * @request GET:/users/{username}/following/{targetUser} - */ - followingDetail: (username, targetUser, params = {}) => - this.request({ - path: `/users/${username}/following/${targetUser}`, - method: "GET", - ...params, - }), - /** - * @description List a users gists. - * - * @name GistsDetail - * @request GET:/users/{username}/gists - */ - gistsDetail: (username, query, params = {}) => - this.request({ - path: `/users/${username}/gists`, - method: "GET", - query: query, - format: "json", - ...params, - }), - /** - * @description List public keys for a user. Lists the verified public keys for a user. This is accessible by anyone. - * - * @name KeysDetail - * @request GET:/users/{username}/keys - */ - keysDetail: (username, params = {}) => - this.request({ - path: `/users/${username}/keys`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description List all public organizations for a user. - * - * @name OrgsDetail - * @request GET:/users/{username}/orgs - */ - orgsDetail: (username, params = {}) => - this.request({ - path: `/users/${username}/orgs`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description These are events that you'll only see public events. - * - * @name ReceivedEventsDetail - * @request GET:/users/{username}/received_events - */ - receivedEventsDetail: (username, params = {}) => - this.request({ - path: `/users/${username}/received_events`, - method: "GET", - ...params, - }), - /** - * @description List public events that a user has received - * - * @name ReceivedEventsPublicDetail - * @request GET:/users/{username}/received_events/public - */ - receivedEventsPublicDetail: (username, params = {}) => - this.request({ - path: `/users/${username}/received_events/public`, - method: "GET", - ...params, - }), - /** - * @description List public repositories for the specified user. - * - * @name ReposDetail - * @request GET:/users/{username}/repos - */ - reposDetail: (username, query, params = {}) => - this.request({ - path: `/users/${username}/repos`, - method: "GET", - query: query, - format: "json", - ...params, - }), - /** - * @description List repositories being starred by a user. - * - * @name StarredDetail - * @request GET:/users/{username}/starred - */ - starredDetail: (username, params = {}) => - this.request({ - path: `/users/${username}/starred`, - method: "GET", - ...params, - }), - /** - * @description List repositories being watched by a user. - * - * @name SubscriptionsDetail - * @request GET:/users/{username}/subscriptions - */ - subscriptionsDetail: (username, params = {}) => - this.request({ - path: `/users/${username}/subscriptions`, - method: "GET", - ...params, - }), - }; - } + emojis = { + /** + * @description Lists all the emojis available to use on GitHub. + * + * @name EmojisList + * @request GET:/emojis + */ + emojisList: (params = {}) => + this.request({ + path: `/emojis`, + method: "GET", + format: "json", + ...params, + }), + }; + events = { + /** + * @description List public events. + * + * @name EventsList + * @request GET:/events + */ + eventsList: (params = {}) => + this.request({ + path: `/events`, + method: "GET", + format: "json", + ...params, + }), + }; + feeds = { + /** + * @description List Feeds. GitHub provides several timeline resources in Atom format. The Feeds API lists all the feeds available to the authenticating user. + * + * @name FeedsList + * @request GET:/feeds + */ + feedsList: (params = {}) => + this.request({ + path: `/feeds`, + method: "GET", + format: "json", + ...params, + }), + }; + gists = { + /** + * @description List the authenticated user's gists or if called anonymously, this will return all public gists. + * + * @name GistsList + * @request GET:/gists + */ + gistsList: (query, params = {}) => + this.request({ + path: `/gists`, + method: "GET", + query: query, + format: "json", + ...params, + }), + /** + * @description Create a gist. + * + * @name GistsCreate + * @request POST:/gists + */ + gistsCreate: (body, params = {}) => + this.request({ + path: `/gists`, + method: "POST", + body: body, + type: ContentType.Json, + format: "json", + ...params, + }), + /** + * @description List all public gists. + * + * @name PublicList + * @request GET:/gists/public + */ + publicList: (query, params = {}) => + this.request({ + path: `/gists/public`, + method: "GET", + query: query, + format: "json", + ...params, + }), + /** + * @description List the authenticated user's starred gists. + * + * @name StarredList + * @request GET:/gists/starred + */ + starredList: (query, params = {}) => + this.request({ + path: `/gists/starred`, + method: "GET", + query: query, + format: "json", + ...params, + }), + /** + * @description Delete a gist. + * + * @name GistsDelete + * @request DELETE:/gists/{id} + */ + gistsDelete: (id, params = {}) => + this.request({ + path: `/gists/${id}`, + method: "DELETE", + ...params, + }), + /** + * @description Get a single gist. + * + * @name GistsDetail + * @request GET:/gists/{id} + */ + gistsDetail: (id, params = {}) => + this.request({ + path: `/gists/${id}`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description Edit a gist. + * + * @name GistsPartialUpdate + * @request PATCH:/gists/{id} + */ + gistsPartialUpdate: (id, body, params = {}) => + this.request({ + path: `/gists/${id}`, + method: "PATCH", + body: body, + type: ContentType.Json, + format: "json", + ...params, + }), + /** + * @description List comments on a gist. + * + * @name CommentsDetail + * @request GET:/gists/{id}/comments + */ + commentsDetail: (id, params = {}) => + this.request({ + path: `/gists/${id}/comments`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description Create a commen + * + * @name CommentsCreate + * @request POST:/gists/{id}/comments + */ + commentsCreate: (id, body, params = {}) => + this.request({ + path: `/gists/${id}/comments`, + method: "POST", + body: body, + format: "json", + ...params, + }), + /** + * @description Delete a comment. + * + * @name CommentsDelete + * @request DELETE:/gists/{id}/comments/{commentId} + */ + commentsDelete: (id, commentId, params = {}) => + this.request({ + path: `/gists/${id}/comments/${commentId}`, + method: "DELETE", + ...params, + }), + /** + * @description Get a single comment. + * + * @name CommentsDetail2 + * @request GET:/gists/{id}/comments/{commentId} + * @originalName commentsDetail + * @duplicate + */ + commentsDetail2: (id, commentId, params = {}) => + this.request({ + path: `/gists/${id}/comments/${commentId}`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description Edit a comment. + * + * @name CommentsPartialUpdate + * @request PATCH:/gists/{id}/comments/{commentId} + */ + commentsPartialUpdate: (id, commentId, body, params = {}) => + this.request({ + path: `/gists/${id}/comments/${commentId}`, + method: "PATCH", + body: body, + type: ContentType.Json, + format: "json", + ...params, + }), + /** + * @description Fork a gist. + * + * @name ForksCreate + * @request POST:/gists/{id}/forks + */ + forksCreate: (id, params = {}) => + this.request({ + path: `/gists/${id}/forks`, + method: "POST", + ...params, + }), + /** + * @description Unstar a gist. + * + * @name StarDelete + * @request DELETE:/gists/{id}/star + */ + starDelete: (id, params = {}) => + this.request({ + path: `/gists/${id}/star`, + method: "DELETE", + ...params, + }), + /** + * @description Check if a gist is starred. + * + * @name StarDetail + * @request GET:/gists/{id}/star + */ + starDetail: (id, params = {}) => + this.request({ + path: `/gists/${id}/star`, + method: "GET", + ...params, + }), + /** + * @description Star a gist. + * + * @name StarUpdate + * @request PUT:/gists/{id}/star + */ + starUpdate: (id, params = {}) => + this.request({ + path: `/gists/${id}/star`, + method: "PUT", + ...params, + }), + }; + gitignore = { + /** + * @description Listing available templates. List all templates available to pass as an option when creating a repository. + * + * @name TemplatesList + * @request GET:/gitignore/templates + */ + templatesList: (params = {}) => + this.request({ + path: `/gitignore/templates`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description Get a single template. + * + * @name TemplatesDetail + * @request GET:/gitignore/templates/{language} + */ + templatesDetail: (language, params = {}) => + this.request({ + path: `/gitignore/templates/${language}`, + method: "GET", + format: "json", + ...params, + }), + }; + issues = { + /** + * @description List issues. List all issues across all the authenticated user's visible repositories. + * + * @name IssuesList + * @request GET:/issues + */ + issuesList: (query, params = {}) => + this.request({ + path: `/issues`, + method: "GET", + query: query, + format: "json", + ...params, + }), + }; + legacy = { + /** + * @description Find issues by state and keyword. + * + * @name IssuesSearchDetail + * @request GET:/legacy/issues/search/{owner}/{repository}/{state}/{keyword} + * @deprecated + */ + issuesSearchDetail: (keyword, state, owner, repository, params = {}) => + this.request({ + path: `/legacy/issues/search/${owner}/${repository}/${state}/${keyword}`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description Find repositories by keyword. Note, this legacy method does not follow the v3 pagination pattern. This method returns up to 100 results per page and pages can be fetched using the start_page parameter. + * + * @name ReposSearchDetail + * @request GET:/legacy/repos/search/{keyword} + * @deprecated + */ + reposSearchDetail: (keyword, query, params = {}) => + this.request({ + path: `/legacy/repos/search/${keyword}`, + method: "GET", + query: query, + format: "json", + ...params, + }), + /** + * @description This API call is added for compatibility reasons only. + * + * @name UserEmailDetail + * @request GET:/legacy/user/email/{email} + * @deprecated + */ + userEmailDetail: (email, params = {}) => + this.request({ + path: `/legacy/user/email/${email}`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description Find users by keyword. + * + * @name UserSearchDetail + * @request GET:/legacy/user/search/{keyword} + * @deprecated + */ + userSearchDetail: (keyword, query, params = {}) => + this.request({ + path: `/legacy/user/search/${keyword}`, + method: "GET", + query: query, + format: "json", + ...params, + }), + }; + markdown = { + /** + * @description Render an arbitrary Markdown document + * + * @name MarkdownCreate + * @request POST:/markdown + */ + markdownCreate: (body, params = {}) => + this.request({ + path: `/markdown`, + method: "POST", + body: body, + type: ContentType.Json, + ...params, + }), + /** + * @description Render a Markdown document in raw mode + * + * @name PostMarkdown + * @request POST:/markdown/raw + */ + postMarkdown: (params = {}) => + this.request({ + path: `/markdown/raw`, + method: "POST", + ...params, + }), + }; + meta = { + /** + * @description This gives some information about GitHub.com, the service. + * + * @name MetaList + * @request GET:/meta + */ + metaList: (params = {}) => + this.request({ + path: `/meta`, + method: "GET", + format: "json", + ...params, + }), + }; + networks = { + /** + * @description List public events for a network of repositories. + * + * @name EventsDetail + * @request GET:/networks/{owner}/{repo}/events + */ + eventsDetail: (owner, repo, params = {}) => + this.request({ + path: `/networks/${owner}/${repo}/events`, + method: "GET", + format: "json", + ...params, + }), + }; + notifications = { + /** + * @description List your notifications. List all notifications for the current user, grouped by repository. + * + * @name NotificationsList + * @request GET:/notifications + */ + notificationsList: (query, params = {}) => + this.request({ + path: `/notifications`, + method: "GET", + query: query, + format: "json", + ...params, + }), + /** + * @description Mark as read. Marking a notification as "read" removes it from the default view on GitHub.com. + * + * @name NotificationsUpdate + * @request PUT:/notifications + */ + notificationsUpdate: (body, params = {}) => + this.request({ + path: `/notifications`, + method: "PUT", + body: body, + ...params, + }), + /** + * @description View a single thread. + * + * @name ThreadsDetail + * @request GET:/notifications/threads/{id} + */ + threadsDetail: (id, params = {}) => + this.request({ + path: `/notifications/threads/${id}`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description Mark a thread as read + * + * @name ThreadsPartialUpdate + * @request PATCH:/notifications/threads/{id} + */ + threadsPartialUpdate: (id, params = {}) => + this.request({ + path: `/notifications/threads/${id}`, + method: "PATCH", + ...params, + }), + /** + * @description Delete a Thread Subscription. + * + * @name ThreadsSubscriptionDelete + * @request DELETE:/notifications/threads/{id}/subscription + */ + threadsSubscriptionDelete: (id, params = {}) => + this.request({ + path: `/notifications/threads/${id}/subscription`, + method: "DELETE", + ...params, + }), + /** + * @description Get a Thread Subscription. + * + * @name ThreadsSubscriptionDetail + * @request GET:/notifications/threads/{id}/subscription + */ + threadsSubscriptionDetail: (id, params = {}) => + this.request({ + path: `/notifications/threads/${id}/subscription`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description Set a Thread Subscription. This lets you subscribe to a thread, or ignore it. Subscribing to a thread is unnecessary if the user is already subscribed to the repository. Ignoring a thread will mute all future notifications (until you comment or get @mentioned). + * + * @name ThreadsSubscriptionUpdate + * @request PUT:/notifications/threads/{id}/subscription + */ + threadsSubscriptionUpdate: (id, body, params = {}) => + this.request({ + path: `/notifications/threads/${id}/subscription`, + method: "PUT", + body: body, + type: ContentType.Json, + format: "json", + ...params, + }), + }; + orgs = { + /** + * @description Get an Organization. + * + * @name OrgsDetail + * @request GET:/orgs/{org} + */ + orgsDetail: (org, params = {}) => + this.request({ + path: `/orgs/${org}`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description Edit an Organization. + * + * @name OrgsPartialUpdate + * @request PATCH:/orgs/{org} + */ + orgsPartialUpdate: (org, body, params = {}) => + this.request({ + path: `/orgs/${org}`, + method: "PATCH", + body: body, + type: ContentType.Json, + format: "json", + ...params, + }), + /** + * @description List public events for an organization. + * + * @name EventsDetail + * @request GET:/orgs/{org}/events + */ + eventsDetail: (org, params = {}) => + this.request({ + path: `/orgs/${org}/events`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description List issues. List all issues for a given organization for the authenticated user. + * + * @name IssuesDetail + * @request GET:/orgs/{org}/issues + */ + issuesDetail: (org, query, params = {}) => + this.request({ + path: `/orgs/${org}/issues`, + method: "GET", + query: query, + format: "json", + ...params, + }), + /** + * @description Members list. List all users who are members of an organization. A member is a user tha belongs to at least 1 team in the organization. If the authenticated user is also an owner of this organization then both concealed and public members will be returned. If the requester is not an owner of the organization the query will be redirected to the public members list. + * + * @name MembersDetail + * @request GET:/orgs/{org}/members + */ + membersDetail: (org, params = {}) => + this.request({ + path: `/orgs/${org}/members`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description Remove a member. Removing a user from this list will remove them from all teams and they will no longer have any access to the organization's repositories. + * + * @name MembersDelete + * @request DELETE:/orgs/{org}/members/{username} + */ + membersDelete: (org, username, params = {}) => + this.request({ + path: `/orgs/${org}/members/${username}`, + method: "DELETE", + ...params, + }), + /** + * @description Check if a user is, publicly or privately, a member of the organization. + * + * @name MembersDetail2 + * @request GET:/orgs/{org}/members/{username} + * @originalName membersDetail + * @duplicate + */ + membersDetail2: (org, username, params = {}) => + this.request({ + path: `/orgs/${org}/members/${username}`, + method: "GET", + ...params, + }), + /** + * @description Public members list. Members of an organization can choose to have their membership publicized or not. + * + * @name PublicMembersDetail + * @request GET:/orgs/{org}/public_members + */ + publicMembersDetail: (org, params = {}) => + this.request({ + path: `/orgs/${org}/public_members`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description Conceal a user's membership. + * + * @name PublicMembersDelete + * @request DELETE:/orgs/{org}/public_members/{username} + */ + publicMembersDelete: (org, username, params = {}) => + this.request({ + path: `/orgs/${org}/public_members/${username}`, + method: "DELETE", + ...params, + }), + /** + * @description Check public membership. + * + * @name PublicMembersDetail2 + * @request GET:/orgs/{org}/public_members/{username} + * @originalName publicMembersDetail + * @duplicate + */ + publicMembersDetail2: (org, username, params = {}) => + this.request({ + path: `/orgs/${org}/public_members/${username}`, + method: "GET", + ...params, + }), + /** + * @description Publicize a user's membership. + * + * @name PublicMembersUpdate + * @request PUT:/orgs/{org}/public_members/{username} + */ + publicMembersUpdate: (org, username, params = {}) => + this.request({ + path: `/orgs/${org}/public_members/${username}`, + method: "PUT", + ...params, + }), + /** + * @description List repositories for the specified org. + * + * @name ReposDetail + * @request GET:/orgs/{org}/repos + */ + reposDetail: (org, query, params = {}) => + this.request({ + path: `/orgs/${org}/repos`, + method: "GET", + query: query, + format: "json", + ...params, + }), + /** + * @description Create a new repository for the authenticated user. OAuth users must supply repo scope. + * + * @name ReposCreate + * @request POST:/orgs/{org}/repos + */ + reposCreate: (org, body, params = {}) => + this.request({ + path: `/orgs/${org}/repos`, + method: "POST", + body: body, + format: "json", + ...params, + }), + /** + * @description List teams. + * + * @name TeamsDetail + * @request GET:/orgs/{org}/teams + */ + teamsDetail: (org, params = {}) => + this.request({ + path: `/orgs/${org}/teams`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description Create team. In order to create a team, the authenticated user must be an owner of organization. + * + * @name TeamsCreate + * @request POST:/orgs/{org}/teams + */ + teamsCreate: (org, body, params = {}) => + this.request({ + path: `/orgs/${org}/teams`, + method: "POST", + body: body, + type: ContentType.Json, + format: "json", + ...params, + }), + }; + rateLimit = { + /** + * @description Get your current rate limit status Note: Accessing this endpoint does not count against your rate limit. + * + * @name RateLimitList + * @request GET:/rate_limit + */ + rateLimitList: (params = {}) => + this.request({ + path: `/rate_limit`, + method: "GET", + format: "json", + ...params, + }), + }; + repos = { + /** + * @description Delete a Repository. Deleting a repository requires admin access. If OAuth is used, the delete_repo scope is required. + * + * @name ReposDelete + * @request DELETE:/repos/{owner}/{repo} + */ + reposDelete: (owner, repo, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}`, + method: "DELETE", + ...params, + }), + /** + * @description Get repository. + * + * @name ReposDetail + * @request GET:/repos/{owner}/{repo} + */ + reposDetail: (owner, repo, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description Edit repository. + * + * @name ReposPartialUpdate + * @request PATCH:/repos/{owner}/{repo} + */ + reposPartialUpdate: (owner, repo, body, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}`, + method: "PATCH", + body: body, + type: ContentType.Json, + format: "json", + ...params, + }), + /** + * @description List assignees. This call lists all the available assignees (owner + collaborators) to which issues may be assigned. + * + * @name AssigneesDetail + * @request GET:/repos/{owner}/{repo}/assignees + */ + assigneesDetail: (owner, repo, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/assignees`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description Check assignee. You may also check to see if a particular user is an assignee for a repository. + * + * @name AssigneesDetail2 + * @request GET:/repos/{owner}/{repo}/assignees/{assignee} + * @originalName assigneesDetail + * @duplicate + */ + assigneesDetail2: (owner, repo, assignee, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/assignees/${assignee}`, + method: "GET", + ...params, + }), + /** + * @description Get list of branches + * + * @name BranchesDetail + * @request GET:/repos/{owner}/{repo}/branches + */ + branchesDetail: (owner, repo, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/branches`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description Get Branch + * + * @name BranchesDetail2 + * @request GET:/repos/{owner}/{repo}/branches/{branch} + * @originalName branchesDetail + * @duplicate + */ + branchesDetail2: (owner, repo, branch, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/branches/${branch}`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description List. When authenticating as an organization owner of an organization-owned repository, all organization owners are included in the list of collaborators. Otherwise, only users with access to the repository are returned in the collaborators list. + * + * @name CollaboratorsDetail + * @request GET:/repos/{owner}/{repo}/collaborators + */ + collaboratorsDetail: (owner, repo, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/collaborators`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description Remove collaborator. + * + * @name CollaboratorsDelete + * @request DELETE:/repos/{owner}/{repo}/collaborators/{user} + */ + collaboratorsDelete: (owner, repo, user, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/collaborators/${user}`, + method: "DELETE", + ...params, + }), + /** + * @description Check if user is a collaborator + * + * @name CollaboratorsDetail2 + * @request GET:/repos/{owner}/{repo}/collaborators/{user} + * @originalName collaboratorsDetail + * @duplicate + */ + collaboratorsDetail2: (owner, repo, user, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/collaborators/${user}`, + method: "GET", + ...params, + }), + /** + * @description Add collaborator. + * + * @name CollaboratorsUpdate + * @request PUT:/repos/{owner}/{repo}/collaborators/{user} + */ + collaboratorsUpdate: (owner, repo, user, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/collaborators/${user}`, + method: "PUT", + ...params, + }), + /** + * @description List commit comments for a repository. Comments are ordered by ascending ID. + * + * @name CommentsDetail + * @request GET:/repos/{owner}/{repo}/comments + */ + commentsDetail: (owner, repo, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/comments`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description Delete a commit comment + * + * @name CommentsDelete + * @request DELETE:/repos/{owner}/{repo}/comments/{commentId} + */ + commentsDelete: (owner, repo, commentId, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/comments/${commentId}`, + method: "DELETE", + ...params, + }), + /** + * @description Get a single commit comment. + * + * @name CommentsDetail2 + * @request GET:/repos/{owner}/{repo}/comments/{commentId} + * @originalName commentsDetail + * @duplicate + */ + commentsDetail2: (owner, repo, commentId, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/comments/${commentId}`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description Update a commit comment. + * + * @name CommentsPartialUpdate + * @request PATCH:/repos/{owner}/{repo}/comments/{commentId} + */ + commentsPartialUpdate: (owner, repo, commentId, body, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/comments/${commentId}`, + method: "PATCH", + body: body, + format: "json", + ...params, + }), + /** + * @description List commits on a repository. + * + * @name CommitsDetail + * @request GET:/repos/{owner}/{repo}/commits + */ + commitsDetail: (owner, repo, query, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/commits`, + method: "GET", + query: query, + format: "json", + ...params, + }), + /** + * @description Get the combined Status for a specific Ref The Combined status endpoint is currently available for developers to preview. During the preview period, the API may change without advance notice. Please see the blog post for full details. To access this endpoint during the preview period, you must provide a custom media type in the Accept header: application/vnd.github.she-hulk-preview+json + * + * @name CommitsStatusDetail + * @request GET:/repos/{owner}/{repo}/commits/{ref}/status + */ + commitsStatusDetail: (owner, repo, ref, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/commits/${ref}/status`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description Get a single commit. + * + * @name CommitsDetail2 + * @request GET:/repos/{owner}/{repo}/commits/{shaCode} + * @originalName commitsDetail + * @duplicate + */ + commitsDetail2: (owner, repo, shaCode, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/commits/${shaCode}`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description List comments for a single commitList comments for a single commit. + * + * @name CommitsCommentsDetail + * @request GET:/repos/{owner}/{repo}/commits/{shaCode}/comments + */ + commitsCommentsDetail: (owner, repo, shaCode, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/commits/${shaCode}/comments`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description Create a commit comment. + * + * @name CommitsCommentsCreate + * @request POST:/repos/{owner}/{repo}/commits/{shaCode}/comments + */ + commitsCommentsCreate: (owner, repo, shaCode, body, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/commits/${shaCode}/comments`, + method: "POST", + body: body, + type: ContentType.Json, + format: "json", + ...params, + }), + /** + * @description Compare two commits + * + * @name CompareDetail + * @request GET:/repos/{owner}/{repo}/compare/{baseId}...{headId} + */ + compareDetail: (owner, repo, baseId, headId, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/compare/${baseId}...${headId}`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description Delete a file. This method deletes a file in a repository. + * + * @name ContentsDelete + * @request DELETE:/repos/{owner}/{repo}/contents/{path} + */ + contentsDelete: (owner, repo, path, body, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/contents/${path}`, + method: "DELETE", + body: body, + type: ContentType.Json, + format: "json", + ...params, + }), + /** + * @description Get contents. This method returns the contents of a file or directory in a repository. Files and symlinks support a custom media type for getting the raw content. Directories and submodules do not support custom media types. Note: This API supports files up to 1 megabyte in size. Here can be many outcomes. For details see "http://developer.github.com/v3/repos/contents/" + * + * @name ContentsDetail + * @request GET:/repos/{owner}/{repo}/contents/{path} + */ + contentsDetail: (owner, repo, path, query, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/contents/${path}`, + method: "GET", + query: query, + format: "json", + ...params, + }), + /** + * @description Create a file. + * + * @name ContentsUpdate + * @request PUT:/repos/{owner}/{repo}/contents/{path} + */ + contentsUpdate: (owner, repo, path, body, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/contents/${path}`, + method: "PUT", + body: body, + type: ContentType.Json, + format: "json", + ...params, + }), + /** + * @description Get list of contributors. + * + * @name ContributorsDetail + * @request GET:/repos/{owner}/{repo}/contributors + */ + contributorsDetail: (owner, repo, query, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/contributors`, + method: "GET", + query: query, + format: "json", + ...params, + }), + /** + * @description Users with pull access can view deployments for a repository + * + * @name DeploymentsDetail + * @request GET:/repos/{owner}/{repo}/deployments + */ + deploymentsDetail: (owner, repo, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/deployments`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description Users with push access can create a deployment for a given ref + * + * @name DeploymentsCreate + * @request POST:/repos/{owner}/{repo}/deployments + */ + deploymentsCreate: (owner, repo, body, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/deployments`, + method: "POST", + body: body, + type: ContentType.Json, + format: "json", + ...params, + }), + /** + * @description Users with pull access can view deployment statuses for a deployment + * + * @name DeploymentsStatusesDetail + * @request GET:/repos/{owner}/{repo}/deployments/{id}/statuses + */ + deploymentsStatusesDetail: (owner, repo, id, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/deployments/${id}/statuses`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description Create a Deployment Status Users with push access can create deployment statuses for a given deployment: + * + * @name DeploymentsStatusesCreate + * @request POST:/repos/{owner}/{repo}/deployments/{id}/statuses + */ + deploymentsStatusesCreate: (owner, repo, id, body, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/deployments/${id}/statuses`, + method: "POST", + body: body, + type: ContentType.Json, + ...params, + }), + /** + * @description Deprecated. List downloads for a repository. + * + * @name DownloadsDetail + * @request GET:/repos/{owner}/{repo}/downloads + * @deprecated + */ + downloadsDetail: (owner, repo, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/downloads`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description Deprecated. Delete a download. + * + * @name DownloadsDelete + * @request DELETE:/repos/{owner}/{repo}/downloads/{downloadId} + * @deprecated + */ + downloadsDelete: (owner, repo, downloadId, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/downloads/${downloadId}`, + method: "DELETE", + ...params, + }), + /** + * @description Deprecated. Get a single download. + * + * @name DownloadsDetail2 + * @request GET:/repos/{owner}/{repo}/downloads/{downloadId} + * @deprecated + * @originalName downloadsDetail + * @duplicate + */ + downloadsDetail2: (owner, repo, downloadId, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/downloads/${downloadId}`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description Get list of repository events. + * + * @name EventsDetail + * @request GET:/repos/{owner}/{repo}/events + */ + eventsDetail: (owner, repo, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/events`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description List forks. + * + * @name ForksDetail + * @request GET:/repos/{owner}/{repo}/forks + */ + forksDetail: (owner, repo, query, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/forks`, + method: "GET", + query: query, + format: "json", + ...params, + }), + /** + * @description Create a fork. Forking a Repository happens asynchronously. Therefore, you may have to wai a short period before accessing the git objects. If this takes longer than 5 minutes, be sure to contact Support. + * + * @name ForksCreate + * @request POST:/repos/{owner}/{repo}/forks + */ + forksCreate: (owner, repo, body, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/forks`, + method: "POST", + body: body, + type: ContentType.Json, + format: "json", + ...params, + }), + /** + * @description Create a Blob. + * + * @name GitBlobsCreate + * @request POST:/repos/{owner}/{repo}/git/blobs + */ + gitBlobsCreate: (owner, repo, body, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/git/blobs`, + method: "POST", + body: body, + type: ContentType.Json, + format: "json", + ...params, + }), + /** + * @description Get a Blob. Since blobs can be any arbitrary binary data, the input and responses for the blob API takes an encoding parameter that can be either utf-8 or base64. If your data cannot be losslessly sent as a UTF-8 string, you can base64 encode it. + * + * @name GitBlobsDetail + * @request GET:/repos/{owner}/{repo}/git/blobs/{shaCode} + */ + gitBlobsDetail: (owner, repo, shaCode, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/git/blobs/${shaCode}`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description Create a Commit. + * + * @name GitCommitsCreate + * @request POST:/repos/{owner}/{repo}/git/commits + */ + gitCommitsCreate: (owner, repo, body, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/git/commits`, + method: "POST", + body: body, + type: ContentType.Json, + format: "json", + ...params, + }), + /** + * @description Get a Commit. + * + * @name GitCommitsDetail + * @request GET:/repos/{owner}/{repo}/git/commits/{shaCode} + */ + gitCommitsDetail: (owner, repo, shaCode, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/git/commits/${shaCode}`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description Get all References + * + * @name GitRefsDetail + * @request GET:/repos/{owner}/{repo}/git/refs + */ + gitRefsDetail: (owner, repo, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/git/refs`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description Create a Reference + * + * @name GitRefsCreate + * @request POST:/repos/{owner}/{repo}/git/refs + */ + gitRefsCreate: (owner, repo, body, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/git/refs`, + method: "POST", + body: body, + type: ContentType.Json, + format: "json", + ...params, + }), + /** + * @description Delete a Reference Example: Deleting a branch: DELETE /repos/octocat/Hello-World/git/refs/heads/feature-a Example: Deleting a tag: DELETE /repos/octocat/Hello-World/git/refs/tags/v1.0 + * + * @name GitRefsDelete + * @request DELETE:/repos/{owner}/{repo}/git/refs/{ref} + */ + gitRefsDelete: (owner, repo, ref, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/git/refs/${ref}`, + method: "DELETE", + ...params, + }), + /** + * @description Get a Reference + * + * @name GitRefsDetail2 + * @request GET:/repos/{owner}/{repo}/git/refs/{ref} + * @originalName gitRefsDetail + * @duplicate + */ + gitRefsDetail2: (owner, repo, ref, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/git/refs/${ref}`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description Update a Reference + * + * @name GitRefsPartialUpdate + * @request PATCH:/repos/{owner}/{repo}/git/refs/{ref} + */ + gitRefsPartialUpdate: (owner, repo, ref, body, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/git/refs/${ref}`, + method: "PATCH", + body: body, + type: ContentType.Json, + format: "json", + ...params, + }), + /** + * @description Create a Tag Object. Note that creating a tag object does not create the reference that makes a tag in Git. If you want to create an annotated tag in Git, you have to do this call to create the tag object, and then create the refs/tags/[tag] reference. If you want to create a lightweight tag, you only have to create the tag reference - this call would be unnecessary. + * + * @name GitTagsCreate + * @request POST:/repos/{owner}/{repo}/git/tags + */ + gitTagsCreate: (owner, repo, body, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/git/tags`, + method: "POST", + body: body, + type: ContentType.Json, + format: "json", + ...params, + }), + /** + * @description Get a Tag. + * + * @name GitTagsDetail + * @request GET:/repos/{owner}/{repo}/git/tags/{shaCode} + */ + gitTagsDetail: (owner, repo, shaCode, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/git/tags/${shaCode}`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description Create a Tree. The tree creation API will take nested entries as well. If both a tree and a nested path modifying that tree are specified, it will overwrite the contents of that tree with the new path contents and write a new tree out. + * + * @name GitTreesCreate + * @request POST:/repos/{owner}/{repo}/git/trees + */ + gitTreesCreate: (owner, repo, body, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/git/trees`, + method: "POST", + body: body, + type: ContentType.Json, + format: "json", + ...params, + }), + /** + * @description Get a Tree. + * + * @name GitTreesDetail + * @request GET:/repos/{owner}/{repo}/git/trees/{shaCode} + */ + gitTreesDetail: (owner, repo, shaCode, query, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/git/trees/${shaCode}`, + method: "GET", + query: query, + format: "json", + ...params, + }), + /** + * @description Get list of hooks. + * + * @name HooksDetail + * @request GET:/repos/{owner}/{repo}/hooks + */ + hooksDetail: (owner, repo, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/hooks`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description Create a hook. + * + * @name HooksCreate + * @request POST:/repos/{owner}/{repo}/hooks + */ + hooksCreate: (owner, repo, body, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/hooks`, + method: "POST", + body: body, + format: "json", + ...params, + }), + /** + * @description Delete a hook. + * + * @name HooksDelete + * @request DELETE:/repos/{owner}/{repo}/hooks/{hookId} + */ + hooksDelete: (owner, repo, hookId, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/hooks/${hookId}`, + method: "DELETE", + ...params, + }), + /** + * @description Get single hook. + * + * @name HooksDetail2 + * @request GET:/repos/{owner}/{repo}/hooks/{hookId} + * @originalName hooksDetail + * @duplicate + */ + hooksDetail2: (owner, repo, hookId, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/hooks/${hookId}`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description Edit a hook. + * + * @name HooksPartialUpdate + * @request PATCH:/repos/{owner}/{repo}/hooks/{hookId} + */ + hooksPartialUpdate: (owner, repo, hookId, body, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/hooks/${hookId}`, + method: "PATCH", + body: body, + format: "json", + ...params, + }), + /** + * @description Test a push hook. This will trigger the hook with the latest push to the current repository if the hook is subscribed to push events. If the hook is not subscribed to push events, the server will respond with 204 but no test POST will be generated. Note: Previously /repos/:owner/:repo/hooks/:id/tes + * + * @name HooksTestsCreate + * @request POST:/repos/{owner}/{repo}/hooks/{hookId}/tests + */ + hooksTestsCreate: (owner, repo, hookId, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/hooks/${hookId}/tests`, + method: "POST", + ...params, + }), + /** + * @description List issues for a repository. + * + * @name IssuesDetail + * @request GET:/repos/{owner}/{repo}/issues + */ + issuesDetail: (owner, repo, query, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/issues`, + method: "GET", + query: query, + format: "json", + ...params, + }), + /** + * @description Create an issue. Any user with pull access to a repository can create an issue. + * + * @name IssuesCreate + * @request POST:/repos/{owner}/{repo}/issues + */ + issuesCreate: (owner, repo, body, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/issues`, + method: "POST", + body: body, + format: "json", + ...params, + }), + /** + * @description List comments in a repository. + * + * @name IssuesCommentsDetail + * @request GET:/repos/{owner}/{repo}/issues/comments + */ + issuesCommentsDetail: (owner, repo, query, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/issues/comments`, + method: "GET", + query: query, + format: "json", + ...params, + }), + /** + * @description Delete a comment. + * + * @name IssuesCommentsDelete + * @request DELETE:/repos/{owner}/{repo}/issues/comments/{commentId} + */ + issuesCommentsDelete: (owner, repo, commentId, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/issues/comments/${commentId}`, + method: "DELETE", + ...params, + }), + /** + * @description Get a single comment. + * + * @name IssuesCommentsDetail2 + * @request GET:/repos/{owner}/{repo}/issues/comments/{commentId} + * @originalName issuesCommentsDetail + * @duplicate + */ + issuesCommentsDetail2: (owner, repo, commentId, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/issues/comments/${commentId}`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description Edit a comment. + * + * @name IssuesCommentsPartialUpdate + * @request PATCH:/repos/{owner}/{repo}/issues/comments/{commentId} + */ + issuesCommentsPartialUpdate: (owner, repo, commentId, body, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/issues/comments/${commentId}`, + method: "PATCH", + body: body, + format: "json", + ...params, + }), + /** + * @description List issue events for a repository. + * + * @name IssuesEventsDetail + * @request GET:/repos/{owner}/{repo}/issues/events + */ + issuesEventsDetail: (owner, repo, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/issues/events`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description Get a single event. + * + * @name IssuesEventsDetail2 + * @request GET:/repos/{owner}/{repo}/issues/events/{eventId} + * @originalName issuesEventsDetail + * @duplicate + */ + issuesEventsDetail2: (owner, repo, eventId, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/issues/events/${eventId}`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description Get a single issue + * + * @name IssuesDetail2 + * @request GET:/repos/{owner}/{repo}/issues/{number} + * @originalName issuesDetail + * @duplicate + */ + issuesDetail2: (owner, repo, number, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/issues/${number}`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description Edit an issue. Issue owners and users with push access can edit an issue. + * + * @name IssuesPartialUpdate + * @request PATCH:/repos/{owner}/{repo}/issues/{number} + */ + issuesPartialUpdate: (owner, repo, number, body, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/issues/${number}`, + method: "PATCH", + body: body, + format: "json", + ...params, + }), + /** + * @description List comments on an issue. + * + * @name IssuesCommentsDetail3 + * @request GET:/repos/{owner}/{repo}/issues/{number}/comments + * @originalName issuesCommentsDetail + * @duplicate + */ + issuesCommentsDetail3: (owner, repo, number, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/issues/${number}/comments`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description Create a comment. + * + * @name IssuesCommentsCreate + * @request POST:/repos/{owner}/{repo}/issues/{number}/comments + */ + issuesCommentsCreate: (owner, repo, number, body, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/issues/${number}/comments`, + method: "POST", + body: body, + format: "json", + ...params, + }), + /** + * @description List events for an issue. + * + * @name IssuesEventsDetail3 + * @request GET:/repos/{owner}/{repo}/issues/{number}/events + * @originalName issuesEventsDetail + * @duplicate + */ + issuesEventsDetail3: (owner, repo, number, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/issues/${number}/events`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description Remove all labels from an issue. + * + * @name IssuesLabelsDelete + * @request DELETE:/repos/{owner}/{repo}/issues/{number}/labels + */ + issuesLabelsDelete: (owner, repo, number, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/issues/${number}/labels`, + method: "DELETE", + ...params, + }), + /** + * @description List labels on an issue. + * + * @name IssuesLabelsDetail + * @request GET:/repos/{owner}/{repo}/issues/{number}/labels + */ + issuesLabelsDetail: (owner, repo, number, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/issues/${number}/labels`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description Add labels to an issue. + * + * @name IssuesLabelsCreate + * @request POST:/repos/{owner}/{repo}/issues/{number}/labels + */ + issuesLabelsCreate: (owner, repo, number, body, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/issues/${number}/labels`, + method: "POST", + body: body, + format: "json", + ...params, + }), + /** + * @description Replace all labels for an issue. Sending an empty array ([]) will remove all Labels from the Issue. + * + * @name IssuesLabelsUpdate + * @request PUT:/repos/{owner}/{repo}/issues/{number}/labels + */ + issuesLabelsUpdate: (owner, repo, number, body, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/issues/${number}/labels`, + method: "PUT", + body: body, + format: "json", + ...params, + }), + /** + * @description Remove a label from an issue. + * + * @name IssuesLabelsDelete2 + * @request DELETE:/repos/{owner}/{repo}/issues/{number}/labels/{name} + * @originalName issuesLabelsDelete + * @duplicate + */ + issuesLabelsDelete2: (owner, repo, number, name, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/issues/${number}/labels/${name}`, + method: "DELETE", + ...params, + }), + /** + * @description Get list of keys. + * + * @name KeysDetail + * @request GET:/repos/{owner}/{repo}/keys + */ + keysDetail: (owner, repo, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/keys`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description Create a key. + * + * @name KeysCreate + * @request POST:/repos/{owner}/{repo}/keys + */ + keysCreate: (owner, repo, body, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/keys`, + method: "POST", + body: body, + format: "json", + ...params, + }), + /** + * @description Delete a key. + * + * @name KeysDelete + * @request DELETE:/repos/{owner}/{repo}/keys/{keyId} + */ + keysDelete: (owner, repo, keyId, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/keys/${keyId}`, + method: "DELETE", + ...params, + }), + /** + * @description Get a key + * + * @name KeysDetail2 + * @request GET:/repos/{owner}/{repo}/keys/{keyId} + * @originalName keysDetail + * @duplicate + */ + keysDetail2: (owner, repo, keyId, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/keys/${keyId}`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description List all labels for this repository. + * + * @name LabelsDetail + * @request GET:/repos/{owner}/{repo}/labels + */ + labelsDetail: (owner, repo, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/labels`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description Create a label. + * + * @name LabelsCreate + * @request POST:/repos/{owner}/{repo}/labels + */ + labelsCreate: (owner, repo, body, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/labels`, + method: "POST", + body: body, + format: "json", + ...params, + }), + /** + * @description Delete a label. + * + * @name LabelsDelete + * @request DELETE:/repos/{owner}/{repo}/labels/{name} + */ + labelsDelete: (owner, repo, name, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/labels/${name}`, + method: "DELETE", + ...params, + }), + /** + * @description Get a single label. + * + * @name LabelsDetail2 + * @request GET:/repos/{owner}/{repo}/labels/{name} + * @originalName labelsDetail + * @duplicate + */ + labelsDetail2: (owner, repo, name, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/labels/${name}`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description Update a label. + * + * @name LabelsPartialUpdate + * @request PATCH:/repos/{owner}/{repo}/labels/{name} + */ + labelsPartialUpdate: (owner, repo, name, body, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/labels/${name}`, + method: "PATCH", + body: body, + format: "json", + ...params, + }), + /** + * @description List languages. List languages for the specified repository. The value on the right of a language is the number of bytes of code written in that language. + * + * @name LanguagesDetail + * @request GET:/repos/{owner}/{repo}/languages + */ + languagesDetail: (owner, repo, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/languages`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description Perform a merge. + * + * @name MergesCreate + * @request POST:/repos/{owner}/{repo}/merges + */ + mergesCreate: (owner, repo, body, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/merges`, + method: "POST", + body: body, + type: ContentType.Json, + format: "json", + ...params, + }), + /** + * @description List milestones for a repository. + * + * @name MilestonesDetail + * @request GET:/repos/{owner}/{repo}/milestones + */ + milestonesDetail: (owner, repo, query, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/milestones`, + method: "GET", + query: query, + format: "json", + ...params, + }), + /** + * @description Create a milestone. + * + * @name MilestonesCreate + * @request POST:/repos/{owner}/{repo}/milestones + */ + milestonesCreate: (owner, repo, body, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/milestones`, + method: "POST", + body: body, + format: "json", + ...params, + }), + /** + * @description Delete a milestone. + * + * @name MilestonesDelete + * @request DELETE:/repos/{owner}/{repo}/milestones/{number} + */ + milestonesDelete: (owner, repo, number, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/milestones/${number}`, + method: "DELETE", + ...params, + }), + /** + * @description Get a single milestone. + * + * @name MilestonesDetail2 + * @request GET:/repos/{owner}/{repo}/milestones/{number} + * @originalName milestonesDetail + * @duplicate + */ + milestonesDetail2: (owner, repo, number, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/milestones/${number}`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description Update a milestone. + * + * @name MilestonesPartialUpdate + * @request PATCH:/repos/{owner}/{repo}/milestones/{number} + */ + milestonesPartialUpdate: (owner, repo, number, body, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/milestones/${number}`, + method: "PATCH", + body: body, + format: "json", + ...params, + }), + /** + * @description Get labels for every issue in a milestone. + * + * @name MilestonesLabelsDetail + * @request GET:/repos/{owner}/{repo}/milestones/{number}/labels + */ + milestonesLabelsDetail: (owner, repo, number, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/milestones/${number}/labels`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description List your notifications in a repository List all notifications for the current user. + * + * @name NotificationsDetail + * @request GET:/repos/{owner}/{repo}/notifications + */ + notificationsDetail: (owner, repo, query, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/notifications`, + method: "GET", + query: query, + format: "json", + ...params, + }), + /** + * @description Mark notifications as read in a repository. Marking all notifications in a repository as "read" removes them from the default view on GitHub.com. + * + * @name NotificationsUpdate + * @request PUT:/repos/{owner}/{repo}/notifications + */ + notificationsUpdate: (owner, repo, body, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/notifications`, + method: "PUT", + body: body, + ...params, + }), + /** + * @description List pull requests. + * + * @name PullsDetail + * @request GET:/repos/{owner}/{repo}/pulls + */ + pullsDetail: (owner, repo, query, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/pulls`, + method: "GET", + query: query, + format: "json", + ...params, + }), + /** + * @description Create a pull request. + * + * @name PullsCreate + * @request POST:/repos/{owner}/{repo}/pulls + */ + pullsCreate: (owner, repo, body, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/pulls`, + method: "POST", + body: body, + type: ContentType.Json, + format: "json", + ...params, + }), + /** + * @description List comments in a repository. By default, Review Comments are ordered by ascending ID. + * + * @name PullsCommentsDetail + * @request GET:/repos/{owner}/{repo}/pulls/comments + */ + pullsCommentsDetail: (owner, repo, query, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/pulls/comments`, + method: "GET", + query: query, + format: "json", + ...params, + }), + /** + * @description Delete a comment. + * + * @name PullsCommentsDelete + * @request DELETE:/repos/{owner}/{repo}/pulls/comments/{commentId} + */ + pullsCommentsDelete: (owner, repo, commentId, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/pulls/comments/${commentId}`, + method: "DELETE", + ...params, + }), + /** + * @description Get a single comment. + * + * @name PullsCommentsDetail2 + * @request GET:/repos/{owner}/{repo}/pulls/comments/{commentId} + * @originalName pullsCommentsDetail + * @duplicate + */ + pullsCommentsDetail2: (owner, repo, commentId, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/pulls/comments/${commentId}`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description Edit a comment. + * + * @name PullsCommentsPartialUpdate + * @request PATCH:/repos/{owner}/{repo}/pulls/comments/{commentId} + */ + pullsCommentsPartialUpdate: (owner, repo, commentId, body, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/pulls/comments/${commentId}`, + method: "PATCH", + body: body, + format: "json", + ...params, + }), + /** + * @description Get a single pull request. + * + * @name PullsDetail2 + * @request GET:/repos/{owner}/{repo}/pulls/{number} + * @originalName pullsDetail + * @duplicate + */ + pullsDetail2: (owner, repo, number, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/pulls/${number}`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description Update a pull request. + * + * @name PullsPartialUpdate + * @request PATCH:/repos/{owner}/{repo}/pulls/{number} + */ + pullsPartialUpdate: (owner, repo, number, body, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/pulls/${number}`, + method: "PATCH", + body: body, + type: ContentType.Json, + format: "json", + ...params, + }), + /** + * @description List comments on a pull request. + * + * @name PullsCommentsDetail3 + * @request GET:/repos/{owner}/{repo}/pulls/{number}/comments + * @originalName pullsCommentsDetail + * @duplicate + */ + pullsCommentsDetail3: (owner, repo, number, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/pulls/${number}/comments`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description Create a comment. #TODO Alternative input ( http://developer.github.com/v3/pulls/comments/ ) description: | Alternative Input. Instead of passing commit_id, path, and position you can reply to an existing Pull Request Comment like this: body Required string in_reply_to Required number - Comment id to reply to. + * + * @name PullsCommentsCreate + * @request POST:/repos/{owner}/{repo}/pulls/{number}/comments + */ + pullsCommentsCreate: (owner, repo, number, body, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/pulls/${number}/comments`, + method: "POST", + body: body, + type: ContentType.Json, + format: "json", + ...params, + }), + /** + * @description List commits on a pull request. + * + * @name PullsCommitsDetail + * @request GET:/repos/{owner}/{repo}/pulls/{number}/commits + */ + pullsCommitsDetail: (owner, repo, number, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/pulls/${number}/commits`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description List pull requests files. + * + * @name PullsFilesDetail + * @request GET:/repos/{owner}/{repo}/pulls/{number}/files + */ + pullsFilesDetail: (owner, repo, number, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/pulls/${number}/files`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description Get if a pull request has been merged. + * + * @name PullsMergeDetail + * @request GET:/repos/{owner}/{repo}/pulls/{number}/merge + */ + pullsMergeDetail: (owner, repo, number, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/pulls/${number}/merge`, + method: "GET", + ...params, + }), + /** + * @description Merge a pull request (Merge Button's) + * + * @name PullsMergeUpdate + * @request PUT:/repos/{owner}/{repo}/pulls/{number}/merge + */ + pullsMergeUpdate: (owner, repo, number, body, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/pulls/${number}/merge`, + method: "PUT", + body: body, + type: ContentType.Json, + format: "json", + ...params, + }), + /** + * @description Get the README. This method returns the preferred README for a repository. + * + * @name ReadmeDetail + * @request GET:/repos/{owner}/{repo}/readme + */ + readmeDetail: (owner, repo, query, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/readme`, + method: "GET", + query: query, + format: "json", + ...params, + }), + /** + * @description Users with push access to the repository will receive all releases (i.e., published releases and draft releases). Users with pull access will receive published releases only + * + * @name ReleasesDetail + * @request GET:/repos/{owner}/{repo}/releases + */ + releasesDetail: (owner, repo, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/releases`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description Create a release Users with push access to the repository can create a release. + * + * @name ReleasesCreate + * @request POST:/repos/{owner}/{repo}/releases + */ + releasesCreate: (owner, repo, body, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/releases`, + method: "POST", + body: body, + format: "json", + ...params, + }), + /** + * @description Delete a release asset + * + * @name ReleasesAssetsDelete + * @request DELETE:/repos/{owner}/{repo}/releases/assets/{id} + */ + releasesAssetsDelete: (owner, repo, id, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/releases/assets/${id}`, + method: "DELETE", + ...params, + }), + /** + * @description Get a single release asset + * + * @name ReleasesAssetsDetail + * @request GET:/repos/{owner}/{repo}/releases/assets/{id} + */ + releasesAssetsDetail: (owner, repo, id, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/releases/assets/${id}`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description Edit a release asset Users with push access to the repository can edit a release asset. + * + * @name ReleasesAssetsPartialUpdate + * @request PATCH:/repos/{owner}/{repo}/releases/assets/{id} + */ + releasesAssetsPartialUpdate: (owner, repo, id, body, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/releases/assets/${id}`, + method: "PATCH", + body: body, + type: ContentType.Json, + format: "json", + ...params, + }), + /** + * @description Users with push access to the repository can delete a release. + * + * @name ReleasesDelete + * @request DELETE:/repos/{owner}/{repo}/releases/{id} + */ + releasesDelete: (owner, repo, id, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/releases/${id}`, + method: "DELETE", + ...params, + }), + /** + * @description Get a single release + * + * @name ReleasesDetail2 + * @request GET:/repos/{owner}/{repo}/releases/{id} + * @originalName releasesDetail + * @duplicate + */ + releasesDetail2: (owner, repo, id, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/releases/${id}`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description Users with push access to the repository can edit a release + * + * @name ReleasesPartialUpdate + * @request PATCH:/repos/{owner}/{repo}/releases/{id} + */ + releasesPartialUpdate: (owner, repo, id, body, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/releases/${id}`, + method: "PATCH", + body: body, + format: "json", + ...params, + }), + /** + * @description List assets for a release + * + * @name ReleasesAssetsDetail2 + * @request GET:/repos/{owner}/{repo}/releases/{id}/assets + * @originalName releasesAssetsDetail + * @duplicate + */ + releasesAssetsDetail2: (owner, repo, id, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/releases/${id}/assets`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description List Stargazers. + * + * @name StargazersDetail + * @request GET:/repos/{owner}/{repo}/stargazers + */ + stargazersDetail: (owner, repo, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/stargazers`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description Get the number of additions and deletions per week. Returns a weekly aggregate of the number of additions and deletions pushed to a repository. + * + * @name StatsCodeFrequencyDetail + * @request GET:/repos/{owner}/{repo}/stats/code_frequency + */ + statsCodeFrequencyDetail: (owner, repo, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/stats/code_frequency`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description Get the last year of commit activity data. Returns the last year of commit activity grouped by week. The days array is a group of commits per day, starting on Sunday. + * + * @name StatsCommitActivityDetail + * @request GET:/repos/{owner}/{repo}/stats/commit_activity + */ + statsCommitActivityDetail: (owner, repo, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/stats/commit_activity`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description Get contributors list with additions, deletions, and commit counts. + * + * @name StatsContributorsDetail + * @request GET:/repos/{owner}/{repo}/stats/contributors + */ + statsContributorsDetail: (owner, repo, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/stats/contributors`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description Get the weekly commit count for the repo owner and everyone else. + * + * @name StatsParticipationDetail + * @request GET:/repos/{owner}/{repo}/stats/participation + */ + statsParticipationDetail: (owner, repo, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/stats/participation`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description Get the number of commits per hour in each day. Each array contains the day number, hour number, and number of commits 0-6 Sunday - Saturday 0-23 Hour of day Number of commits For example, [2, 14, 25] indicates that there were 25 total commits, during the 2.00pm hour on Tuesdays. All times are based on the time zone of individual commits. + * + * @name StatsPunchCardDetail + * @request GET:/repos/{owner}/{repo}/stats/punch_card + */ + statsPunchCardDetail: (owner, repo, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/stats/punch_card`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description List Statuses for a specific Ref. + * + * @name StatusesDetail + * @request GET:/repos/{owner}/{repo}/statuses/{ref} + */ + statusesDetail: (owner, repo, ref, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/statuses/${ref}`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description Create a Status. + * + * @name StatusesCreate + * @request POST:/repos/{owner}/{repo}/statuses/{ref} + */ + statusesCreate: (owner, repo, ref, body, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/statuses/${ref}`, + method: "POST", + body: body, + type: ContentType.Json, + format: "json", + ...params, + }), + /** + * @description List watchers. + * + * @name SubscribersDetail + * @request GET:/repos/{owner}/{repo}/subscribers + */ + subscribersDetail: (owner, repo, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/subscribers`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description Delete a Repository Subscription. + * + * @name SubscriptionDelete + * @request DELETE:/repos/{owner}/{repo}/subscription + */ + subscriptionDelete: (owner, repo, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/subscription`, + method: "DELETE", + ...params, + }), + /** + * @description Get a Repository Subscription. + * + * @name SubscriptionDetail + * @request GET:/repos/{owner}/{repo}/subscription + */ + subscriptionDetail: (owner, repo, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/subscription`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description Set a Repository Subscription + * + * @name SubscriptionUpdate + * @request PUT:/repos/{owner}/{repo}/subscription + */ + subscriptionUpdate: (owner, repo, body, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/subscription`, + method: "PUT", + body: body, + type: ContentType.Json, + format: "json", + ...params, + }), + /** + * @description Get list of tags. + * + * @name TagsDetail + * @request GET:/repos/{owner}/{repo}/tags + */ + tagsDetail: (owner, repo, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/tags`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description Get list of teams + * + * @name TeamsDetail + * @request GET:/repos/{owner}/{repo}/teams + */ + teamsDetail: (owner, repo, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/teams`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description List Stargazers. New implementation. + * + * @name WatchersDetail + * @request GET:/repos/{owner}/{repo}/watchers + */ + watchersDetail: (owner, repo, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/watchers`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description Get archive link. This method will return a 302 to a URL to download a tarball or zipball archive for a repository. Please make sure your HTTP framework is configured to follow redirects or you will need to use the Location header to make a second GET request. Note: For private repositories, these links are temporary and expire quickly. + * + * @name ReposDetail2 + * @request GET:/repos/{owner}/{repo}/{archive_format}/{path} + * @originalName reposDetail + * @duplicate + */ + reposDetail2: (owner, repo, archiveFormat, path, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/${archiveFormat}/${path}`, + method: "GET", + ...params, + }), + }; + repositories = { + /** + * @description List all public repositories. This provides a dump of every public repository, in the order that they were created. Note: Pagination is powered exclusively by the since parameter. is the Link header to get the URL for the next page of repositories. + * + * @name RepositoriesList + * @request GET:/repositories + */ + repositoriesList: (query, params = {}) => + this.request({ + path: `/repositories`, + method: "GET", + query: query, + format: "json", + ...params, + }), + }; + search = { + /** + * @description Search code. + * + * @name CodeList + * @request GET:/search/code + */ + codeList: (query, params = {}) => + this.request({ + path: `/search/code`, + method: "GET", + query: query, + format: "json", + ...params, + }), + /** + * @description Find issues by state and keyword. (This method returns up to 100 results per page.) + * + * @name IssuesList + * @request GET:/search/issues + */ + issuesList: (query, params = {}) => + this.request({ + path: `/search/issues`, + method: "GET", + query: query, + format: "json", + ...params, + }), + /** + * @description Search repositories. + * + * @name RepositoriesList + * @request GET:/search/repositories + */ + repositoriesList: (query, params = {}) => + this.request({ + path: `/search/repositories`, + method: "GET", + query: query, + format: "json", + ...params, + }), + /** + * @description Search users. + * + * @name UsersList + * @request GET:/search/users + */ + usersList: (query, params = {}) => + this.request({ + path: `/search/users`, + method: "GET", + query: query, + format: "json", + ...params, + }), + }; + teams = { + /** + * @description Delete team. In order to delete a team, the authenticated user must be an owner of the org that the team is associated with. + * + * @name TeamsDelete + * @request DELETE:/teams/{teamId} + */ + teamsDelete: (teamId, params = {}) => + this.request({ + path: `/teams/${teamId}`, + method: "DELETE", + ...params, + }), + /** + * @description Get team. + * + * @name TeamsDetail + * @request GET:/teams/{teamId} + */ + teamsDetail: (teamId, params = {}) => + this.request({ + path: `/teams/${teamId}`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description Edit team. In order to edit a team, the authenticated user must be an owner of the org that the team is associated with. + * + * @name TeamsPartialUpdate + * @request PATCH:/teams/{teamId} + */ + teamsPartialUpdate: (teamId, body, params = {}) => + this.request({ + path: `/teams/${teamId}`, + method: "PATCH", + body: body, + type: ContentType.Json, + format: "json", + ...params, + }), + /** + * @description List team members. In order to list members in a team, the authenticated user must be a member of the team. + * + * @name MembersDetail + * @request GET:/teams/{teamId}/members + */ + membersDetail: (teamId, params = {}) => + this.request({ + path: `/teams/${teamId}/members`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description The "Remove team member" API is deprecated and is scheduled for removal in the next major version of the API. We recommend using the Remove team membership API instead. It allows you to remove both active and pending memberships. Remove team member. In order to remove a user from a team, the authenticated user must have 'admin' permissions to the team or be an owner of the org that the team is associated with. NOTE This does not delete the user, it just remove them from the team. + * + * @name MembersDelete + * @request DELETE:/teams/{teamId}/members/{username} + * @deprecated + */ + membersDelete: (teamId, username, params = {}) => + this.request({ + path: `/teams/${teamId}/members/${username}`, + method: "DELETE", + ...params, + }), + /** + * @description The "Get team member" API is deprecated and is scheduled for removal in the next major version of the API. We recommend using the Get team membership API instead. It allows you to get both active and pending memberships. Get team member. In order to get if a user is a member of a team, the authenticated user mus be a member of the team. + * + * @name MembersDetail2 + * @request GET:/teams/{teamId}/members/{username} + * @deprecated + * @originalName membersDetail + * @duplicate + */ + membersDetail2: (teamId, username, params = {}) => + this.request({ + path: `/teams/${teamId}/members/${username}`, + method: "GET", + ...params, + }), + /** + * @description The API (described below) is deprecated and is scheduled for removal in the next major version of the API. We recommend using the Add team membership API instead. It allows you to invite new organization members to your teams. Add team member. In order to add a user to a team, the authenticated user must have 'admin' permissions to the team or be an owner of the org that the team is associated with. + * + * @name MembersUpdate + * @request PUT:/teams/{teamId}/members/{username} + * @deprecated + */ + membersUpdate: (teamId, username, params = {}) => + this.request({ + path: `/teams/${teamId}/members/${username}`, + method: "PUT", + ...params, + }), + /** + * @description Remove team membership. In order to remove a membership between a user and a team, the authenticated user must have 'admin' permissions to the team or be an owner of the organization that the team is associated with. NOTE: This does not delete the user, it just removes their membership from the team. + * + * @name MembershipsDelete + * @request DELETE:/teams/{teamId}/memberships/{username} + */ + membershipsDelete: (teamId, username, params = {}) => + this.request({ + path: `/teams/${teamId}/memberships/${username}`, + method: "DELETE", + ...params, + }), + /** + * @description Get team membership. In order to get a user's membership with a team, the authenticated user must be a member of the team or an owner of the team's organization. + * + * @name MembershipsDetail + * @request GET:/teams/{teamId}/memberships/{username} + */ + membershipsDetail: (teamId, username, params = {}) => + this.request({ + path: `/teams/${teamId}/memberships/${username}`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description Add team membership. In order to add a membership between a user and a team, the authenticated user must have 'admin' permissions to the team or be an owner of the organization that the team is associated with. If the user is already a part of the team's organization (meaning they're on at least one other team in the organization), this endpoint will add the user to the team. If the user is completely unaffiliated with the team's organization (meaning they're on none of the organization's teams), this endpoint will send an invitation to the user via email. This newly-created membership will be in the 'pending' state until the user accepts the invitation, at which point the membership will transition to the 'active' state and the user will be added as a member of the team. + * + * @name MembershipsUpdate + * @request PUT:/teams/{teamId}/memberships/{username} + */ + membershipsUpdate: (teamId, username, params = {}) => + this.request({ + path: `/teams/${teamId}/memberships/${username}`, + method: "PUT", + format: "json", + ...params, + }), + /** + * @description List team repos + * + * @name ReposDetail + * @request GET:/teams/{teamId}/repos + */ + reposDetail: (teamId, params = {}) => + this.request({ + path: `/teams/${teamId}/repos`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description In order to remove a repository from a team, the authenticated user must be an owner of the org that the team is associated with. NOTE: This does not delete the repository, it just removes it from the team. + * + * @name ReposDelete + * @request DELETE:/teams/{teamId}/repos/{owner}/{repo} + */ + reposDelete: (teamId, owner, repo, params = {}) => + this.request({ + path: `/teams/${teamId}/repos/${owner}/${repo}`, + method: "DELETE", + ...params, + }), + /** + * @description Check if a team manages a repository + * + * @name ReposDetail2 + * @request GET:/teams/{teamId}/repos/{owner}/{repo} + * @originalName reposDetail + * @duplicate + */ + reposDetail2: (teamId, owner, repo, params = {}) => + this.request({ + path: `/teams/${teamId}/repos/${owner}/${repo}`, + method: "GET", + ...params, + }), + /** + * @description In order to add a repository to a team, the authenticated user must be an owner of the org that the team is associated with. Also, the repository must be owned by the organization, or a direct fork of a repository owned by the organization. + * + * @name ReposUpdate + * @request PUT:/teams/{teamId}/repos/{owner}/{repo} + */ + reposUpdate: (teamId, owner, repo, params = {}) => + this.request({ + path: `/teams/${teamId}/repos/${owner}/${repo}`, + method: "PUT", + ...params, + }), + }; + user = { + /** + * @description Get the authenticated user. + * + * @name UserList + * @request GET:/user + */ + userList: (params = {}) => + this.request({ + path: `/user`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description Update the authenticated user. + * + * @name UserPartialUpdate + * @request PATCH:/user + */ + userPartialUpdate: (body, params = {}) => + this.request({ + path: `/user`, + method: "PATCH", + body: body, + type: ContentType.Json, + format: "json", + ...params, + }), + /** + * @description Delete email address(es). You can include a single email address or an array of addresses. + * + * @name EmailsDelete + * @request DELETE:/user/emails + */ + emailsDelete: (body, params = {}) => + this.request({ + path: `/user/emails`, + method: "DELETE", + body: body, + type: ContentType.Json, + ...params, + }), + /** + * @description List email addresses for a user. In the final version of the API, this method will return an array of hashes with extended information for each email address indicating if the address has been verified and if it's primary email address for GitHub. Until API v3 is finalized, use the application/vnd.github.v3 media type to get other response format. + * + * @name EmailsList + * @request GET:/user/emails + */ + emailsList: (params = {}) => + this.request({ + path: `/user/emails`, + method: "GET", + ...params, + }), + /** + * @description Add email address(es). You can post a single email address or an array of addresses. + * + * @name EmailsCreate + * @request POST:/user/emails + */ + emailsCreate: (body, params = {}) => + this.request({ + path: `/user/emails`, + method: "POST", + body: body, + ...params, + }), + /** + * @description List the authenticated user's followers + * + * @name FollowersList + * @request GET:/user/followers + */ + followersList: (params = {}) => + this.request({ + path: `/user/followers`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description List who the authenticated user is following. + * + * @name FollowingList + * @request GET:/user/following + */ + followingList: (params = {}) => + this.request({ + path: `/user/following`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description Unfollow a user. Unfollowing a user requires the user to be logged in and authenticated with basic auth or OAuth with the user:follow scope. + * + * @name FollowingDelete + * @request DELETE:/user/following/{username} + */ + followingDelete: (username, params = {}) => + this.request({ + path: `/user/following/${username}`, + method: "DELETE", + ...params, + }), + /** + * @description Check if you are following a user. + * + * @name FollowingDetail + * @request GET:/user/following/{username} + */ + followingDetail: (username, params = {}) => + this.request({ + path: `/user/following/${username}`, + method: "GET", + ...params, + }), + /** + * @description Follow a user. Following a user requires the user to be logged in and authenticated with basic auth or OAuth with the user:follow scope. + * + * @name FollowingUpdate + * @request PUT:/user/following/{username} + */ + followingUpdate: (username, params = {}) => + this.request({ + path: `/user/following/${username}`, + method: "PUT", + ...params, + }), + /** + * @description List issues. List all issues across owned and member repositories for the authenticated user. + * + * @name IssuesList + * @request GET:/user/issues + */ + issuesList: (query, params = {}) => + this.request({ + path: `/user/issues`, + method: "GET", + query: query, + format: "json", + ...params, + }), + /** + * @description List your public keys. Lists the current user's keys. Management of public keys via the API requires that you are authenticated through basic auth, or OAuth with the 'user', 'write:public_key' scopes. + * + * @name KeysList + * @request GET:/user/keys + */ + keysList: (params = {}) => + this.request({ + path: `/user/keys`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description Create a public key. + * + * @name KeysCreate + * @request POST:/user/keys + */ + keysCreate: (body, params = {}) => + this.request({ + path: `/user/keys`, + method: "POST", + body: body, + format: "json", + ...params, + }), + /** + * @description Delete a public key. Removes a public key. Requires that you are authenticated via Basic Auth or via OAuth with at least admin:public_key scope. + * + * @name KeysDelete + * @request DELETE:/user/keys/{keyId} + */ + keysDelete: (keyId, params = {}) => + this.request({ + path: `/user/keys/${keyId}`, + method: "DELETE", + ...params, + }), + /** + * @description Get a single public key. + * + * @name KeysDetail + * @request GET:/user/keys/{keyId} + */ + keysDetail: (keyId, params = {}) => + this.request({ + path: `/user/keys/${keyId}`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description List public and private organizations for the authenticated user. + * + * @name OrgsList + * @request GET:/user/orgs + */ + orgsList: (params = {}) => + this.request({ + path: `/user/orgs`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description List repositories for the authenticated user. Note that this does not include repositories owned by organizations which the user can access. You can lis user organizations and list organization repositories separately. + * + * @name ReposList + * @request GET:/user/repos + */ + reposList: (query, params = {}) => + this.request({ + path: `/user/repos`, + method: "GET", + query: query, + format: "json", + ...params, + }), + /** + * @description Create a new repository for the authenticated user. OAuth users must supply repo scope. + * + * @name ReposCreate + * @request POST:/user/repos + */ + reposCreate: (body, params = {}) => + this.request({ + path: `/user/repos`, + method: "POST", + body: body, + format: "json", + ...params, + }), + /** + * @description List repositories being starred by the authenticated user. + * + * @name StarredList + * @request GET:/user/starred + */ + starredList: (query, params = {}) => + this.request({ + path: `/user/starred`, + method: "GET", + query: query, + format: "json", + ...params, + }), + /** + * @description Unstar a repository + * + * @name StarredDelete + * @request DELETE:/user/starred/{owner}/{repo} + */ + starredDelete: (owner, repo, params = {}) => + this.request({ + path: `/user/starred/${owner}/${repo}`, + method: "DELETE", + ...params, + }), + /** + * @description Check if you are starring a repository. + * + * @name StarredDetail + * @request GET:/user/starred/{owner}/{repo} + */ + starredDetail: (owner, repo, params = {}) => + this.request({ + path: `/user/starred/${owner}/${repo}`, + method: "GET", + ...params, + }), + /** + * @description Star a repository. + * + * @name StarredUpdate + * @request PUT:/user/starred/{owner}/{repo} + */ + starredUpdate: (owner, repo, params = {}) => + this.request({ + path: `/user/starred/${owner}/${repo}`, + method: "PUT", + ...params, + }), + /** + * @description List repositories being watched by the authenticated user. + * + * @name SubscriptionsList + * @request GET:/user/subscriptions + */ + subscriptionsList: (params = {}) => + this.request({ + path: `/user/subscriptions`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description Stop watching a repository + * + * @name SubscriptionsDelete + * @request DELETE:/user/subscriptions/{owner}/{repo} + * @deprecated + */ + subscriptionsDelete: (owner, repo, params = {}) => + this.request({ + path: `/user/subscriptions/${owner}/${repo}`, + method: "DELETE", + ...params, + }), + /** + * @description Check if you are watching a repository. + * + * @name SubscriptionsDetail + * @request GET:/user/subscriptions/{owner}/{repo} + * @deprecated + */ + subscriptionsDetail: (owner, repo, params = {}) => + this.request({ + path: `/user/subscriptions/${owner}/${repo}`, + method: "GET", + ...params, + }), + /** + * @description Watch a repository. + * + * @name SubscriptionsUpdate + * @request PUT:/user/subscriptions/{owner}/{repo} + * @deprecated + */ + subscriptionsUpdate: (owner, repo, params = {}) => + this.request({ + path: `/user/subscriptions/${owner}/${repo}`, + method: "PUT", + ...params, + }), + /** + * @description List all of the teams across all of the organizations to which the authenticated user belongs. This method requires user or repo scope when authenticating via OAuth. + * + * @name TeamsList + * @request GET:/user/teams + */ + teamsList: (params = {}) => + this.request({ + path: `/user/teams`, + method: "GET", + format: "json", + ...params, + }), + }; + users = { + /** + * @description Get all users. This provides a dump of every user, in the order that they signed up for GitHub. Note: Pagination is powered exclusively by the since parameter. Use the Link header to get the URL for the next page of users. + * + * @name UsersList + * @request GET:/users + */ + usersList: (query, params = {}) => + this.request({ + path: `/users`, + method: "GET", + query: query, + format: "json", + ...params, + }), + /** + * @description Get a single user. + * + * @name UsersDetail + * @request GET:/users/{username} + */ + usersDetail: (username, params = {}) => + this.request({ + path: `/users/${username}`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description If you are authenticated as the given user, you will see your private events. Otherwise, you'll only see public events. + * + * @name EventsDetail + * @request GET:/users/{username}/events + */ + eventsDetail: (username, params = {}) => + this.request({ + path: `/users/${username}/events`, + method: "GET", + ...params, + }), + /** + * @description This is the user's organization dashboard. You must be authenticated as the user to view this. + * + * @name EventsOrgsDetail + * @request GET:/users/{username}/events/orgs/{org} + */ + eventsOrgsDetail: (username, org, params = {}) => + this.request({ + path: `/users/${username}/events/orgs/${org}`, + method: "GET", + ...params, + }), + /** + * @description List a user's followers + * + * @name FollowersDetail + * @request GET:/users/{username}/followers + */ + followersDetail: (username, params = {}) => + this.request({ + path: `/users/${username}/followers`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description Check if one user follows another. + * + * @name FollowingDetail + * @request GET:/users/{username}/following/{targetUser} + */ + followingDetail: (username, targetUser, params = {}) => + this.request({ + path: `/users/${username}/following/${targetUser}`, + method: "GET", + ...params, + }), + /** + * @description List a users gists. + * + * @name GistsDetail + * @request GET:/users/{username}/gists + */ + gistsDetail: (username, query, params = {}) => + this.request({ + path: `/users/${username}/gists`, + method: "GET", + query: query, + format: "json", + ...params, + }), + /** + * @description List public keys for a user. Lists the verified public keys for a user. This is accessible by anyone. + * + * @name KeysDetail + * @request GET:/users/{username}/keys + */ + keysDetail: (username, params = {}) => + this.request({ + path: `/users/${username}/keys`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description List all public organizations for a user. + * + * @name OrgsDetail + * @request GET:/users/{username}/orgs + */ + orgsDetail: (username, params = {}) => + this.request({ + path: `/users/${username}/orgs`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description These are events that you'll only see public events. + * + * @name ReceivedEventsDetail + * @request GET:/users/{username}/received_events + */ + receivedEventsDetail: (username, params = {}) => + this.request({ + path: `/users/${username}/received_events`, + method: "GET", + ...params, + }), + /** + * @description List public events that a user has received + * + * @name ReceivedEventsPublicDetail + * @request GET:/users/{username}/received_events/public + */ + receivedEventsPublicDetail: (username, params = {}) => + this.request({ + path: `/users/${username}/received_events/public`, + method: "GET", + ...params, + }), + /** + * @description List public repositories for the specified user. + * + * @name ReposDetail + * @request GET:/users/{username}/repos + */ + reposDetail: (username, query, params = {}) => + this.request({ + path: `/users/${username}/repos`, + method: "GET", + query: query, + format: "json", + ...params, + }), + /** + * @description List repositories being starred by a user. + * + * @name StarredDetail + * @request GET:/users/{username}/starred + */ + starredDetail: (username, params = {}) => + this.request({ + path: `/users/${username}/starred`, + method: "GET", + ...params, + }), + /** + * @description List repositories being watched by a user. + * + * @name SubscriptionsDetail + * @request GET:/users/{username}/subscriptions + */ + subscriptionsDetail: (username, params = {}) => + this.request({ + path: `/users/${username}/subscriptions`, + method: "GET", + ...params, + }), + }; } diff --git a/tests/spec/jsAxios/schema.d.ts b/tests/spec/jsAxios/schema.d.ts index e9c2e48e5..6c06f7528 100644 --- a/tests/spec/jsAxios/schema.d.ts +++ b/tests/spec/jsAxios/schema.d.ts @@ -1739,8 +1739,9 @@ export declare class HttpClient { private format?; constructor({ securityWorker, secure, format, ...axiosConfig }?: ApiConfig); setSecurityData: (data: SecurityDataType | null) => void; - private mergeRequestParams; - private createFormData; + protected mergeRequestParams(params1: AxiosRequestConfig, params2?: AxiosRequestConfig): AxiosRequestConfig; + protected stringifyFormItem(formItem: unknown): string; + protected createFormData(input: Record): FormData; request: ({ secure, path, @@ -1749,7 +1750,7 @@ export declare class HttpClient { format, body, ...params - }: FullRequestParams) => Promise; + }: FullRequestParams) => Promise>; } /** * @title GitHub diff --git a/tests/spec/jsAxios/schema.js b/tests/spec/jsAxios/schema.js index 5b6a5b6e5..b6aff87f3 100644 --- a/tests/spec/jsAxios/schema.js +++ b/tests/spec/jsAxios/schema.js @@ -17,55 +17,50 @@ export var ContentType; ContentType["UrlEncoded"] = "application/x-www-form-urlencoded"; })(ContentType || (ContentType = {})); export class HttpClient { + instance; + securityData = null; + securityWorker; + secure; + format; constructor({ securityWorker, secure, format, ...axiosConfig } = {}) { - this.securityData = null; - this.setSecurityData = (data) => { - this.securityData = data; - }; - this.request = async ({ secure, path, type, query, format, body, ...params }) => { - const secureParams = - ((typeof secure === "boolean" ? secure : this.secure) && - this.securityWorker && - (await this.securityWorker(this.securityData))) || - {}; - const requestParams = this.mergeRequestParams(params, secureParams); - const responseFormat = (format && this.format) || void 0; - if (type === ContentType.FormData && body && body !== null && typeof body === "object") { - requestParams.headers.common = { Accept: "*/*" }; - requestParams.headers.post = {}; - requestParams.headers.put = {}; - body = this.createFormData(body); - } - return this.instance.request({ - ...requestParams, - headers: { - ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), - ...(requestParams.headers || {}), - }, - params: query, - responseType: responseFormat, - data: body, - url: path, - }); - }; this.instance = axios.create({ ...axiosConfig, baseURL: axiosConfig.baseURL || "https://api.github.com" }); this.secure = secure; this.format = format; this.securityWorker = securityWorker; } + setSecurityData = (data) => { + this.securityData = data; + }; mergeRequestParams(params1, params2) { + const method = params1.method || (params2 && params2.method); return { ...this.instance.defaults, ...params1, ...(params2 || {}), headers: { - ...(this.instance.defaults.headers || {}), + ...((method && this.instance.defaults.headers[method.toLowerCase()]) || {}), ...(params1.headers || {}), ...((params2 && params2.headers) || {}), }, }; } + stringifyFormItem(formItem) { + if (typeof formItem === "object" && formItem !== null) { + return JSON.stringify(formItem); + } else { + return `${formItem}`; + } + } createFormData(input) { + return Object.keys(input || {}).reduce((formData, key) => { + const property = input[key]; + const propertyContent = property instanceof Array ? property : [property]; + for (const formItem of propertyContent) { + const isFileType = formItem instanceof Blob || formItem instanceof File; + formData.append(key, isFileType ? formItem : this.stringifyFormItem(formItem)); + } + return formData; + }, new FormData()); return Object.keys(input || {}).reduce((formData, key) => { const property = input[key]; formData.append( @@ -79,6 +74,29 @@ export class HttpClient { return formData; }, new FormData()); } + request = async ({ secure, path, type, query, format, body, ...params }) => { + const secureParams = + ((typeof secure === "boolean" ? secure : this.secure) && + this.securityWorker && + (await this.securityWorker(this.securityData))) || + {}; + const requestParams = this.mergeRequestParams(params, secureParams); + const responseFormat = format || this.format || undefined; + if (type === ContentType.FormData && body && body !== null && typeof body === "object") { + body = this.createFormData(body); + } + return this.instance.request({ + ...requestParams, + headers: { + ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), + ...(requestParams.headers || {}), + }, + params: query, + responseType: responseFormat, + data: body, + url: path, + }); + }; } /** * @title GitHub @@ -90,3336 +108,3333 @@ export class HttpClient { * Powerful collaboration, code review, and code management for open source and private projects. */ export class Api extends HttpClient { - constructor() { - super(...arguments); - this.emojis = { - /** - * @description Lists all the emojis available to use on GitHub. - * - * @name EmojisList - * @request GET:/emojis - */ - emojisList: (params = {}) => - this.request({ - path: `/emojis`, - method: "GET", - format: "json", - ...params, - }), - }; - this.events = { - /** - * @description List public events. - * - * @name EventsList - * @request GET:/events - */ - eventsList: (params = {}) => - this.request({ - path: `/events`, - method: "GET", - format: "json", - ...params, - }), - }; - this.feeds = { - /** - * @description List Feeds. GitHub provides several timeline resources in Atom format. The Feeds API lists all the feeds available to the authenticating user. - * - * @name FeedsList - * @request GET:/feeds - */ - feedsList: (params = {}) => - this.request({ - path: `/feeds`, - method: "GET", - format: "json", - ...params, - }), - }; - this.gists = { - /** - * @description List the authenticated user's gists or if called anonymously, this will return all public gists. - * - * @name GistsList - * @request GET:/gists - */ - gistsList: (query, params = {}) => - this.request({ - path: `/gists`, - method: "GET", - query: query, - format: "json", - ...params, - }), - /** - * @description Create a gist. - * - * @name GistsCreate - * @request POST:/gists - */ - gistsCreate: (body, params = {}) => - this.request({ - path: `/gists`, - method: "POST", - body: body, - type: ContentType.Json, - format: "json", - ...params, - }), - /** - * @description List all public gists. - * - * @name PublicList - * @request GET:/gists/public - */ - publicList: (query, params = {}) => - this.request({ - path: `/gists/public`, - method: "GET", - query: query, - format: "json", - ...params, - }), - /** - * @description List the authenticated user's starred gists. - * - * @name StarredList - * @request GET:/gists/starred - */ - starredList: (query, params = {}) => - this.request({ - path: `/gists/starred`, - method: "GET", - query: query, - format: "json", - ...params, - }), - /** - * @description Delete a gist. - * - * @name GistsDelete - * @request DELETE:/gists/{id} - */ - gistsDelete: (id, params = {}) => - this.request({ - path: `/gists/${id}`, - method: "DELETE", - ...params, - }), - /** - * @description Get a single gist. - * - * @name GistsDetail - * @request GET:/gists/{id} - */ - gistsDetail: (id, params = {}) => - this.request({ - path: `/gists/${id}`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description Edit a gist. - * - * @name GistsPartialUpdate - * @request PATCH:/gists/{id} - */ - gistsPartialUpdate: (id, body, params = {}) => - this.request({ - path: `/gists/${id}`, - method: "PATCH", - body: body, - type: ContentType.Json, - format: "json", - ...params, - }), - /** - * @description List comments on a gist. - * - * @name CommentsDetail - * @request GET:/gists/{id}/comments - */ - commentsDetail: (id, params = {}) => - this.request({ - path: `/gists/${id}/comments`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description Create a commen - * - * @name CommentsCreate - * @request POST:/gists/{id}/comments - */ - commentsCreate: (id, body, params = {}) => - this.request({ - path: `/gists/${id}/comments`, - method: "POST", - body: body, - format: "json", - ...params, - }), - /** - * @description Delete a comment. - * - * @name CommentsDelete - * @request DELETE:/gists/{id}/comments/{commentId} - */ - commentsDelete: (id, commentId, params = {}) => - this.request({ - path: `/gists/${id}/comments/${commentId}`, - method: "DELETE", - ...params, - }), - /** - * @description Get a single comment. - * - * @name CommentsDetail2 - * @request GET:/gists/{id}/comments/{commentId} - * @originalName commentsDetail - * @duplicate - */ - commentsDetail2: (id, commentId, params = {}) => - this.request({ - path: `/gists/${id}/comments/${commentId}`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description Edit a comment. - * - * @name CommentsPartialUpdate - * @request PATCH:/gists/{id}/comments/{commentId} - */ - commentsPartialUpdate: (id, commentId, body, params = {}) => - this.request({ - path: `/gists/${id}/comments/${commentId}`, - method: "PATCH", - body: body, - type: ContentType.Json, - format: "json", - ...params, - }), - /** - * @description Fork a gist. - * - * @name ForksCreate - * @request POST:/gists/{id}/forks - */ - forksCreate: (id, params = {}) => - this.request({ - path: `/gists/${id}/forks`, - method: "POST", - ...params, - }), - /** - * @description Unstar a gist. - * - * @name StarDelete - * @request DELETE:/gists/{id}/star - */ - starDelete: (id, params = {}) => - this.request({ - path: `/gists/${id}/star`, - method: "DELETE", - ...params, - }), - /** - * @description Check if a gist is starred. - * - * @name StarDetail - * @request GET:/gists/{id}/star - */ - starDetail: (id, params = {}) => - this.request({ - path: `/gists/${id}/star`, - method: "GET", - ...params, - }), - /** - * @description Star a gist. - * - * @name StarUpdate - * @request PUT:/gists/{id}/star - */ - starUpdate: (id, params = {}) => - this.request({ - path: `/gists/${id}/star`, - method: "PUT", - ...params, - }), - }; - this.gitignore = { - /** - * @description Listing available templates. List all templates available to pass as an option when creating a repository. - * - * @name TemplatesList - * @request GET:/gitignore/templates - */ - templatesList: (params = {}) => - this.request({ - path: `/gitignore/templates`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description Get a single template. - * - * @name TemplatesDetail - * @request GET:/gitignore/templates/{language} - */ - templatesDetail: (language, params = {}) => - this.request({ - path: `/gitignore/templates/${language}`, - method: "GET", - format: "json", - ...params, - }), - }; - this.issues = { - /** - * @description List issues. List all issues across all the authenticated user's visible repositories. - * - * @name IssuesList - * @request GET:/issues - */ - issuesList: (query, params = {}) => - this.request({ - path: `/issues`, - method: "GET", - query: query, - format: "json", - ...params, - }), - }; - this.legacy = { - /** - * @description Find issues by state and keyword. - * - * @name IssuesSearchDetail - * @request GET:/legacy/issues/search/{owner}/{repository}/{state}/{keyword} - * @deprecated - */ - issuesSearchDetail: (keyword, state, owner, repository, params = {}) => - this.request({ - path: `/legacy/issues/search/${owner}/${repository}/${state}/${keyword}`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description Find repositories by keyword. Note, this legacy method does not follow the v3 pagination pattern. This method returns up to 100 results per page and pages can be fetched using the start_page parameter. - * - * @name ReposSearchDetail - * @request GET:/legacy/repos/search/{keyword} - * @deprecated - */ - reposSearchDetail: (keyword, query, params = {}) => - this.request({ - path: `/legacy/repos/search/${keyword}`, - method: "GET", - query: query, - format: "json", - ...params, - }), - /** - * @description This API call is added for compatibility reasons only. - * - * @name UserEmailDetail - * @request GET:/legacy/user/email/{email} - * @deprecated - */ - userEmailDetail: (email, params = {}) => - this.request({ - path: `/legacy/user/email/${email}`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description Find users by keyword. - * - * @name UserSearchDetail - * @request GET:/legacy/user/search/{keyword} - * @deprecated - */ - userSearchDetail: (keyword, query, params = {}) => - this.request({ - path: `/legacy/user/search/${keyword}`, - method: "GET", - query: query, - format: "json", - ...params, - }), - }; - this.markdown = { - /** - * @description Render an arbitrary Markdown document - * - * @name MarkdownCreate - * @request POST:/markdown - */ - markdownCreate: (body, params = {}) => - this.request({ - path: `/markdown`, - method: "POST", - body: body, - type: ContentType.Json, - ...params, - }), - /** - * @description Render a Markdown document in raw mode - * - * @name PostMarkdown - * @request POST:/markdown/raw - */ - postMarkdown: (params = {}) => - this.request({ - path: `/markdown/raw`, - method: "POST", - ...params, - }), - }; - this.meta = { - /** - * @description This gives some information about GitHub.com, the service. - * - * @name MetaList - * @request GET:/meta - */ - metaList: (params = {}) => - this.request({ - path: `/meta`, - method: "GET", - format: "json", - ...params, - }), - }; - this.networks = { - /** - * @description List public events for a network of repositories. - * - * @name EventsDetail - * @request GET:/networks/{owner}/{repo}/events - */ - eventsDetail: (owner, repo, params = {}) => - this.request({ - path: `/networks/${owner}/${repo}/events`, - method: "GET", - format: "json", - ...params, - }), - }; - this.notifications = { - /** - * @description List your notifications. List all notifications for the current user, grouped by repository. - * - * @name NotificationsList - * @request GET:/notifications - */ - notificationsList: (query, params = {}) => - this.request({ - path: `/notifications`, - method: "GET", - query: query, - format: "json", - ...params, - }), - /** - * @description Mark as read. Marking a notification as "read" removes it from the default view on GitHub.com. - * - * @name NotificationsUpdate - * @request PUT:/notifications - */ - notificationsUpdate: (body, params = {}) => - this.request({ - path: `/notifications`, - method: "PUT", - body: body, - ...params, - }), - /** - * @description View a single thread. - * - * @name ThreadsDetail - * @request GET:/notifications/threads/{id} - */ - threadsDetail: (id, params = {}) => - this.request({ - path: `/notifications/threads/${id}`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description Mark a thread as read - * - * @name ThreadsPartialUpdate - * @request PATCH:/notifications/threads/{id} - */ - threadsPartialUpdate: (id, params = {}) => - this.request({ - path: `/notifications/threads/${id}`, - method: "PATCH", - ...params, - }), - /** - * @description Delete a Thread Subscription. - * - * @name ThreadsSubscriptionDelete - * @request DELETE:/notifications/threads/{id}/subscription - */ - threadsSubscriptionDelete: (id, params = {}) => - this.request({ - path: `/notifications/threads/${id}/subscription`, - method: "DELETE", - ...params, - }), - /** - * @description Get a Thread Subscription. - * - * @name ThreadsSubscriptionDetail - * @request GET:/notifications/threads/{id}/subscription - */ - threadsSubscriptionDetail: (id, params = {}) => - this.request({ - path: `/notifications/threads/${id}/subscription`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description Set a Thread Subscription. This lets you subscribe to a thread, or ignore it. Subscribing to a thread is unnecessary if the user is already subscribed to the repository. Ignoring a thread will mute all future notifications (until you comment or get @mentioned). - * - * @name ThreadsSubscriptionUpdate - * @request PUT:/notifications/threads/{id}/subscription - */ - threadsSubscriptionUpdate: (id, body, params = {}) => - this.request({ - path: `/notifications/threads/${id}/subscription`, - method: "PUT", - body: body, - type: ContentType.Json, - format: "json", - ...params, - }), - }; - this.orgs = { - /** - * @description Get an Organization. - * - * @name OrgsDetail - * @request GET:/orgs/{org} - */ - orgsDetail: (org, params = {}) => - this.request({ - path: `/orgs/${org}`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description Edit an Organization. - * - * @name OrgsPartialUpdate - * @request PATCH:/orgs/{org} - */ - orgsPartialUpdate: (org, body, params = {}) => - this.request({ - path: `/orgs/${org}`, - method: "PATCH", - body: body, - type: ContentType.Json, - format: "json", - ...params, - }), - /** - * @description List public events for an organization. - * - * @name EventsDetail - * @request GET:/orgs/{org}/events - */ - eventsDetail: (org, params = {}) => - this.request({ - path: `/orgs/${org}/events`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description List issues. List all issues for a given organization for the authenticated user. - * - * @name IssuesDetail - * @request GET:/orgs/{org}/issues - */ - issuesDetail: (org, query, params = {}) => - this.request({ - path: `/orgs/${org}/issues`, - method: "GET", - query: query, - format: "json", - ...params, - }), - /** - * @description Members list. List all users who are members of an organization. A member is a user tha belongs to at least 1 team in the organization. If the authenticated user is also an owner of this organization then both concealed and public members will be returned. If the requester is not an owner of the organization the query will be redirected to the public members list. - * - * @name MembersDetail - * @request GET:/orgs/{org}/members - */ - membersDetail: (org, params = {}) => - this.request({ - path: `/orgs/${org}/members`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description Remove a member. Removing a user from this list will remove them from all teams and they will no longer have any access to the organization's repositories. - * - * @name MembersDelete - * @request DELETE:/orgs/{org}/members/{username} - */ - membersDelete: (org, username, params = {}) => - this.request({ - path: `/orgs/${org}/members/${username}`, - method: "DELETE", - ...params, - }), - /** - * @description Check if a user is, publicly or privately, a member of the organization. - * - * @name MembersDetail2 - * @request GET:/orgs/{org}/members/{username} - * @originalName membersDetail - * @duplicate - */ - membersDetail2: (org, username, params = {}) => - this.request({ - path: `/orgs/${org}/members/${username}`, - method: "GET", - ...params, - }), - /** - * @description Public members list. Members of an organization can choose to have their membership publicized or not. - * - * @name PublicMembersDetail - * @request GET:/orgs/{org}/public_members - */ - publicMembersDetail: (org, params = {}) => - this.request({ - path: `/orgs/${org}/public_members`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description Conceal a user's membership. - * - * @name PublicMembersDelete - * @request DELETE:/orgs/{org}/public_members/{username} - */ - publicMembersDelete: (org, username, params = {}) => - this.request({ - path: `/orgs/${org}/public_members/${username}`, - method: "DELETE", - ...params, - }), - /** - * @description Check public membership. - * - * @name PublicMembersDetail2 - * @request GET:/orgs/{org}/public_members/{username} - * @originalName publicMembersDetail - * @duplicate - */ - publicMembersDetail2: (org, username, params = {}) => - this.request({ - path: `/orgs/${org}/public_members/${username}`, - method: "GET", - ...params, - }), - /** - * @description Publicize a user's membership. - * - * @name PublicMembersUpdate - * @request PUT:/orgs/{org}/public_members/{username} - */ - publicMembersUpdate: (org, username, params = {}) => - this.request({ - path: `/orgs/${org}/public_members/${username}`, - method: "PUT", - ...params, - }), - /** - * @description List repositories for the specified org. - * - * @name ReposDetail - * @request GET:/orgs/{org}/repos - */ - reposDetail: (org, query, params = {}) => - this.request({ - path: `/orgs/${org}/repos`, - method: "GET", - query: query, - format: "json", - ...params, - }), - /** - * @description Create a new repository for the authenticated user. OAuth users must supply repo scope. - * - * @name ReposCreate - * @request POST:/orgs/{org}/repos - */ - reposCreate: (org, body, params = {}) => - this.request({ - path: `/orgs/${org}/repos`, - method: "POST", - body: body, - format: "json", - ...params, - }), - /** - * @description List teams. - * - * @name TeamsDetail - * @request GET:/orgs/{org}/teams - */ - teamsDetail: (org, params = {}) => - this.request({ - path: `/orgs/${org}/teams`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description Create team. In order to create a team, the authenticated user must be an owner of organization. - * - * @name TeamsCreate - * @request POST:/orgs/{org}/teams - */ - teamsCreate: (org, body, params = {}) => - this.request({ - path: `/orgs/${org}/teams`, - method: "POST", - body: body, - type: ContentType.Json, - format: "json", - ...params, - }), - }; - this.rateLimit = { - /** - * @description Get your current rate limit status Note: Accessing this endpoint does not count against your rate limit. - * - * @name RateLimitList - * @request GET:/rate_limit - */ - rateLimitList: (params = {}) => - this.request({ - path: `/rate_limit`, - method: "GET", - format: "json", - ...params, - }), - }; - this.repos = { - /** - * @description Delete a Repository. Deleting a repository requires admin access. If OAuth is used, the delete_repo scope is required. - * - * @name ReposDelete - * @request DELETE:/repos/{owner}/{repo} - */ - reposDelete: (owner, repo, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}`, - method: "DELETE", - ...params, - }), - /** - * @description Get repository. - * - * @name ReposDetail - * @request GET:/repos/{owner}/{repo} - */ - reposDetail: (owner, repo, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description Edit repository. - * - * @name ReposPartialUpdate - * @request PATCH:/repos/{owner}/{repo} - */ - reposPartialUpdate: (owner, repo, body, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}`, - method: "PATCH", - body: body, - type: ContentType.Json, - format: "json", - ...params, - }), - /** - * @description List assignees. This call lists all the available assignees (owner + collaborators) to which issues may be assigned. - * - * @name AssigneesDetail - * @request GET:/repos/{owner}/{repo}/assignees - */ - assigneesDetail: (owner, repo, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/assignees`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description Check assignee. You may also check to see if a particular user is an assignee for a repository. - * - * @name AssigneesDetail2 - * @request GET:/repos/{owner}/{repo}/assignees/{assignee} - * @originalName assigneesDetail - * @duplicate - */ - assigneesDetail2: (owner, repo, assignee, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/assignees/${assignee}`, - method: "GET", - ...params, - }), - /** - * @description Get list of branches - * - * @name BranchesDetail - * @request GET:/repos/{owner}/{repo}/branches - */ - branchesDetail: (owner, repo, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/branches`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description Get Branch - * - * @name BranchesDetail2 - * @request GET:/repos/{owner}/{repo}/branches/{branch} - * @originalName branchesDetail - * @duplicate - */ - branchesDetail2: (owner, repo, branch, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/branches/${branch}`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description List. When authenticating as an organization owner of an organization-owned repository, all organization owners are included in the list of collaborators. Otherwise, only users with access to the repository are returned in the collaborators list. - * - * @name CollaboratorsDetail - * @request GET:/repos/{owner}/{repo}/collaborators - */ - collaboratorsDetail: (owner, repo, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/collaborators`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description Remove collaborator. - * - * @name CollaboratorsDelete - * @request DELETE:/repos/{owner}/{repo}/collaborators/{user} - */ - collaboratorsDelete: (owner, repo, user, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/collaborators/${user}`, - method: "DELETE", - ...params, - }), - /** - * @description Check if user is a collaborator - * - * @name CollaboratorsDetail2 - * @request GET:/repos/{owner}/{repo}/collaborators/{user} - * @originalName collaboratorsDetail - * @duplicate - */ - collaboratorsDetail2: (owner, repo, user, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/collaborators/${user}`, - method: "GET", - ...params, - }), - /** - * @description Add collaborator. - * - * @name CollaboratorsUpdate - * @request PUT:/repos/{owner}/{repo}/collaborators/{user} - */ - collaboratorsUpdate: (owner, repo, user, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/collaborators/${user}`, - method: "PUT", - ...params, - }), - /** - * @description List commit comments for a repository. Comments are ordered by ascending ID. - * - * @name CommentsDetail - * @request GET:/repos/{owner}/{repo}/comments - */ - commentsDetail: (owner, repo, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/comments`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description Delete a commit comment - * - * @name CommentsDelete - * @request DELETE:/repos/{owner}/{repo}/comments/{commentId} - */ - commentsDelete: (owner, repo, commentId, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/comments/${commentId}`, - method: "DELETE", - ...params, - }), - /** - * @description Get a single commit comment. - * - * @name CommentsDetail2 - * @request GET:/repos/{owner}/{repo}/comments/{commentId} - * @originalName commentsDetail - * @duplicate - */ - commentsDetail2: (owner, repo, commentId, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/comments/${commentId}`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description Update a commit comment. - * - * @name CommentsPartialUpdate - * @request PATCH:/repos/{owner}/{repo}/comments/{commentId} - */ - commentsPartialUpdate: (owner, repo, commentId, body, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/comments/${commentId}`, - method: "PATCH", - body: body, - format: "json", - ...params, - }), - /** - * @description List commits on a repository. - * - * @name CommitsDetail - * @request GET:/repos/{owner}/{repo}/commits - */ - commitsDetail: (owner, repo, query, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/commits`, - method: "GET", - query: query, - format: "json", - ...params, - }), - /** - * @description Get the combined Status for a specific Ref The Combined status endpoint is currently available for developers to preview. During the preview period, the API may change without advance notice. Please see the blog post for full details. To access this endpoint during the preview period, you must provide a custom media type in the Accept header: application/vnd.github.she-hulk-preview+json - * - * @name CommitsStatusDetail - * @request GET:/repos/{owner}/{repo}/commits/{ref}/status - */ - commitsStatusDetail: (owner, repo, ref, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/commits/${ref}/status`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description Get a single commit. - * - * @name CommitsDetail2 - * @request GET:/repos/{owner}/{repo}/commits/{shaCode} - * @originalName commitsDetail - * @duplicate - */ - commitsDetail2: (owner, repo, shaCode, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/commits/${shaCode}`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description List comments for a single commitList comments for a single commit. - * - * @name CommitsCommentsDetail - * @request GET:/repos/{owner}/{repo}/commits/{shaCode}/comments - */ - commitsCommentsDetail: (owner, repo, shaCode, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/commits/${shaCode}/comments`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description Create a commit comment. - * - * @name CommitsCommentsCreate - * @request POST:/repos/{owner}/{repo}/commits/{shaCode}/comments - */ - commitsCommentsCreate: (owner, repo, shaCode, body, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/commits/${shaCode}/comments`, - method: "POST", - body: body, - type: ContentType.Json, - format: "json", - ...params, - }), - /** - * @description Compare two commits - * - * @name CompareDetail - * @request GET:/repos/{owner}/{repo}/compare/{baseId}...{headId} - */ - compareDetail: (owner, repo, baseId, headId, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/compare/${baseId}...${headId}`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description Delete a file. This method deletes a file in a repository. - * - * @name ContentsDelete - * @request DELETE:/repos/{owner}/{repo}/contents/{path} - */ - contentsDelete: (owner, repo, path, body, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/contents/${path}`, - method: "DELETE", - body: body, - type: ContentType.Json, - format: "json", - ...params, - }), - /** - * @description Get contents. This method returns the contents of a file or directory in a repository. Files and symlinks support a custom media type for getting the raw content. Directories and submodules do not support custom media types. Note: This API supports files up to 1 megabyte in size. Here can be many outcomes. For details see "http://developer.github.com/v3/repos/contents/" - * - * @name ContentsDetail - * @request GET:/repos/{owner}/{repo}/contents/{path} - */ - contentsDetail: (owner, repo, path, query, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/contents/${path}`, - method: "GET", - query: query, - format: "json", - ...params, - }), - /** - * @description Create a file. - * - * @name ContentsUpdate - * @request PUT:/repos/{owner}/{repo}/contents/{path} - */ - contentsUpdate: (owner, repo, path, body, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/contents/${path}`, - method: "PUT", - body: body, - type: ContentType.Json, - format: "json", - ...params, - }), - /** - * @description Get list of contributors. - * - * @name ContributorsDetail - * @request GET:/repos/{owner}/{repo}/contributors - */ - contributorsDetail: (owner, repo, query, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/contributors`, - method: "GET", - query: query, - format: "json", - ...params, - }), - /** - * @description Users with pull access can view deployments for a repository - * - * @name DeploymentsDetail - * @request GET:/repos/{owner}/{repo}/deployments - */ - deploymentsDetail: (owner, repo, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/deployments`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description Users with push access can create a deployment for a given ref - * - * @name DeploymentsCreate - * @request POST:/repos/{owner}/{repo}/deployments - */ - deploymentsCreate: (owner, repo, body, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/deployments`, - method: "POST", - body: body, - type: ContentType.Json, - format: "json", - ...params, - }), - /** - * @description Users with pull access can view deployment statuses for a deployment - * - * @name DeploymentsStatusesDetail - * @request GET:/repos/{owner}/{repo}/deployments/{id}/statuses - */ - deploymentsStatusesDetail: (owner, repo, id, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/deployments/${id}/statuses`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description Create a Deployment Status Users with push access can create deployment statuses for a given deployment: - * - * @name DeploymentsStatusesCreate - * @request POST:/repos/{owner}/{repo}/deployments/{id}/statuses - */ - deploymentsStatusesCreate: (owner, repo, id, body, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/deployments/${id}/statuses`, - method: "POST", - body: body, - type: ContentType.Json, - ...params, - }), - /** - * @description Deprecated. List downloads for a repository. - * - * @name DownloadsDetail - * @request GET:/repos/{owner}/{repo}/downloads - * @deprecated - */ - downloadsDetail: (owner, repo, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/downloads`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description Deprecated. Delete a download. - * - * @name DownloadsDelete - * @request DELETE:/repos/{owner}/{repo}/downloads/{downloadId} - * @deprecated - */ - downloadsDelete: (owner, repo, downloadId, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/downloads/${downloadId}`, - method: "DELETE", - ...params, - }), - /** - * @description Deprecated. Get a single download. - * - * @name DownloadsDetail2 - * @request GET:/repos/{owner}/{repo}/downloads/{downloadId} - * @deprecated - * @originalName downloadsDetail - * @duplicate - */ - downloadsDetail2: (owner, repo, downloadId, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/downloads/${downloadId}`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description Get list of repository events. - * - * @name EventsDetail - * @request GET:/repos/{owner}/{repo}/events - */ - eventsDetail: (owner, repo, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/events`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description List forks. - * - * @name ForksDetail - * @request GET:/repos/{owner}/{repo}/forks - */ - forksDetail: (owner, repo, query, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/forks`, - method: "GET", - query: query, - format: "json", - ...params, - }), - /** - * @description Create a fork. Forking a Repository happens asynchronously. Therefore, you may have to wai a short period before accessing the git objects. If this takes longer than 5 minutes, be sure to contact Support. - * - * @name ForksCreate - * @request POST:/repos/{owner}/{repo}/forks - */ - forksCreate: (owner, repo, body, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/forks`, - method: "POST", - body: body, - type: ContentType.Json, - format: "json", - ...params, - }), - /** - * @description Create a Blob. - * - * @name GitBlobsCreate - * @request POST:/repos/{owner}/{repo}/git/blobs - */ - gitBlobsCreate: (owner, repo, body, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/git/blobs`, - method: "POST", - body: body, - type: ContentType.Json, - format: "json", - ...params, - }), - /** - * @description Get a Blob. Since blobs can be any arbitrary binary data, the input and responses for the blob API takes an encoding parameter that can be either utf-8 or base64. If your data cannot be losslessly sent as a UTF-8 string, you can base64 encode it. - * - * @name GitBlobsDetail - * @request GET:/repos/{owner}/{repo}/git/blobs/{shaCode} - */ - gitBlobsDetail: (owner, repo, shaCode, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/git/blobs/${shaCode}`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description Create a Commit. - * - * @name GitCommitsCreate - * @request POST:/repos/{owner}/{repo}/git/commits - */ - gitCommitsCreate: (owner, repo, body, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/git/commits`, - method: "POST", - body: body, - type: ContentType.Json, - format: "json", - ...params, - }), - /** - * @description Get a Commit. - * - * @name GitCommitsDetail - * @request GET:/repos/{owner}/{repo}/git/commits/{shaCode} - */ - gitCommitsDetail: (owner, repo, shaCode, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/git/commits/${shaCode}`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description Get all References - * - * @name GitRefsDetail - * @request GET:/repos/{owner}/{repo}/git/refs - */ - gitRefsDetail: (owner, repo, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/git/refs`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description Create a Reference - * - * @name GitRefsCreate - * @request POST:/repos/{owner}/{repo}/git/refs - */ - gitRefsCreate: (owner, repo, body, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/git/refs`, - method: "POST", - body: body, - type: ContentType.Json, - format: "json", - ...params, - }), - /** - * @description Delete a Reference Example: Deleting a branch: DELETE /repos/octocat/Hello-World/git/refs/heads/feature-a Example: Deleting a tag: DELETE /repos/octocat/Hello-World/git/refs/tags/v1.0 - * - * @name GitRefsDelete - * @request DELETE:/repos/{owner}/{repo}/git/refs/{ref} - */ - gitRefsDelete: (owner, repo, ref, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/git/refs/${ref}`, - method: "DELETE", - ...params, - }), - /** - * @description Get a Reference - * - * @name GitRefsDetail2 - * @request GET:/repos/{owner}/{repo}/git/refs/{ref} - * @originalName gitRefsDetail - * @duplicate - */ - gitRefsDetail2: (owner, repo, ref, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/git/refs/${ref}`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description Update a Reference - * - * @name GitRefsPartialUpdate - * @request PATCH:/repos/{owner}/{repo}/git/refs/{ref} - */ - gitRefsPartialUpdate: (owner, repo, ref, body, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/git/refs/${ref}`, - method: "PATCH", - body: body, - type: ContentType.Json, - format: "json", - ...params, - }), - /** - * @description Create a Tag Object. Note that creating a tag object does not create the reference that makes a tag in Git. If you want to create an annotated tag in Git, you have to do this call to create the tag object, and then create the refs/tags/[tag] reference. If you want to create a lightweight tag, you only have to create the tag reference - this call would be unnecessary. - * - * @name GitTagsCreate - * @request POST:/repos/{owner}/{repo}/git/tags - */ - gitTagsCreate: (owner, repo, body, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/git/tags`, - method: "POST", - body: body, - type: ContentType.Json, - format: "json", - ...params, - }), - /** - * @description Get a Tag. - * - * @name GitTagsDetail - * @request GET:/repos/{owner}/{repo}/git/tags/{shaCode} - */ - gitTagsDetail: (owner, repo, shaCode, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/git/tags/${shaCode}`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description Create a Tree. The tree creation API will take nested entries as well. If both a tree and a nested path modifying that tree are specified, it will overwrite the contents of that tree with the new path contents and write a new tree out. - * - * @name GitTreesCreate - * @request POST:/repos/{owner}/{repo}/git/trees - */ - gitTreesCreate: (owner, repo, body, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/git/trees`, - method: "POST", - body: body, - type: ContentType.Json, - format: "json", - ...params, - }), - /** - * @description Get a Tree. - * - * @name GitTreesDetail - * @request GET:/repos/{owner}/{repo}/git/trees/{shaCode} - */ - gitTreesDetail: (owner, repo, shaCode, query, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/git/trees/${shaCode}`, - method: "GET", - query: query, - format: "json", - ...params, - }), - /** - * @description Get list of hooks. - * - * @name HooksDetail - * @request GET:/repos/{owner}/{repo}/hooks - */ - hooksDetail: (owner, repo, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/hooks`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description Create a hook. - * - * @name HooksCreate - * @request POST:/repos/{owner}/{repo}/hooks - */ - hooksCreate: (owner, repo, body, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/hooks`, - method: "POST", - body: body, - format: "json", - ...params, - }), - /** - * @description Delete a hook. - * - * @name HooksDelete - * @request DELETE:/repos/{owner}/{repo}/hooks/{hookId} - */ - hooksDelete: (owner, repo, hookId, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/hooks/${hookId}`, - method: "DELETE", - ...params, - }), - /** - * @description Get single hook. - * - * @name HooksDetail2 - * @request GET:/repos/{owner}/{repo}/hooks/{hookId} - * @originalName hooksDetail - * @duplicate - */ - hooksDetail2: (owner, repo, hookId, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/hooks/${hookId}`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description Edit a hook. - * - * @name HooksPartialUpdate - * @request PATCH:/repos/{owner}/{repo}/hooks/{hookId} - */ - hooksPartialUpdate: (owner, repo, hookId, body, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/hooks/${hookId}`, - method: "PATCH", - body: body, - format: "json", - ...params, - }), - /** - * @description Test a push hook. This will trigger the hook with the latest push to the current repository if the hook is subscribed to push events. If the hook is not subscribed to push events, the server will respond with 204 but no test POST will be generated. Note: Previously /repos/:owner/:repo/hooks/:id/tes - * - * @name HooksTestsCreate - * @request POST:/repos/{owner}/{repo}/hooks/{hookId}/tests - */ - hooksTestsCreate: (owner, repo, hookId, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/hooks/${hookId}/tests`, - method: "POST", - ...params, - }), - /** - * @description List issues for a repository. - * - * @name IssuesDetail - * @request GET:/repos/{owner}/{repo}/issues - */ - issuesDetail: (owner, repo, query, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/issues`, - method: "GET", - query: query, - format: "json", - ...params, - }), - /** - * @description Create an issue. Any user with pull access to a repository can create an issue. - * - * @name IssuesCreate - * @request POST:/repos/{owner}/{repo}/issues - */ - issuesCreate: (owner, repo, body, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/issues`, - method: "POST", - body: body, - format: "json", - ...params, - }), - /** - * @description List comments in a repository. - * - * @name IssuesCommentsDetail - * @request GET:/repos/{owner}/{repo}/issues/comments - */ - issuesCommentsDetail: (owner, repo, query, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/issues/comments`, - method: "GET", - query: query, - format: "json", - ...params, - }), - /** - * @description Delete a comment. - * - * @name IssuesCommentsDelete - * @request DELETE:/repos/{owner}/{repo}/issues/comments/{commentId} - */ - issuesCommentsDelete: (owner, repo, commentId, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/issues/comments/${commentId}`, - method: "DELETE", - ...params, - }), - /** - * @description Get a single comment. - * - * @name IssuesCommentsDetail2 - * @request GET:/repos/{owner}/{repo}/issues/comments/{commentId} - * @originalName issuesCommentsDetail - * @duplicate - */ - issuesCommentsDetail2: (owner, repo, commentId, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/issues/comments/${commentId}`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description Edit a comment. - * - * @name IssuesCommentsPartialUpdate - * @request PATCH:/repos/{owner}/{repo}/issues/comments/{commentId} - */ - issuesCommentsPartialUpdate: (owner, repo, commentId, body, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/issues/comments/${commentId}`, - method: "PATCH", - body: body, - format: "json", - ...params, - }), - /** - * @description List issue events for a repository. - * - * @name IssuesEventsDetail - * @request GET:/repos/{owner}/{repo}/issues/events - */ - issuesEventsDetail: (owner, repo, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/issues/events`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description Get a single event. - * - * @name IssuesEventsDetail2 - * @request GET:/repos/{owner}/{repo}/issues/events/{eventId} - * @originalName issuesEventsDetail - * @duplicate - */ - issuesEventsDetail2: (owner, repo, eventId, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/issues/events/${eventId}`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description Get a single issue - * - * @name IssuesDetail2 - * @request GET:/repos/{owner}/{repo}/issues/{number} - * @originalName issuesDetail - * @duplicate - */ - issuesDetail2: (owner, repo, number, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/issues/${number}`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description Edit an issue. Issue owners and users with push access can edit an issue. - * - * @name IssuesPartialUpdate - * @request PATCH:/repos/{owner}/{repo}/issues/{number} - */ - issuesPartialUpdate: (owner, repo, number, body, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/issues/${number}`, - method: "PATCH", - body: body, - format: "json", - ...params, - }), - /** - * @description List comments on an issue. - * - * @name IssuesCommentsDetail3 - * @request GET:/repos/{owner}/{repo}/issues/{number}/comments - * @originalName issuesCommentsDetail - * @duplicate - */ - issuesCommentsDetail3: (owner, repo, number, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/issues/${number}/comments`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description Create a comment. - * - * @name IssuesCommentsCreate - * @request POST:/repos/{owner}/{repo}/issues/{number}/comments - */ - issuesCommentsCreate: (owner, repo, number, body, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/issues/${number}/comments`, - method: "POST", - body: body, - format: "json", - ...params, - }), - /** - * @description List events for an issue. - * - * @name IssuesEventsDetail3 - * @request GET:/repos/{owner}/{repo}/issues/{number}/events - * @originalName issuesEventsDetail - * @duplicate - */ - issuesEventsDetail3: (owner, repo, number, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/issues/${number}/events`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description Remove all labels from an issue. - * - * @name IssuesLabelsDelete - * @request DELETE:/repos/{owner}/{repo}/issues/{number}/labels - */ - issuesLabelsDelete: (owner, repo, number, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/issues/${number}/labels`, - method: "DELETE", - ...params, - }), - /** - * @description List labels on an issue. - * - * @name IssuesLabelsDetail - * @request GET:/repos/{owner}/{repo}/issues/{number}/labels - */ - issuesLabelsDetail: (owner, repo, number, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/issues/${number}/labels`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description Add labels to an issue. - * - * @name IssuesLabelsCreate - * @request POST:/repos/{owner}/{repo}/issues/{number}/labels - */ - issuesLabelsCreate: (owner, repo, number, body, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/issues/${number}/labels`, - method: "POST", - body: body, - format: "json", - ...params, - }), - /** - * @description Replace all labels for an issue. Sending an empty array ([]) will remove all Labels from the Issue. - * - * @name IssuesLabelsUpdate - * @request PUT:/repos/{owner}/{repo}/issues/{number}/labels - */ - issuesLabelsUpdate: (owner, repo, number, body, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/issues/${number}/labels`, - method: "PUT", - body: body, - format: "json", - ...params, - }), - /** - * @description Remove a label from an issue. - * - * @name IssuesLabelsDelete2 - * @request DELETE:/repos/{owner}/{repo}/issues/{number}/labels/{name} - * @originalName issuesLabelsDelete - * @duplicate - */ - issuesLabelsDelete2: (owner, repo, number, name, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/issues/${number}/labels/${name}`, - method: "DELETE", - ...params, - }), - /** - * @description Get list of keys. - * - * @name KeysDetail - * @request GET:/repos/{owner}/{repo}/keys - */ - keysDetail: (owner, repo, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/keys`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description Create a key. - * - * @name KeysCreate - * @request POST:/repos/{owner}/{repo}/keys - */ - keysCreate: (owner, repo, body, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/keys`, - method: "POST", - body: body, - format: "json", - ...params, - }), - /** - * @description Delete a key. - * - * @name KeysDelete - * @request DELETE:/repos/{owner}/{repo}/keys/{keyId} - */ - keysDelete: (owner, repo, keyId, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/keys/${keyId}`, - method: "DELETE", - ...params, - }), - /** - * @description Get a key - * - * @name KeysDetail2 - * @request GET:/repos/{owner}/{repo}/keys/{keyId} - * @originalName keysDetail - * @duplicate - */ - keysDetail2: (owner, repo, keyId, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/keys/${keyId}`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description List all labels for this repository. - * - * @name LabelsDetail - * @request GET:/repos/{owner}/{repo}/labels - */ - labelsDetail: (owner, repo, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/labels`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description Create a label. - * - * @name LabelsCreate - * @request POST:/repos/{owner}/{repo}/labels - */ - labelsCreate: (owner, repo, body, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/labels`, - method: "POST", - body: body, - format: "json", - ...params, - }), - /** - * @description Delete a label. - * - * @name LabelsDelete - * @request DELETE:/repos/{owner}/{repo}/labels/{name} - */ - labelsDelete: (owner, repo, name, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/labels/${name}`, - method: "DELETE", - ...params, - }), - /** - * @description Get a single label. - * - * @name LabelsDetail2 - * @request GET:/repos/{owner}/{repo}/labels/{name} - * @originalName labelsDetail - * @duplicate - */ - labelsDetail2: (owner, repo, name, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/labels/${name}`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description Update a label. - * - * @name LabelsPartialUpdate - * @request PATCH:/repos/{owner}/{repo}/labels/{name} - */ - labelsPartialUpdate: (owner, repo, name, body, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/labels/${name}`, - method: "PATCH", - body: body, - format: "json", - ...params, - }), - /** - * @description List languages. List languages for the specified repository. The value on the right of a language is the number of bytes of code written in that language. - * - * @name LanguagesDetail - * @request GET:/repos/{owner}/{repo}/languages - */ - languagesDetail: (owner, repo, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/languages`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description Perform a merge. - * - * @name MergesCreate - * @request POST:/repos/{owner}/{repo}/merges - */ - mergesCreate: (owner, repo, body, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/merges`, - method: "POST", - body: body, - type: ContentType.Json, - format: "json", - ...params, - }), - /** - * @description List milestones for a repository. - * - * @name MilestonesDetail - * @request GET:/repos/{owner}/{repo}/milestones - */ - milestonesDetail: (owner, repo, query, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/milestones`, - method: "GET", - query: query, - format: "json", - ...params, - }), - /** - * @description Create a milestone. - * - * @name MilestonesCreate - * @request POST:/repos/{owner}/{repo}/milestones - */ - milestonesCreate: (owner, repo, body, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/milestones`, - method: "POST", - body: body, - format: "json", - ...params, - }), - /** - * @description Delete a milestone. - * - * @name MilestonesDelete - * @request DELETE:/repos/{owner}/{repo}/milestones/{number} - */ - milestonesDelete: (owner, repo, number, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/milestones/${number}`, - method: "DELETE", - ...params, - }), - /** - * @description Get a single milestone. - * - * @name MilestonesDetail2 - * @request GET:/repos/{owner}/{repo}/milestones/{number} - * @originalName milestonesDetail - * @duplicate - */ - milestonesDetail2: (owner, repo, number, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/milestones/${number}`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description Update a milestone. - * - * @name MilestonesPartialUpdate - * @request PATCH:/repos/{owner}/{repo}/milestones/{number} - */ - milestonesPartialUpdate: (owner, repo, number, body, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/milestones/${number}`, - method: "PATCH", - body: body, - format: "json", - ...params, - }), - /** - * @description Get labels for every issue in a milestone. - * - * @name MilestonesLabelsDetail - * @request GET:/repos/{owner}/{repo}/milestones/{number}/labels - */ - milestonesLabelsDetail: (owner, repo, number, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/milestones/${number}/labels`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description List your notifications in a repository List all notifications for the current user. - * - * @name NotificationsDetail - * @request GET:/repos/{owner}/{repo}/notifications - */ - notificationsDetail: (owner, repo, query, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/notifications`, - method: "GET", - query: query, - format: "json", - ...params, - }), - /** - * @description Mark notifications as read in a repository. Marking all notifications in a repository as "read" removes them from the default view on GitHub.com. - * - * @name NotificationsUpdate - * @request PUT:/repos/{owner}/{repo}/notifications - */ - notificationsUpdate: (owner, repo, body, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/notifications`, - method: "PUT", - body: body, - ...params, - }), - /** - * @description List pull requests. - * - * @name PullsDetail - * @request GET:/repos/{owner}/{repo}/pulls - */ - pullsDetail: (owner, repo, query, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/pulls`, - method: "GET", - query: query, - format: "json", - ...params, - }), - /** - * @description Create a pull request. - * - * @name PullsCreate - * @request POST:/repos/{owner}/{repo}/pulls - */ - pullsCreate: (owner, repo, body, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/pulls`, - method: "POST", - body: body, - type: ContentType.Json, - format: "json", - ...params, - }), - /** - * @description List comments in a repository. By default, Review Comments are ordered by ascending ID. - * - * @name PullsCommentsDetail - * @request GET:/repos/{owner}/{repo}/pulls/comments - */ - pullsCommentsDetail: (owner, repo, query, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/pulls/comments`, - method: "GET", - query: query, - format: "json", - ...params, - }), - /** - * @description Delete a comment. - * - * @name PullsCommentsDelete - * @request DELETE:/repos/{owner}/{repo}/pulls/comments/{commentId} - */ - pullsCommentsDelete: (owner, repo, commentId, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/pulls/comments/${commentId}`, - method: "DELETE", - ...params, - }), - /** - * @description Get a single comment. - * - * @name PullsCommentsDetail2 - * @request GET:/repos/{owner}/{repo}/pulls/comments/{commentId} - * @originalName pullsCommentsDetail - * @duplicate - */ - pullsCommentsDetail2: (owner, repo, commentId, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/pulls/comments/${commentId}`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description Edit a comment. - * - * @name PullsCommentsPartialUpdate - * @request PATCH:/repos/{owner}/{repo}/pulls/comments/{commentId} - */ - pullsCommentsPartialUpdate: (owner, repo, commentId, body, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/pulls/comments/${commentId}`, - method: "PATCH", - body: body, - format: "json", - ...params, - }), - /** - * @description Get a single pull request. - * - * @name PullsDetail2 - * @request GET:/repos/{owner}/{repo}/pulls/{number} - * @originalName pullsDetail - * @duplicate - */ - pullsDetail2: (owner, repo, number, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/pulls/${number}`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description Update a pull request. - * - * @name PullsPartialUpdate - * @request PATCH:/repos/{owner}/{repo}/pulls/{number} - */ - pullsPartialUpdate: (owner, repo, number, body, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/pulls/${number}`, - method: "PATCH", - body: body, - type: ContentType.Json, - format: "json", - ...params, - }), - /** - * @description List comments on a pull request. - * - * @name PullsCommentsDetail3 - * @request GET:/repos/{owner}/{repo}/pulls/{number}/comments - * @originalName pullsCommentsDetail - * @duplicate - */ - pullsCommentsDetail3: (owner, repo, number, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/pulls/${number}/comments`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description Create a comment. #TODO Alternative input ( http://developer.github.com/v3/pulls/comments/ ) description: | Alternative Input. Instead of passing commit_id, path, and position you can reply to an existing Pull Request Comment like this: body Required string in_reply_to Required number - Comment id to reply to. - * - * @name PullsCommentsCreate - * @request POST:/repos/{owner}/{repo}/pulls/{number}/comments - */ - pullsCommentsCreate: (owner, repo, number, body, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/pulls/${number}/comments`, - method: "POST", - body: body, - type: ContentType.Json, - format: "json", - ...params, - }), - /** - * @description List commits on a pull request. - * - * @name PullsCommitsDetail - * @request GET:/repos/{owner}/{repo}/pulls/{number}/commits - */ - pullsCommitsDetail: (owner, repo, number, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/pulls/${number}/commits`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description List pull requests files. - * - * @name PullsFilesDetail - * @request GET:/repos/{owner}/{repo}/pulls/{number}/files - */ - pullsFilesDetail: (owner, repo, number, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/pulls/${number}/files`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description Get if a pull request has been merged. - * - * @name PullsMergeDetail - * @request GET:/repos/{owner}/{repo}/pulls/{number}/merge - */ - pullsMergeDetail: (owner, repo, number, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/pulls/${number}/merge`, - method: "GET", - ...params, - }), - /** - * @description Merge a pull request (Merge Button's) - * - * @name PullsMergeUpdate - * @request PUT:/repos/{owner}/{repo}/pulls/{number}/merge - */ - pullsMergeUpdate: (owner, repo, number, body, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/pulls/${number}/merge`, - method: "PUT", - body: body, - type: ContentType.Json, - format: "json", - ...params, - }), - /** - * @description Get the README. This method returns the preferred README for a repository. - * - * @name ReadmeDetail - * @request GET:/repos/{owner}/{repo}/readme - */ - readmeDetail: (owner, repo, query, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/readme`, - method: "GET", - query: query, - format: "json", - ...params, - }), - /** - * @description Users with push access to the repository will receive all releases (i.e., published releases and draft releases). Users with pull access will receive published releases only - * - * @name ReleasesDetail - * @request GET:/repos/{owner}/{repo}/releases - */ - releasesDetail: (owner, repo, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/releases`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description Create a release Users with push access to the repository can create a release. - * - * @name ReleasesCreate - * @request POST:/repos/{owner}/{repo}/releases - */ - releasesCreate: (owner, repo, body, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/releases`, - method: "POST", - body: body, - format: "json", - ...params, - }), - /** - * @description Delete a release asset - * - * @name ReleasesAssetsDelete - * @request DELETE:/repos/{owner}/{repo}/releases/assets/{id} - */ - releasesAssetsDelete: (owner, repo, id, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/releases/assets/${id}`, - method: "DELETE", - ...params, - }), - /** - * @description Get a single release asset - * - * @name ReleasesAssetsDetail - * @request GET:/repos/{owner}/{repo}/releases/assets/{id} - */ - releasesAssetsDetail: (owner, repo, id, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/releases/assets/${id}`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description Edit a release asset Users with push access to the repository can edit a release asset. - * - * @name ReleasesAssetsPartialUpdate - * @request PATCH:/repos/{owner}/{repo}/releases/assets/{id} - */ - releasesAssetsPartialUpdate: (owner, repo, id, body, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/releases/assets/${id}`, - method: "PATCH", - body: body, - type: ContentType.Json, - format: "json", - ...params, - }), - /** - * @description Users with push access to the repository can delete a release. - * - * @name ReleasesDelete - * @request DELETE:/repos/{owner}/{repo}/releases/{id} - */ - releasesDelete: (owner, repo, id, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/releases/${id}`, - method: "DELETE", - ...params, - }), - /** - * @description Get a single release - * - * @name ReleasesDetail2 - * @request GET:/repos/{owner}/{repo}/releases/{id} - * @originalName releasesDetail - * @duplicate - */ - releasesDetail2: (owner, repo, id, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/releases/${id}`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description Users with push access to the repository can edit a release - * - * @name ReleasesPartialUpdate - * @request PATCH:/repos/{owner}/{repo}/releases/{id} - */ - releasesPartialUpdate: (owner, repo, id, body, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/releases/${id}`, - method: "PATCH", - body: body, - format: "json", - ...params, - }), - /** - * @description List assets for a release - * - * @name ReleasesAssetsDetail2 - * @request GET:/repos/{owner}/{repo}/releases/{id}/assets - * @originalName releasesAssetsDetail - * @duplicate - */ - releasesAssetsDetail2: (owner, repo, id, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/releases/${id}/assets`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description List Stargazers. - * - * @name StargazersDetail - * @request GET:/repos/{owner}/{repo}/stargazers - */ - stargazersDetail: (owner, repo, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/stargazers`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description Get the number of additions and deletions per week. Returns a weekly aggregate of the number of additions and deletions pushed to a repository. - * - * @name StatsCodeFrequencyDetail - * @request GET:/repos/{owner}/{repo}/stats/code_frequency - */ - statsCodeFrequencyDetail: (owner, repo, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/stats/code_frequency`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description Get the last year of commit activity data. Returns the last year of commit activity grouped by week. The days array is a group of commits per day, starting on Sunday. - * - * @name StatsCommitActivityDetail - * @request GET:/repos/{owner}/{repo}/stats/commit_activity - */ - statsCommitActivityDetail: (owner, repo, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/stats/commit_activity`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description Get contributors list with additions, deletions, and commit counts. - * - * @name StatsContributorsDetail - * @request GET:/repos/{owner}/{repo}/stats/contributors - */ - statsContributorsDetail: (owner, repo, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/stats/contributors`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description Get the weekly commit count for the repo owner and everyone else. - * - * @name StatsParticipationDetail - * @request GET:/repos/{owner}/{repo}/stats/participation - */ - statsParticipationDetail: (owner, repo, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/stats/participation`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description Get the number of commits per hour in each day. Each array contains the day number, hour number, and number of commits 0-6 Sunday - Saturday 0-23 Hour of day Number of commits For example, [2, 14, 25] indicates that there were 25 total commits, during the 2.00pm hour on Tuesdays. All times are based on the time zone of individual commits. - * - * @name StatsPunchCardDetail - * @request GET:/repos/{owner}/{repo}/stats/punch_card - */ - statsPunchCardDetail: (owner, repo, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/stats/punch_card`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description List Statuses for a specific Ref. - * - * @name StatusesDetail - * @request GET:/repos/{owner}/{repo}/statuses/{ref} - */ - statusesDetail: (owner, repo, ref, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/statuses/${ref}`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description Create a Status. - * - * @name StatusesCreate - * @request POST:/repos/{owner}/{repo}/statuses/{ref} - */ - statusesCreate: (owner, repo, ref, body, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/statuses/${ref}`, - method: "POST", - body: body, - type: ContentType.Json, - format: "json", - ...params, - }), - /** - * @description List watchers. - * - * @name SubscribersDetail - * @request GET:/repos/{owner}/{repo}/subscribers - */ - subscribersDetail: (owner, repo, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/subscribers`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description Delete a Repository Subscription. - * - * @name SubscriptionDelete - * @request DELETE:/repos/{owner}/{repo}/subscription - */ - subscriptionDelete: (owner, repo, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/subscription`, - method: "DELETE", - ...params, - }), - /** - * @description Get a Repository Subscription. - * - * @name SubscriptionDetail - * @request GET:/repos/{owner}/{repo}/subscription - */ - subscriptionDetail: (owner, repo, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/subscription`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description Set a Repository Subscription - * - * @name SubscriptionUpdate - * @request PUT:/repos/{owner}/{repo}/subscription - */ - subscriptionUpdate: (owner, repo, body, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/subscription`, - method: "PUT", - body: body, - type: ContentType.Json, - format: "json", - ...params, - }), - /** - * @description Get list of tags. - * - * @name TagsDetail - * @request GET:/repos/{owner}/{repo}/tags - */ - tagsDetail: (owner, repo, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/tags`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description Get list of teams - * - * @name TeamsDetail - * @request GET:/repos/{owner}/{repo}/teams - */ - teamsDetail: (owner, repo, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/teams`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description List Stargazers. New implementation. - * - * @name WatchersDetail - * @request GET:/repos/{owner}/{repo}/watchers - */ - watchersDetail: (owner, repo, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/watchers`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description Get archive link. This method will return a 302 to a URL to download a tarball or zipball archive for a repository. Please make sure your HTTP framework is configured to follow redirects or you will need to use the Location header to make a second GET request. Note: For private repositories, these links are temporary and expire quickly. - * - * @name ReposDetail2 - * @request GET:/repos/{owner}/{repo}/{archive_format}/{path} - * @originalName reposDetail - * @duplicate - */ - reposDetail2: (owner, repo, archiveFormat, path, params = {}) => - this.request({ - path: `/repos/${owner}/${repo}/${archiveFormat}/${path}`, - method: "GET", - ...params, - }), - }; - this.repositories = { - /** - * @description List all public repositories. This provides a dump of every public repository, in the order that they were created. Note: Pagination is powered exclusively by the since parameter. is the Link header to get the URL for the next page of repositories. - * - * @name RepositoriesList - * @request GET:/repositories - */ - repositoriesList: (query, params = {}) => - this.request({ - path: `/repositories`, - method: "GET", - query: query, - format: "json", - ...params, - }), - }; - this.search = { - /** - * @description Search code. - * - * @name CodeList - * @request GET:/search/code - */ - codeList: (query, params = {}) => - this.request({ - path: `/search/code`, - method: "GET", - query: query, - format: "json", - ...params, - }), - /** - * @description Find issues by state and keyword. (This method returns up to 100 results per page.) - * - * @name IssuesList - * @request GET:/search/issues - */ - issuesList: (query, params = {}) => - this.request({ - path: `/search/issues`, - method: "GET", - query: query, - format: "json", - ...params, - }), - /** - * @description Search repositories. - * - * @name RepositoriesList - * @request GET:/search/repositories - */ - repositoriesList: (query, params = {}) => - this.request({ - path: `/search/repositories`, - method: "GET", - query: query, - format: "json", - ...params, - }), - /** - * @description Search users. - * - * @name UsersList - * @request GET:/search/users - */ - usersList: (query, params = {}) => - this.request({ - path: `/search/users`, - method: "GET", - query: query, - format: "json", - ...params, - }), - }; - this.teams = { - /** - * @description Delete team. In order to delete a team, the authenticated user must be an owner of the org that the team is associated with. - * - * @name TeamsDelete - * @request DELETE:/teams/{teamId} - */ - teamsDelete: (teamId, params = {}) => - this.request({ - path: `/teams/${teamId}`, - method: "DELETE", - ...params, - }), - /** - * @description Get team. - * - * @name TeamsDetail - * @request GET:/teams/{teamId} - */ - teamsDetail: (teamId, params = {}) => - this.request({ - path: `/teams/${teamId}`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description Edit team. In order to edit a team, the authenticated user must be an owner of the org that the team is associated with. - * - * @name TeamsPartialUpdate - * @request PATCH:/teams/{teamId} - */ - teamsPartialUpdate: (teamId, body, params = {}) => - this.request({ - path: `/teams/${teamId}`, - method: "PATCH", - body: body, - type: ContentType.Json, - format: "json", - ...params, - }), - /** - * @description List team members. In order to list members in a team, the authenticated user must be a member of the team. - * - * @name MembersDetail - * @request GET:/teams/{teamId}/members - */ - membersDetail: (teamId, params = {}) => - this.request({ - path: `/teams/${teamId}/members`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description The "Remove team member" API is deprecated and is scheduled for removal in the next major version of the API. We recommend using the Remove team membership API instead. It allows you to remove both active and pending memberships. Remove team member. In order to remove a user from a team, the authenticated user must have 'admin' permissions to the team or be an owner of the org that the team is associated with. NOTE This does not delete the user, it just remove them from the team. - * - * @name MembersDelete - * @request DELETE:/teams/{teamId}/members/{username} - * @deprecated - */ - membersDelete: (teamId, username, params = {}) => - this.request({ - path: `/teams/${teamId}/members/${username}`, - method: "DELETE", - ...params, - }), - /** - * @description The "Get team member" API is deprecated and is scheduled for removal in the next major version of the API. We recommend using the Get team membership API instead. It allows you to get both active and pending memberships. Get team member. In order to get if a user is a member of a team, the authenticated user mus be a member of the team. - * - * @name MembersDetail2 - * @request GET:/teams/{teamId}/members/{username} - * @deprecated - * @originalName membersDetail - * @duplicate - */ - membersDetail2: (teamId, username, params = {}) => - this.request({ - path: `/teams/${teamId}/members/${username}`, - method: "GET", - ...params, - }), - /** - * @description The API (described below) is deprecated and is scheduled for removal in the next major version of the API. We recommend using the Add team membership API instead. It allows you to invite new organization members to your teams. Add team member. In order to add a user to a team, the authenticated user must have 'admin' permissions to the team or be an owner of the org that the team is associated with. - * - * @name MembersUpdate - * @request PUT:/teams/{teamId}/members/{username} - * @deprecated - */ - membersUpdate: (teamId, username, params = {}) => - this.request({ - path: `/teams/${teamId}/members/${username}`, - method: "PUT", - ...params, - }), - /** - * @description Remove team membership. In order to remove a membership between a user and a team, the authenticated user must have 'admin' permissions to the team or be an owner of the organization that the team is associated with. NOTE: This does not delete the user, it just removes their membership from the team. - * - * @name MembershipsDelete - * @request DELETE:/teams/{teamId}/memberships/{username} - */ - membershipsDelete: (teamId, username, params = {}) => - this.request({ - path: `/teams/${teamId}/memberships/${username}`, - method: "DELETE", - ...params, - }), - /** - * @description Get team membership. In order to get a user's membership with a team, the authenticated user must be a member of the team or an owner of the team's organization. - * - * @name MembershipsDetail - * @request GET:/teams/{teamId}/memberships/{username} - */ - membershipsDetail: (teamId, username, params = {}) => - this.request({ - path: `/teams/${teamId}/memberships/${username}`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description Add team membership. In order to add a membership between a user and a team, the authenticated user must have 'admin' permissions to the team or be an owner of the organization that the team is associated with. If the user is already a part of the team's organization (meaning they're on at least one other team in the organization), this endpoint will add the user to the team. If the user is completely unaffiliated with the team's organization (meaning they're on none of the organization's teams), this endpoint will send an invitation to the user via email. This newly-created membership will be in the 'pending' state until the user accepts the invitation, at which point the membership will transition to the 'active' state and the user will be added as a member of the team. - * - * @name MembershipsUpdate - * @request PUT:/teams/{teamId}/memberships/{username} - */ - membershipsUpdate: (teamId, username, params = {}) => - this.request({ - path: `/teams/${teamId}/memberships/${username}`, - method: "PUT", - format: "json", - ...params, - }), - /** - * @description List team repos - * - * @name ReposDetail - * @request GET:/teams/{teamId}/repos - */ - reposDetail: (teamId, params = {}) => - this.request({ - path: `/teams/${teamId}/repos`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description In order to remove a repository from a team, the authenticated user must be an owner of the org that the team is associated with. NOTE: This does not delete the repository, it just removes it from the team. - * - * @name ReposDelete - * @request DELETE:/teams/{teamId}/repos/{owner}/{repo} - */ - reposDelete: (teamId, owner, repo, params = {}) => - this.request({ - path: `/teams/${teamId}/repos/${owner}/${repo}`, - method: "DELETE", - ...params, - }), - /** - * @description Check if a team manages a repository - * - * @name ReposDetail2 - * @request GET:/teams/{teamId}/repos/{owner}/{repo} - * @originalName reposDetail - * @duplicate - */ - reposDetail2: (teamId, owner, repo, params = {}) => - this.request({ - path: `/teams/${teamId}/repos/${owner}/${repo}`, - method: "GET", - ...params, - }), - /** - * @description In order to add a repository to a team, the authenticated user must be an owner of the org that the team is associated with. Also, the repository must be owned by the organization, or a direct fork of a repository owned by the organization. - * - * @name ReposUpdate - * @request PUT:/teams/{teamId}/repos/{owner}/{repo} - */ - reposUpdate: (teamId, owner, repo, params = {}) => - this.request({ - path: `/teams/${teamId}/repos/${owner}/${repo}`, - method: "PUT", - ...params, - }), - }; - this.user = { - /** - * @description Get the authenticated user. - * - * @name UserList - * @request GET:/user - */ - userList: (params = {}) => - this.request({ - path: `/user`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description Update the authenticated user. - * - * @name UserPartialUpdate - * @request PATCH:/user - */ - userPartialUpdate: (body, params = {}) => - this.request({ - path: `/user`, - method: "PATCH", - body: body, - type: ContentType.Json, - format: "json", - ...params, - }), - /** - * @description Delete email address(es). You can include a single email address or an array of addresses. - * - * @name EmailsDelete - * @request DELETE:/user/emails - */ - emailsDelete: (body, params = {}) => - this.request({ - path: `/user/emails`, - method: "DELETE", - body: body, - type: ContentType.Json, - ...params, - }), - /** - * @description List email addresses for a user. In the final version of the API, this method will return an array of hashes with extended information for each email address indicating if the address has been verified and if it's primary email address for GitHub. Until API v3 is finalized, use the application/vnd.github.v3 media type to get other response format. - * - * @name EmailsList - * @request GET:/user/emails - */ - emailsList: (params = {}) => - this.request({ - path: `/user/emails`, - method: "GET", - ...params, - }), - /** - * @description Add email address(es). You can post a single email address or an array of addresses. - * - * @name EmailsCreate - * @request POST:/user/emails - */ - emailsCreate: (body, params = {}) => - this.request({ - path: `/user/emails`, - method: "POST", - body: body, - ...params, - }), - /** - * @description List the authenticated user's followers - * - * @name FollowersList - * @request GET:/user/followers - */ - followersList: (params = {}) => - this.request({ - path: `/user/followers`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description List who the authenticated user is following. - * - * @name FollowingList - * @request GET:/user/following - */ - followingList: (params = {}) => - this.request({ - path: `/user/following`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description Unfollow a user. Unfollowing a user requires the user to be logged in and authenticated with basic auth or OAuth with the user:follow scope. - * - * @name FollowingDelete - * @request DELETE:/user/following/{username} - */ - followingDelete: (username, params = {}) => - this.request({ - path: `/user/following/${username}`, - method: "DELETE", - ...params, - }), - /** - * @description Check if you are following a user. - * - * @name FollowingDetail - * @request GET:/user/following/{username} - */ - followingDetail: (username, params = {}) => - this.request({ - path: `/user/following/${username}`, - method: "GET", - ...params, - }), - /** - * @description Follow a user. Following a user requires the user to be logged in and authenticated with basic auth or OAuth with the user:follow scope. - * - * @name FollowingUpdate - * @request PUT:/user/following/{username} - */ - followingUpdate: (username, params = {}) => - this.request({ - path: `/user/following/${username}`, - method: "PUT", - ...params, - }), - /** - * @description List issues. List all issues across owned and member repositories for the authenticated user. - * - * @name IssuesList - * @request GET:/user/issues - */ - issuesList: (query, params = {}) => - this.request({ - path: `/user/issues`, - method: "GET", - query: query, - format: "json", - ...params, - }), - /** - * @description List your public keys. Lists the current user's keys. Management of public keys via the API requires that you are authenticated through basic auth, or OAuth with the 'user', 'write:public_key' scopes. - * - * @name KeysList - * @request GET:/user/keys - */ - keysList: (params = {}) => - this.request({ - path: `/user/keys`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description Create a public key. - * - * @name KeysCreate - * @request POST:/user/keys - */ - keysCreate: (body, params = {}) => - this.request({ - path: `/user/keys`, - method: "POST", - body: body, - format: "json", - ...params, - }), - /** - * @description Delete a public key. Removes a public key. Requires that you are authenticated via Basic Auth or via OAuth with at least admin:public_key scope. - * - * @name KeysDelete - * @request DELETE:/user/keys/{keyId} - */ - keysDelete: (keyId, params = {}) => - this.request({ - path: `/user/keys/${keyId}`, - method: "DELETE", - ...params, - }), - /** - * @description Get a single public key. - * - * @name KeysDetail - * @request GET:/user/keys/{keyId} - */ - keysDetail: (keyId, params = {}) => - this.request({ - path: `/user/keys/${keyId}`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description List public and private organizations for the authenticated user. - * - * @name OrgsList - * @request GET:/user/orgs - */ - orgsList: (params = {}) => - this.request({ - path: `/user/orgs`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description List repositories for the authenticated user. Note that this does not include repositories owned by organizations which the user can access. You can lis user organizations and list organization repositories separately. - * - * @name ReposList - * @request GET:/user/repos - */ - reposList: (query, params = {}) => - this.request({ - path: `/user/repos`, - method: "GET", - query: query, - format: "json", - ...params, - }), - /** - * @description Create a new repository for the authenticated user. OAuth users must supply repo scope. - * - * @name ReposCreate - * @request POST:/user/repos - */ - reposCreate: (body, params = {}) => - this.request({ - path: `/user/repos`, - method: "POST", - body: body, - format: "json", - ...params, - }), - /** - * @description List repositories being starred by the authenticated user. - * - * @name StarredList - * @request GET:/user/starred - */ - starredList: (query, params = {}) => - this.request({ - path: `/user/starred`, - method: "GET", - query: query, - format: "json", - ...params, - }), - /** - * @description Unstar a repository - * - * @name StarredDelete - * @request DELETE:/user/starred/{owner}/{repo} - */ - starredDelete: (owner, repo, params = {}) => - this.request({ - path: `/user/starred/${owner}/${repo}`, - method: "DELETE", - ...params, - }), - /** - * @description Check if you are starring a repository. - * - * @name StarredDetail - * @request GET:/user/starred/{owner}/{repo} - */ - starredDetail: (owner, repo, params = {}) => - this.request({ - path: `/user/starred/${owner}/${repo}`, - method: "GET", - ...params, - }), - /** - * @description Star a repository. - * - * @name StarredUpdate - * @request PUT:/user/starred/{owner}/{repo} - */ - starredUpdate: (owner, repo, params = {}) => - this.request({ - path: `/user/starred/${owner}/${repo}`, - method: "PUT", - ...params, - }), - /** - * @description List repositories being watched by the authenticated user. - * - * @name SubscriptionsList - * @request GET:/user/subscriptions - */ - subscriptionsList: (params = {}) => - this.request({ - path: `/user/subscriptions`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description Stop watching a repository - * - * @name SubscriptionsDelete - * @request DELETE:/user/subscriptions/{owner}/{repo} - * @deprecated - */ - subscriptionsDelete: (owner, repo, params = {}) => - this.request({ - path: `/user/subscriptions/${owner}/${repo}`, - method: "DELETE", - ...params, - }), - /** - * @description Check if you are watching a repository. - * - * @name SubscriptionsDetail - * @request GET:/user/subscriptions/{owner}/{repo} - * @deprecated - */ - subscriptionsDetail: (owner, repo, params = {}) => - this.request({ - path: `/user/subscriptions/${owner}/${repo}`, - method: "GET", - ...params, - }), - /** - * @description Watch a repository. - * - * @name SubscriptionsUpdate - * @request PUT:/user/subscriptions/{owner}/{repo} - * @deprecated - */ - subscriptionsUpdate: (owner, repo, params = {}) => - this.request({ - path: `/user/subscriptions/${owner}/${repo}`, - method: "PUT", - ...params, - }), - /** - * @description List all of the teams across all of the organizations to which the authenticated user belongs. This method requires user or repo scope when authenticating via OAuth. - * - * @name TeamsList - * @request GET:/user/teams - */ - teamsList: (params = {}) => - this.request({ - path: `/user/teams`, - method: "GET", - format: "json", - ...params, - }), - }; - this.users = { - /** - * @description Get all users. This provides a dump of every user, in the order that they signed up for GitHub. Note: Pagination is powered exclusively by the since parameter. Use the Link header to get the URL for the next page of users. - * - * @name UsersList - * @request GET:/users - */ - usersList: (query, params = {}) => - this.request({ - path: `/users`, - method: "GET", - query: query, - format: "json", - ...params, - }), - /** - * @description Get a single user. - * - * @name UsersDetail - * @request GET:/users/{username} - */ - usersDetail: (username, params = {}) => - this.request({ - path: `/users/${username}`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description If you are authenticated as the given user, you will see your private events. Otherwise, you'll only see public events. - * - * @name EventsDetail - * @request GET:/users/{username}/events - */ - eventsDetail: (username, params = {}) => - this.request({ - path: `/users/${username}/events`, - method: "GET", - ...params, - }), - /** - * @description This is the user's organization dashboard. You must be authenticated as the user to view this. - * - * @name EventsOrgsDetail - * @request GET:/users/{username}/events/orgs/{org} - */ - eventsOrgsDetail: (username, org, params = {}) => - this.request({ - path: `/users/${username}/events/orgs/${org}`, - method: "GET", - ...params, - }), - /** - * @description List a user's followers - * - * @name FollowersDetail - * @request GET:/users/{username}/followers - */ - followersDetail: (username, params = {}) => - this.request({ - path: `/users/${username}/followers`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description Check if one user follows another. - * - * @name FollowingDetail - * @request GET:/users/{username}/following/{targetUser} - */ - followingDetail: (username, targetUser, params = {}) => - this.request({ - path: `/users/${username}/following/${targetUser}`, - method: "GET", - ...params, - }), - /** - * @description List a users gists. - * - * @name GistsDetail - * @request GET:/users/{username}/gists - */ - gistsDetail: (username, query, params = {}) => - this.request({ - path: `/users/${username}/gists`, - method: "GET", - query: query, - format: "json", - ...params, - }), - /** - * @description List public keys for a user. Lists the verified public keys for a user. This is accessible by anyone. - * - * @name KeysDetail - * @request GET:/users/{username}/keys - */ - keysDetail: (username, params = {}) => - this.request({ - path: `/users/${username}/keys`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description List all public organizations for a user. - * - * @name OrgsDetail - * @request GET:/users/{username}/orgs - */ - orgsDetail: (username, params = {}) => - this.request({ - path: `/users/${username}/orgs`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description These are events that you'll only see public events. - * - * @name ReceivedEventsDetail - * @request GET:/users/{username}/received_events - */ - receivedEventsDetail: (username, params = {}) => - this.request({ - path: `/users/${username}/received_events`, - method: "GET", - ...params, - }), - /** - * @description List public events that a user has received - * - * @name ReceivedEventsPublicDetail - * @request GET:/users/{username}/received_events/public - */ - receivedEventsPublicDetail: (username, params = {}) => - this.request({ - path: `/users/${username}/received_events/public`, - method: "GET", - ...params, - }), - /** - * @description List public repositories for the specified user. - * - * @name ReposDetail - * @request GET:/users/{username}/repos - */ - reposDetail: (username, query, params = {}) => - this.request({ - path: `/users/${username}/repos`, - method: "GET", - query: query, - format: "json", - ...params, - }), - /** - * @description List repositories being starred by a user. - * - * @name StarredDetail - * @request GET:/users/{username}/starred - */ - starredDetail: (username, params = {}) => - this.request({ - path: `/users/${username}/starred`, - method: "GET", - ...params, - }), - /** - * @description List repositories being watched by a user. - * - * @name SubscriptionsDetail - * @request GET:/users/{username}/subscriptions - */ - subscriptionsDetail: (username, params = {}) => - this.request({ - path: `/users/${username}/subscriptions`, - method: "GET", - ...params, - }), - }; - } + emojis = { + /** + * @description Lists all the emojis available to use on GitHub. + * + * @name EmojisList + * @request GET:/emojis + */ + emojisList: (params = {}) => + this.request({ + path: `/emojis`, + method: "GET", + format: "json", + ...params, + }), + }; + events = { + /** + * @description List public events. + * + * @name EventsList + * @request GET:/events + */ + eventsList: (params = {}) => + this.request({ + path: `/events`, + method: "GET", + format: "json", + ...params, + }), + }; + feeds = { + /** + * @description List Feeds. GitHub provides several timeline resources in Atom format. The Feeds API lists all the feeds available to the authenticating user. + * + * @name FeedsList + * @request GET:/feeds + */ + feedsList: (params = {}) => + this.request({ + path: `/feeds`, + method: "GET", + format: "json", + ...params, + }), + }; + gists = { + /** + * @description List the authenticated user's gists or if called anonymously, this will return all public gists. + * + * @name GistsList + * @request GET:/gists + */ + gistsList: (query, params = {}) => + this.request({ + path: `/gists`, + method: "GET", + query: query, + format: "json", + ...params, + }), + /** + * @description Create a gist. + * + * @name GistsCreate + * @request POST:/gists + */ + gistsCreate: (body, params = {}) => + this.request({ + path: `/gists`, + method: "POST", + body: body, + type: ContentType.Json, + format: "json", + ...params, + }), + /** + * @description List all public gists. + * + * @name PublicList + * @request GET:/gists/public + */ + publicList: (query, params = {}) => + this.request({ + path: `/gists/public`, + method: "GET", + query: query, + format: "json", + ...params, + }), + /** + * @description List the authenticated user's starred gists. + * + * @name StarredList + * @request GET:/gists/starred + */ + starredList: (query, params = {}) => + this.request({ + path: `/gists/starred`, + method: "GET", + query: query, + format: "json", + ...params, + }), + /** + * @description Delete a gist. + * + * @name GistsDelete + * @request DELETE:/gists/{id} + */ + gistsDelete: (id, params = {}) => + this.request({ + path: `/gists/${id}`, + method: "DELETE", + ...params, + }), + /** + * @description Get a single gist. + * + * @name GistsDetail + * @request GET:/gists/{id} + */ + gistsDetail: (id, params = {}) => + this.request({ + path: `/gists/${id}`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description Edit a gist. + * + * @name GistsPartialUpdate + * @request PATCH:/gists/{id} + */ + gistsPartialUpdate: (id, body, params = {}) => + this.request({ + path: `/gists/${id}`, + method: "PATCH", + body: body, + type: ContentType.Json, + format: "json", + ...params, + }), + /** + * @description List comments on a gist. + * + * @name CommentsDetail + * @request GET:/gists/{id}/comments + */ + commentsDetail: (id, params = {}) => + this.request({ + path: `/gists/${id}/comments`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description Create a commen + * + * @name CommentsCreate + * @request POST:/gists/{id}/comments + */ + commentsCreate: (id, body, params = {}) => + this.request({ + path: `/gists/${id}/comments`, + method: "POST", + body: body, + format: "json", + ...params, + }), + /** + * @description Delete a comment. + * + * @name CommentsDelete + * @request DELETE:/gists/{id}/comments/{commentId} + */ + commentsDelete: (id, commentId, params = {}) => + this.request({ + path: `/gists/${id}/comments/${commentId}`, + method: "DELETE", + ...params, + }), + /** + * @description Get a single comment. + * + * @name CommentsDetail2 + * @request GET:/gists/{id}/comments/{commentId} + * @originalName commentsDetail + * @duplicate + */ + commentsDetail2: (id, commentId, params = {}) => + this.request({ + path: `/gists/${id}/comments/${commentId}`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description Edit a comment. + * + * @name CommentsPartialUpdate + * @request PATCH:/gists/{id}/comments/{commentId} + */ + commentsPartialUpdate: (id, commentId, body, params = {}) => + this.request({ + path: `/gists/${id}/comments/${commentId}`, + method: "PATCH", + body: body, + type: ContentType.Json, + format: "json", + ...params, + }), + /** + * @description Fork a gist. + * + * @name ForksCreate + * @request POST:/gists/{id}/forks + */ + forksCreate: (id, params = {}) => + this.request({ + path: `/gists/${id}/forks`, + method: "POST", + ...params, + }), + /** + * @description Unstar a gist. + * + * @name StarDelete + * @request DELETE:/gists/{id}/star + */ + starDelete: (id, params = {}) => + this.request({ + path: `/gists/${id}/star`, + method: "DELETE", + ...params, + }), + /** + * @description Check if a gist is starred. + * + * @name StarDetail + * @request GET:/gists/{id}/star + */ + starDetail: (id, params = {}) => + this.request({ + path: `/gists/${id}/star`, + method: "GET", + ...params, + }), + /** + * @description Star a gist. + * + * @name StarUpdate + * @request PUT:/gists/{id}/star + */ + starUpdate: (id, params = {}) => + this.request({ + path: `/gists/${id}/star`, + method: "PUT", + ...params, + }), + }; + gitignore = { + /** + * @description Listing available templates. List all templates available to pass as an option when creating a repository. + * + * @name TemplatesList + * @request GET:/gitignore/templates + */ + templatesList: (params = {}) => + this.request({ + path: `/gitignore/templates`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description Get a single template. + * + * @name TemplatesDetail + * @request GET:/gitignore/templates/{language} + */ + templatesDetail: (language, params = {}) => + this.request({ + path: `/gitignore/templates/${language}`, + method: "GET", + format: "json", + ...params, + }), + }; + issues = { + /** + * @description List issues. List all issues across all the authenticated user's visible repositories. + * + * @name IssuesList + * @request GET:/issues + */ + issuesList: (query, params = {}) => + this.request({ + path: `/issues`, + method: "GET", + query: query, + format: "json", + ...params, + }), + }; + legacy = { + /** + * @description Find issues by state and keyword. + * + * @name IssuesSearchDetail + * @request GET:/legacy/issues/search/{owner}/{repository}/{state}/{keyword} + * @deprecated + */ + issuesSearchDetail: (keyword, state, owner, repository, params = {}) => + this.request({ + path: `/legacy/issues/search/${owner}/${repository}/${state}/${keyword}`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description Find repositories by keyword. Note, this legacy method does not follow the v3 pagination pattern. This method returns up to 100 results per page and pages can be fetched using the start_page parameter. + * + * @name ReposSearchDetail + * @request GET:/legacy/repos/search/{keyword} + * @deprecated + */ + reposSearchDetail: (keyword, query, params = {}) => + this.request({ + path: `/legacy/repos/search/${keyword}`, + method: "GET", + query: query, + format: "json", + ...params, + }), + /** + * @description This API call is added for compatibility reasons only. + * + * @name UserEmailDetail + * @request GET:/legacy/user/email/{email} + * @deprecated + */ + userEmailDetail: (email, params = {}) => + this.request({ + path: `/legacy/user/email/${email}`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description Find users by keyword. + * + * @name UserSearchDetail + * @request GET:/legacy/user/search/{keyword} + * @deprecated + */ + userSearchDetail: (keyword, query, params = {}) => + this.request({ + path: `/legacy/user/search/${keyword}`, + method: "GET", + query: query, + format: "json", + ...params, + }), + }; + markdown = { + /** + * @description Render an arbitrary Markdown document + * + * @name MarkdownCreate + * @request POST:/markdown + */ + markdownCreate: (body, params = {}) => + this.request({ + path: `/markdown`, + method: "POST", + body: body, + type: ContentType.Json, + ...params, + }), + /** + * @description Render a Markdown document in raw mode + * + * @name PostMarkdown + * @request POST:/markdown/raw + */ + postMarkdown: (params = {}) => + this.request({ + path: `/markdown/raw`, + method: "POST", + ...params, + }), + }; + meta = { + /** + * @description This gives some information about GitHub.com, the service. + * + * @name MetaList + * @request GET:/meta + */ + metaList: (params = {}) => + this.request({ + path: `/meta`, + method: "GET", + format: "json", + ...params, + }), + }; + networks = { + /** + * @description List public events for a network of repositories. + * + * @name EventsDetail + * @request GET:/networks/{owner}/{repo}/events + */ + eventsDetail: (owner, repo, params = {}) => + this.request({ + path: `/networks/${owner}/${repo}/events`, + method: "GET", + format: "json", + ...params, + }), + }; + notifications = { + /** + * @description List your notifications. List all notifications for the current user, grouped by repository. + * + * @name NotificationsList + * @request GET:/notifications + */ + notificationsList: (query, params = {}) => + this.request({ + path: `/notifications`, + method: "GET", + query: query, + format: "json", + ...params, + }), + /** + * @description Mark as read. Marking a notification as "read" removes it from the default view on GitHub.com. + * + * @name NotificationsUpdate + * @request PUT:/notifications + */ + notificationsUpdate: (body, params = {}) => + this.request({ + path: `/notifications`, + method: "PUT", + body: body, + ...params, + }), + /** + * @description View a single thread. + * + * @name ThreadsDetail + * @request GET:/notifications/threads/{id} + */ + threadsDetail: (id, params = {}) => + this.request({ + path: `/notifications/threads/${id}`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description Mark a thread as read + * + * @name ThreadsPartialUpdate + * @request PATCH:/notifications/threads/{id} + */ + threadsPartialUpdate: (id, params = {}) => + this.request({ + path: `/notifications/threads/${id}`, + method: "PATCH", + ...params, + }), + /** + * @description Delete a Thread Subscription. + * + * @name ThreadsSubscriptionDelete + * @request DELETE:/notifications/threads/{id}/subscription + */ + threadsSubscriptionDelete: (id, params = {}) => + this.request({ + path: `/notifications/threads/${id}/subscription`, + method: "DELETE", + ...params, + }), + /** + * @description Get a Thread Subscription. + * + * @name ThreadsSubscriptionDetail + * @request GET:/notifications/threads/{id}/subscription + */ + threadsSubscriptionDetail: (id, params = {}) => + this.request({ + path: `/notifications/threads/${id}/subscription`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description Set a Thread Subscription. This lets you subscribe to a thread, or ignore it. Subscribing to a thread is unnecessary if the user is already subscribed to the repository. Ignoring a thread will mute all future notifications (until you comment or get @mentioned). + * + * @name ThreadsSubscriptionUpdate + * @request PUT:/notifications/threads/{id}/subscription + */ + threadsSubscriptionUpdate: (id, body, params = {}) => + this.request({ + path: `/notifications/threads/${id}/subscription`, + method: "PUT", + body: body, + type: ContentType.Json, + format: "json", + ...params, + }), + }; + orgs = { + /** + * @description Get an Organization. + * + * @name OrgsDetail + * @request GET:/orgs/{org} + */ + orgsDetail: (org, params = {}) => + this.request({ + path: `/orgs/${org}`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description Edit an Organization. + * + * @name OrgsPartialUpdate + * @request PATCH:/orgs/{org} + */ + orgsPartialUpdate: (org, body, params = {}) => + this.request({ + path: `/orgs/${org}`, + method: "PATCH", + body: body, + type: ContentType.Json, + format: "json", + ...params, + }), + /** + * @description List public events for an organization. + * + * @name EventsDetail + * @request GET:/orgs/{org}/events + */ + eventsDetail: (org, params = {}) => + this.request({ + path: `/orgs/${org}/events`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description List issues. List all issues for a given organization for the authenticated user. + * + * @name IssuesDetail + * @request GET:/orgs/{org}/issues + */ + issuesDetail: (org, query, params = {}) => + this.request({ + path: `/orgs/${org}/issues`, + method: "GET", + query: query, + format: "json", + ...params, + }), + /** + * @description Members list. List all users who are members of an organization. A member is a user tha belongs to at least 1 team in the organization. If the authenticated user is also an owner of this organization then both concealed and public members will be returned. If the requester is not an owner of the organization the query will be redirected to the public members list. + * + * @name MembersDetail + * @request GET:/orgs/{org}/members + */ + membersDetail: (org, params = {}) => + this.request({ + path: `/orgs/${org}/members`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description Remove a member. Removing a user from this list will remove them from all teams and they will no longer have any access to the organization's repositories. + * + * @name MembersDelete + * @request DELETE:/orgs/{org}/members/{username} + */ + membersDelete: (org, username, params = {}) => + this.request({ + path: `/orgs/${org}/members/${username}`, + method: "DELETE", + ...params, + }), + /** + * @description Check if a user is, publicly or privately, a member of the organization. + * + * @name MembersDetail2 + * @request GET:/orgs/{org}/members/{username} + * @originalName membersDetail + * @duplicate + */ + membersDetail2: (org, username, params = {}) => + this.request({ + path: `/orgs/${org}/members/${username}`, + method: "GET", + ...params, + }), + /** + * @description Public members list. Members of an organization can choose to have their membership publicized or not. + * + * @name PublicMembersDetail + * @request GET:/orgs/{org}/public_members + */ + publicMembersDetail: (org, params = {}) => + this.request({ + path: `/orgs/${org}/public_members`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description Conceal a user's membership. + * + * @name PublicMembersDelete + * @request DELETE:/orgs/{org}/public_members/{username} + */ + publicMembersDelete: (org, username, params = {}) => + this.request({ + path: `/orgs/${org}/public_members/${username}`, + method: "DELETE", + ...params, + }), + /** + * @description Check public membership. + * + * @name PublicMembersDetail2 + * @request GET:/orgs/{org}/public_members/{username} + * @originalName publicMembersDetail + * @duplicate + */ + publicMembersDetail2: (org, username, params = {}) => + this.request({ + path: `/orgs/${org}/public_members/${username}`, + method: "GET", + ...params, + }), + /** + * @description Publicize a user's membership. + * + * @name PublicMembersUpdate + * @request PUT:/orgs/{org}/public_members/{username} + */ + publicMembersUpdate: (org, username, params = {}) => + this.request({ + path: `/orgs/${org}/public_members/${username}`, + method: "PUT", + ...params, + }), + /** + * @description List repositories for the specified org. + * + * @name ReposDetail + * @request GET:/orgs/{org}/repos + */ + reposDetail: (org, query, params = {}) => + this.request({ + path: `/orgs/${org}/repos`, + method: "GET", + query: query, + format: "json", + ...params, + }), + /** + * @description Create a new repository for the authenticated user. OAuth users must supply repo scope. + * + * @name ReposCreate + * @request POST:/orgs/{org}/repos + */ + reposCreate: (org, body, params = {}) => + this.request({ + path: `/orgs/${org}/repos`, + method: "POST", + body: body, + format: "json", + ...params, + }), + /** + * @description List teams. + * + * @name TeamsDetail + * @request GET:/orgs/{org}/teams + */ + teamsDetail: (org, params = {}) => + this.request({ + path: `/orgs/${org}/teams`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description Create team. In order to create a team, the authenticated user must be an owner of organization. + * + * @name TeamsCreate + * @request POST:/orgs/{org}/teams + */ + teamsCreate: (org, body, params = {}) => + this.request({ + path: `/orgs/${org}/teams`, + method: "POST", + body: body, + type: ContentType.Json, + format: "json", + ...params, + }), + }; + rateLimit = { + /** + * @description Get your current rate limit status Note: Accessing this endpoint does not count against your rate limit. + * + * @name RateLimitList + * @request GET:/rate_limit + */ + rateLimitList: (params = {}) => + this.request({ + path: `/rate_limit`, + method: "GET", + format: "json", + ...params, + }), + }; + repos = { + /** + * @description Delete a Repository. Deleting a repository requires admin access. If OAuth is used, the delete_repo scope is required. + * + * @name ReposDelete + * @request DELETE:/repos/{owner}/{repo} + */ + reposDelete: (owner, repo, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}`, + method: "DELETE", + ...params, + }), + /** + * @description Get repository. + * + * @name ReposDetail + * @request GET:/repos/{owner}/{repo} + */ + reposDetail: (owner, repo, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description Edit repository. + * + * @name ReposPartialUpdate + * @request PATCH:/repos/{owner}/{repo} + */ + reposPartialUpdate: (owner, repo, body, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}`, + method: "PATCH", + body: body, + type: ContentType.Json, + format: "json", + ...params, + }), + /** + * @description List assignees. This call lists all the available assignees (owner + collaborators) to which issues may be assigned. + * + * @name AssigneesDetail + * @request GET:/repos/{owner}/{repo}/assignees + */ + assigneesDetail: (owner, repo, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/assignees`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description Check assignee. You may also check to see if a particular user is an assignee for a repository. + * + * @name AssigneesDetail2 + * @request GET:/repos/{owner}/{repo}/assignees/{assignee} + * @originalName assigneesDetail + * @duplicate + */ + assigneesDetail2: (owner, repo, assignee, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/assignees/${assignee}`, + method: "GET", + ...params, + }), + /** + * @description Get list of branches + * + * @name BranchesDetail + * @request GET:/repos/{owner}/{repo}/branches + */ + branchesDetail: (owner, repo, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/branches`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description Get Branch + * + * @name BranchesDetail2 + * @request GET:/repos/{owner}/{repo}/branches/{branch} + * @originalName branchesDetail + * @duplicate + */ + branchesDetail2: (owner, repo, branch, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/branches/${branch}`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description List. When authenticating as an organization owner of an organization-owned repository, all organization owners are included in the list of collaborators. Otherwise, only users with access to the repository are returned in the collaborators list. + * + * @name CollaboratorsDetail + * @request GET:/repos/{owner}/{repo}/collaborators + */ + collaboratorsDetail: (owner, repo, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/collaborators`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description Remove collaborator. + * + * @name CollaboratorsDelete + * @request DELETE:/repos/{owner}/{repo}/collaborators/{user} + */ + collaboratorsDelete: (owner, repo, user, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/collaborators/${user}`, + method: "DELETE", + ...params, + }), + /** + * @description Check if user is a collaborator + * + * @name CollaboratorsDetail2 + * @request GET:/repos/{owner}/{repo}/collaborators/{user} + * @originalName collaboratorsDetail + * @duplicate + */ + collaboratorsDetail2: (owner, repo, user, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/collaborators/${user}`, + method: "GET", + ...params, + }), + /** + * @description Add collaborator. + * + * @name CollaboratorsUpdate + * @request PUT:/repos/{owner}/{repo}/collaborators/{user} + */ + collaboratorsUpdate: (owner, repo, user, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/collaborators/${user}`, + method: "PUT", + ...params, + }), + /** + * @description List commit comments for a repository. Comments are ordered by ascending ID. + * + * @name CommentsDetail + * @request GET:/repos/{owner}/{repo}/comments + */ + commentsDetail: (owner, repo, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/comments`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description Delete a commit comment + * + * @name CommentsDelete + * @request DELETE:/repos/{owner}/{repo}/comments/{commentId} + */ + commentsDelete: (owner, repo, commentId, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/comments/${commentId}`, + method: "DELETE", + ...params, + }), + /** + * @description Get a single commit comment. + * + * @name CommentsDetail2 + * @request GET:/repos/{owner}/{repo}/comments/{commentId} + * @originalName commentsDetail + * @duplicate + */ + commentsDetail2: (owner, repo, commentId, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/comments/${commentId}`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description Update a commit comment. + * + * @name CommentsPartialUpdate + * @request PATCH:/repos/{owner}/{repo}/comments/{commentId} + */ + commentsPartialUpdate: (owner, repo, commentId, body, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/comments/${commentId}`, + method: "PATCH", + body: body, + format: "json", + ...params, + }), + /** + * @description List commits on a repository. + * + * @name CommitsDetail + * @request GET:/repos/{owner}/{repo}/commits + */ + commitsDetail: (owner, repo, query, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/commits`, + method: "GET", + query: query, + format: "json", + ...params, + }), + /** + * @description Get the combined Status for a specific Ref The Combined status endpoint is currently available for developers to preview. During the preview period, the API may change without advance notice. Please see the blog post for full details. To access this endpoint during the preview period, you must provide a custom media type in the Accept header: application/vnd.github.she-hulk-preview+json + * + * @name CommitsStatusDetail + * @request GET:/repos/{owner}/{repo}/commits/{ref}/status + */ + commitsStatusDetail: (owner, repo, ref, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/commits/${ref}/status`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description Get a single commit. + * + * @name CommitsDetail2 + * @request GET:/repos/{owner}/{repo}/commits/{shaCode} + * @originalName commitsDetail + * @duplicate + */ + commitsDetail2: (owner, repo, shaCode, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/commits/${shaCode}`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description List comments for a single commitList comments for a single commit. + * + * @name CommitsCommentsDetail + * @request GET:/repos/{owner}/{repo}/commits/{shaCode}/comments + */ + commitsCommentsDetail: (owner, repo, shaCode, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/commits/${shaCode}/comments`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description Create a commit comment. + * + * @name CommitsCommentsCreate + * @request POST:/repos/{owner}/{repo}/commits/{shaCode}/comments + */ + commitsCommentsCreate: (owner, repo, shaCode, body, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/commits/${shaCode}/comments`, + method: "POST", + body: body, + type: ContentType.Json, + format: "json", + ...params, + }), + /** + * @description Compare two commits + * + * @name CompareDetail + * @request GET:/repos/{owner}/{repo}/compare/{baseId}...{headId} + */ + compareDetail: (owner, repo, baseId, headId, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/compare/${baseId}...${headId}`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description Delete a file. This method deletes a file in a repository. + * + * @name ContentsDelete + * @request DELETE:/repos/{owner}/{repo}/contents/{path} + */ + contentsDelete: (owner, repo, path, body, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/contents/${path}`, + method: "DELETE", + body: body, + type: ContentType.Json, + format: "json", + ...params, + }), + /** + * @description Get contents. This method returns the contents of a file or directory in a repository. Files and symlinks support a custom media type for getting the raw content. Directories and submodules do not support custom media types. Note: This API supports files up to 1 megabyte in size. Here can be many outcomes. For details see "http://developer.github.com/v3/repos/contents/" + * + * @name ContentsDetail + * @request GET:/repos/{owner}/{repo}/contents/{path} + */ + contentsDetail: (owner, repo, path, query, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/contents/${path}`, + method: "GET", + query: query, + format: "json", + ...params, + }), + /** + * @description Create a file. + * + * @name ContentsUpdate + * @request PUT:/repos/{owner}/{repo}/contents/{path} + */ + contentsUpdate: (owner, repo, path, body, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/contents/${path}`, + method: "PUT", + body: body, + type: ContentType.Json, + format: "json", + ...params, + }), + /** + * @description Get list of contributors. + * + * @name ContributorsDetail + * @request GET:/repos/{owner}/{repo}/contributors + */ + contributorsDetail: (owner, repo, query, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/contributors`, + method: "GET", + query: query, + format: "json", + ...params, + }), + /** + * @description Users with pull access can view deployments for a repository + * + * @name DeploymentsDetail + * @request GET:/repos/{owner}/{repo}/deployments + */ + deploymentsDetail: (owner, repo, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/deployments`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description Users with push access can create a deployment for a given ref + * + * @name DeploymentsCreate + * @request POST:/repos/{owner}/{repo}/deployments + */ + deploymentsCreate: (owner, repo, body, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/deployments`, + method: "POST", + body: body, + type: ContentType.Json, + format: "json", + ...params, + }), + /** + * @description Users with pull access can view deployment statuses for a deployment + * + * @name DeploymentsStatusesDetail + * @request GET:/repos/{owner}/{repo}/deployments/{id}/statuses + */ + deploymentsStatusesDetail: (owner, repo, id, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/deployments/${id}/statuses`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description Create a Deployment Status Users with push access can create deployment statuses for a given deployment: + * + * @name DeploymentsStatusesCreate + * @request POST:/repos/{owner}/{repo}/deployments/{id}/statuses + */ + deploymentsStatusesCreate: (owner, repo, id, body, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/deployments/${id}/statuses`, + method: "POST", + body: body, + type: ContentType.Json, + ...params, + }), + /** + * @description Deprecated. List downloads for a repository. + * + * @name DownloadsDetail + * @request GET:/repos/{owner}/{repo}/downloads + * @deprecated + */ + downloadsDetail: (owner, repo, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/downloads`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description Deprecated. Delete a download. + * + * @name DownloadsDelete + * @request DELETE:/repos/{owner}/{repo}/downloads/{downloadId} + * @deprecated + */ + downloadsDelete: (owner, repo, downloadId, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/downloads/${downloadId}`, + method: "DELETE", + ...params, + }), + /** + * @description Deprecated. Get a single download. + * + * @name DownloadsDetail2 + * @request GET:/repos/{owner}/{repo}/downloads/{downloadId} + * @deprecated + * @originalName downloadsDetail + * @duplicate + */ + downloadsDetail2: (owner, repo, downloadId, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/downloads/${downloadId}`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description Get list of repository events. + * + * @name EventsDetail + * @request GET:/repos/{owner}/{repo}/events + */ + eventsDetail: (owner, repo, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/events`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description List forks. + * + * @name ForksDetail + * @request GET:/repos/{owner}/{repo}/forks + */ + forksDetail: (owner, repo, query, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/forks`, + method: "GET", + query: query, + format: "json", + ...params, + }), + /** + * @description Create a fork. Forking a Repository happens asynchronously. Therefore, you may have to wai a short period before accessing the git objects. If this takes longer than 5 minutes, be sure to contact Support. + * + * @name ForksCreate + * @request POST:/repos/{owner}/{repo}/forks + */ + forksCreate: (owner, repo, body, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/forks`, + method: "POST", + body: body, + type: ContentType.Json, + format: "json", + ...params, + }), + /** + * @description Create a Blob. + * + * @name GitBlobsCreate + * @request POST:/repos/{owner}/{repo}/git/blobs + */ + gitBlobsCreate: (owner, repo, body, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/git/blobs`, + method: "POST", + body: body, + type: ContentType.Json, + format: "json", + ...params, + }), + /** + * @description Get a Blob. Since blobs can be any arbitrary binary data, the input and responses for the blob API takes an encoding parameter that can be either utf-8 or base64. If your data cannot be losslessly sent as a UTF-8 string, you can base64 encode it. + * + * @name GitBlobsDetail + * @request GET:/repos/{owner}/{repo}/git/blobs/{shaCode} + */ + gitBlobsDetail: (owner, repo, shaCode, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/git/blobs/${shaCode}`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description Create a Commit. + * + * @name GitCommitsCreate + * @request POST:/repos/{owner}/{repo}/git/commits + */ + gitCommitsCreate: (owner, repo, body, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/git/commits`, + method: "POST", + body: body, + type: ContentType.Json, + format: "json", + ...params, + }), + /** + * @description Get a Commit. + * + * @name GitCommitsDetail + * @request GET:/repos/{owner}/{repo}/git/commits/{shaCode} + */ + gitCommitsDetail: (owner, repo, shaCode, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/git/commits/${shaCode}`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description Get all References + * + * @name GitRefsDetail + * @request GET:/repos/{owner}/{repo}/git/refs + */ + gitRefsDetail: (owner, repo, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/git/refs`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description Create a Reference + * + * @name GitRefsCreate + * @request POST:/repos/{owner}/{repo}/git/refs + */ + gitRefsCreate: (owner, repo, body, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/git/refs`, + method: "POST", + body: body, + type: ContentType.Json, + format: "json", + ...params, + }), + /** + * @description Delete a Reference Example: Deleting a branch: DELETE /repos/octocat/Hello-World/git/refs/heads/feature-a Example: Deleting a tag: DELETE /repos/octocat/Hello-World/git/refs/tags/v1.0 + * + * @name GitRefsDelete + * @request DELETE:/repos/{owner}/{repo}/git/refs/{ref} + */ + gitRefsDelete: (owner, repo, ref, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/git/refs/${ref}`, + method: "DELETE", + ...params, + }), + /** + * @description Get a Reference + * + * @name GitRefsDetail2 + * @request GET:/repos/{owner}/{repo}/git/refs/{ref} + * @originalName gitRefsDetail + * @duplicate + */ + gitRefsDetail2: (owner, repo, ref, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/git/refs/${ref}`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description Update a Reference + * + * @name GitRefsPartialUpdate + * @request PATCH:/repos/{owner}/{repo}/git/refs/{ref} + */ + gitRefsPartialUpdate: (owner, repo, ref, body, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/git/refs/${ref}`, + method: "PATCH", + body: body, + type: ContentType.Json, + format: "json", + ...params, + }), + /** + * @description Create a Tag Object. Note that creating a tag object does not create the reference that makes a tag in Git. If you want to create an annotated tag in Git, you have to do this call to create the tag object, and then create the refs/tags/[tag] reference. If you want to create a lightweight tag, you only have to create the tag reference - this call would be unnecessary. + * + * @name GitTagsCreate + * @request POST:/repos/{owner}/{repo}/git/tags + */ + gitTagsCreate: (owner, repo, body, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/git/tags`, + method: "POST", + body: body, + type: ContentType.Json, + format: "json", + ...params, + }), + /** + * @description Get a Tag. + * + * @name GitTagsDetail + * @request GET:/repos/{owner}/{repo}/git/tags/{shaCode} + */ + gitTagsDetail: (owner, repo, shaCode, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/git/tags/${shaCode}`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description Create a Tree. The tree creation API will take nested entries as well. If both a tree and a nested path modifying that tree are specified, it will overwrite the contents of that tree with the new path contents and write a new tree out. + * + * @name GitTreesCreate + * @request POST:/repos/{owner}/{repo}/git/trees + */ + gitTreesCreate: (owner, repo, body, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/git/trees`, + method: "POST", + body: body, + type: ContentType.Json, + format: "json", + ...params, + }), + /** + * @description Get a Tree. + * + * @name GitTreesDetail + * @request GET:/repos/{owner}/{repo}/git/trees/{shaCode} + */ + gitTreesDetail: (owner, repo, shaCode, query, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/git/trees/${shaCode}`, + method: "GET", + query: query, + format: "json", + ...params, + }), + /** + * @description Get list of hooks. + * + * @name HooksDetail + * @request GET:/repos/{owner}/{repo}/hooks + */ + hooksDetail: (owner, repo, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/hooks`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description Create a hook. + * + * @name HooksCreate + * @request POST:/repos/{owner}/{repo}/hooks + */ + hooksCreate: (owner, repo, body, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/hooks`, + method: "POST", + body: body, + format: "json", + ...params, + }), + /** + * @description Delete a hook. + * + * @name HooksDelete + * @request DELETE:/repos/{owner}/{repo}/hooks/{hookId} + */ + hooksDelete: (owner, repo, hookId, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/hooks/${hookId}`, + method: "DELETE", + ...params, + }), + /** + * @description Get single hook. + * + * @name HooksDetail2 + * @request GET:/repos/{owner}/{repo}/hooks/{hookId} + * @originalName hooksDetail + * @duplicate + */ + hooksDetail2: (owner, repo, hookId, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/hooks/${hookId}`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description Edit a hook. + * + * @name HooksPartialUpdate + * @request PATCH:/repos/{owner}/{repo}/hooks/{hookId} + */ + hooksPartialUpdate: (owner, repo, hookId, body, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/hooks/${hookId}`, + method: "PATCH", + body: body, + format: "json", + ...params, + }), + /** + * @description Test a push hook. This will trigger the hook with the latest push to the current repository if the hook is subscribed to push events. If the hook is not subscribed to push events, the server will respond with 204 but no test POST will be generated. Note: Previously /repos/:owner/:repo/hooks/:id/tes + * + * @name HooksTestsCreate + * @request POST:/repos/{owner}/{repo}/hooks/{hookId}/tests + */ + hooksTestsCreate: (owner, repo, hookId, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/hooks/${hookId}/tests`, + method: "POST", + ...params, + }), + /** + * @description List issues for a repository. + * + * @name IssuesDetail + * @request GET:/repos/{owner}/{repo}/issues + */ + issuesDetail: (owner, repo, query, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/issues`, + method: "GET", + query: query, + format: "json", + ...params, + }), + /** + * @description Create an issue. Any user with pull access to a repository can create an issue. + * + * @name IssuesCreate + * @request POST:/repos/{owner}/{repo}/issues + */ + issuesCreate: (owner, repo, body, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/issues`, + method: "POST", + body: body, + format: "json", + ...params, + }), + /** + * @description List comments in a repository. + * + * @name IssuesCommentsDetail + * @request GET:/repos/{owner}/{repo}/issues/comments + */ + issuesCommentsDetail: (owner, repo, query, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/issues/comments`, + method: "GET", + query: query, + format: "json", + ...params, + }), + /** + * @description Delete a comment. + * + * @name IssuesCommentsDelete + * @request DELETE:/repos/{owner}/{repo}/issues/comments/{commentId} + */ + issuesCommentsDelete: (owner, repo, commentId, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/issues/comments/${commentId}`, + method: "DELETE", + ...params, + }), + /** + * @description Get a single comment. + * + * @name IssuesCommentsDetail2 + * @request GET:/repos/{owner}/{repo}/issues/comments/{commentId} + * @originalName issuesCommentsDetail + * @duplicate + */ + issuesCommentsDetail2: (owner, repo, commentId, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/issues/comments/${commentId}`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description Edit a comment. + * + * @name IssuesCommentsPartialUpdate + * @request PATCH:/repos/{owner}/{repo}/issues/comments/{commentId} + */ + issuesCommentsPartialUpdate: (owner, repo, commentId, body, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/issues/comments/${commentId}`, + method: "PATCH", + body: body, + format: "json", + ...params, + }), + /** + * @description List issue events for a repository. + * + * @name IssuesEventsDetail + * @request GET:/repos/{owner}/{repo}/issues/events + */ + issuesEventsDetail: (owner, repo, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/issues/events`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description Get a single event. + * + * @name IssuesEventsDetail2 + * @request GET:/repos/{owner}/{repo}/issues/events/{eventId} + * @originalName issuesEventsDetail + * @duplicate + */ + issuesEventsDetail2: (owner, repo, eventId, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/issues/events/${eventId}`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description Get a single issue + * + * @name IssuesDetail2 + * @request GET:/repos/{owner}/{repo}/issues/{number} + * @originalName issuesDetail + * @duplicate + */ + issuesDetail2: (owner, repo, number, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/issues/${number}`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description Edit an issue. Issue owners and users with push access can edit an issue. + * + * @name IssuesPartialUpdate + * @request PATCH:/repos/{owner}/{repo}/issues/{number} + */ + issuesPartialUpdate: (owner, repo, number, body, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/issues/${number}`, + method: "PATCH", + body: body, + format: "json", + ...params, + }), + /** + * @description List comments on an issue. + * + * @name IssuesCommentsDetail3 + * @request GET:/repos/{owner}/{repo}/issues/{number}/comments + * @originalName issuesCommentsDetail + * @duplicate + */ + issuesCommentsDetail3: (owner, repo, number, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/issues/${number}/comments`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description Create a comment. + * + * @name IssuesCommentsCreate + * @request POST:/repos/{owner}/{repo}/issues/{number}/comments + */ + issuesCommentsCreate: (owner, repo, number, body, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/issues/${number}/comments`, + method: "POST", + body: body, + format: "json", + ...params, + }), + /** + * @description List events for an issue. + * + * @name IssuesEventsDetail3 + * @request GET:/repos/{owner}/{repo}/issues/{number}/events + * @originalName issuesEventsDetail + * @duplicate + */ + issuesEventsDetail3: (owner, repo, number, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/issues/${number}/events`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description Remove all labels from an issue. + * + * @name IssuesLabelsDelete + * @request DELETE:/repos/{owner}/{repo}/issues/{number}/labels + */ + issuesLabelsDelete: (owner, repo, number, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/issues/${number}/labels`, + method: "DELETE", + ...params, + }), + /** + * @description List labels on an issue. + * + * @name IssuesLabelsDetail + * @request GET:/repos/{owner}/{repo}/issues/{number}/labels + */ + issuesLabelsDetail: (owner, repo, number, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/issues/${number}/labels`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description Add labels to an issue. + * + * @name IssuesLabelsCreate + * @request POST:/repos/{owner}/{repo}/issues/{number}/labels + */ + issuesLabelsCreate: (owner, repo, number, body, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/issues/${number}/labels`, + method: "POST", + body: body, + format: "json", + ...params, + }), + /** + * @description Replace all labels for an issue. Sending an empty array ([]) will remove all Labels from the Issue. + * + * @name IssuesLabelsUpdate + * @request PUT:/repos/{owner}/{repo}/issues/{number}/labels + */ + issuesLabelsUpdate: (owner, repo, number, body, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/issues/${number}/labels`, + method: "PUT", + body: body, + format: "json", + ...params, + }), + /** + * @description Remove a label from an issue. + * + * @name IssuesLabelsDelete2 + * @request DELETE:/repos/{owner}/{repo}/issues/{number}/labels/{name} + * @originalName issuesLabelsDelete + * @duplicate + */ + issuesLabelsDelete2: (owner, repo, number, name, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/issues/${number}/labels/${name}`, + method: "DELETE", + ...params, + }), + /** + * @description Get list of keys. + * + * @name KeysDetail + * @request GET:/repos/{owner}/{repo}/keys + */ + keysDetail: (owner, repo, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/keys`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description Create a key. + * + * @name KeysCreate + * @request POST:/repos/{owner}/{repo}/keys + */ + keysCreate: (owner, repo, body, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/keys`, + method: "POST", + body: body, + format: "json", + ...params, + }), + /** + * @description Delete a key. + * + * @name KeysDelete + * @request DELETE:/repos/{owner}/{repo}/keys/{keyId} + */ + keysDelete: (owner, repo, keyId, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/keys/${keyId}`, + method: "DELETE", + ...params, + }), + /** + * @description Get a key + * + * @name KeysDetail2 + * @request GET:/repos/{owner}/{repo}/keys/{keyId} + * @originalName keysDetail + * @duplicate + */ + keysDetail2: (owner, repo, keyId, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/keys/${keyId}`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description List all labels for this repository. + * + * @name LabelsDetail + * @request GET:/repos/{owner}/{repo}/labels + */ + labelsDetail: (owner, repo, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/labels`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description Create a label. + * + * @name LabelsCreate + * @request POST:/repos/{owner}/{repo}/labels + */ + labelsCreate: (owner, repo, body, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/labels`, + method: "POST", + body: body, + format: "json", + ...params, + }), + /** + * @description Delete a label. + * + * @name LabelsDelete + * @request DELETE:/repos/{owner}/{repo}/labels/{name} + */ + labelsDelete: (owner, repo, name, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/labels/${name}`, + method: "DELETE", + ...params, + }), + /** + * @description Get a single label. + * + * @name LabelsDetail2 + * @request GET:/repos/{owner}/{repo}/labels/{name} + * @originalName labelsDetail + * @duplicate + */ + labelsDetail2: (owner, repo, name, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/labels/${name}`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description Update a label. + * + * @name LabelsPartialUpdate + * @request PATCH:/repos/{owner}/{repo}/labels/{name} + */ + labelsPartialUpdate: (owner, repo, name, body, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/labels/${name}`, + method: "PATCH", + body: body, + format: "json", + ...params, + }), + /** + * @description List languages. List languages for the specified repository. The value on the right of a language is the number of bytes of code written in that language. + * + * @name LanguagesDetail + * @request GET:/repos/{owner}/{repo}/languages + */ + languagesDetail: (owner, repo, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/languages`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description Perform a merge. + * + * @name MergesCreate + * @request POST:/repos/{owner}/{repo}/merges + */ + mergesCreate: (owner, repo, body, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/merges`, + method: "POST", + body: body, + type: ContentType.Json, + format: "json", + ...params, + }), + /** + * @description List milestones for a repository. + * + * @name MilestonesDetail + * @request GET:/repos/{owner}/{repo}/milestones + */ + milestonesDetail: (owner, repo, query, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/milestones`, + method: "GET", + query: query, + format: "json", + ...params, + }), + /** + * @description Create a milestone. + * + * @name MilestonesCreate + * @request POST:/repos/{owner}/{repo}/milestones + */ + milestonesCreate: (owner, repo, body, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/milestones`, + method: "POST", + body: body, + format: "json", + ...params, + }), + /** + * @description Delete a milestone. + * + * @name MilestonesDelete + * @request DELETE:/repos/{owner}/{repo}/milestones/{number} + */ + milestonesDelete: (owner, repo, number, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/milestones/${number}`, + method: "DELETE", + ...params, + }), + /** + * @description Get a single milestone. + * + * @name MilestonesDetail2 + * @request GET:/repos/{owner}/{repo}/milestones/{number} + * @originalName milestonesDetail + * @duplicate + */ + milestonesDetail2: (owner, repo, number, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/milestones/${number}`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description Update a milestone. + * + * @name MilestonesPartialUpdate + * @request PATCH:/repos/{owner}/{repo}/milestones/{number} + */ + milestonesPartialUpdate: (owner, repo, number, body, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/milestones/${number}`, + method: "PATCH", + body: body, + format: "json", + ...params, + }), + /** + * @description Get labels for every issue in a milestone. + * + * @name MilestonesLabelsDetail + * @request GET:/repos/{owner}/{repo}/milestones/{number}/labels + */ + milestonesLabelsDetail: (owner, repo, number, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/milestones/${number}/labels`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description List your notifications in a repository List all notifications for the current user. + * + * @name NotificationsDetail + * @request GET:/repos/{owner}/{repo}/notifications + */ + notificationsDetail: (owner, repo, query, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/notifications`, + method: "GET", + query: query, + format: "json", + ...params, + }), + /** + * @description Mark notifications as read in a repository. Marking all notifications in a repository as "read" removes them from the default view on GitHub.com. + * + * @name NotificationsUpdate + * @request PUT:/repos/{owner}/{repo}/notifications + */ + notificationsUpdate: (owner, repo, body, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/notifications`, + method: "PUT", + body: body, + ...params, + }), + /** + * @description List pull requests. + * + * @name PullsDetail + * @request GET:/repos/{owner}/{repo}/pulls + */ + pullsDetail: (owner, repo, query, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/pulls`, + method: "GET", + query: query, + format: "json", + ...params, + }), + /** + * @description Create a pull request. + * + * @name PullsCreate + * @request POST:/repos/{owner}/{repo}/pulls + */ + pullsCreate: (owner, repo, body, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/pulls`, + method: "POST", + body: body, + type: ContentType.Json, + format: "json", + ...params, + }), + /** + * @description List comments in a repository. By default, Review Comments are ordered by ascending ID. + * + * @name PullsCommentsDetail + * @request GET:/repos/{owner}/{repo}/pulls/comments + */ + pullsCommentsDetail: (owner, repo, query, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/pulls/comments`, + method: "GET", + query: query, + format: "json", + ...params, + }), + /** + * @description Delete a comment. + * + * @name PullsCommentsDelete + * @request DELETE:/repos/{owner}/{repo}/pulls/comments/{commentId} + */ + pullsCommentsDelete: (owner, repo, commentId, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/pulls/comments/${commentId}`, + method: "DELETE", + ...params, + }), + /** + * @description Get a single comment. + * + * @name PullsCommentsDetail2 + * @request GET:/repos/{owner}/{repo}/pulls/comments/{commentId} + * @originalName pullsCommentsDetail + * @duplicate + */ + pullsCommentsDetail2: (owner, repo, commentId, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/pulls/comments/${commentId}`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description Edit a comment. + * + * @name PullsCommentsPartialUpdate + * @request PATCH:/repos/{owner}/{repo}/pulls/comments/{commentId} + */ + pullsCommentsPartialUpdate: (owner, repo, commentId, body, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/pulls/comments/${commentId}`, + method: "PATCH", + body: body, + format: "json", + ...params, + }), + /** + * @description Get a single pull request. + * + * @name PullsDetail2 + * @request GET:/repos/{owner}/{repo}/pulls/{number} + * @originalName pullsDetail + * @duplicate + */ + pullsDetail2: (owner, repo, number, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/pulls/${number}`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description Update a pull request. + * + * @name PullsPartialUpdate + * @request PATCH:/repos/{owner}/{repo}/pulls/{number} + */ + pullsPartialUpdate: (owner, repo, number, body, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/pulls/${number}`, + method: "PATCH", + body: body, + type: ContentType.Json, + format: "json", + ...params, + }), + /** + * @description List comments on a pull request. + * + * @name PullsCommentsDetail3 + * @request GET:/repos/{owner}/{repo}/pulls/{number}/comments + * @originalName pullsCommentsDetail + * @duplicate + */ + pullsCommentsDetail3: (owner, repo, number, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/pulls/${number}/comments`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description Create a comment. #TODO Alternative input ( http://developer.github.com/v3/pulls/comments/ ) description: | Alternative Input. Instead of passing commit_id, path, and position you can reply to an existing Pull Request Comment like this: body Required string in_reply_to Required number - Comment id to reply to. + * + * @name PullsCommentsCreate + * @request POST:/repos/{owner}/{repo}/pulls/{number}/comments + */ + pullsCommentsCreate: (owner, repo, number, body, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/pulls/${number}/comments`, + method: "POST", + body: body, + type: ContentType.Json, + format: "json", + ...params, + }), + /** + * @description List commits on a pull request. + * + * @name PullsCommitsDetail + * @request GET:/repos/{owner}/{repo}/pulls/{number}/commits + */ + pullsCommitsDetail: (owner, repo, number, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/pulls/${number}/commits`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description List pull requests files. + * + * @name PullsFilesDetail + * @request GET:/repos/{owner}/{repo}/pulls/{number}/files + */ + pullsFilesDetail: (owner, repo, number, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/pulls/${number}/files`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description Get if a pull request has been merged. + * + * @name PullsMergeDetail + * @request GET:/repos/{owner}/{repo}/pulls/{number}/merge + */ + pullsMergeDetail: (owner, repo, number, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/pulls/${number}/merge`, + method: "GET", + ...params, + }), + /** + * @description Merge a pull request (Merge Button's) + * + * @name PullsMergeUpdate + * @request PUT:/repos/{owner}/{repo}/pulls/{number}/merge + */ + pullsMergeUpdate: (owner, repo, number, body, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/pulls/${number}/merge`, + method: "PUT", + body: body, + type: ContentType.Json, + format: "json", + ...params, + }), + /** + * @description Get the README. This method returns the preferred README for a repository. + * + * @name ReadmeDetail + * @request GET:/repos/{owner}/{repo}/readme + */ + readmeDetail: (owner, repo, query, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/readme`, + method: "GET", + query: query, + format: "json", + ...params, + }), + /** + * @description Users with push access to the repository will receive all releases (i.e., published releases and draft releases). Users with pull access will receive published releases only + * + * @name ReleasesDetail + * @request GET:/repos/{owner}/{repo}/releases + */ + releasesDetail: (owner, repo, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/releases`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description Create a release Users with push access to the repository can create a release. + * + * @name ReleasesCreate + * @request POST:/repos/{owner}/{repo}/releases + */ + releasesCreate: (owner, repo, body, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/releases`, + method: "POST", + body: body, + format: "json", + ...params, + }), + /** + * @description Delete a release asset + * + * @name ReleasesAssetsDelete + * @request DELETE:/repos/{owner}/{repo}/releases/assets/{id} + */ + releasesAssetsDelete: (owner, repo, id, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/releases/assets/${id}`, + method: "DELETE", + ...params, + }), + /** + * @description Get a single release asset + * + * @name ReleasesAssetsDetail + * @request GET:/repos/{owner}/{repo}/releases/assets/{id} + */ + releasesAssetsDetail: (owner, repo, id, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/releases/assets/${id}`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description Edit a release asset Users with push access to the repository can edit a release asset. + * + * @name ReleasesAssetsPartialUpdate + * @request PATCH:/repos/{owner}/{repo}/releases/assets/{id} + */ + releasesAssetsPartialUpdate: (owner, repo, id, body, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/releases/assets/${id}`, + method: "PATCH", + body: body, + type: ContentType.Json, + format: "json", + ...params, + }), + /** + * @description Users with push access to the repository can delete a release. + * + * @name ReleasesDelete + * @request DELETE:/repos/{owner}/{repo}/releases/{id} + */ + releasesDelete: (owner, repo, id, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/releases/${id}`, + method: "DELETE", + ...params, + }), + /** + * @description Get a single release + * + * @name ReleasesDetail2 + * @request GET:/repos/{owner}/{repo}/releases/{id} + * @originalName releasesDetail + * @duplicate + */ + releasesDetail2: (owner, repo, id, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/releases/${id}`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description Users with push access to the repository can edit a release + * + * @name ReleasesPartialUpdate + * @request PATCH:/repos/{owner}/{repo}/releases/{id} + */ + releasesPartialUpdate: (owner, repo, id, body, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/releases/${id}`, + method: "PATCH", + body: body, + format: "json", + ...params, + }), + /** + * @description List assets for a release + * + * @name ReleasesAssetsDetail2 + * @request GET:/repos/{owner}/{repo}/releases/{id}/assets + * @originalName releasesAssetsDetail + * @duplicate + */ + releasesAssetsDetail2: (owner, repo, id, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/releases/${id}/assets`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description List Stargazers. + * + * @name StargazersDetail + * @request GET:/repos/{owner}/{repo}/stargazers + */ + stargazersDetail: (owner, repo, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/stargazers`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description Get the number of additions and deletions per week. Returns a weekly aggregate of the number of additions and deletions pushed to a repository. + * + * @name StatsCodeFrequencyDetail + * @request GET:/repos/{owner}/{repo}/stats/code_frequency + */ + statsCodeFrequencyDetail: (owner, repo, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/stats/code_frequency`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description Get the last year of commit activity data. Returns the last year of commit activity grouped by week. The days array is a group of commits per day, starting on Sunday. + * + * @name StatsCommitActivityDetail + * @request GET:/repos/{owner}/{repo}/stats/commit_activity + */ + statsCommitActivityDetail: (owner, repo, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/stats/commit_activity`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description Get contributors list with additions, deletions, and commit counts. + * + * @name StatsContributorsDetail + * @request GET:/repos/{owner}/{repo}/stats/contributors + */ + statsContributorsDetail: (owner, repo, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/stats/contributors`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description Get the weekly commit count for the repo owner and everyone else. + * + * @name StatsParticipationDetail + * @request GET:/repos/{owner}/{repo}/stats/participation + */ + statsParticipationDetail: (owner, repo, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/stats/participation`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description Get the number of commits per hour in each day. Each array contains the day number, hour number, and number of commits 0-6 Sunday - Saturday 0-23 Hour of day Number of commits For example, [2, 14, 25] indicates that there were 25 total commits, during the 2.00pm hour on Tuesdays. All times are based on the time zone of individual commits. + * + * @name StatsPunchCardDetail + * @request GET:/repos/{owner}/{repo}/stats/punch_card + */ + statsPunchCardDetail: (owner, repo, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/stats/punch_card`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description List Statuses for a specific Ref. + * + * @name StatusesDetail + * @request GET:/repos/{owner}/{repo}/statuses/{ref} + */ + statusesDetail: (owner, repo, ref, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/statuses/${ref}`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description Create a Status. + * + * @name StatusesCreate + * @request POST:/repos/{owner}/{repo}/statuses/{ref} + */ + statusesCreate: (owner, repo, ref, body, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/statuses/${ref}`, + method: "POST", + body: body, + type: ContentType.Json, + format: "json", + ...params, + }), + /** + * @description List watchers. + * + * @name SubscribersDetail + * @request GET:/repos/{owner}/{repo}/subscribers + */ + subscribersDetail: (owner, repo, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/subscribers`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description Delete a Repository Subscription. + * + * @name SubscriptionDelete + * @request DELETE:/repos/{owner}/{repo}/subscription + */ + subscriptionDelete: (owner, repo, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/subscription`, + method: "DELETE", + ...params, + }), + /** + * @description Get a Repository Subscription. + * + * @name SubscriptionDetail + * @request GET:/repos/{owner}/{repo}/subscription + */ + subscriptionDetail: (owner, repo, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/subscription`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description Set a Repository Subscription + * + * @name SubscriptionUpdate + * @request PUT:/repos/{owner}/{repo}/subscription + */ + subscriptionUpdate: (owner, repo, body, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/subscription`, + method: "PUT", + body: body, + type: ContentType.Json, + format: "json", + ...params, + }), + /** + * @description Get list of tags. + * + * @name TagsDetail + * @request GET:/repos/{owner}/{repo}/tags + */ + tagsDetail: (owner, repo, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/tags`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description Get list of teams + * + * @name TeamsDetail + * @request GET:/repos/{owner}/{repo}/teams + */ + teamsDetail: (owner, repo, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/teams`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description List Stargazers. New implementation. + * + * @name WatchersDetail + * @request GET:/repos/{owner}/{repo}/watchers + */ + watchersDetail: (owner, repo, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/watchers`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description Get archive link. This method will return a 302 to a URL to download a tarball or zipball archive for a repository. Please make sure your HTTP framework is configured to follow redirects or you will need to use the Location header to make a second GET request. Note: For private repositories, these links are temporary and expire quickly. + * + * @name ReposDetail2 + * @request GET:/repos/{owner}/{repo}/{archive_format}/{path} + * @originalName reposDetail + * @duplicate + */ + reposDetail2: (owner, repo, archiveFormat, path, params = {}) => + this.request({ + path: `/repos/${owner}/${repo}/${archiveFormat}/${path}`, + method: "GET", + ...params, + }), + }; + repositories = { + /** + * @description List all public repositories. This provides a dump of every public repository, in the order that they were created. Note: Pagination is powered exclusively by the since parameter. is the Link header to get the URL for the next page of repositories. + * + * @name RepositoriesList + * @request GET:/repositories + */ + repositoriesList: (query, params = {}) => + this.request({ + path: `/repositories`, + method: "GET", + query: query, + format: "json", + ...params, + }), + }; + search = { + /** + * @description Search code. + * + * @name CodeList + * @request GET:/search/code + */ + codeList: (query, params = {}) => + this.request({ + path: `/search/code`, + method: "GET", + query: query, + format: "json", + ...params, + }), + /** + * @description Find issues by state and keyword. (This method returns up to 100 results per page.) + * + * @name IssuesList + * @request GET:/search/issues + */ + issuesList: (query, params = {}) => + this.request({ + path: `/search/issues`, + method: "GET", + query: query, + format: "json", + ...params, + }), + /** + * @description Search repositories. + * + * @name RepositoriesList + * @request GET:/search/repositories + */ + repositoriesList: (query, params = {}) => + this.request({ + path: `/search/repositories`, + method: "GET", + query: query, + format: "json", + ...params, + }), + /** + * @description Search users. + * + * @name UsersList + * @request GET:/search/users + */ + usersList: (query, params = {}) => + this.request({ + path: `/search/users`, + method: "GET", + query: query, + format: "json", + ...params, + }), + }; + teams = { + /** + * @description Delete team. In order to delete a team, the authenticated user must be an owner of the org that the team is associated with. + * + * @name TeamsDelete + * @request DELETE:/teams/{teamId} + */ + teamsDelete: (teamId, params = {}) => + this.request({ + path: `/teams/${teamId}`, + method: "DELETE", + ...params, + }), + /** + * @description Get team. + * + * @name TeamsDetail + * @request GET:/teams/{teamId} + */ + teamsDetail: (teamId, params = {}) => + this.request({ + path: `/teams/${teamId}`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description Edit team. In order to edit a team, the authenticated user must be an owner of the org that the team is associated with. + * + * @name TeamsPartialUpdate + * @request PATCH:/teams/{teamId} + */ + teamsPartialUpdate: (teamId, body, params = {}) => + this.request({ + path: `/teams/${teamId}`, + method: "PATCH", + body: body, + type: ContentType.Json, + format: "json", + ...params, + }), + /** + * @description List team members. In order to list members in a team, the authenticated user must be a member of the team. + * + * @name MembersDetail + * @request GET:/teams/{teamId}/members + */ + membersDetail: (teamId, params = {}) => + this.request({ + path: `/teams/${teamId}/members`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description The "Remove team member" API is deprecated and is scheduled for removal in the next major version of the API. We recommend using the Remove team membership API instead. It allows you to remove both active and pending memberships. Remove team member. In order to remove a user from a team, the authenticated user must have 'admin' permissions to the team or be an owner of the org that the team is associated with. NOTE This does not delete the user, it just remove them from the team. + * + * @name MembersDelete + * @request DELETE:/teams/{teamId}/members/{username} + * @deprecated + */ + membersDelete: (teamId, username, params = {}) => + this.request({ + path: `/teams/${teamId}/members/${username}`, + method: "DELETE", + ...params, + }), + /** + * @description The "Get team member" API is deprecated and is scheduled for removal in the next major version of the API. We recommend using the Get team membership API instead. It allows you to get both active and pending memberships. Get team member. In order to get if a user is a member of a team, the authenticated user mus be a member of the team. + * + * @name MembersDetail2 + * @request GET:/teams/{teamId}/members/{username} + * @deprecated + * @originalName membersDetail + * @duplicate + */ + membersDetail2: (teamId, username, params = {}) => + this.request({ + path: `/teams/${teamId}/members/${username}`, + method: "GET", + ...params, + }), + /** + * @description The API (described below) is deprecated and is scheduled for removal in the next major version of the API. We recommend using the Add team membership API instead. It allows you to invite new organization members to your teams. Add team member. In order to add a user to a team, the authenticated user must have 'admin' permissions to the team or be an owner of the org that the team is associated with. + * + * @name MembersUpdate + * @request PUT:/teams/{teamId}/members/{username} + * @deprecated + */ + membersUpdate: (teamId, username, params = {}) => + this.request({ + path: `/teams/${teamId}/members/${username}`, + method: "PUT", + ...params, + }), + /** + * @description Remove team membership. In order to remove a membership between a user and a team, the authenticated user must have 'admin' permissions to the team or be an owner of the organization that the team is associated with. NOTE: This does not delete the user, it just removes their membership from the team. + * + * @name MembershipsDelete + * @request DELETE:/teams/{teamId}/memberships/{username} + */ + membershipsDelete: (teamId, username, params = {}) => + this.request({ + path: `/teams/${teamId}/memberships/${username}`, + method: "DELETE", + ...params, + }), + /** + * @description Get team membership. In order to get a user's membership with a team, the authenticated user must be a member of the team or an owner of the team's organization. + * + * @name MembershipsDetail + * @request GET:/teams/{teamId}/memberships/{username} + */ + membershipsDetail: (teamId, username, params = {}) => + this.request({ + path: `/teams/${teamId}/memberships/${username}`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description Add team membership. In order to add a membership between a user and a team, the authenticated user must have 'admin' permissions to the team or be an owner of the organization that the team is associated with. If the user is already a part of the team's organization (meaning they're on at least one other team in the organization), this endpoint will add the user to the team. If the user is completely unaffiliated with the team's organization (meaning they're on none of the organization's teams), this endpoint will send an invitation to the user via email. This newly-created membership will be in the 'pending' state until the user accepts the invitation, at which point the membership will transition to the 'active' state and the user will be added as a member of the team. + * + * @name MembershipsUpdate + * @request PUT:/teams/{teamId}/memberships/{username} + */ + membershipsUpdate: (teamId, username, params = {}) => + this.request({ + path: `/teams/${teamId}/memberships/${username}`, + method: "PUT", + format: "json", + ...params, + }), + /** + * @description List team repos + * + * @name ReposDetail + * @request GET:/teams/{teamId}/repos + */ + reposDetail: (teamId, params = {}) => + this.request({ + path: `/teams/${teamId}/repos`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description In order to remove a repository from a team, the authenticated user must be an owner of the org that the team is associated with. NOTE: This does not delete the repository, it just removes it from the team. + * + * @name ReposDelete + * @request DELETE:/teams/{teamId}/repos/{owner}/{repo} + */ + reposDelete: (teamId, owner, repo, params = {}) => + this.request({ + path: `/teams/${teamId}/repos/${owner}/${repo}`, + method: "DELETE", + ...params, + }), + /** + * @description Check if a team manages a repository + * + * @name ReposDetail2 + * @request GET:/teams/{teamId}/repos/{owner}/{repo} + * @originalName reposDetail + * @duplicate + */ + reposDetail2: (teamId, owner, repo, params = {}) => + this.request({ + path: `/teams/${teamId}/repos/${owner}/${repo}`, + method: "GET", + ...params, + }), + /** + * @description In order to add a repository to a team, the authenticated user must be an owner of the org that the team is associated with. Also, the repository must be owned by the organization, or a direct fork of a repository owned by the organization. + * + * @name ReposUpdate + * @request PUT:/teams/{teamId}/repos/{owner}/{repo} + */ + reposUpdate: (teamId, owner, repo, params = {}) => + this.request({ + path: `/teams/${teamId}/repos/${owner}/${repo}`, + method: "PUT", + ...params, + }), + }; + user = { + /** + * @description Get the authenticated user. + * + * @name UserList + * @request GET:/user + */ + userList: (params = {}) => + this.request({ + path: `/user`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description Update the authenticated user. + * + * @name UserPartialUpdate + * @request PATCH:/user + */ + userPartialUpdate: (body, params = {}) => + this.request({ + path: `/user`, + method: "PATCH", + body: body, + type: ContentType.Json, + format: "json", + ...params, + }), + /** + * @description Delete email address(es). You can include a single email address or an array of addresses. + * + * @name EmailsDelete + * @request DELETE:/user/emails + */ + emailsDelete: (body, params = {}) => + this.request({ + path: `/user/emails`, + method: "DELETE", + body: body, + type: ContentType.Json, + ...params, + }), + /** + * @description List email addresses for a user. In the final version of the API, this method will return an array of hashes with extended information for each email address indicating if the address has been verified and if it's primary email address for GitHub. Until API v3 is finalized, use the application/vnd.github.v3 media type to get other response format. + * + * @name EmailsList + * @request GET:/user/emails + */ + emailsList: (params = {}) => + this.request({ + path: `/user/emails`, + method: "GET", + ...params, + }), + /** + * @description Add email address(es). You can post a single email address or an array of addresses. + * + * @name EmailsCreate + * @request POST:/user/emails + */ + emailsCreate: (body, params = {}) => + this.request({ + path: `/user/emails`, + method: "POST", + body: body, + ...params, + }), + /** + * @description List the authenticated user's followers + * + * @name FollowersList + * @request GET:/user/followers + */ + followersList: (params = {}) => + this.request({ + path: `/user/followers`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description List who the authenticated user is following. + * + * @name FollowingList + * @request GET:/user/following + */ + followingList: (params = {}) => + this.request({ + path: `/user/following`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description Unfollow a user. Unfollowing a user requires the user to be logged in and authenticated with basic auth or OAuth with the user:follow scope. + * + * @name FollowingDelete + * @request DELETE:/user/following/{username} + */ + followingDelete: (username, params = {}) => + this.request({ + path: `/user/following/${username}`, + method: "DELETE", + ...params, + }), + /** + * @description Check if you are following a user. + * + * @name FollowingDetail + * @request GET:/user/following/{username} + */ + followingDetail: (username, params = {}) => + this.request({ + path: `/user/following/${username}`, + method: "GET", + ...params, + }), + /** + * @description Follow a user. Following a user requires the user to be logged in and authenticated with basic auth or OAuth with the user:follow scope. + * + * @name FollowingUpdate + * @request PUT:/user/following/{username} + */ + followingUpdate: (username, params = {}) => + this.request({ + path: `/user/following/${username}`, + method: "PUT", + ...params, + }), + /** + * @description List issues. List all issues across owned and member repositories for the authenticated user. + * + * @name IssuesList + * @request GET:/user/issues + */ + issuesList: (query, params = {}) => + this.request({ + path: `/user/issues`, + method: "GET", + query: query, + format: "json", + ...params, + }), + /** + * @description List your public keys. Lists the current user's keys. Management of public keys via the API requires that you are authenticated through basic auth, or OAuth with the 'user', 'write:public_key' scopes. + * + * @name KeysList + * @request GET:/user/keys + */ + keysList: (params = {}) => + this.request({ + path: `/user/keys`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description Create a public key. + * + * @name KeysCreate + * @request POST:/user/keys + */ + keysCreate: (body, params = {}) => + this.request({ + path: `/user/keys`, + method: "POST", + body: body, + format: "json", + ...params, + }), + /** + * @description Delete a public key. Removes a public key. Requires that you are authenticated via Basic Auth or via OAuth with at least admin:public_key scope. + * + * @name KeysDelete + * @request DELETE:/user/keys/{keyId} + */ + keysDelete: (keyId, params = {}) => + this.request({ + path: `/user/keys/${keyId}`, + method: "DELETE", + ...params, + }), + /** + * @description Get a single public key. + * + * @name KeysDetail + * @request GET:/user/keys/{keyId} + */ + keysDetail: (keyId, params = {}) => + this.request({ + path: `/user/keys/${keyId}`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description List public and private organizations for the authenticated user. + * + * @name OrgsList + * @request GET:/user/orgs + */ + orgsList: (params = {}) => + this.request({ + path: `/user/orgs`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description List repositories for the authenticated user. Note that this does not include repositories owned by organizations which the user can access. You can lis user organizations and list organization repositories separately. + * + * @name ReposList + * @request GET:/user/repos + */ + reposList: (query, params = {}) => + this.request({ + path: `/user/repos`, + method: "GET", + query: query, + format: "json", + ...params, + }), + /** + * @description Create a new repository for the authenticated user. OAuth users must supply repo scope. + * + * @name ReposCreate + * @request POST:/user/repos + */ + reposCreate: (body, params = {}) => + this.request({ + path: `/user/repos`, + method: "POST", + body: body, + format: "json", + ...params, + }), + /** + * @description List repositories being starred by the authenticated user. + * + * @name StarredList + * @request GET:/user/starred + */ + starredList: (query, params = {}) => + this.request({ + path: `/user/starred`, + method: "GET", + query: query, + format: "json", + ...params, + }), + /** + * @description Unstar a repository + * + * @name StarredDelete + * @request DELETE:/user/starred/{owner}/{repo} + */ + starredDelete: (owner, repo, params = {}) => + this.request({ + path: `/user/starred/${owner}/${repo}`, + method: "DELETE", + ...params, + }), + /** + * @description Check if you are starring a repository. + * + * @name StarredDetail + * @request GET:/user/starred/{owner}/{repo} + */ + starredDetail: (owner, repo, params = {}) => + this.request({ + path: `/user/starred/${owner}/${repo}`, + method: "GET", + ...params, + }), + /** + * @description Star a repository. + * + * @name StarredUpdate + * @request PUT:/user/starred/{owner}/{repo} + */ + starredUpdate: (owner, repo, params = {}) => + this.request({ + path: `/user/starred/${owner}/${repo}`, + method: "PUT", + ...params, + }), + /** + * @description List repositories being watched by the authenticated user. + * + * @name SubscriptionsList + * @request GET:/user/subscriptions + */ + subscriptionsList: (params = {}) => + this.request({ + path: `/user/subscriptions`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description Stop watching a repository + * + * @name SubscriptionsDelete + * @request DELETE:/user/subscriptions/{owner}/{repo} + * @deprecated + */ + subscriptionsDelete: (owner, repo, params = {}) => + this.request({ + path: `/user/subscriptions/${owner}/${repo}`, + method: "DELETE", + ...params, + }), + /** + * @description Check if you are watching a repository. + * + * @name SubscriptionsDetail + * @request GET:/user/subscriptions/{owner}/{repo} + * @deprecated + */ + subscriptionsDetail: (owner, repo, params = {}) => + this.request({ + path: `/user/subscriptions/${owner}/${repo}`, + method: "GET", + ...params, + }), + /** + * @description Watch a repository. + * + * @name SubscriptionsUpdate + * @request PUT:/user/subscriptions/{owner}/{repo} + * @deprecated + */ + subscriptionsUpdate: (owner, repo, params = {}) => + this.request({ + path: `/user/subscriptions/${owner}/${repo}`, + method: "PUT", + ...params, + }), + /** + * @description List all of the teams across all of the organizations to which the authenticated user belongs. This method requires user or repo scope when authenticating via OAuth. + * + * @name TeamsList + * @request GET:/user/teams + */ + teamsList: (params = {}) => + this.request({ + path: `/user/teams`, + method: "GET", + format: "json", + ...params, + }), + }; + users = { + /** + * @description Get all users. This provides a dump of every user, in the order that they signed up for GitHub. Note: Pagination is powered exclusively by the since parameter. Use the Link header to get the URL for the next page of users. + * + * @name UsersList + * @request GET:/users + */ + usersList: (query, params = {}) => + this.request({ + path: `/users`, + method: "GET", + query: query, + format: "json", + ...params, + }), + /** + * @description Get a single user. + * + * @name UsersDetail + * @request GET:/users/{username} + */ + usersDetail: (username, params = {}) => + this.request({ + path: `/users/${username}`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description If you are authenticated as the given user, you will see your private events. Otherwise, you'll only see public events. + * + * @name EventsDetail + * @request GET:/users/{username}/events + */ + eventsDetail: (username, params = {}) => + this.request({ + path: `/users/${username}/events`, + method: "GET", + ...params, + }), + /** + * @description This is the user's organization dashboard. You must be authenticated as the user to view this. + * + * @name EventsOrgsDetail + * @request GET:/users/{username}/events/orgs/{org} + */ + eventsOrgsDetail: (username, org, params = {}) => + this.request({ + path: `/users/${username}/events/orgs/${org}`, + method: "GET", + ...params, + }), + /** + * @description List a user's followers + * + * @name FollowersDetail + * @request GET:/users/{username}/followers + */ + followersDetail: (username, params = {}) => + this.request({ + path: `/users/${username}/followers`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description Check if one user follows another. + * + * @name FollowingDetail + * @request GET:/users/{username}/following/{targetUser} + */ + followingDetail: (username, targetUser, params = {}) => + this.request({ + path: `/users/${username}/following/${targetUser}`, + method: "GET", + ...params, + }), + /** + * @description List a users gists. + * + * @name GistsDetail + * @request GET:/users/{username}/gists + */ + gistsDetail: (username, query, params = {}) => + this.request({ + path: `/users/${username}/gists`, + method: "GET", + query: query, + format: "json", + ...params, + }), + /** + * @description List public keys for a user. Lists the verified public keys for a user. This is accessible by anyone. + * + * @name KeysDetail + * @request GET:/users/{username}/keys + */ + keysDetail: (username, params = {}) => + this.request({ + path: `/users/${username}/keys`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description List all public organizations for a user. + * + * @name OrgsDetail + * @request GET:/users/{username}/orgs + */ + orgsDetail: (username, params = {}) => + this.request({ + path: `/users/${username}/orgs`, + method: "GET", + format: "json", + ...params, + }), + /** + * @description These are events that you'll only see public events. + * + * @name ReceivedEventsDetail + * @request GET:/users/{username}/received_events + */ + receivedEventsDetail: (username, params = {}) => + this.request({ + path: `/users/${username}/received_events`, + method: "GET", + ...params, + }), + /** + * @description List public events that a user has received + * + * @name ReceivedEventsPublicDetail + * @request GET:/users/{username}/received_events/public + */ + receivedEventsPublicDetail: (username, params = {}) => + this.request({ + path: `/users/${username}/received_events/public`, + method: "GET", + ...params, + }), + /** + * @description List public repositories for the specified user. + * + * @name ReposDetail + * @request GET:/users/{username}/repos + */ + reposDetail: (username, query, params = {}) => + this.request({ + path: `/users/${username}/repos`, + method: "GET", + query: query, + format: "json", + ...params, + }), + /** + * @description List repositories being starred by a user. + * + * @name StarredDetail + * @request GET:/users/{username}/starred + */ + starredDetail: (username, params = {}) => + this.request({ + path: `/users/${username}/starred`, + method: "GET", + ...params, + }), + /** + * @description List repositories being watched by a user. + * + * @name SubscriptionsDetail + * @request GET:/users/{username}/subscriptions + */ + subscriptionsDetail: (username, params = {}) => + this.request({ + path: `/users/${username}/subscriptions`, + method: "GET", + ...params, + }), + }; } diff --git a/tests/spec/modular/http-client.ts b/tests/spec/modular/http-client.ts index 32767484c..8a4bd657b 100644 --- a/tests/spec/modular/http-client.ts +++ b/tests/spec/modular/http-client.ts @@ -75,16 +75,16 @@ export class HttpClient { this.securityData = data; }; - private encodeQueryParam(key: string, value: any) { + protected encodeQueryParam(key: string, value: any) { const encodedKey = encodeURIComponent(key); return `${encodedKey}=${encodeURIComponent(typeof value === "number" ? value : `${value}`)}`; } - private addQueryParam(query: QueryParamsType, key: string) { + protected addQueryParam(query: QueryParamsType, key: string) { return this.encodeQueryParam(key, query[key]); } - private addArrayQueryParam(query: QueryParamsType, key: string) { + protected addArrayQueryParam(query: QueryParamsType, key: string) { const value = query[key]; return value.map((v: any) => this.encodeQueryParam(key, v)).join("&"); } @@ -121,7 +121,7 @@ export class HttpClient { [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), }; - private mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { return { ...this.baseApiParams, ...params1, @@ -134,7 +134,7 @@ export class HttpClient { }; } - private createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { if (this.abortControllers.has(cancelToken)) { const abortController = this.abortControllers.get(cancelToken); if (abortController) { @@ -184,12 +184,12 @@ export class HttpClient { ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), ...(requestParams.headers || {}), }, - signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0, + signal: cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal, body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), }).then(async (response) => { const r = response as HttpResponse; - r.data = (null as unknown) as T; - r.error = (null as unknown) as E; + r.data = null as unknown as T; + r.error = null as unknown as E; const data = !responseFormat ? r diff --git a/tests/spec/moduleNameFirstTag/schema.ts b/tests/spec/moduleNameFirstTag/schema.ts index 4929d629a..6de1a6346 100644 --- a/tests/spec/moduleNameFirstTag/schema.ts +++ b/tests/spec/moduleNameFirstTag/schema.ts @@ -203,16 +203,16 @@ export class HttpClient { this.securityData = data; }; - private encodeQueryParam(key: string, value: any) { + protected encodeQueryParam(key: string, value: any) { const encodedKey = encodeURIComponent(key); return `${encodedKey}=${encodeURIComponent(typeof value === "number" ? value : `${value}`)}`; } - private addQueryParam(query: QueryParamsType, key: string) { + protected addQueryParam(query: QueryParamsType, key: string) { return this.encodeQueryParam(key, query[key]); } - private addArrayQueryParam(query: QueryParamsType, key: string) { + protected addArrayQueryParam(query: QueryParamsType, key: string) { const value = query[key]; return value.map((v: any) => this.encodeQueryParam(key, v)).join("&"); } @@ -249,7 +249,7 @@ export class HttpClient { [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), }; - private mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { return { ...this.baseApiParams, ...params1, @@ -262,7 +262,7 @@ export class HttpClient { }; } - private createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { if (this.abortControllers.has(cancelToken)) { const abortController = this.abortControllers.get(cancelToken); if (abortController) { @@ -312,12 +312,12 @@ export class HttpClient { ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), ...(requestParams.headers || {}), }, - signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0, + signal: cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal, body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), }).then(async (response) => { const r = response as HttpResponse; - r.data = (null as unknown) as T; - r.error = (null as unknown) as E; + r.data = null as unknown as T; + r.error = null as unknown as E; const data = !responseFormat ? r diff --git a/tests/spec/moduleNameIndex/schema.ts b/tests/spec/moduleNameIndex/schema.ts index f4994948d..640fd4b69 100644 --- a/tests/spec/moduleNameIndex/schema.ts +++ b/tests/spec/moduleNameIndex/schema.ts @@ -203,16 +203,16 @@ export class HttpClient { this.securityData = data; }; - private encodeQueryParam(key: string, value: any) { + protected encodeQueryParam(key: string, value: any) { const encodedKey = encodeURIComponent(key); return `${encodedKey}=${encodeURIComponent(typeof value === "number" ? value : `${value}`)}`; } - private addQueryParam(query: QueryParamsType, key: string) { + protected addQueryParam(query: QueryParamsType, key: string) { return this.encodeQueryParam(key, query[key]); } - private addArrayQueryParam(query: QueryParamsType, key: string) { + protected addArrayQueryParam(query: QueryParamsType, key: string) { const value = query[key]; return value.map((v: any) => this.encodeQueryParam(key, v)).join("&"); } @@ -249,7 +249,7 @@ export class HttpClient { [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), }; - private mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { return { ...this.baseApiParams, ...params1, @@ -262,7 +262,7 @@ export class HttpClient { }; } - private createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { if (this.abortControllers.has(cancelToken)) { const abortController = this.abortControllers.get(cancelToken); if (abortController) { @@ -312,12 +312,12 @@ export class HttpClient { ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), ...(requestParams.headers || {}), }, - signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0, + signal: cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal, body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), }).then(async (response) => { const r = response as HttpResponse; - r.data = (null as unknown) as T; - r.error = (null as unknown) as E; + r.data = null as unknown as T; + r.error = null as unknown as E; const data = !responseFormat ? r diff --git a/tests/spec/partialBaseTemplate/schema.ts b/tests/spec/partialBaseTemplate/schema.ts index c4bdacfc1..e5ed9c90f 100644 --- a/tests/spec/partialBaseTemplate/schema.ts +++ b/tests/spec/partialBaseTemplate/schema.ts @@ -87,16 +87,16 @@ export class HttpClient { this.securityData = data; }; - private encodeQueryParam(key: string, value: any) { + protected encodeQueryParam(key: string, value: any) { const encodedKey = encodeURIComponent(key); return `${encodedKey}=${encodeURIComponent(typeof value === "number" ? value : `${value}`)}`; } - private addQueryParam(query: QueryParamsType, key: string) { + protected addQueryParam(query: QueryParamsType, key: string) { return this.encodeQueryParam(key, query[key]); } - private addArrayQueryParam(query: QueryParamsType, key: string) { + protected addArrayQueryParam(query: QueryParamsType, key: string) { const value = query[key]; return value.map((v: any) => this.encodeQueryParam(key, v)).join("&"); } @@ -133,7 +133,7 @@ export class HttpClient { [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), }; - private mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { return { ...this.baseApiParams, ...params1, @@ -146,7 +146,7 @@ export class HttpClient { }; } - private createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { if (this.abortControllers.has(cancelToken)) { const abortController = this.abortControllers.get(cancelToken); if (abortController) { @@ -196,12 +196,12 @@ export class HttpClient { ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), ...(requestParams.headers || {}), }, - signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0, + signal: cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal, body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), }).then(async (response) => { const r = response as HttpResponse; - r.data = (null as unknown) as T; - r.error = (null as unknown) as E; + r.data = null as unknown as T; + r.error = null as unknown as E; const data = !responseFormat ? r diff --git a/tests/spec/partialDefaultTemplate/schema.ts b/tests/spec/partialDefaultTemplate/schema.ts index bb345e83a..40de34dbd 100644 --- a/tests/spec/partialDefaultTemplate/schema.ts +++ b/tests/spec/partialDefaultTemplate/schema.ts @@ -83,16 +83,16 @@ export class HttpClient { this.securityData = data; }; - private encodeQueryParam(key: string, value: any) { + protected encodeQueryParam(key: string, value: any) { const encodedKey = encodeURIComponent(key); return `${encodedKey}=${encodeURIComponent(typeof value === "number" ? value : `${value}`)}`; } - private addQueryParam(query: QueryParamsType, key: string) { + protected addQueryParam(query: QueryParamsType, key: string) { return this.encodeQueryParam(key, query[key]); } - private addArrayQueryParam(query: QueryParamsType, key: string) { + protected addArrayQueryParam(query: QueryParamsType, key: string) { const value = query[key]; return value.map((v: any) => this.encodeQueryParam(key, v)).join("&"); } @@ -129,7 +129,7 @@ export class HttpClient { [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), }; - private mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { return { ...this.baseApiParams, ...params1, @@ -142,7 +142,7 @@ export class HttpClient { }; } - private createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { if (this.abortControllers.has(cancelToken)) { const abortController = this.abortControllers.get(cancelToken); if (abortController) { @@ -192,12 +192,12 @@ export class HttpClient { ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), ...(requestParams.headers || {}), }, - signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0, + signal: cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal, body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), }).then(async (response) => { const r = response as HttpResponse; - r.data = (null as unknown) as T; - r.error = (null as unknown) as E; + r.data = null as unknown as T; + r.error = null as unknown as E; const data = !responseFormat ? r diff --git a/tests/spec/patch/schema.json b/tests/spec/patch/schema.json new file mode 100644 index 000000000..a20f38f33 --- /dev/null +++ b/tests/spec/patch/schema.json @@ -0,0 +1,23683 @@ +{ + "swagger": "2.0", + "schemes": ["https"], + "host": "api.github.com", + "basePath": "/", + "info": { + "description": "Powerful collaboration, code review, and code management for open source and private projects.\n", + "termsOfService": "not a url", + "title": "GitHub", + "version": "v3", + "x-apisguru-categories": ["collaboration", "developer_tools"], + "x-logo": { + "url": "https://api.apis.guru/v2/cache/logo/https_twitter.com_github_profile_image.jpeg" + }, + "x-origin": [ + { + "format": "swagger", + "url": "https://raw.githubusercontent.com/APIs-guru/unofficial_openapi_specs/master/github.com/v3/swagger.yaml", + "version": "2.0" + } + ], + "x-preferred": false, + "x-providerName": "github.com", + "x-unofficialSpec": true + }, + "externalDocs": { + "url": "https://developer.github.com/v3/" + }, + "consumes": ["application/json"], + "produces": ["application/json"], + "securityDefinitions": { + "oauth_2_0": { + "authorizationUrl": "https://github.com/login/oauth/authorize", + "description": "OAuth2 is a protocol that lets external apps request authorization to private\ndetails in a user's GitHub account without getting their password. This is\npreferred over Basic Authentication because tokens can be limited to specific\ntypes of data, and can be revoked by users at any time.\n", + "flow": "accessCode", + "scopes": { + "admin:org": "", + "admin:org_hook": "", + "admin:public_key": "", + "admin:repo_hook": "", + "delete_repo": "", + "gist": "", + "notifications": "", + "public_repo": "", + "read:org": "", + "read:public_key": "", + "read:repo_hook": "", + "repo": "", + "repo:status": "", + "repo_deployment": "", + "user": "", + "user:email": "", + "user:follow": "", + "write:org": "", + "write:public_key": "", + "write:repo_hook": "" + }, + "tokenUrl": "https://github.com/login/oauth/access_token", + "type": "oauth2" + } + }, + "paths": { + "/emojis": { + "get": { + "description": "Lists all the emojis available to use on GitHub.", + "parameters": [ + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/emojis" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + } + }, + "/events": { + "get": { + "description": "List public events.", + "parameters": [ + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/events" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + } + }, + "/feeds": { + "get": { + "description": "List Feeds.\nGitHub provides several timeline resources in Atom format. The Feeds API\n lists all the feeds available to the authenticating user.\n", + "parameters": [ + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/feeds" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + } + }, + "/gists": { + "get": { + "description": "List the authenticated user's gists or if called anonymously, this will\nreturn all public gists.\n", + "parameters": [ + { + "description": "Timestamp in ISO 8601 format YYYY-MM-DDTHH:MM:SSZ.\nOnly gists updated at or after this time are returned.\n", + "in": "query", + "name": "since", + "type": "string" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/gists" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + }, + "post": { + "description": "Create a gist.", + "parameters": [ + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + }, + { + "in": "body", + "name": "body", + "required": true, + "schema": { + "$ref": "#/definitions/postGist" + } + } + ], + "responses": { + "201": { + "description": "Created", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/gist" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + } + }, + "/gists/public": { + "get": { + "description": "List all public gists.", + "parameters": [ + { + "description": "Timestamp in ISO 8601 format YYYY-MM-DDTHH:MM:SSZ.\nOnly gists updated at or after this time are returned.\n", + "in": "query", + "name": "since", + "type": "string" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/gists" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + } + }, + "/gists/starred": { + "get": { + "description": "List the authenticated user's starred gists.", + "parameters": [ + { + "description": "Timestamp in ISO 8601 format YYYY-MM-DDTHH:MM:SSZ.\nOnly gists updated at or after this time are returned.\n", + "in": "query", + "name": "since", + "type": "string" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/gists" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + } + }, + "/gists/{id}": { + "delete": { + "description": "Delete a gist.", + "parameters": [ + { + "description": "Id of gist.", + "in": "path", + "name": "id", + "required": true, + "type": "integer" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "204": { + "description": "No content.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + }, + "get": { + "description": "Get a single gist.", + "parameters": [ + { + "description": "Id of gist.", + "in": "path", + "name": "id", + "required": true, + "type": "integer" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/gist" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + }, + "patch": { + "description": "Edit a gist.", + "parameters": [ + { + "description": "Id of gist.", + "in": "path", + "name": "id", + "required": true, + "type": "integer" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + }, + { + "in": "body", + "name": "body", + "required": true, + "schema": { + "$ref": "#/definitions/patchGist" + } + } + ], + "responses": { + "200": { + "description": "OK", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/gist" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + } + }, + "/gists/{id}/comments": { + "get": { + "description": "List comments on a gist.", + "parameters": [ + { + "description": "Id of gist.", + "in": "path", + "name": "id", + "required": true, + "type": "integer" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/comments" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + }, + "post": { + "description": "Create a commen", + "parameters": [ + { + "description": "Id of gist.", + "in": "path", + "name": "id", + "required": true, + "type": "integer" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + }, + { + "in": "body", + "name": "body", + "required": true, + "schema": { + "$ref": "#/definitions/commentBody" + } + } + ], + "responses": { + "201": { + "description": "Created", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/comment" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + } + }, + "/gists/{id}/comments/{commentId}": { + "delete": { + "description": "Delete a comment.", + "parameters": [ + { + "description": "Id of gist.", + "in": "path", + "name": "id", + "required": true, + "type": "integer" + }, + { + "description": "Id of comment.", + "in": "path", + "name": "commentId", + "required": true, + "type": "integer" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "204": { + "description": "No content.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + }, + "get": { + "description": "Get a single comment.", + "parameters": [ + { + "description": "Id of gist.", + "in": "path", + "name": "id", + "required": true, + "type": "integer" + }, + { + "description": "Id of comment.", + "in": "path", + "name": "commentId", + "required": true, + "type": "integer" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/comment" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + }, + "patch": { + "description": "Edit a comment.", + "parameters": [ + { + "description": "Id of gist.", + "in": "path", + "name": "id", + "required": true, + "type": "integer" + }, + { + "description": "Id of comment.", + "in": "path", + "name": "commentId", + "required": true, + "type": "integer" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + }, + { + "in": "body", + "name": "body", + "required": true, + "schema": { + "$ref": "#/definitions/comment" + } + } + ], + "responses": { + "200": { + "description": "OK", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/comment" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + } + }, + "/gists/{id}/forks": { + "post": { + "description": "Fork a gist.", + "parameters": [ + { + "description": "Id of gist.", + "in": "path", + "name": "id", + "required": true, + "type": "integer" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "204": { + "description": "Exists.", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + }, + "404": { + "description": "Not exists.", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + } + }, + "/gists/{id}/star": { + "delete": { + "description": "Unstar a gist.", + "parameters": [ + { + "description": "Id of gist.", + "in": "path", + "name": "id", + "required": true, + "type": "integer" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "204": { + "description": "Item removed.", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + }, + "get": { + "description": "Check if a gist is starred.", + "parameters": [ + { + "description": "Id of gist.", + "in": "path", + "name": "id", + "required": true, + "type": "integer" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "204": { + "description": "Exists.", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + }, + "404": { + "description": "Not exists.", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + }, + "put": { + "description": "Star a gist.", + "parameters": [ + { + "description": "Id of gist.", + "in": "path", + "name": "id", + "required": true, + "type": "integer" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "204": { + "description": "Starred.", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + } + }, + "/gitignore/templates": { + "get": { + "description": "Listing available templates.\nList all templates available to pass as an option when creating a repository.\n", + "parameters": [ + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/gitignore" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + } + }, + "/gitignore/templates/{language}": { + "get": { + "description": "Get a single template.", + "parameters": [ + { + "in": "path", + "name": "language", + "required": true, + "type": "string" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/gitignore-lang" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + } + }, + "/issues": { + "get": { + "description": "List issues.\nList all issues across all the authenticated user's visible repositories.\n", + "parameters": [ + { + "default": "all", + "description": "Issues assigned to you / created by you / mentioning you / you're\nsubscribed to updates for / All issues the authenticated user can see\n", + "enum": ["assigned", "created", "mentioned", "subscribed", "all"], + "in": "query", + "name": "filter", + "required": true, + "type": "string" + }, + { + "default": "open", + "enum": ["open", "closed"], + "in": "query", + "name": "state", + "required": true, + "type": "string" + }, + { + "description": "String list of comma separated Label names. Example - bug,ui,@high.", + "in": "query", + "name": "labels", + "required": true, + "type": "string" + }, + { + "default": "created", + "enum": ["created", "updated", "comments"], + "in": "query", + "name": "sort", + "required": true, + "type": "string" + }, + { + "default": "desc", + "enum": ["asc", "desc"], + "in": "query", + "name": "direction", + "required": true, + "type": "string" + }, + { + "description": "Optional string of a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ.\nOnly issues updated at or after this time are returned.\n", + "in": "query", + "name": "since", + "type": "string" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/issues" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + } + }, + "/legacy/issues/search/{owner}/{repository}/{state}/{keyword}": { + "get": { + "deprecated": true, + "description": "Find issues by state and keyword.", + "parameters": [ + { + "description": "The search term.", + "in": "path", + "name": "keyword", + "required": true, + "type": "string" + }, + { + "description": "Indicates the state of the issues to return. Can be either open or closed.", + "enum": ["open", "closed"], + "in": "path", + "name": "state", + "required": true, + "type": "string" + }, + { + "in": "path", + "name": "owner", + "required": true, + "type": "string" + }, + { + "in": "path", + "name": "repository", + "required": true, + "type": "string" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/search-issues-by-keyword" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + } + }, + "/legacy/repos/search/{keyword}": { + "get": { + "deprecated": true, + "description": "Find repositories by keyword. Note, this legacy method does not follow the v3 pagination pattern. This method returns up to 100 results per page and pages can be fetched using the start_page parameter.", + "parameters": [ + { + "description": "The search term", + "in": "path", + "name": "keyword", + "required": true, + "type": "string" + }, + { + "default": "desc", + "description": "The sort field. if sort param is provided. Can be either asc or desc.", + "enum": ["desc", "asc"], + "in": "query", + "name": "order", + "type": "string" + }, + { + "description": "Filter results by language", + "in": "query", + "name": "language", + "type": "string" + }, + { + "description": "The page number to fetch", + "in": "query", + "name": "start_page", + "type": "string" + }, + { + "description": "The sort field. One of stars, forks, or updated. Default: results are sorted by best match.", + "enum": ["updated", "stars", "forks"], + "in": "query", + "name": "sort", + "type": "string" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/search-repositories-by-keyword" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + } + }, + "/legacy/user/email/{email}": { + "get": { + "deprecated": true, + "description": "This API call is added for compatibility reasons only.", + "parameters": [ + { + "description": "The email address", + "in": "path", + "name": "email", + "required": true, + "type": "string" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/search-user-by-email" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + } + }, + "/legacy/user/search/{keyword}": { + "get": { + "deprecated": true, + "description": "Find users by keyword.", + "parameters": [ + { + "description": "The search term", + "in": "path", + "name": "keyword", + "required": true, + "type": "string" + }, + { + "default": "desc", + "description": "The sort field. if sort param is provided. Can be either asc or desc.", + "enum": ["desc", "asc"], + "in": "query", + "name": "order", + "type": "string" + }, + { + "description": "The page number to fetch", + "in": "query", + "name": "start_page", + "type": "string" + }, + { + "description": "The sort field. One of stars, forks, or updated. Default: results are sorted by best match.", + "enum": ["updated", "stars", "forks"], + "in": "query", + "name": "sort", + "type": "string" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/search-users-by-keyword" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + } + }, + "/markdown": { + "post": { + "description": "Render an arbitrary Markdown document", + "parameters": [ + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + }, + { + "in": "body", + "name": "body", + "required": true, + "schema": { + "$ref": "#/definitions/markdown" + } + } + ], + "produces": ["text/html"], + "responses": { + "200": { + "description": "OK", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + } + }, + "/markdown/raw": { + "post": { + "consumes": ["text/plain"], + "description": "Render a Markdown document in raw mode", + "parameters": [ + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "produces": ["text/html"], + "responses": { + "200": { + "description": "OK", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + } + }, + "/meta": { + "get": { + "description": "This gives some information about GitHub.com, the service.", + "parameters": [ + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/meta" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + } + }, + "/networks/{owner}/{repo}/events": { + "get": { + "description": "List public events for a network of repositories.", + "parameters": [ + { + "description": "Name of the owner.", + "in": "path", + "name": "owner", + "required": true, + "type": "string" + }, + { + "description": "Name of repository.", + "in": "path", + "name": "repo", + "required": true, + "type": "string" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/events" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + } + }, + "/notifications": { + "get": { + "description": "List your notifications.\nList all notifications for the current user, grouped by repository.\n", + "parameters": [ + { + "description": "True to show notifications marked as read.", + "in": "query", + "name": "all", + "type": "boolean" + }, + { + "description": "True to show only notifications in which the user is directly participating\nor mentioned.\n", + "in": "query", + "name": "participating", + "type": "boolean" + }, + { + "description": "The time should be passed in as UTC in the ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ.\nExample: \"2012-10-09T23:39:01Z\".\n", + "in": "query", + "name": "since", + "type": "string" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/notifications" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + }, + "put": { + "description": "Mark as read.\nMarking a notification as \"read\" removes it from the default view on GitHub.com.\n", + "parameters": [ + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + }, + { + "in": "body", + "name": "body", + "required": true, + "schema": { + "$ref": "#/definitions/notificationMarkRead" + } + } + ], + "responses": { + "205": { + "description": "Marked as read.", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + } + }, + "/notifications/threads/{id}": { + "get": { + "description": "View a single thread.", + "parameters": [ + { + "description": "Id of thread.", + "in": "path", + "name": "id", + "required": true, + "type": "integer" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/notifications" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + }, + "patch": { + "description": "Mark a thread as read", + "parameters": [ + { + "description": "Id of thread.", + "in": "path", + "name": "id", + "required": true, + "type": "integer" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "205": { + "description": "Thread marked as read.", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + } + }, + "/notifications/threads/{id}/subscription": { + "delete": { + "description": "Delete a Thread Subscription.", + "parameters": [ + { + "description": "Id of thread.", + "in": "path", + "name": "id", + "required": true, + "type": "integer" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "204": { + "description": "No Content\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + }, + "get": { + "description": "Get a Thread Subscription.", + "parameters": [ + { + "description": "Id of thread.", + "in": "path", + "name": "id", + "required": true, + "type": "integer" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/subscription" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + }, + "put": { + "description": "Set a Thread Subscription.\nThis lets you subscribe to a thread, or ignore it. Subscribing to a thread\nis unnecessary if the user is already subscribed to the repository. Ignoring\na thread will mute all future notifications (until you comment or get @mentioned).\n", + "parameters": [ + { + "description": "Id of thread.", + "in": "path", + "name": "id", + "required": true, + "type": "integer" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + }, + { + "in": "body", + "name": "body", + "required": true, + "schema": { + "$ref": "#/definitions/putSubscription" + } + } + ], + "responses": { + "200": { + "description": "OK", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/subscription" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + } + }, + "/orgs/{org}": { + "get": { + "description": "Get an Organization.", + "parameters": [ + { + "description": "Name of organisation.", + "in": "path", + "name": "org", + "required": true, + "type": "string" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/organization" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + }, + "patch": { + "description": "Edit an Organization.", + "parameters": [ + { + "description": "Name of organisation.", + "in": "path", + "name": "org", + "required": true, + "type": "string" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + }, + { + "in": "body", + "name": "body", + "required": true, + "schema": { + "$ref": "#/definitions/patchOrg" + } + } + ], + "responses": { + "200": { + "description": "OK", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/organization" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + } + }, + "/orgs/{org}/events": { + "get": { + "description": "List public events for an organization.", + "parameters": [ + { + "description": "Name of organisation.", + "in": "path", + "name": "org", + "required": true, + "type": "string" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/events" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + } + }, + "/orgs/{org}/issues": { + "get": { + "description": "List issues.\nList all issues for a given organization for the authenticated user.\n", + "parameters": [ + { + "description": "Name of organisation.", + "in": "path", + "name": "org", + "required": true, + "type": "string" + }, + { + "default": "all", + "description": "Issues assigned to you / created by you / mentioning you / you're\nsubscribed to updates for / All issues the authenticated user can see\n", + "enum": ["assigned", "created", "mentioned", "subscribed", "all"], + "in": "query", + "name": "filter", + "required": true, + "type": "string" + }, + { + "default": "open", + "enum": ["open", "closed"], + "in": "query", + "name": "state", + "required": true, + "type": "string" + }, + { + "description": "String list of comma separated Label names. Example - bug,ui,@high.", + "in": "query", + "name": "labels", + "required": true, + "type": "string" + }, + { + "default": "created", + "enum": ["created", "updated", "comments"], + "in": "query", + "name": "sort", + "required": true, + "type": "string" + }, + { + "default": "desc", + "enum": ["asc", "desc"], + "in": "query", + "name": "direction", + "required": true, + "type": "string" + }, + { + "description": "Optional string of a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ.\nOnly issues updated at or after this time are returned.\n", + "in": "query", + "name": "since", + "type": "string" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/issues" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + } + }, + "/orgs/{org}/members": { + "get": { + "description": "Members list.\nList all users who are members of an organization. A member is a user tha\nbelongs to at least 1 team in the organization. If the authenticated user\nis also an owner of this organization then both concealed and public members\nwill be returned. If the requester is not an owner of the organization the\nquery will be redirected to the public members list.\n", + "parameters": [ + { + "description": "Name of organisation.", + "in": "path", + "name": "org", + "required": true, + "type": "string" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/users" + } + }, + "302": { + "description": "Response if requester is not an organization member.", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + } + }, + "/orgs/{org}/members/{username}": { + "delete": { + "description": "Remove a member.\nRemoving a user from this list will remove them from all teams and they\nwill no longer have any access to the organization's repositories.\n", + "parameters": [ + { + "description": "Name of organisation.", + "in": "path", + "name": "org", + "required": true, + "type": "string" + }, + { + "description": "Name of the user.", + "in": "path", + "name": "username", + "required": true, + "type": "string" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "204": { + "description": "No content.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + }, + "get": { + "description": "Check if a user is, publicly or privately, a member of the organization.", + "parameters": [ + { + "description": "Name of organisation.", + "in": "path", + "name": "org", + "required": true, + "type": "string" + }, + { + "description": "Name of the user.", + "in": "path", + "name": "username", + "required": true, + "type": "string" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "204": { + "description": "No content. Response if requester is an organization member and user is a member\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + }, + "302": { + "description": "Found. Response if requester is not an organization member\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + }, + "404": { + "description": "Not Found.\na. Response if requester is an organization member and user is not a member\nb. Response if requester is not an organization member and is inquiring about themselves\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + } + }, + "/orgs/{org}/public_members": { + "get": { + "description": "Public members list.\nMembers of an organization can choose to have their membership publicized\nor not.\n", + "parameters": [ + { + "description": "Name of organisation.", + "in": "path", + "name": "org", + "required": true, + "type": "string" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/users" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + } + }, + "/orgs/{org}/public_members/{username}": { + "delete": { + "description": "Conceal a user's membership.", + "parameters": [ + { + "description": "Name of organisation.", + "in": "path", + "name": "org", + "required": true, + "type": "string" + }, + { + "description": "Name of the user.", + "in": "path", + "name": "username", + "required": true, + "type": "string" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "204": { + "description": "Concealed.", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + }, + "get": { + "description": "Check public membership.", + "parameters": [ + { + "description": "Name of organisation.", + "in": "path", + "name": "org", + "required": true, + "type": "string" + }, + { + "description": "Name of the user.", + "in": "path", + "name": "username", + "required": true, + "type": "string" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "204": { + "description": "User is a public member.", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + }, + "404": { + "description": "User is not a public member.", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + }, + "put": { + "description": "Publicize a user's membership.", + "parameters": [ + { + "description": "Name of organisation.", + "in": "path", + "name": "org", + "required": true, + "type": "string" + }, + { + "description": "Name of the user.", + "in": "path", + "name": "username", + "required": true, + "type": "string" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "204": { + "description": "Publicized.", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + } + }, + "/orgs/{org}/repos": { + "get": { + "description": "List repositories for the specified org.", + "parameters": [ + { + "description": "Name of organisation.", + "in": "path", + "name": "org", + "required": true, + "type": "string" + }, + { + "default": "all", + "enum": ["all", "public", "private", "forks", "sources", "member"], + "in": "query", + "name": "type", + "type": "string" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/repos" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + }, + "post": { + "description": "Create a new repository for the authenticated user. OAuth users must supply\nrepo scope.\n", + "parameters": [ + { + "description": "Name of organisation.", + "in": "path", + "name": "org", + "required": true, + "type": "string" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + }, + { + "in": "body", + "name": "body", + "required": true, + "schema": { + "$ref": "#/definitions/postRepo" + } + } + ], + "responses": { + "201": { + "description": "Created", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/repos" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + } + }, + "/orgs/{org}/teams": { + "get": { + "description": "List teams.", + "parameters": [ + { + "description": "Name of organisation.", + "in": "path", + "name": "org", + "required": true, + "type": "string" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/teams" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + }, + "post": { + "description": "Create team.\nIn order to create a team, the authenticated user must be an owner of organization.\n", + "parameters": [ + { + "description": "Name of organisation.", + "in": "path", + "name": "org", + "required": true, + "type": "string" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + }, + { + "in": "body", + "name": "body", + "required": true, + "schema": { + "$ref": "#/definitions/orgTeamsPost" + } + } + ], + "responses": { + "201": { + "description": "Created", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/team" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + } + }, + "/rate_limit": { + "get": { + "description": "Get your current rate limit status\nNote: Accessing this endpoint does not count against your rate limit.\n", + "parameters": [ + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/rate_limit" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + } + }, + "/repos/{owner}/{repo}": { + "delete": { + "description": "Delete a Repository.\nDeleting a repository requires admin access. If OAuth is used, the delete_repo\nscope is required.\n", + "parameters": [ + { + "description": "Name of repository owner.", + "in": "path", + "name": "owner", + "required": true, + "type": "string" + }, + { + "description": "Name of repository.", + "in": "path", + "name": "repo", + "required": true, + "type": "string" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "204": { + "description": "Item removed.", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + }, + "get": { + "description": "Get repository.", + "parameters": [ + { + "description": "Name of repository owner.", + "in": "path", + "name": "owner", + "required": true, + "type": "string" + }, + { + "description": "Name of repository.", + "in": "path", + "name": "repo", + "required": true, + "type": "string" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/repo" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + }, + "patch": { + "description": "Edit repository.", + "parameters": [ + { + "description": "Name of repository owner.", + "in": "path", + "name": "owner", + "required": true, + "type": "string" + }, + { + "description": "Name of repository.", + "in": "path", + "name": "repo", + "required": true, + "type": "string" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + }, + { + "in": "body", + "name": "body", + "required": true, + "schema": { + "$ref": "#/definitions/repoEdit" + } + } + ], + "responses": { + "200": { + "description": "OK", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/repo" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + } + }, + "/repos/{owner}/{repo}/assignees": { + "get": { + "description": "List assignees.\nThis call lists all the available assignees (owner + collaborators) to which\nissues may be assigned.\n", + "parameters": [ + { + "description": "Name of repository owner.", + "in": "path", + "name": "owner", + "required": true, + "type": "string" + }, + { + "description": "Name of repository.", + "in": "path", + "name": "repo", + "required": true, + "type": "string" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/assignees" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + } + }, + "/repos/{owner}/{repo}/assignees/{assignee}": { + "get": { + "description": "Check assignee.\nYou may also check to see if a particular user is an assignee for a repository.\n", + "parameters": [ + { + "description": "Name of repository owner.", + "in": "path", + "name": "owner", + "required": true, + "type": "string" + }, + { + "description": "Name of repository.", + "in": "path", + "name": "repo", + "required": true, + "type": "string" + }, + { + "description": "Login of the assignee.", + "in": "path", + "name": "assignee", + "required": true, + "type": "string" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "204": { + "description": "User is an assignee.", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + }, + "404": { + "description": "User isn't an assignee.", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + } + }, + "/repos/{owner}/{repo}/branches": { + "get": { + "description": "Get list of branches", + "parameters": [ + { + "description": "Name of repository owner.", + "in": "path", + "name": "owner", + "required": true, + "type": "string" + }, + { + "description": "Name of repository.", + "in": "path", + "name": "repo", + "required": true, + "type": "string" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/branches" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + } + }, + "/repos/{owner}/{repo}/branches/{branch}": { + "get": { + "description": "Get Branch", + "parameters": [ + { + "description": "Name of repository owner.", + "in": "path", + "name": "owner", + "required": true, + "type": "string" + }, + { + "description": "Name of repository.", + "in": "path", + "name": "repo", + "required": true, + "type": "string" + }, + { + "description": "Name of the branch.", + "in": "path", + "name": "branch", + "required": true, + "type": "string" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/branch" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + } + }, + "/repos/{owner}/{repo}/collaborators": { + "get": { + "description": "List.\nWhen authenticating as an organization owner of an organization-owned\nrepository, all organization owners are included in the list of\ncollaborators. Otherwise, only users with access to the repository are\nreturned in the collaborators list.\n", + "parameters": [ + { + "description": "Name of repository owner.", + "in": "path", + "name": "owner", + "required": true, + "type": "string" + }, + { + "description": "Name of repository.", + "in": "path", + "name": "repo", + "required": true, + "type": "string" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/users" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + } + }, + "/repos/{owner}/{repo}/collaborators/{user}": { + "delete": { + "description": "Remove collaborator.", + "parameters": [ + { + "description": "Name of repository owner.", + "in": "path", + "name": "owner", + "required": true, + "type": "string" + }, + { + "description": "Name of repository.", + "in": "path", + "name": "repo", + "required": true, + "type": "string" + }, + { + "description": "Login of the user.", + "in": "path", + "name": "user", + "required": true, + "type": "string" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "204": { + "description": "Collaborator removed.", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + }, + "get": { + "description": "Check if user is a collaborator", + "parameters": [ + { + "description": "Name of repository owner.", + "in": "path", + "name": "owner", + "required": true, + "type": "string" + }, + { + "description": "Name of repository.", + "in": "path", + "name": "repo", + "required": true, + "type": "string" + }, + { + "description": "Login of the user.", + "in": "path", + "name": "user", + "required": true, + "type": "string" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "204": { + "description": "User is a collaborator.", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + }, + "404": { + "description": "User is not a collaborator.", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + }, + "put": { + "description": "Add collaborator.", + "parameters": [ + { + "description": "Name of repository owner.", + "in": "path", + "name": "owner", + "required": true, + "type": "string" + }, + { + "description": "Name of repository.", + "in": "path", + "name": "repo", + "required": true, + "type": "string" + }, + { + "description": "Login of the user.", + "in": "path", + "name": "user", + "required": true, + "type": "string" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "204": { + "description": "Collaborator added.", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + } + }, + "/repos/{owner}/{repo}/comments": { + "get": { + "description": "List commit comments for a repository.\nComments are ordered by ascending ID.\n", + "parameters": [ + { + "description": "Name of repository owner.", + "in": "path", + "name": "owner", + "required": true, + "type": "string" + }, + { + "description": "Name of repository.", + "in": "path", + "name": "repo", + "required": true, + "type": "string" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/repoComments" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + } + }, + "/repos/{owner}/{repo}/comments/{commentId}": { + "delete": { + "description": "Delete a commit comment", + "parameters": [ + { + "description": "Name of repository owner.", + "in": "path", + "name": "owner", + "required": true, + "type": "string" + }, + { + "description": "Name of repository.", + "in": "path", + "name": "repo", + "required": true, + "type": "string" + }, + { + "description": "Id of comment.", + "in": "path", + "name": "commentId", + "required": true, + "type": "integer" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "204": { + "description": "No content.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + }, + "get": { + "description": "Get a single commit comment.", + "parameters": [ + { + "description": "Name of repository owner.", + "in": "path", + "name": "owner", + "required": true, + "type": "string" + }, + { + "description": "Name of repository.", + "in": "path", + "name": "repo", + "required": true, + "type": "string" + }, + { + "description": "Id of comment.", + "in": "path", + "name": "commentId", + "required": true, + "type": "integer" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/commitComment" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + }, + "patch": { + "description": "Update a commit comment.", + "parameters": [ + { + "description": "Name of repository owner.", + "in": "path", + "name": "owner", + "required": true, + "type": "string" + }, + { + "description": "Name of repository.", + "in": "path", + "name": "repo", + "required": true, + "type": "string" + }, + { + "description": "Id of comment.", + "in": "path", + "name": "commentId", + "required": true, + "type": "integer" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + }, + { + "in": "body", + "name": "body", + "required": true, + "schema": { + "$ref": "#/definitions/commentBody" + } + } + ], + "responses": { + "200": { + "description": "OK", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/commitComment" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + } + }, + "/repos/{owner}/{repo}/commits": { + "get": { + "description": "List commits on a repository.", + "parameters": [ + { + "description": "Name of repository owner.", + "in": "path", + "name": "owner", + "required": true, + "type": "string" + }, + { + "description": "Name of repository.", + "in": "path", + "name": "repo", + "required": true, + "type": "string" + }, + { + "description": "The time should be passed in as UTC in the ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ.\nExample: \"2012-10-09T23:39:01Z\".\n", + "in": "query", + "name": "since", + "type": "string" + }, + { + "description": "Sha or branch to start listing commits from.", + "in": "query", + "name": "sha", + "type": "string" + }, + { + "description": "Only commits containing this file path will be returned.", + "in": "query", + "name": "path", + "type": "string" + }, + { + "description": "GitHub login, name, or email by which to filter by commit author.", + "in": "query", + "name": "author", + "type": "string" + }, + { + "description": "ISO 8601 Date - Only commits before this date will be returned.", + "in": "query", + "name": "until", + "type": "string" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/commits" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + } + }, + "/repos/{owner}/{repo}/commits/{ref}/status": { + "get": { + "description": "Get the combined Status for a specific Ref\nThe Combined status endpoint is currently available for developers to preview. During the preview period, the API may change without advance notice. Please see the blog post for full details.\nTo access this endpoint during the preview period, you must provide a custom media type in the Accept header:\napplication/vnd.github.she-hulk-preview+json\n", + "parameters": [ + { + "description": "Name of repository owner.", + "in": "path", + "name": "owner", + "required": true, + "type": "string" + }, + { + "description": "Name of repository.", + "in": "path", + "name": "repo", + "required": true, + "type": "string" + }, + { + "in": "path", + "name": "ref", + "required": true, + "type": "string" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/refStatus" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + } + }, + "/repos/{owner}/{repo}/commits/{shaCode}": { + "get": { + "description": "Get a single commit.", + "parameters": [ + { + "description": "Name of repository owner.", + "in": "path", + "name": "owner", + "required": true, + "type": "string" + }, + { + "description": "Name of repository.", + "in": "path", + "name": "repo", + "required": true, + "type": "string" + }, + { + "description": "SHA-1 code of the commit.", + "in": "path", + "name": "shaCode", + "required": true, + "type": "string" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/commit" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + } + }, + "/repos/{owner}/{repo}/commits/{shaCode}/comments": { + "get": { + "description": "List comments for a single commitList comments for a single commit.", + "parameters": [ + { + "description": "Name of repository owner.", + "in": "path", + "name": "owner", + "required": true, + "type": "string" + }, + { + "description": "Name of repository.", + "in": "path", + "name": "repo", + "required": true, + "type": "string" + }, + { + "description": "SHA-1 code of the commit.", + "in": "path", + "name": "shaCode", + "required": true, + "type": "string" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/repoComments" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + }, + "post": { + "description": "Create a commit comment.", + "parameters": [ + { + "description": "Name of repository owner.", + "in": "path", + "name": "owner", + "required": true, + "type": "string" + }, + { + "description": "Name of repository.", + "in": "path", + "name": "repo", + "required": true, + "type": "string" + }, + { + "description": "SHA-1 code of the commit.", + "in": "path", + "name": "shaCode", + "required": true, + "type": "string" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + }, + { + "in": "body", + "name": "body", + "required": true, + "schema": { + "$ref": "#/definitions/commitCommentBody" + } + } + ], + "responses": { + "201": { + "description": "Created", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/commitComment" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + } + }, + "/repos/{owner}/{repo}/compare/{baseId}...{headId}": { + "get": { + "description": "Compare two commits", + "parameters": [ + { + "description": "Name of repository owner.", + "in": "path", + "name": "owner", + "required": true, + "type": "string" + }, + { + "description": "Name of repository.", + "in": "path", + "name": "repo", + "required": true, + "type": "string" + }, + { + "in": "path", + "name": "baseId", + "required": true, + "type": "string" + }, + { + "in": "path", + "name": "headId", + "required": true, + "type": "string" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/compare-commits" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + } + }, + "/repos/{owner}/{repo}/contents/{path}": { + "delete": { + "description": "Delete a file.\nThis method deletes a file in a repository.\n", + "parameters": [ + { + "description": "Name of repository owner.", + "in": "path", + "name": "owner", + "required": true, + "type": "string" + }, + { + "description": "Name of repository.", + "in": "path", + "name": "repo", + "required": true, + "type": "string" + }, + { + "in": "path", + "name": "path", + "required": true, + "type": "string" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + }, + { + "in": "body", + "name": "body", + "required": true, + "schema": { + "$ref": "#/definitions/deleteFileBody" + } + } + ], + "responses": { + "200": { + "description": "OK", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/deleteFile" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + }, + "get": { + "description": "Get contents.\nThis method returns the contents of a file or directory in a repository.\nFiles and symlinks support a custom media type for getting the raw content.\nDirectories and submodules do not support custom media types.\nNote: This API supports files up to 1 megabyte in size.\nHere can be many outcomes. For details see \"http://developer.github.com/v3/repos/contents/\"\n", + "parameters": [ + { + "description": "Name of repository owner.", + "in": "path", + "name": "owner", + "required": true, + "type": "string" + }, + { + "description": "Name of repository.", + "in": "path", + "name": "repo", + "required": true, + "type": "string" + }, + { + "in": "path", + "name": "path", + "required": true, + "type": "string" + }, + { + "description": "The content path.", + "in": "query", + "name": "path", + "type": "string" + }, + { + "description": "The String name of the Commit/Branch/Tag. Defaults to 'master'.", + "in": "query", + "name": "ref", + "type": "string" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/contents-path" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + }, + "put": { + "description": "Create a file.", + "parameters": [ + { + "description": "Name of repository owner.", + "in": "path", + "name": "owner", + "required": true, + "type": "string" + }, + { + "description": "Name of repository.", + "in": "path", + "name": "repo", + "required": true, + "type": "string" + }, + { + "in": "path", + "name": "path", + "required": true, + "type": "string" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + }, + { + "in": "body", + "name": "body", + "required": true, + "schema": { + "$ref": "#/definitions/createFileBody" + } + } + ], + "responses": { + "200": { + "description": "OK", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/createFile" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + } + }, + "/repos/{owner}/{repo}/contributors": { + "get": { + "description": "Get list of contributors.", + "parameters": [ + { + "description": "Name of repository owner.", + "in": "path", + "name": "owner", + "required": true, + "type": "string" + }, + { + "description": "Name of repository.", + "in": "path", + "name": "repo", + "required": true, + "type": "string" + }, + { + "description": "Set to 1 or true to include anonymous contributors in results.", + "in": "query", + "name": "anon", + "required": true, + "type": "string" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/users" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + } + }, + "/repos/{owner}/{repo}/deployments": { + "get": { + "description": "Users with pull access can view deployments for a repository", + "parameters": [ + { + "description": "Name of repository owner.", + "in": "path", + "name": "owner", + "required": true, + "type": "string" + }, + { + "description": "Name of repository.", + "in": "path", + "name": "repo", + "required": true, + "type": "string" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/repo-deployments" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + }, + "post": { + "description": "Users with push access can create a deployment for a given ref", + "parameters": [ + { + "description": "Name of repository owner.", + "in": "path", + "name": "owner", + "required": true, + "type": "string" + }, + { + "description": "Name of repository.", + "in": "path", + "name": "repo", + "required": true, + "type": "string" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + }, + { + "in": "body", + "name": "body", + "required": true, + "schema": { + "$ref": "#/definitions/deployment" + } + } + ], + "responses": { + "201": { + "description": "Created", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/deployment-resp" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + } + }, + "/repos/{owner}/{repo}/deployments/{id}/statuses": { + "get": { + "description": "Users with pull access can view deployment statuses for a deployment", + "parameters": [ + { + "description": "Name of repository owner.", + "in": "path", + "name": "owner", + "required": true, + "type": "string" + }, + { + "description": "Name of repository.", + "in": "path", + "name": "repo", + "required": true, + "type": "string" + }, + { + "description": "The Deployment ID to list the statuses from.", + "in": "path", + "name": "id", + "required": true, + "type": "integer" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/deployment-statuses" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + }, + "post": { + "description": "Create a Deployment Status\nUsers with push access can create deployment statuses for a given deployment:\n", + "parameters": [ + { + "description": "Name of repository owner.", + "in": "path", + "name": "owner", + "required": true, + "type": "string" + }, + { + "description": "Name of repository.", + "in": "path", + "name": "repo", + "required": true, + "type": "string" + }, + { + "description": "The Deployment ID to list the statuses from.", + "in": "path", + "name": "id", + "required": true, + "type": "integer" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + }, + { + "in": "body", + "name": "body", + "required": true, + "schema": { + "$ref": "#/definitions/deployment-statuses-create" + } + } + ], + "responses": { + "201": { + "description": "ok", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + } + }, + "/repos/{owner}/{repo}/downloads": { + "get": { + "deprecated": true, + "description": "Deprecated. List downloads for a repository.", + "parameters": [ + { + "description": "Name of repository owner.", + "in": "path", + "name": "owner", + "required": true, + "type": "string" + }, + { + "description": "Name of repository.", + "in": "path", + "name": "repo", + "required": true, + "type": "string" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/downloads" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + } + }, + "/repos/{owner}/{repo}/downloads/{downloadId}": { + "delete": { + "deprecated": true, + "description": "Deprecated. Delete a download.", + "parameters": [ + { + "description": "Name of repository owner.", + "in": "path", + "name": "owner", + "required": true, + "type": "string" + }, + { + "description": "Name of repository.", + "in": "path", + "name": "repo", + "required": true, + "type": "string" + }, + { + "description": "Id of download.", + "in": "path", + "name": "downloadId", + "required": true, + "type": "integer" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "204": { + "description": "No content.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + }, + "get": { + "deprecated": true, + "description": "Deprecated. Get a single download.", + "parameters": [ + { + "description": "Name of repository owner.", + "in": "path", + "name": "owner", + "required": true, + "type": "string" + }, + { + "description": "Name of repository.", + "in": "path", + "name": "repo", + "required": true, + "type": "string" + }, + { + "description": "Id of download.", + "in": "path", + "name": "downloadId", + "required": true, + "type": "integer" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/download" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + } + }, + "/repos/{owner}/{repo}/events": { + "get": { + "description": "Get list of repository events.", + "parameters": [ + { + "description": "Name of repository owner.", + "in": "path", + "name": "owner", + "required": true, + "type": "string" + }, + { + "description": "Name of repository.", + "in": "path", + "name": "repo", + "required": true, + "type": "string" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/events" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + } + }, + "/repos/{owner}/{repo}/forks": { + "get": { + "description": "List forks.", + "parameters": [ + { + "description": "Name of repository owner.", + "in": "path", + "name": "owner", + "required": true, + "type": "string" + }, + { + "description": "Name of repository.", + "in": "path", + "name": "repo", + "required": true, + "type": "string" + }, + { + "default": "newes", + "enum": ["newes", "oldes", "watchers"], + "in": "query", + "name": "sort", + "type": "string" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/forks" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + }, + "post": { + "description": "Create a fork.\nForking a Repository happens asynchronously. Therefore, you may have to wai\na short period before accessing the git objects. If this takes longer than 5\nminutes, be sure to contact Support.\n", + "parameters": [ + { + "description": "Name of repository owner.", + "in": "path", + "name": "owner", + "required": true, + "type": "string" + }, + { + "description": "Name of repository.", + "in": "path", + "name": "repo", + "required": true, + "type": "string" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + }, + { + "in": "body", + "name": "body", + "required": true, + "schema": { + "$ref": "#/definitions/forkBody" + } + } + ], + "responses": { + "201": { + "description": "Created", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/repo" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + } + }, + "/repos/{owner}/{repo}/git/blobs": { + "post": { + "description": "Create a Blob.", + "parameters": [ + { + "description": "Name of repository owner.", + "in": "path", + "name": "owner", + "required": true, + "type": "string" + }, + { + "description": "Name of repository.", + "in": "path", + "name": "repo", + "required": true, + "type": "string" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + }, + { + "in": "body", + "name": "body", + "required": true, + "schema": { + "$ref": "#/definitions/blob" + } + } + ], + "responses": { + "201": { + "description": "Created", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/blobs" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + } + }, + "/repos/{owner}/{repo}/git/blobs/{shaCode}": { + "get": { + "description": "Get a Blob.\nSince blobs can be any arbitrary binary data, the input and responses for\nthe blob API takes an encoding parameter that can be either utf-8 or\nbase64. If your data cannot be losslessly sent as a UTF-8 string, you can\nbase64 encode it.\n", + "parameters": [ + { + "description": "Name of repository owner.", + "in": "path", + "name": "owner", + "required": true, + "type": "string" + }, + { + "description": "Name of repository.", + "in": "path", + "name": "repo", + "required": true, + "type": "string" + }, + { + "description": "SHA-1 code.", + "in": "path", + "name": "shaCode", + "required": true, + "type": "string" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/blob" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + } + }, + "/repos/{owner}/{repo}/git/commits": { + "post": { + "description": "Create a Commit.", + "parameters": [ + { + "description": "Name of repository owner.", + "in": "path", + "name": "owner", + "required": true, + "type": "string" + }, + { + "description": "Name of repository.", + "in": "path", + "name": "repo", + "required": true, + "type": "string" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + }, + { + "in": "body", + "name": "body", + "required": true, + "schema": { + "$ref": "#/definitions/repoCommitBody" + } + } + ], + "responses": { + "201": { + "description": "Created", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/gitCommit" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + } + }, + "/repos/{owner}/{repo}/git/commits/{shaCode}": { + "get": { + "description": "Get a Commit.", + "parameters": [ + { + "description": "Name of repository owner.", + "in": "path", + "name": "owner", + "required": true, + "type": "string" + }, + { + "description": "Name of repository.", + "in": "path", + "name": "repo", + "required": true, + "type": "string" + }, + { + "description": "SHA-1 code.", + "in": "path", + "name": "shaCode", + "required": true, + "type": "string" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/repoCommit" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + } + }, + "/repos/{owner}/{repo}/git/refs": { + "get": { + "description": "Get all References", + "parameters": [ + { + "description": "Name of repository owner.", + "in": "path", + "name": "owner", + "required": true, + "type": "string" + }, + { + "description": "Name of repository.", + "in": "path", + "name": "repo", + "required": true, + "type": "string" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/refs" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + }, + "post": { + "description": "Create a Reference", + "parameters": [ + { + "description": "Name of repository owner.", + "in": "path", + "name": "owner", + "required": true, + "type": "string" + }, + { + "description": "Name of repository.", + "in": "path", + "name": "repo", + "required": true, + "type": "string" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + }, + { + "in": "body", + "name": "body", + "required": true, + "schema": { + "$ref": "#/definitions/refsBody" + } + } + ], + "responses": { + "201": { + "description": "Created", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/headBranch" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + } + }, + "/repos/{owner}/{repo}/git/refs/{ref}": { + "delete": { + "description": "Delete a Reference\nExample: Deleting a branch: DELETE /repos/octocat/Hello-World/git/refs/heads/feature-a\nExample: Deleting a tag: DELETE /repos/octocat/Hello-World/git/refs/tags/v1.0\n", + "parameters": [ + { + "description": "Name of repository owner.", + "in": "path", + "name": "owner", + "required": true, + "type": "string" + }, + { + "description": "Name of repository.", + "in": "path", + "name": "repo", + "required": true, + "type": "string" + }, + { + "in": "path", + "name": "ref", + "required": true, + "type": "string" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "204": { + "description": "No Content", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + }, + "get": { + "description": "Get a Reference", + "parameters": [ + { + "description": "Name of repository owner.", + "in": "path", + "name": "owner", + "required": true, + "type": "string" + }, + { + "description": "Name of repository.", + "in": "path", + "name": "repo", + "required": true, + "type": "string" + }, + { + "in": "path", + "name": "ref", + "required": true, + "type": "string" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/headBranch" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + }, + "patch": { + "description": "Update a Reference", + "parameters": [ + { + "description": "Name of repository owner.", + "in": "path", + "name": "owner", + "required": true, + "type": "string" + }, + { + "description": "Name of repository.", + "in": "path", + "name": "repo", + "required": true, + "type": "string" + }, + { + "in": "path", + "name": "ref", + "required": true, + "type": "string" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + }, + { + "in": "body", + "name": "body", + "required": true, + "schema": { + "$ref": "#/definitions/gitRefPatch" + } + } + ], + "responses": { + "200": { + "description": "OK", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/headBranch" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + } + }, + "/repos/{owner}/{repo}/git/tags": { + "post": { + "description": "Create a Tag Object.\nNote that creating a tag object does not create the reference that makes a\ntag in Git. If you want to create an annotated tag in Git, you have to do\nthis call to create the tag object, and then create the refs/tags/[tag]\nreference. If you want to create a lightweight tag, you only have to create\nthe tag reference - this call would be unnecessary.\n", + "parameters": [ + { + "description": "Name of repository owner.", + "in": "path", + "name": "owner", + "required": true, + "type": "string" + }, + { + "description": "Name of repository.", + "in": "path", + "name": "repo", + "required": true, + "type": "string" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + }, + { + "in": "body", + "name": "body", + "required": true, + "schema": { + "$ref": "#/definitions/tagBody" + } + } + ], + "responses": { + "201": { + "description": "Created", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/tag" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + } + }, + "/repos/{owner}/{repo}/git/tags/{shaCode}": { + "get": { + "description": "Get a Tag.", + "parameters": [ + { + "description": "Name of repository owner.", + "in": "path", + "name": "owner", + "required": true, + "type": "string" + }, + { + "description": "Name of repository.", + "in": "path", + "name": "repo", + "required": true, + "type": "string" + }, + { + "in": "path", + "name": "shaCode", + "required": true, + "type": "string" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/tag" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + } + }, + "/repos/{owner}/{repo}/git/trees": { + "post": { + "description": "Create a Tree.\nThe tree creation API will take nested entries as well. If both a tree and\na nested path modifying that tree are specified, it will overwrite the\ncontents of that tree with the new path contents and write a new tree out.\n", + "parameters": [ + { + "description": "Name of repository owner.", + "in": "path", + "name": "owner", + "required": true, + "type": "string" + }, + { + "description": "Name of repository.", + "in": "path", + "name": "repo", + "required": true, + "type": "string" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + }, + { + "in": "body", + "name": "body", + "required": true, + "schema": { + "$ref": "#/definitions/tree" + } + } + ], + "responses": { + "201": { + "description": "Created", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/trees" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + } + }, + "/repos/{owner}/{repo}/git/trees/{shaCode}": { + "get": { + "description": "Get a Tree.", + "parameters": [ + { + "description": "Name of repository owner.", + "in": "path", + "name": "owner", + "required": true, + "type": "string" + }, + { + "description": "Name of repository.", + "in": "path", + "name": "repo", + "required": true, + "type": "string" + }, + { + "description": "Tree SHA.", + "in": "path", + "name": "shaCode", + "required": true, + "type": "string" + }, + { + "description": "Get a Tree Recursively. (0 or 1)", + "in": "query", + "name": "recursive", + "type": "integer" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/tree" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + } + }, + "/repos/{owner}/{repo}/hooks": { + "get": { + "description": "Get list of hooks.", + "parameters": [ + { + "description": "Name of repository owner.", + "in": "path", + "name": "owner", + "required": true, + "type": "string" + }, + { + "description": "Name of repository.", + "in": "path", + "name": "repo", + "required": true, + "type": "string" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/hook" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + }, + "post": { + "description": "Create a hook.", + "parameters": [ + { + "description": "Name of repository owner.", + "in": "path", + "name": "owner", + "required": true, + "type": "string" + }, + { + "description": "Name of repository.", + "in": "path", + "name": "repo", + "required": true, + "type": "string" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + }, + { + "in": "body", + "name": "body", + "required": true, + "schema": { + "$ref": "#/definitions/hookBody" + } + } + ], + "responses": { + "201": { + "description": "Created", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/hook" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + } + }, + "/repos/{owner}/{repo}/hooks/{hookId}": { + "delete": { + "description": "Delete a hook.", + "parameters": [ + { + "description": "Name of repository owner.", + "in": "path", + "name": "owner", + "required": true, + "type": "string" + }, + { + "description": "Name of repository.", + "in": "path", + "name": "repo", + "required": true, + "type": "string" + }, + { + "description": "Id of hook.", + "in": "path", + "name": "hookId", + "required": true, + "type": "integer" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "204": { + "description": "No content.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + }, + "get": { + "description": "Get single hook.", + "parameters": [ + { + "description": "Name of repository owner.", + "in": "path", + "name": "owner", + "required": true, + "type": "string" + }, + { + "description": "Name of repository.", + "in": "path", + "name": "repo", + "required": true, + "type": "string" + }, + { + "description": "Id of hook.", + "in": "path", + "name": "hookId", + "required": true, + "type": "integer" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/hook" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + }, + "patch": { + "description": "Edit a hook.", + "parameters": [ + { + "description": "Name of repository owner.", + "in": "path", + "name": "owner", + "required": true, + "type": "string" + }, + { + "description": "Name of repository.", + "in": "path", + "name": "repo", + "required": true, + "type": "string" + }, + { + "description": "Id of hook.", + "in": "path", + "name": "hookId", + "required": true, + "type": "integer" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + }, + { + "in": "body", + "name": "body", + "required": true, + "schema": { + "$ref": "#/definitions/hookBody" + } + } + ], + "responses": { + "200": { + "description": "OK", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/hook" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + } + }, + "/repos/{owner}/{repo}/hooks/{hookId}/tests": { + "post": { + "description": "Test a push hook.\nThis will trigger the hook with the latest push to the current repository\nif the hook is subscribed to push events. If the hook is not subscribed\nto push events, the server will respond with 204 but no test POST will\nbe generated.\nNote: Previously /repos/:owner/:repo/hooks/:id/tes\n", + "parameters": [ + { + "description": "Name of repository owner.", + "in": "path", + "name": "owner", + "required": true, + "type": "string" + }, + { + "description": "Name of repository.", + "in": "path", + "name": "repo", + "required": true, + "type": "string" + }, + { + "description": "Id of hook.", + "in": "path", + "name": "hookId", + "required": true, + "type": "integer" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "204": { + "description": "Hook is triggered.", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + } + }, + "/repos/{owner}/{repo}/issues": { + "get": { + "description": "List issues for a repository.", + "parameters": [ + { + "description": "Name of repository owner.", + "in": "path", + "name": "owner", + "required": true, + "type": "string" + }, + { + "description": "Name of repository.", + "in": "path", + "name": "repo", + "required": true, + "type": "string" + }, + { + "default": "all", + "description": "Issues assigned to you / created by you / mentioning you / you're\nsubscribed to updates for / All issues the authenticated user can see\n", + "enum": ["assigned", "created", "mentioned", "subscribed", "all"], + "in": "query", + "name": "filter", + "required": true, + "type": "string" + }, + { + "default": "open", + "enum": ["open", "closed"], + "in": "query", + "name": "state", + "required": true, + "type": "string" + }, + { + "description": "String list of comma separated Label names. Example - bug,ui,@high.", + "in": "query", + "name": "labels", + "required": true, + "type": "string" + }, + { + "default": "created", + "enum": ["created", "updated", "comments"], + "in": "query", + "name": "sort", + "required": true, + "type": "string" + }, + { + "default": "desc", + "enum": ["asc", "desc"], + "in": "query", + "name": "direction", + "required": true, + "type": "string" + }, + { + "description": "Optional string of a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ.\nOnly issues updated at or after this time are returned.\n", + "in": "query", + "name": "since", + "type": "string" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/issues" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + }, + "post": { + "description": "Create an issue.\nAny user with pull access to a repository can create an issue.\n", + "parameters": [ + { + "description": "Name of repository owner.", + "in": "path", + "name": "owner", + "required": true, + "type": "string" + }, + { + "description": "Name of repository.", + "in": "path", + "name": "repo", + "required": true, + "type": "string" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + }, + { + "in": "body", + "name": "body", + "required": true, + "schema": { + "$ref": "#/definitions/issue" + } + } + ], + "responses": { + "201": { + "description": "Created", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/issue" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + } + }, + "/repos/{owner}/{repo}/issues/comments": { + "get": { + "description": "List comments in a repository.", + "parameters": [ + { + "description": "Name of repository owner.", + "in": "path", + "name": "owner", + "required": true, + "type": "string" + }, + { + "description": "Name of repository.", + "in": "path", + "name": "repo", + "required": true, + "type": "string" + }, + { + "description": "Ignored without 'sort' parameter.", + "in": "query", + "name": "direction", + "type": "string" + }, + { + "description": "", + "enum": ["created", "updated"], + "in": "query", + "name": "sort", + "type": "string" + }, + { + "description": "The time should be passed in as UTC in the ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ.\nExample: \"2012-10-09T23:39:01Z\".\n", + "in": "query", + "name": "since", + "type": "string" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/issuesComments" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + } + }, + "/repos/{owner}/{repo}/issues/comments/{commentId}": { + "delete": { + "description": "Delete a comment.", + "parameters": [ + { + "description": "Name of repository owner.", + "in": "path", + "name": "owner", + "required": true, + "type": "string" + }, + { + "description": "Name of repository.", + "in": "path", + "name": "repo", + "required": true, + "type": "string" + }, + { + "description": "ID of comment.", + "in": "path", + "name": "commentId", + "required": true, + "type": "integer" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "204": { + "description": "No content.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + }, + "get": { + "description": "Get a single comment.", + "parameters": [ + { + "description": "Name of repository owner.", + "in": "path", + "name": "owner", + "required": true, + "type": "string" + }, + { + "description": "Name of repository.", + "in": "path", + "name": "repo", + "required": true, + "type": "string" + }, + { + "description": "ID of comment.", + "in": "path", + "name": "commentId", + "required": true, + "type": "integer" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/issuesComment" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + }, + "patch": { + "description": "Edit a comment.", + "parameters": [ + { + "description": "Name of repository owner.", + "in": "path", + "name": "owner", + "required": true, + "type": "string" + }, + { + "description": "Name of repository.", + "in": "path", + "name": "repo", + "required": true, + "type": "string" + }, + { + "description": "ID of comment.", + "in": "path", + "name": "commentId", + "required": true, + "type": "integer" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + }, + { + "in": "body", + "name": "body", + "required": true, + "schema": { + "$ref": "#/definitions/commentBody" + } + } + ], + "responses": { + "200": { + "description": "OK", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/issuesComment" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + } + }, + "/repos/{owner}/{repo}/issues/events": { + "get": { + "description": "List issue events for a repository.", + "parameters": [ + { + "description": "Name of repository owner.", + "in": "path", + "name": "owner", + "required": true, + "type": "string" + }, + { + "description": "Name of repository.", + "in": "path", + "name": "repo", + "required": true, + "type": "string" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/issueEvents" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + } + }, + "/repos/{owner}/{repo}/issues/events/{eventId}": { + "get": { + "description": "Get a single event.", + "parameters": [ + { + "description": "Name of repository owner.", + "in": "path", + "name": "owner", + "required": true, + "type": "string" + }, + { + "description": "Name of repository.", + "in": "path", + "name": "repo", + "required": true, + "type": "string" + }, + { + "description": "Id of the event.", + "in": "path", + "name": "eventId", + "required": true, + "type": "integer" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/issueEvent" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + } + }, + "/repos/{owner}/{repo}/issues/{number}": { + "get": { + "description": "Get a single issue", + "parameters": [ + { + "description": "Name of repository owner.", + "in": "path", + "name": "owner", + "required": true, + "type": "string" + }, + { + "description": "Name of repository.", + "in": "path", + "name": "repo", + "required": true, + "type": "string" + }, + { + "description": "Number of issue.", + "in": "path", + "name": "number", + "required": true, + "type": "integer" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/issue" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + }, + "patch": { + "description": "Edit an issue.\nIssue owners and users with push access can edit an issue.\n", + "parameters": [ + { + "description": "Name of repository owner.", + "in": "path", + "name": "owner", + "required": true, + "type": "string" + }, + { + "description": "Name of repository.", + "in": "path", + "name": "repo", + "required": true, + "type": "string" + }, + { + "description": "Number of issue.", + "in": "path", + "name": "number", + "required": true, + "type": "integer" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + }, + { + "in": "body", + "name": "body", + "required": true, + "schema": { + "$ref": "#/definitions/issue" + } + } + ], + "responses": { + "200": { + "description": "OK", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/issue" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + } + }, + "/repos/{owner}/{repo}/issues/{number}/comments": { + "get": { + "description": "List comments on an issue.", + "parameters": [ + { + "description": "Name of repository owner.", + "in": "path", + "name": "owner", + "required": true, + "type": "string" + }, + { + "description": "Name of repository.", + "in": "path", + "name": "repo", + "required": true, + "type": "string" + }, + { + "description": "Number of issue.", + "in": "path", + "name": "number", + "required": true, + "type": "integer" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/issuesComments" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + }, + "post": { + "description": "Create a comment.", + "parameters": [ + { + "description": "Name of repository owner.", + "in": "path", + "name": "owner", + "required": true, + "type": "string" + }, + { + "description": "Name of repository.", + "in": "path", + "name": "repo", + "required": true, + "type": "string" + }, + { + "description": "Number of issue.", + "in": "path", + "name": "number", + "required": true, + "type": "integer" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + }, + { + "in": "body", + "name": "body", + "required": true, + "schema": { + "$ref": "#/definitions/commentBody" + } + } + ], + "responses": { + "201": { + "description": "Created", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/issuesComment" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + } + }, + "/repos/{owner}/{repo}/issues/{number}/events": { + "get": { + "description": "List events for an issue.", + "parameters": [ + { + "description": "Name of repository owner.", + "in": "path", + "name": "owner", + "required": true, + "type": "string" + }, + { + "description": "Name of repository.", + "in": "path", + "name": "repo", + "required": true, + "type": "string" + }, + { + "description": "Number of issue.", + "in": "path", + "name": "number", + "required": true, + "type": "integer" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/issueEvents" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + } + }, + "/repos/{owner}/{repo}/issues/{number}/labels": { + "delete": { + "description": "Remove all labels from an issue.", + "parameters": [ + { + "description": "Name of repository owner.", + "in": "path", + "name": "owner", + "required": true, + "type": "string" + }, + { + "description": "Name of repository.", + "in": "path", + "name": "repo", + "required": true, + "type": "string" + }, + { + "description": "Number of issue.", + "in": "path", + "name": "number", + "required": true, + "type": "integer" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "204": { + "description": "No content.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + }, + "get": { + "description": "List labels on an issue.", + "parameters": [ + { + "description": "Name of repository owner.", + "in": "path", + "name": "owner", + "required": true, + "type": "string" + }, + { + "description": "Name of repository.", + "in": "path", + "name": "repo", + "required": true, + "type": "string" + }, + { + "description": "Number of issue.", + "in": "path", + "name": "number", + "required": true, + "type": "integer" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/labels" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + }, + "post": { + "description": "Add labels to an issue.", + "parameters": [ + { + "description": "Name of repository owner.", + "in": "path", + "name": "owner", + "required": true, + "type": "string" + }, + { + "description": "Name of repository.", + "in": "path", + "name": "repo", + "required": true, + "type": "string" + }, + { + "description": "Number of issue.", + "in": "path", + "name": "number", + "required": true, + "type": "integer" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + }, + { + "in": "body", + "name": "body", + "required": true, + "schema": { + "$ref": "#/definitions/emailsPost" + } + } + ], + "responses": { + "201": { + "description": "Created", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/label" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + }, + "put": { + "description": "Replace all labels for an issue.\nSending an empty array ([]) will remove all Labels from the Issue.\n", + "parameters": [ + { + "description": "Name of repository owner.", + "in": "path", + "name": "owner", + "required": true, + "type": "string" + }, + { + "description": "Name of repository.", + "in": "path", + "name": "repo", + "required": true, + "type": "string" + }, + { + "description": "Number of issue.", + "in": "path", + "name": "number", + "required": true, + "type": "integer" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + }, + { + "in": "body", + "name": "body", + "required": true, + "schema": { + "$ref": "#/definitions/emailsPost" + } + } + ], + "responses": { + "201": { + "description": "Created", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/label" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + } + }, + "/repos/{owner}/{repo}/issues/{number}/labels/{name}": { + "delete": { + "description": "Remove a label from an issue.", + "parameters": [ + { + "description": "Name of repository owner.", + "in": "path", + "name": "owner", + "required": true, + "type": "string" + }, + { + "description": "Name of repository.", + "in": "path", + "name": "repo", + "required": true, + "type": "string" + }, + { + "description": "Number of issue.", + "in": "path", + "name": "number", + "required": true, + "type": "integer" + }, + { + "description": "Name of the label.", + "in": "path", + "name": "name", + "required": true, + "type": "string" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "204": { + "description": "Item removed.", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + } + }, + "/repos/{owner}/{repo}/keys": { + "get": { + "description": "Get list of keys.", + "parameters": [ + { + "description": "Name of repository owner.", + "in": "path", + "name": "owner", + "required": true, + "type": "string" + }, + { + "description": "Name of repository.", + "in": "path", + "name": "repo", + "required": true, + "type": "string" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/keys" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + }, + "post": { + "description": "Create a key.", + "parameters": [ + { + "description": "Name of repository owner.", + "in": "path", + "name": "owner", + "required": true, + "type": "string" + }, + { + "description": "Name of repository.", + "in": "path", + "name": "repo", + "required": true, + "type": "string" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + }, + { + "in": "body", + "name": "body", + "required": true, + "schema": { + "$ref": "#/definitions/user-keys-post" + } + } + ], + "responses": { + "201": { + "description": "Created", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/user-keys-keyId" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + } + }, + "/repos/{owner}/{repo}/keys/{keyId}": { + "delete": { + "description": "Delete a key.", + "parameters": [ + { + "description": "Name of repository owner.", + "in": "path", + "name": "owner", + "required": true, + "type": "string" + }, + { + "description": "Name of repository.", + "in": "path", + "name": "repo", + "required": true, + "type": "string" + }, + { + "description": "Id of key.", + "in": "path", + "name": "keyId", + "required": true, + "type": "integer" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "204": { + "description": "No content.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + }, + "get": { + "description": "Get a key", + "parameters": [ + { + "description": "Name of repository owner.", + "in": "path", + "name": "owner", + "required": true, + "type": "string" + }, + { + "description": "Name of repository.", + "in": "path", + "name": "repo", + "required": true, + "type": "string" + }, + { + "description": "Id of key.", + "in": "path", + "name": "keyId", + "required": true, + "type": "integer" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/user-keys-keyId" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + } + }, + "/repos/{owner}/{repo}/labels": { + "get": { + "description": "List all labels for this repository.", + "parameters": [ + { + "description": "Name of repository owner.", + "in": "path", + "name": "owner", + "required": true, + "type": "string" + }, + { + "description": "Name of repository.", + "in": "path", + "name": "repo", + "required": true, + "type": "string" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/labels" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + }, + "post": { + "description": "Create a label.", + "parameters": [ + { + "description": "Name of repository owner.", + "in": "path", + "name": "owner", + "required": true, + "type": "string" + }, + { + "description": "Name of repository.", + "in": "path", + "name": "repo", + "required": true, + "type": "string" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + }, + { + "in": "body", + "name": "body", + "required": true, + "schema": { + "$ref": "#/definitions/emailsPost" + } + } + ], + "responses": { + "201": { + "description": "Created", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/label" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + } + }, + "/repos/{owner}/{repo}/labels/{name}": { + "delete": { + "description": "Delete a label.", + "parameters": [ + { + "description": "Name of repository owner.", + "in": "path", + "name": "owner", + "required": true, + "type": "string" + }, + { + "description": "Name of repository.", + "in": "path", + "name": "repo", + "required": true, + "type": "string" + }, + { + "description": "Name of the label.", + "in": "path", + "name": "name", + "required": true, + "type": "string" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "204": { + "description": "No content.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + }, + "get": { + "description": "Get a single label.", + "parameters": [ + { + "description": "Name of repository owner.", + "in": "path", + "name": "owner", + "required": true, + "type": "string" + }, + { + "description": "Name of repository.", + "in": "path", + "name": "repo", + "required": true, + "type": "string" + }, + { + "description": "Name of the label.", + "in": "path", + "name": "name", + "required": true, + "type": "string" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/label" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + }, + "patch": { + "description": "Update a label.", + "parameters": [ + { + "description": "Name of repository owner.", + "in": "path", + "name": "owner", + "required": true, + "type": "string" + }, + { + "description": "Name of repository.", + "in": "path", + "name": "repo", + "required": true, + "type": "string" + }, + { + "description": "Name of the label.", + "in": "path", + "name": "name", + "required": true, + "type": "string" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + }, + { + "in": "body", + "name": "body", + "required": true, + "schema": { + "$ref": "#/definitions/emailsPost" + } + } + ], + "responses": { + "200": { + "description": "OK", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/label" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + } + }, + "/repos/{owner}/{repo}/languages": { + "get": { + "description": "List languages.\nList languages for the specified repository. The value on the right of a\nlanguage is the number of bytes of code written in that language.\n", + "parameters": [ + { + "description": "Name of repository owner.", + "in": "path", + "name": "owner", + "required": true, + "type": "string" + }, + { + "description": "Name of repository.", + "in": "path", + "name": "repo", + "required": true, + "type": "string" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/languages" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + } + }, + "/repos/{owner}/{repo}/merges": { + "post": { + "description": "Perform a merge.", + "parameters": [ + { + "description": "Name of repository owner.", + "in": "path", + "name": "owner", + "required": true, + "type": "string" + }, + { + "description": "Name of repository.", + "in": "path", + "name": "repo", + "required": true, + "type": "string" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + }, + { + "in": "body", + "name": "body", + "required": true, + "schema": { + "$ref": "#/definitions/mergesBody" + } + } + ], + "responses": { + "201": { + "description": "Successful Response (The resulting merge commit)", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/mergesSuccessful" + } + }, + "204": { + "description": "No-op response (base already contains the head, nothing to merge)", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + }, + "404": { + "description": "Missing base response or missing head response", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/mergesConflict" + } + }, + "409": { + "description": "Merge conflict response.", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/mergesConflict" + } + } + } + } + }, + "/repos/{owner}/{repo}/milestones": { + "get": { + "description": "List milestones for a repository.", + "parameters": [ + { + "description": "Name of repository owner.", + "in": "path", + "name": "owner", + "required": true, + "type": "string" + }, + { + "description": "Name of repository.", + "in": "path", + "name": "repo", + "required": true, + "type": "string" + }, + { + "default": "open", + "description": "String to filter by state.", + "enum": ["open", "closed"], + "in": "query", + "name": "state", + "type": "string" + }, + { + "description": "Ignored without 'sort' parameter.", + "in": "query", + "name": "direction", + "type": "string" + }, + { + "default": "due_date", + "description": "", + "enum": ["due_date", "completeness"], + "in": "query", + "name": "sort", + "type": "string" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/milestone" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + }, + "post": { + "description": "Create a milestone.", + "parameters": [ + { + "description": "Name of repository owner.", + "in": "path", + "name": "owner", + "required": true, + "type": "string" + }, + { + "description": "Name of repository.", + "in": "path", + "name": "repo", + "required": true, + "type": "string" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + }, + { + "in": "body", + "name": "body", + "required": true, + "schema": { + "$ref": "#/definitions/milestoneUpdate" + } + } + ], + "responses": { + "201": { + "description": "Created", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/milestone" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + } + }, + "/repos/{owner}/{repo}/milestones/{number}": { + "delete": { + "description": "Delete a milestone.", + "parameters": [ + { + "description": "Name of repository owner.", + "in": "path", + "name": "owner", + "required": true, + "type": "string" + }, + { + "description": "Name of repository.", + "in": "path", + "name": "repo", + "required": true, + "type": "string" + }, + { + "description": "Number of milestone.", + "in": "path", + "name": "number", + "required": true, + "type": "integer" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "204": { + "description": "No content.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + }, + "get": { + "description": "Get a single milestone.", + "parameters": [ + { + "description": "Name of repository owner.", + "in": "path", + "name": "owner", + "required": true, + "type": "string" + }, + { + "description": "Name of repository.", + "in": "path", + "name": "repo", + "required": true, + "type": "string" + }, + { + "description": "Number of milestone.", + "in": "path", + "name": "number", + "required": true, + "type": "integer" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/milestone" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + }, + "patch": { + "description": "Update a milestone.", + "parameters": [ + { + "description": "Name of repository owner.", + "in": "path", + "name": "owner", + "required": true, + "type": "string" + }, + { + "description": "Name of repository.", + "in": "path", + "name": "repo", + "required": true, + "type": "string" + }, + { + "description": "Number of milestone.", + "in": "path", + "name": "number", + "required": true, + "type": "integer" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + }, + { + "in": "body", + "name": "body", + "required": true, + "schema": { + "$ref": "#/definitions/milestoneUpdate" + } + } + ], + "responses": { + "200": { + "description": "OK", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/milestone" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + } + }, + "/repos/{owner}/{repo}/milestones/{number}/labels": { + "get": { + "description": "Get labels for every issue in a milestone.", + "parameters": [ + { + "description": "Name of repository owner.", + "in": "path", + "name": "owner", + "required": true, + "type": "string" + }, + { + "description": "Name of repository.", + "in": "path", + "name": "repo", + "required": true, + "type": "string" + }, + { + "description": "Number of milestone.", + "in": "path", + "name": "number", + "required": true, + "type": "integer" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/labels" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + } + }, + "/repos/{owner}/{repo}/notifications": { + "get": { + "description": "List your notifications in a repository\nList all notifications for the current user.\n", + "parameters": [ + { + "description": "Name of repository owner.", + "in": "path", + "name": "owner", + "required": true, + "type": "string" + }, + { + "description": "Name of repository.", + "in": "path", + "name": "repo", + "required": true, + "type": "string" + }, + { + "description": "True to show notifications marked as read.", + "in": "query", + "name": "all", + "type": "boolean" + }, + { + "description": "True to show only notifications in which the user is directly participating\nor mentioned.\n", + "in": "query", + "name": "participating", + "type": "boolean" + }, + { + "description": "The time should be passed in as UTC in the ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ.\nExample: \"2012-10-09T23:39:01Z\".\n", + "in": "query", + "name": "since", + "type": "string" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/notifications" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + }, + "put": { + "description": "Mark notifications as read in a repository.\nMarking all notifications in a repository as \"read\" removes them from the\ndefault view on GitHub.com.\n", + "parameters": [ + { + "description": "Name of repository owner.", + "in": "path", + "name": "owner", + "required": true, + "type": "string" + }, + { + "description": "Name of repository.", + "in": "path", + "name": "repo", + "required": true, + "type": "string" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + }, + { + "in": "body", + "name": "body", + "required": true, + "schema": { + "$ref": "#/definitions/notificationMarkRead" + } + } + ], + "responses": { + "205": { + "description": "Marked as read.", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + } + }, + "/repos/{owner}/{repo}/pulls": { + "get": { + "description": "List pull requests.", + "parameters": [ + { + "description": "Name of repository owner.", + "in": "path", + "name": "owner", + "required": true, + "type": "string" + }, + { + "description": "Name of repository.", + "in": "path", + "name": "repo", + "required": true, + "type": "string" + }, + { + "default": "open", + "description": "String to filter by state.", + "enum": ["open", "closed"], + "in": "query", + "name": "state", + "type": "string" + }, + { + "description": "Filter pulls by head user and branch name in the format of 'user:ref-name'.\nExample: github:new-script-format.\n", + "in": "query", + "name": "head", + "type": "string" + }, + { + "description": "Filter pulls by base branch name. Example - gh-pages.", + "in": "query", + "name": "base", + "type": "string" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/pulls" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + }, + "post": { + "description": "Create a pull request.", + "parameters": [ + { + "description": "Name of repository owner.", + "in": "path", + "name": "owner", + "required": true, + "type": "string" + }, + { + "description": "Name of repository.", + "in": "path", + "name": "repo", + "required": true, + "type": "string" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + }, + { + "in": "body", + "name": "body", + "required": true, + "schema": { + "$ref": "#/definitions/pullsPost" + } + } + ], + "responses": { + "201": { + "description": "Created", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/pulls" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + } + }, + "/repos/{owner}/{repo}/pulls/comments": { + "get": { + "description": "List comments in a repository.\nBy default, Review Comments are ordered by ascending ID.\n", + "parameters": [ + { + "description": "Name of repository owner.", + "in": "path", + "name": "owner", + "required": true, + "type": "string" + }, + { + "description": "Name of repository.", + "in": "path", + "name": "repo", + "required": true, + "type": "string" + }, + { + "description": "Ignored without 'sort' parameter.", + "in": "query", + "name": "direction", + "type": "string" + }, + { + "description": "", + "enum": ["created", "updated"], + "in": "query", + "name": "sort", + "type": "string" + }, + { + "description": "The time should be passed in as UTC in the ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ.\nExample: \"2012-10-09T23:39:01Z\".\n", + "in": "query", + "name": "since", + "type": "string" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/issuesComments" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + } + }, + "/repos/{owner}/{repo}/pulls/comments/{commentId}": { + "delete": { + "description": "Delete a comment.", + "parameters": [ + { + "description": "Name of repository owner.", + "in": "path", + "name": "owner", + "required": true, + "type": "string" + }, + { + "description": "Name of repository.", + "in": "path", + "name": "repo", + "required": true, + "type": "string" + }, + { + "description": "Id of comment.", + "in": "path", + "name": "commentId", + "required": true, + "type": "integer" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "204": { + "description": "No content.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + }, + "get": { + "description": "Get a single comment.", + "parameters": [ + { + "description": "Name of repository owner.", + "in": "path", + "name": "owner", + "required": true, + "type": "string" + }, + { + "description": "Name of repository.", + "in": "path", + "name": "repo", + "required": true, + "type": "string" + }, + { + "description": "Id of comment.", + "in": "path", + "name": "commentId", + "required": true, + "type": "integer" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/pullsComment" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + }, + "patch": { + "description": "Edit a comment.", + "parameters": [ + { + "description": "Name of repository owner.", + "in": "path", + "name": "owner", + "required": true, + "type": "string" + }, + { + "description": "Name of repository.", + "in": "path", + "name": "repo", + "required": true, + "type": "string" + }, + { + "description": "Id of comment.", + "in": "path", + "name": "commentId", + "required": true, + "type": "integer" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + }, + { + "in": "body", + "name": "body", + "required": true, + "schema": { + "$ref": "#/definitions/commentBody" + } + } + ], + "responses": { + "200": { + "description": "OK", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/pullsComment" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + } + }, + "/repos/{owner}/{repo}/pulls/{number}": { + "get": { + "description": "Get a single pull request.", + "parameters": [ + { + "description": "Name of repository owner.", + "in": "path", + "name": "owner", + "required": true, + "type": "string" + }, + { + "description": "Name of repository.", + "in": "path", + "name": "repo", + "required": true, + "type": "string" + }, + { + "description": "Id of pull.", + "in": "path", + "name": "number", + "required": true, + "type": "integer" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/pullRequest" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + }, + "patch": { + "description": "Update a pull request.", + "parameters": [ + { + "description": "Name of repository owner.", + "in": "path", + "name": "owner", + "required": true, + "type": "string" + }, + { + "description": "Name of repository.", + "in": "path", + "name": "repo", + "required": true, + "type": "string" + }, + { + "description": "Id of pull.", + "in": "path", + "name": "number", + "required": true, + "type": "integer" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + }, + { + "in": "body", + "name": "body", + "required": true, + "schema": { + "$ref": "#/definitions/pullUpdate" + } + } + ], + "responses": { + "200": { + "description": "OK", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/repo" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + } + }, + "/repos/{owner}/{repo}/pulls/{number}/comments": { + "get": { + "description": "List comments on a pull request.", + "parameters": [ + { + "description": "Name of repository owner.", + "in": "path", + "name": "owner", + "required": true, + "type": "string" + }, + { + "description": "Name of repository.", + "in": "path", + "name": "repo", + "required": true, + "type": "string" + }, + { + "description": "Id of pull.", + "in": "path", + "name": "number", + "required": true, + "type": "integer" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/pullsComment" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + }, + "post": { + "description": "Create a comment.\n #TODO Alternative input ( http://developer.github.com/v3/pulls/comments/ )\n description: |\n Alternative Input.\n Instead of passing commit_id, path, and position you can reply to an\n existing Pull Request Comment like this:\n\n body\n Required string\n in_reply_to\n Required number - Comment id to reply to.\n", + "parameters": [ + { + "description": "Name of repository owner.", + "in": "path", + "name": "owner", + "required": true, + "type": "string" + }, + { + "description": "Name of repository.", + "in": "path", + "name": "repo", + "required": true, + "type": "string" + }, + { + "description": "Id of pull.", + "in": "path", + "name": "number", + "required": true, + "type": "integer" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + }, + { + "in": "body", + "name": "body", + "required": true, + "schema": { + "$ref": "#/definitions/pullsCommentPost" + } + } + ], + "responses": { + "201": { + "description": "Created", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/pullsComment" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + } + }, + "/repos/{owner}/{repo}/pulls/{number}/commits": { + "get": { + "description": "List commits on a pull request.", + "parameters": [ + { + "description": "Name of repository owner.", + "in": "path", + "name": "owner", + "required": true, + "type": "string" + }, + { + "description": "Name of repository.", + "in": "path", + "name": "repo", + "required": true, + "type": "string" + }, + { + "description": "Id of pull.", + "in": "path", + "name": "number", + "required": true, + "type": "integer" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/commits" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + } + }, + "/repos/{owner}/{repo}/pulls/{number}/files": { + "get": { + "description": "List pull requests files.", + "parameters": [ + { + "description": "Name of repository owner.", + "in": "path", + "name": "owner", + "required": true, + "type": "string" + }, + { + "description": "Name of repository.", + "in": "path", + "name": "repo", + "required": true, + "type": "string" + }, + { + "description": "Id of pull.", + "in": "path", + "name": "number", + "required": true, + "type": "integer" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/pulls" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + } + }, + "/repos/{owner}/{repo}/pulls/{number}/merge": { + "get": { + "description": "Get if a pull request has been merged.", + "parameters": [ + { + "description": "Name of repository owner.", + "in": "path", + "name": "owner", + "required": true, + "type": "string" + }, + { + "description": "Name of repository.", + "in": "path", + "name": "repo", + "required": true, + "type": "string" + }, + { + "description": "Id of pull.", + "in": "path", + "name": "number", + "required": true, + "type": "integer" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "204": { + "description": "Pull request has been merged.", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + }, + "404": { + "description": "Pull request has not been merged.", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + }, + "put": { + "description": "Merge a pull request (Merge Button's)", + "parameters": [ + { + "description": "Name of repository owner.", + "in": "path", + "name": "owner", + "required": true, + "type": "string" + }, + { + "description": "Name of repository.", + "in": "path", + "name": "repo", + "required": true, + "type": "string" + }, + { + "description": "Id of pull.", + "in": "path", + "name": "number", + "required": true, + "type": "integer" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + }, + { + "in": "body", + "name": "body", + "required": true, + "schema": { + "$ref": "#/definitions/mergePullBody" + } + } + ], + "responses": { + "200": { + "description": "Response if merge was successful.", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/merge" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + }, + "405": { + "description": "Response if merge cannot be performed.", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/merge" + } + } + } + } + }, + "/repos/{owner}/{repo}/readme": { + "get": { + "description": "Get the README.\nThis method returns the preferred README for a repository.\n", + "parameters": [ + { + "description": "Name of repository owner.", + "in": "path", + "name": "owner", + "required": true, + "type": "string" + }, + { + "description": "Name of repository.", + "in": "path", + "name": "repo", + "required": true, + "type": "string" + }, + { + "description": "The String name of the Commit/Branch/Tag. Defaults to master.", + "in": "query", + "name": "ref", + "type": "string" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/contents-path" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + } + }, + "/repos/{owner}/{repo}/releases": { + "get": { + "description": "Users with push access to the repository will receive all releases (i.e., published releases and draft releases). Users with pull access will receive published releases only", + "parameters": [ + { + "description": "Name of repository owner.", + "in": "path", + "name": "owner", + "required": true, + "type": "string" + }, + { + "description": "Name of repository.", + "in": "path", + "name": "repo", + "required": true, + "type": "string" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/releases" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + }, + "post": { + "description": "Create a release\nUsers with push access to the repository can create a release.\n", + "parameters": [ + { + "description": "Name of repository owner.", + "in": "path", + "name": "owner", + "required": true, + "type": "string" + }, + { + "description": "Name of repository.", + "in": "path", + "name": "repo", + "required": true, + "type": "string" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + }, + { + "in": "body", + "name": "body", + "required": true, + "schema": { + "$ref": "#/definitions/release-create" + } + } + ], + "responses": { + "201": { + "description": "Created", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/release" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + } + }, + "/repos/{owner}/{repo}/releases/assets/{id}": { + "delete": { + "description": "Delete a release asset", + "parameters": [ + { + "description": "Name of repository owner.", + "in": "path", + "name": "owner", + "required": true, + "type": "string" + }, + { + "description": "Name of repository.", + "in": "path", + "name": "repo", + "required": true, + "type": "string" + }, + { + "in": "path", + "name": "id", + "required": true, + "type": "string" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "204": { + "description": "No Content", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + }, + "get": { + "description": "Get a single release asset", + "parameters": [ + { + "description": "Name of repository owner.", + "in": "path", + "name": "owner", + "required": true, + "type": "string" + }, + { + "description": "Name of repository.", + "in": "path", + "name": "repo", + "required": true, + "type": "string" + }, + { + "in": "path", + "name": "id", + "required": true, + "type": "string" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/asset" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + }, + "patch": { + "description": "Edit a release asset\nUsers with push access to the repository can edit a release asset.\n", + "parameters": [ + { + "description": "Name of repository owner.", + "in": "path", + "name": "owner", + "required": true, + "type": "string" + }, + { + "description": "Name of repository.", + "in": "path", + "name": "repo", + "required": true, + "type": "string" + }, + { + "in": "path", + "name": "id", + "required": true, + "type": "string" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + }, + { + "in": "body", + "name": "body", + "required": true, + "schema": { + "$ref": "#/definitions/assetPatch" + } + } + ], + "responses": { + "200": { + "description": "OK", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/asset" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + } + }, + "/repos/{owner}/{repo}/releases/{id}": { + "delete": { + "description": "Users with push access to the repository can delete a release.", + "parameters": [ + { + "description": "Name of repository owner.", + "in": "path", + "name": "owner", + "required": true, + "type": "string" + }, + { + "description": "Name of repository.", + "in": "path", + "name": "repo", + "required": true, + "type": "string" + }, + { + "in": "path", + "name": "id", + "required": true, + "type": "string" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "204": { + "description": "No Content", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + }, + "get": { + "description": "Get a single release", + "parameters": [ + { + "description": "Name of repository owner.", + "in": "path", + "name": "owner", + "required": true, + "type": "string" + }, + { + "description": "Name of repository.", + "in": "path", + "name": "repo", + "required": true, + "type": "string" + }, + { + "in": "path", + "name": "id", + "required": true, + "type": "string" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/release" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + }, + "patch": { + "description": "Users with push access to the repository can edit a release", + "parameters": [ + { + "description": "Name of repository owner.", + "in": "path", + "name": "owner", + "required": true, + "type": "string" + }, + { + "description": "Name of repository.", + "in": "path", + "name": "repo", + "required": true, + "type": "string" + }, + { + "in": "path", + "name": "id", + "required": true, + "type": "string" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + }, + { + "in": "body", + "name": "body", + "required": true, + "schema": { + "$ref": "#/definitions/release-create" + } + } + ], + "responses": { + "200": { + "description": "OK", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/release" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + } + }, + "/repos/{owner}/{repo}/releases/{id}/assets": { + "get": { + "description": "List assets for a release", + "parameters": [ + { + "description": "Name of repository owner.", + "in": "path", + "name": "owner", + "required": true, + "type": "string" + }, + { + "description": "Name of repository.", + "in": "path", + "name": "repo", + "required": true, + "type": "string" + }, + { + "in": "path", + "name": "id", + "required": true, + "type": "string" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/assets" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + } + }, + "/repos/{owner}/{repo}/stargazers": { + "get": { + "description": "List Stargazers.", + "parameters": [ + { + "description": "Name of repository owner.", + "in": "path", + "name": "owner", + "required": true, + "type": "string" + }, + { + "description": "Name of repository.", + "in": "path", + "name": "repo", + "required": true, + "type": "string" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/users" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + } + }, + "/repos/{owner}/{repo}/stats/code_frequency": { + "get": { + "description": "Get the number of additions and deletions per week.\nReturns a weekly aggregate of the number of additions and deletions pushed\nto a repository.\n", + "parameters": [ + { + "description": "Name of repository owner.", + "in": "path", + "name": "owner", + "required": true, + "type": "string" + }, + { + "description": "Name of repository.", + "in": "path", + "name": "repo", + "required": true, + "type": "string" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/codeFrequencyStats" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + } + }, + "/repos/{owner}/{repo}/stats/commit_activity": { + "get": { + "description": "Get the last year of commit activity data.\nReturns the last year of commit activity grouped by week. The days array\nis a group of commits per day, starting on Sunday.\n", + "parameters": [ + { + "description": "Name of repository owner.", + "in": "path", + "name": "owner", + "required": true, + "type": "string" + }, + { + "description": "Name of repository.", + "in": "path", + "name": "repo", + "required": true, + "type": "string" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/commitActivityStats" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + } + }, + "/repos/{owner}/{repo}/stats/contributors": { + "get": { + "description": "Get contributors list with additions, deletions, and commit counts.", + "parameters": [ + { + "description": "Name of repository owner.", + "in": "path", + "name": "owner", + "required": true, + "type": "string" + }, + { + "description": "Name of repository.", + "in": "path", + "name": "repo", + "required": true, + "type": "string" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/contributorsStats" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + } + }, + "/repos/{owner}/{repo}/stats/participation": { + "get": { + "description": "Get the weekly commit count for the repo owner and everyone else.", + "parameters": [ + { + "description": "Name of repository owner.", + "in": "path", + "name": "owner", + "required": true, + "type": "string" + }, + { + "description": "Name of repository.", + "in": "path", + "name": "repo", + "required": true, + "type": "string" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/participationStats" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + } + }, + "/repos/{owner}/{repo}/stats/punch_card": { + "get": { + "description": "Get the number of commits per hour in each day.\nEach array contains the day number, hour number, and number of commits\n0-6 Sunday - Saturday\n0-23 Hour of day\nNumber of commits\n\nFor example, [2, 14, 25] indicates that there were 25 total commits, during\nthe 2.00pm hour on Tuesdays. All times are based on the time zone of\nindividual commits.\n", + "parameters": [ + { + "description": "Name of repository owner.", + "in": "path", + "name": "owner", + "required": true, + "type": "string" + }, + { + "description": "Name of repository.", + "in": "path", + "name": "repo", + "required": true, + "type": "string" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/codeFrequencyStats" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + } + }, + "/repos/{owner}/{repo}/statuses/{ref}": { + "get": { + "description": "List Statuses for a specific Ref.", + "parameters": [ + { + "description": "Name of repository owner.", + "in": "path", + "name": "owner", + "required": true, + "type": "string" + }, + { + "description": "Name of repository.", + "in": "path", + "name": "repo", + "required": true, + "type": "string" + }, + { + "description": "Ref to list the statuses from. It can be a SHA, a branch name, or a tag name.\n", + "in": "path", + "name": "ref", + "required": true, + "type": "string" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/ref" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + }, + "post": { + "description": "Create a Status.", + "parameters": [ + { + "description": "Name of repository owner.", + "in": "path", + "name": "owner", + "required": true, + "type": "string" + }, + { + "description": "Name of repository.", + "in": "path", + "name": "repo", + "required": true, + "type": "string" + }, + { + "description": "Ref to list the statuses from. It can be a SHA, a branch name, or a tag name.\n", + "in": "path", + "name": "ref", + "required": true, + "type": "string" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + }, + { + "in": "body", + "name": "body", + "required": true, + "schema": { + "$ref": "#/definitions/headBranch" + } + } + ], + "responses": { + "201": { + "description": "Created", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/ref" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + } + }, + "/repos/{owner}/{repo}/subscribers": { + "get": { + "description": "List watchers.", + "parameters": [ + { + "description": "Name of repository owner.", + "in": "path", + "name": "owner", + "required": true, + "type": "string" + }, + { + "description": "Name of repository.", + "in": "path", + "name": "repo", + "required": true, + "type": "string" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/users" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + } + }, + "/repos/{owner}/{repo}/subscription": { + "delete": { + "description": "Delete a Repository Subscription.", + "parameters": [ + { + "description": "Name of repository owner.", + "in": "path", + "name": "owner", + "required": true, + "type": "string" + }, + { + "description": "Name of repository.", + "in": "path", + "name": "repo", + "required": true, + "type": "string" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "204": { + "description": "No content.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + }, + "get": { + "description": "Get a Repository Subscription.", + "parameters": [ + { + "description": "Name of repository owner.", + "in": "path", + "name": "owner", + "required": true, + "type": "string" + }, + { + "description": "Name of repository.", + "in": "path", + "name": "repo", + "required": true, + "type": "string" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/subscription" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + }, + "put": { + "description": "Set a Repository Subscription", + "parameters": [ + { + "description": "Name of repository owner.", + "in": "path", + "name": "owner", + "required": true, + "type": "string" + }, + { + "description": "Name of repository.", + "in": "path", + "name": "repo", + "required": true, + "type": "string" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + }, + { + "in": "body", + "name": "body", + "required": true, + "schema": { + "$ref": "#/definitions/subscriptionBody" + } + } + ], + "responses": { + "200": { + "description": "OK", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/subscription" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + } + }, + "/repos/{owner}/{repo}/tags": { + "get": { + "description": "Get list of tags.", + "parameters": [ + { + "description": "Name of repository owner.", + "in": "path", + "name": "owner", + "required": true, + "type": "string" + }, + { + "description": "Name of repository.", + "in": "path", + "name": "repo", + "required": true, + "type": "string" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/tags" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + } + }, + "/repos/{owner}/{repo}/teams": { + "get": { + "description": "Get list of teams", + "parameters": [ + { + "description": "Name of repository owner.", + "in": "path", + "name": "owner", + "required": true, + "type": "string" + }, + { + "description": "Name of repository.", + "in": "path", + "name": "repo", + "required": true, + "type": "string" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/teams" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + } + }, + "/repos/{owner}/{repo}/watchers": { + "get": { + "description": "List Stargazers. New implementation.", + "parameters": [ + { + "description": "Name of repository owner.", + "in": "path", + "name": "owner", + "required": true, + "type": "string" + }, + { + "description": "Name of repository.", + "in": "path", + "name": "repo", + "required": true, + "type": "string" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/users" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + } + }, + "/repos/{owner}/{repo}/{archive_format}/{path}": { + "get": { + "description": "Get archive link.\nThis method will return a 302 to a URL to download a tarball or zipball\narchive for a repository. Please make sure your HTTP framework is\nconfigured to follow redirects or you will need to use the Location header\nto make a second GET request.\nNote: For private repositories, these links are temporary and expire quickly.\n", + "parameters": [ + { + "description": "Name of repository owner.", + "in": "path", + "name": "owner", + "required": true, + "type": "string" + }, + { + "description": "Name of repository.", + "in": "path", + "name": "repo", + "required": true, + "type": "string" + }, + { + "enum": ["tarball", "zipball"], + "in": "path", + "name": "archive_format", + "required": true, + "type": "string" + }, + { + "description": "Valid Git reference, defaults to 'master'.", + "in": "path", + "name": "path", + "required": true, + "type": "string" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "302": { + "description": "Found.", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + } + }, + "/repositories": { + "get": { + "description": "List all public repositories.\nThis provides a dump of every public repository, in the order that they\nwere created.\nNote: Pagination is powered exclusively by the since parameter. is the\nLink header to get the URL for the next page of repositories.\n", + "parameters": [ + { + "description": "The time should be passed in as UTC in the ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ.\nExample: \"2012-10-09T23:39:01Z\".\n", + "in": "query", + "name": "since", + "type": "string" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/repos" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + } + }, + "/search/code": { + "get": { + "description": "Search code.", + "parameters": [ + { + "default": "desc", + "description": "The sort field. if sort param is provided. Can be either asc or desc.", + "enum": ["desc", "asc"], + "in": "query", + "name": "order", + "type": "string" + }, + { + "description": "The search terms. This can be any combination of the supported code\nsearch parameters:\n'Search In' Qualifies which fields are searched. With this qualifier\nyou can restrict the search to just the file contents, the file path,\nor both.\n'Languages' Searches code based on the language it's written in.\n'Forks' Filters repositories based on the number of forks, and/or\nwhether code from forked repositories should be included in the results\nat all.\n'Size' Finds files that match a certain size (in bytes).\n'Path' Specifies the path that the resulting file must be at.\n'Extension' Matches files with a certain extension.\n'Users' or 'Repositories' Limits searches to a specific user or repository.\n", + "in": "query", + "name": "q", + "required": true, + "type": "string" + }, + { + "description": "Can only be 'indexed', which indicates how recently a file has been indexed\nby the GitHub search infrastructure. If not provided, results are sorted\nby best match.\n", + "enum": ["indexed"], + "in": "query", + "name": "sort", + "type": "string" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/search-code" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + } + }, + "/search/issues": { + "get": { + "description": "Find issues by state and keyword. (This method returns up to 100 results per page.)", + "parameters": [ + { + "default": "desc", + "description": "The sort field. if sort param is provided. Can be either asc or desc.", + "enum": ["desc", "asc"], + "in": "query", + "name": "order", + "type": "string" + }, + { + "description": "The q search term can also contain any combination of the supported issue search qualifiers:", + "in": "query", + "name": "q", + "required": true, + "type": "string" + }, + { + "description": "The sort field. Can be comments, created, or updated. Default: results are sorted by best match.", + "enum": ["updated", "created", "comments"], + "in": "query", + "name": "sort", + "type": "string" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/search-issues" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + } + }, + "/search/repositories": { + "get": { + "description": "Search repositories.", + "parameters": [ + { + "default": "desc", + "description": "The sort field. if sort param is provided. Can be either asc or desc.", + "enum": ["desc", "asc"], + "in": "query", + "name": "order", + "type": "string" + }, + { + "description": "The search terms. This can be any combination of the supported repository\nsearch parameters:\n'Search In' Qualifies which fields are searched. With this qualifier you\ncan restrict the search to just the repository name, description, readme,\nor any combination of these.\n'Size' Finds repositories that match a certain size (in kilobytes).\n'Forks' Filters repositories based on the number of forks, and/or whether\nforked repositories should be included in the results at all.\n'Created' and 'Last Updated' Filters repositories based on times of\ncreation, or when they were last updated.\n'Users or Repositories' Limits searches to a specific user or repository.\n'Languages' Searches repositories based on the language they are written in.\n'Stars' Searches repositories based on the number of stars.\n", + "in": "query", + "name": "q", + "required": true, + "type": "string" + }, + { + "description": "If not provided, results are sorted by best match.", + "enum": ["stars", "forks", "updated"], + "in": "query", + "name": "sort", + "type": "string" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/search-repositories" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + } + }, + "/search/users": { + "get": { + "description": "Search users.", + "parameters": [ + { + "default": "desc", + "description": "The sort field. if sort param is provided. Can be either asc or desc.", + "enum": ["desc", "asc"], + "in": "query", + "name": "order", + "type": "string" + }, + { + "description": "The search terms. This can be any combination of the supported user\nsearch parameters:\n'Search In' Qualifies which fields are searched. With this qualifier you\ncan restrict the search to just the username, public email, full name,\nlocation, or any combination of these.\n'Repository count' Filters users based on the number of repositories they\nhave.\n'Location' Filter users by the location indicated in their profile.\n'Language' Search for users that have repositories that match a certain\nlanguage.\n'Created' Filter users based on when they joined.\n'Followers' Filter users based on the number of followers they have.\n", + "in": "query", + "name": "q", + "required": true, + "type": "string" + }, + { + "description": "If not provided, results are sorted by best match.", + "enum": ["followers", "repositories", "joined"], + "in": "query", + "name": "sort", + "type": "string" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/search-users" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + } + }, + "/teams/{teamId}": { + "delete": { + "description": "Delete team.\nIn order to delete a team, the authenticated user must be an owner of the\norg that the team is associated with.\n", + "parameters": [ + { + "description": "Id of team.", + "in": "path", + "name": "teamId", + "required": true, + "type": "integer" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "204": { + "description": "No content.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + }, + "get": { + "description": "Get team.", + "parameters": [ + { + "description": "Id of team.", + "in": "path", + "name": "teamId", + "required": true, + "type": "integer" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/team" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + }, + "patch": { + "description": "Edit team.\nIn order to edit a team, the authenticated user must be an owner of the org\nthat the team is associated with.\n", + "parameters": [ + { + "description": "Id of team.", + "in": "path", + "name": "teamId", + "required": true, + "type": "integer" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + }, + { + "in": "body", + "name": "body", + "required": true, + "schema": { + "$ref": "#/definitions/editTeam" + } + } + ], + "responses": { + "200": { + "description": "OK", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/team" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + } + }, + "/teams/{teamId}/members": { + "get": { + "description": "List team members.\nIn order to list members in a team, the authenticated user must be a member\nof the team.\n", + "parameters": [ + { + "description": "Id of team.", + "in": "path", + "name": "teamId", + "required": true, + "type": "integer" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/users" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + } + }, + "/teams/{teamId}/members/{username}": { + "delete": { + "deprecated": true, + "description": "The \"Remove team member\" API is deprecated and is scheduled for removal in the next major version of the API. We recommend using the Remove team membership API instead. It allows you to remove both active and pending memberships.\n\nRemove team member.\nIn order to remove a user from a team, the authenticated user must have 'admin'\npermissions to the team or be an owner of the org that the team is associated\nwith.\nNOTE This does not delete the user, it just remove them from the team.\n", + "parameters": [ + { + "description": "Id of team.", + "in": "path", + "name": "teamId", + "required": true, + "type": "integer" + }, + { + "description": "Name of a member.", + "in": "path", + "name": "username", + "required": true, + "type": "string" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "204": { + "description": "Team member removed.", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + }, + "get": { + "deprecated": true, + "description": "The \"Get team member\" API is deprecated and is scheduled for removal in the next major version of the API. We recommend using the Get team membership API instead. It allows you to get both active and pending memberships.\n\nGet team member.\nIn order to get if a user is a member of a team, the authenticated user mus\nbe a member of the team.\n", + "parameters": [ + { + "description": "Id of team.", + "in": "path", + "name": "teamId", + "required": true, + "type": "integer" + }, + { + "description": "Name of a member.", + "in": "path", + "name": "username", + "required": true, + "type": "string" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "204": { + "description": "User is a member.", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + }, + "404": { + "description": "User is not a member.", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + }, + "put": { + "deprecated": true, + "description": "The API (described below) is deprecated and is scheduled for removal in the next major version of the API. We recommend using the Add team membership API instead. It allows you to invite new organization members to your teams.\n\nAdd team member.\nIn order to add a user to a team, the authenticated user must have 'admin'\npermissions to the team or be an owner of the org that the team is associated\nwith.\n", + "parameters": [ + { + "description": "Id of team.", + "in": "path", + "name": "teamId", + "required": true, + "type": "integer" + }, + { + "description": "Name of a member.", + "in": "path", + "name": "username", + "required": true, + "type": "string" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "204": { + "description": "Team member added.", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + }, + "422": { + "description": "If you attempt to add an organization to a team, you will get this.", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/organizationAsTeamMember" + } + } + } + } + }, + "/teams/{teamId}/memberships/{username}": { + "delete": { + "description": "Remove team membership.\nIn order to remove a membership between a user and a team, the authenticated user must have 'admin' permissions to the team or be an owner of the organization that the team is associated with. NOTE: This does not delete the user, it just removes their membership from the team.\n", + "parameters": [ + { + "description": "Id of team.", + "in": "path", + "name": "teamId", + "required": true, + "type": "integer" + }, + { + "description": "Name of a member.", + "in": "path", + "name": "username", + "required": true, + "type": "string" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "204": { + "description": "Team member removed.", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + }, + "get": { + "description": "Get team membership.\nIn order to get a user's membership with a team, the authenticated user must be a member of the team or an owner of the team's organization.\n", + "parameters": [ + { + "description": "Id of team.", + "in": "path", + "name": "teamId", + "required": true, + "type": "integer" + }, + { + "description": "Name of a member.", + "in": "path", + "name": "username", + "required": true, + "type": "string" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "200": { + "description": "User is a member.", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/teamMembership" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + }, + "404": { + "description": "User has no membership with team", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + }, + "put": { + "description": "Add team membership.\nIn order to add a membership between a user and a team, the authenticated user must have 'admin' permissions to the team or be an owner of the organization that the team is associated with.\n\nIf the user is already a part of the team's organization (meaning they're on at least one other team in the organization), this endpoint will add the user to the team.\n\nIf the user is completely unaffiliated with the team's organization (meaning they're on none of the organization's teams), this endpoint will send an invitation to the user via email. This newly-created membership will be in the 'pending' state until the user accepts the invitation, at which point the membership will transition to the 'active' state and the user will be added as a member of the team.\n", + "parameters": [ + { + "description": "Id of team.", + "in": "path", + "name": "teamId", + "required": true, + "type": "integer" + }, + { + "description": "Name of a member.", + "in": "path", + "name": "username", + "required": true, + "type": "string" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "200": { + "description": "Team member added.", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/teamMembership" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + }, + "422": { + "description": "If you attempt to add an organization to a team, you will get this.", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/organizationAsTeamMember" + } + } + } + } + }, + "/teams/{teamId}/repos": { + "get": { + "description": "List team repos", + "parameters": [ + { + "description": "Id of team.", + "in": "path", + "name": "teamId", + "required": true, + "type": "integer" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/teamRepos" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + } + }, + "/teams/{teamId}/repos/{owner}/{repo}": { + "delete": { + "description": "In order to remove a repository from a team, the authenticated user must be an owner of the org that the team is associated with. NOTE: This does not delete the repository, it just removes it from the team.", + "parameters": [ + { + "description": "Id of team.", + "in": "path", + "name": "teamId", + "required": true, + "type": "integer" + }, + { + "description": "Name of a repository owner.", + "in": "path", + "name": "owner", + "required": true, + "type": "string" + }, + { + "description": "Name of a repository.", + "in": "path", + "name": "repo", + "required": true, + "type": "string" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "204": { + "description": "No content.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + }, + "get": { + "description": "Check if a team manages a repository", + "parameters": [ + { + "description": "Id of team.", + "in": "path", + "name": "teamId", + "required": true, + "type": "integer" + }, + { + "description": "Name of a repository owner.", + "in": "path", + "name": "owner", + "required": true, + "type": "string" + }, + { + "description": "Name of a repository.", + "in": "path", + "name": "repo", + "required": true, + "type": "string" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + }, + "put": { + "description": "In order to add a repository to a team, the authenticated user must be an owner of the org that the team is associated with. Also, the repository must be owned by the organization, or a direct fork of a repository owned by the organization.", + "parameters": [ + { + "description": "Id of team.", + "in": "path", + "name": "teamId", + "required": true, + "type": "integer" + }, + { + "description": "Name of a organization.", + "in": "path", + "name": "owner", + "required": true, + "type": "string" + }, + { + "description": "Name of a repository.", + "in": "path", + "name": "repo", + "required": true, + "type": "string" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + } + }, + "/user": { + "get": { + "description": "Get the authenticated user.", + "parameters": [ + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/user" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + }, + "patch": { + "description": "Update the authenticated user.", + "parameters": [ + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + }, + { + "in": "body", + "name": "body", + "required": true, + "schema": { + "$ref": "#/definitions/user-update" + } + } + ], + "responses": { + "200": { + "description": "OK", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/user" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + } + }, + "/user/emails": { + "delete": { + "description": "Delete email address(es).\nYou can include a single email address or an array of addresses.\n", + "parameters": [ + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + }, + { + "in": "body", + "name": "body", + "required": true, + "schema": { + "$ref": "#/definitions/user-emails" + } + } + ], + "responses": { + "204": { + "description": "No content.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + }, + "get": { + "description": "List email addresses for a user.\nIn the final version of the API, this method will return an array of hashes\nwith extended information for each email address indicating if the address\nhas been verified and if it's primary email address for GitHub.\nUntil API v3 is finalized, use the application/vnd.github.v3 media type to\nget other response format.\n", + "parameters": [ + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "produces": ["application/vnd.github.v3"], + "responses": { + "200": { + "description": "OK", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/user-emails" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + }, + "post": { + "description": "Add email address(es).\nYou can post a single email address or an array of addresses.\n", + "parameters": [ + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + }, + { + "in": "body", + "name": "body", + "required": true, + "schema": { + "$ref": "#/definitions/emailsPost" + } + } + ], + "responses": { + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + } + }, + "/user/followers": { + "get": { + "description": "List the authenticated user's followers", + "parameters": [ + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/users" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + } + }, + "/user/following": { + "get": { + "description": "List who the authenticated user is following.", + "parameters": [ + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/users" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + } + }, + "/user/following/{username}": { + "delete": { + "description": "Unfollow a user.\nUnfollowing a user requires the user to be logged in and authenticated with\nbasic auth or OAuth with the user:follow scope.\n", + "parameters": [ + { + "description": "Name of user.", + "in": "path", + "name": "username", + "required": true, + "type": "string" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "204": { + "description": "User unfollowed.", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + }, + "get": { + "description": "Check if you are following a user.", + "parameters": [ + { + "description": "Name of user.", + "in": "path", + "name": "username", + "required": true, + "type": "string" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "204": { + "description": "Response if you are following this user.", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + }, + "404": { + "description": "Response if you are not following this user.", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + }, + "put": { + "description": "Follow a user.\nFollowing a user requires the user to be logged in and authenticated with\nbasic auth or OAuth with the user:follow scope.\n", + "parameters": [ + { + "description": "Name of user.", + "in": "path", + "name": "username", + "required": true, + "type": "string" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "204": { + "description": "You are now following the user.", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + } + }, + "/user/issues": { + "get": { + "description": "List issues.\nList all issues across owned and member repositories for the authenticated\nuser.\n", + "parameters": [ + { + "default": "all", + "description": "Issues assigned to you / created by you / mentioning you / you're\nsubscribed to updates for / All issues the authenticated user can see\n", + "enum": ["assigned", "created", "mentioned", "subscribed", "all"], + "in": "query", + "name": "filter", + "required": true, + "type": "string" + }, + { + "default": "open", + "enum": ["open", "closed"], + "in": "query", + "name": "state", + "required": true, + "type": "string" + }, + { + "description": "String list of comma separated Label names. Example - bug,ui,@high.", + "in": "query", + "name": "labels", + "required": true, + "type": "string" + }, + { + "default": "created", + "enum": ["created", "updated", "comments"], + "in": "query", + "name": "sort", + "required": true, + "type": "string" + }, + { + "default": "desc", + "enum": ["asc", "desc"], + "in": "query", + "name": "direction", + "required": true, + "type": "string" + }, + { + "description": "Optional string of a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ.\nOnly issues updated at or after this time are returned.\n", + "in": "query", + "name": "since", + "type": "string" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/issues" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + } + }, + "/user/keys": { + "get": { + "description": "List your public keys.\nLists the current user's keys. Management of public keys via the API requires\nthat you are authenticated through basic auth, or OAuth with the 'user', 'write:public_key' scopes.\n", + "parameters": [ + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/gitignore" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + }, + "post": { + "description": "Create a public key.", + "parameters": [ + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + }, + { + "in": "body", + "name": "body", + "required": true, + "schema": { + "$ref": "#/definitions/user-keys-post" + } + } + ], + "responses": { + "201": { + "description": "Created", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/user-keys-keyId" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + } + }, + "/user/keys/{keyId}": { + "delete": { + "description": "Delete a public key. Removes a public key. Requires that you are authenticated via Basic Auth or via OAuth with at least admin:public_key scope.", + "parameters": [ + { + "description": "ID of key.", + "in": "path", + "name": "keyId", + "required": true, + "type": "integer" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "204": { + "description": "No content.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + }, + "get": { + "description": "Get a single public key.", + "parameters": [ + { + "description": "ID of key.", + "in": "path", + "name": "keyId", + "required": true, + "type": "integer" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/user-keys-keyId" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + } + }, + "/user/orgs": { + "get": { + "description": "List public and private organizations for the authenticated user.", + "parameters": [ + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/gitignore" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + } + }, + "/user/repos": { + "get": { + "description": "List repositories for the authenticated user. Note that this does not include\nrepositories owned by organizations which the user can access. You can lis\nuser organizations and list organization repositories separately.\n", + "parameters": [ + { + "default": "all", + "enum": ["all", "public", "private", "forks", "sources", "member"], + "in": "query", + "name": "type", + "type": "string" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/repos" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + }, + "post": { + "description": "Create a new repository for the authenticated user. OAuth users must supply\nrepo scope.\n", + "parameters": [ + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + }, + { + "in": "body", + "name": "body", + "required": true, + "schema": { + "$ref": "#/definitions/postRepo" + } + } + ], + "responses": { + "201": { + "description": "Created", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/repos" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + } + }, + "/user/starred": { + "get": { + "description": "List repositories being starred by the authenticated user.", + "parameters": [ + { + "description": "Ignored without 'sort' parameter.", + "in": "query", + "name": "direction", + "type": "string" + }, + { + "default": "created", + "description": "", + "enum": ["created", "updated"], + "in": "query", + "name": "sort", + "type": "string" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/gitignore" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + } + }, + "/user/starred/{owner}/{repo}": { + "delete": { + "description": "Unstar a repository", + "parameters": [ + { + "description": "Name of a repository owner.", + "in": "path", + "name": "owner", + "required": true, + "type": "string" + }, + { + "description": "Name of a repository.", + "in": "path", + "name": "repo", + "required": true, + "type": "string" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "204": { + "description": "Unstarred.", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + }, + "get": { + "description": "Check if you are starring a repository.", + "parameters": [ + { + "description": "Name of a repository owner.", + "in": "path", + "name": "owner", + "required": true, + "type": "string" + }, + { + "description": "Name of a repository.", + "in": "path", + "name": "repo", + "required": true, + "type": "string" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "204": { + "description": "This repository is starred by you.", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + }, + "404": { + "description": "This repository is not starred by you.", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + }, + "put": { + "description": "Star a repository.", + "parameters": [ + { + "description": "Name of a repository owner.", + "in": "path", + "name": "owner", + "required": true, + "type": "string" + }, + { + "description": "Name of a repository.", + "in": "path", + "name": "repo", + "required": true, + "type": "string" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "204": { + "description": "Repository starred.", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + } + }, + "/user/subscriptions": { + "get": { + "description": "List repositories being watched by the authenticated user.", + "parameters": [ + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/repos" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + } + }, + "/user/subscriptions/{owner}/{repo}": { + "delete": { + "deprecated": true, + "description": "Stop watching a repository", + "parameters": [ + { + "description": "Name of the owner.", + "in": "path", + "name": "owner", + "required": true, + "type": "string" + }, + { + "description": "Name of repository.", + "in": "path", + "name": "repo", + "required": true, + "type": "string" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "204": { + "description": "Unwatched.", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + }, + "get": { + "deprecated": true, + "description": "Check if you are watching a repository.", + "parameters": [ + { + "description": "Name of the owner.", + "in": "path", + "name": "owner", + "required": true, + "type": "string" + }, + { + "description": "Name of repository.", + "in": "path", + "name": "repo", + "required": true, + "type": "string" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "204": { + "description": "Repository is watched by you.", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + }, + "404": { + "description": "Repository is not watched by you.", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + }, + "put": { + "deprecated": true, + "description": "Watch a repository.", + "parameters": [ + { + "description": "Name of the owner.", + "in": "path", + "name": "owner", + "required": true, + "type": "string" + }, + { + "description": "Name of repository.", + "in": "path", + "name": "repo", + "required": true, + "type": "string" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "204": { + "description": "Repository is watched.", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + } + }, + "/user/teams": { + "get": { + "description": "List all of the teams across all of the organizations to which the authenticated user belongs. This method requires user or repo scope when authenticating via OAuth.", + "parameters": [ + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/teams-list" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + } + }, + "/users": { + "get": { + "description": "Get all users.\nThis provides a dump of every user, in the order that they signed up for GitHub.\nNote: Pagination is powered exclusively by the since parameter. Use the Link\nheader to get the URL for the next page of users.\n", + "parameters": [ + { + "description": "The integer ID of the last user that you've seen.", + "in": "query", + "name": "since", + "type": "integer" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/users" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + } + }, + "/users/{username}": { + "get": { + "description": "Get a single user.", + "parameters": [ + { + "description": "Name of user.", + "in": "path", + "name": "username", + "required": true, + "type": "string" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/user" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + } + }, + "/users/{username}/events": { + "get": { + "description": "If you are authenticated as the given user, you will see your private events. Otherwise, you'll only see public events.", + "parameters": [ + { + "description": "Name of user.", + "in": "path", + "name": "username", + "required": true, + "type": "string" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + } + }, + "/users/{username}/events/orgs/{org}": { + "get": { + "description": "This is the user's organization dashboard. You must be authenticated as the user to view this.", + "parameters": [ + { + "description": "Name of user.", + "in": "path", + "name": "username", + "required": true, + "type": "string" + }, + { + "in": "path", + "name": "org", + "required": true, + "type": "string" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + } + }, + "/users/{username}/followers": { + "get": { + "description": "List a user's followers", + "parameters": [ + { + "description": "Name of user.", + "in": "path", + "name": "username", + "required": true, + "type": "string" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/users" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + } + }, + "/users/{username}/following/{targetUser}": { + "get": { + "description": "Check if one user follows another.", + "parameters": [ + { + "description": "Name of user.", + "in": "path", + "name": "username", + "required": true, + "type": "string" + }, + { + "description": "Name of user.", + "in": "path", + "name": "targetUser", + "required": true, + "type": "string" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "204": { + "description": "Response if user follows target user.", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + }, + "404": { + "description": "Response if user does not follow target user.", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + } + }, + "/users/{username}/gists": { + "get": { + "description": "List a users gists.", + "parameters": [ + { + "description": "Name of user.", + "in": "path", + "name": "username", + "required": true, + "type": "string" + }, + { + "description": "The time should be passed in as UTC in the ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ.\nExample: \"2012-10-09T23:39:01Z\".\n", + "in": "query", + "name": "since", + "type": "string" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/gists" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + } + }, + "/users/{username}/keys": { + "get": { + "description": "List public keys for a user.\nLists the verified public keys for a user. This is accessible by anyone.\n", + "parameters": [ + { + "description": "Name of user.", + "in": "path", + "name": "username", + "required": true, + "type": "string" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/gitignore" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + } + }, + "/users/{username}/orgs": { + "get": { + "description": "List all public organizations for a user.", + "parameters": [ + { + "description": "Name of user.", + "in": "path", + "name": "username", + "required": true, + "type": "string" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/gitignore" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + } + }, + "/users/{username}/received_events": { + "get": { + "description": "These are events that you'll only see public events.", + "parameters": [ + { + "description": "Name of user.", + "in": "path", + "name": "username", + "required": true, + "type": "string" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + } + }, + "/users/{username}/received_events/public": { + "get": { + "description": "List public events that a user has received", + "parameters": [ + { + "description": "Name of user.", + "in": "path", + "name": "username", + "required": true, + "type": "string" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + } + }, + "/users/{username}/repos": { + "get": { + "description": "List public repositories for the specified user.", + "parameters": [ + { + "description": "Name of user.", + "in": "path", + "name": "username", + "required": true, + "type": "string" + }, + { + "default": "all", + "enum": ["all", "public", "private", "forks", "sources", "member"], + "in": "query", + "name": "type", + "type": "string" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + }, + "schema": { + "$ref": "#/definitions/repos" + } + }, + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + } + }, + "/users/{username}/starred": { + "get": { + "description": "List repositories being starred by a user.", + "parameters": [ + { + "description": "Name of user.", + "in": "path", + "name": "username", + "required": true, + "type": "string" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + } + }, + "/users/{username}/subscriptions": { + "get": { + "description": "List repositories being watched by a user.", + "parameters": [ + { + "description": "Name of user.", + "in": "path", + "name": "username", + "required": true, + "type": "string" + }, + { + "description": "Is used to set specified media type.", + "in": "header", + "name": "Accept", + "type": "string" + } + ], + "responses": { + "403": { + "description": "API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", + "headers": { + "X-GitHub-Media-Type": { + "description": "You can check the current version of media type in responses.\n", + "type": "string" + }, + "X-GitHub-Request-Id": { + "type": "integer" + }, + "X-RateLimit-Limit": { + "type": "integer" + }, + "X-RateLimit-Remaining": { + "type": "integer" + }, + "X-RateLimit-Reset": { + "type": "integer" + } + } + } + } + } + } + }, + "definitions": { + "actor": { + "description": "A user or organization", + "properties": { + "avatar_url": { + "type": "string" + }, + "bio": { + "type": "string" + }, + "blog": { + "description": "The website URL from the profile page", + "type": "string" + }, + "collaborators": { + "type": "integer" + }, + "company": { + "type": "string" + }, + "created_at": { + "description": "ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ", + "type": "string" + }, + "disk_usage": { + "type": "integer" + }, + "email": { + "description": "Note: The returned email is the user’s publicly visible email address (or null if the user has not specified a public email address in their profile).", + "type": "string" + }, + "followers": { + "type": "integer" + }, + "followers_url": { + "type": "string" + }, + "following": { + "type": "integer" + }, + "following_url": { + "type": "string" + }, + "gists_url": { + "type": "string" + }, + "gravatar_id": { + "type": "string" + }, + "hireable": { + "type": "boolean" + }, + "html_url": { + "type": "string" + }, + "id": { + "type": "integer" + }, + "location": { + "type": "string" + }, + "login": { + "description": "The account username", + "type": "string" + }, + "name": { + "description": "The full account name", + "type": "string" + }, + "organizations_url": { + "type": "string" + }, + "owned_private_repos": { + "type": "integer" + }, + "plan": { + "properties": { + "collaborators": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "private_repos": { + "type": "integer" + }, + "space": { + "type": "integer" + } + }, + "type": "object" + }, + "private_gists": { + "type": "integer" + }, + "public_gists": { + "type": "integer" + }, + "public_repos": { + "type": "integer" + }, + "starred_url": { + "type": "string" + }, + "subscriptions_url": { + "type": "string" + }, + "total_private_repos": { + "type": "integer" + }, + "type": { + "enum": ["User", "Organization"] + }, + "updated_at": { + "description": "ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ", + "type": "string" + }, + "url": { + "type": "string" + } + }, + "type": "object" + }, + "asset": { + "properties": { + "content_type": { + "type": "string" + }, + "created_at": { + "type": "string" + }, + "download_count": { + "type": "number" + }, + "id": { + "type": "number" + }, + "label": { + "type": "string" + }, + "name": { + "type": "string" + }, + "size": { + "type": "number" + }, + "state": { + "type": "string" + }, + "updated_at": { + "type": "string" + }, + "uploader": { + "$ref": "#/definitions/user" + }, + "url": { + "type": "string" + } + }, + "type": "object" + }, + "assetPatch": { + "properties": { + "label": { + "type": "string" + }, + "name": { + "type": "string" + } + }, + "required": ["name"], + "type": "object" + }, + "assets": { + "items": { + "$ref": "#/definitions/asset" + }, + "type": "array" + }, + "assignees": { + "items": { + "$ref": "#/definitions/user" + }, + "type": "array" + }, + "blob": { + "properties": { + "content": { + "type": "string" + }, + "encoding": { + "enum": ["utf-8", "base64"] + }, + "sha": { + "type": "string" + }, + "size": { + "type": "integer" + } + }, + "type": "object" + }, + "blobs": { + "properties": { + "sha": { + "type": "string" + } + }, + "type": "object" + }, + "branch": { + "properties": { + "_links": { + "properties": { + "html": { + "type": "string" + }, + "self": { + "type": "string" + } + }, + "type": "object" + }, + "commit": { + "properties": { + "author": { + "$ref": "#/definitions/user" + }, + "commit": { + "properties": { + "author": { + "properties": { + "date": { + "description": "ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ", + "type": "string" + }, + "email": { + "type": "string" + }, + "name": { + "type": "string" + } + } + }, + "committer": { + "properties": { + "date": { + "description": "ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ", + "type": "string" + }, + "email": { + "type": "string" + }, + "name": { + "type": "string" + } + }, + "type": "object" + }, + "message": { + "type": "string" + }, + "tree": { + "properties": { + "sha": { + "type": "string" + }, + "url": { + "type": "string" + } + }, + "type": "object" + }, + "url": { + "type": "string" + } + }, + "type": "object" + }, + "committer": { + "$ref": "#/definitions/user" + }, + "parents": { + "items": { + "properties": { + "sha": { + "type": "string" + }, + "url": { + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + }, + "sha": { + "type": "string" + }, + "url": { + "type": "string" + } + }, + "type": "object" + }, + "name": { + "type": "string" + } + }, + "type": "object" + }, + "branches": { + "items": { + "properties": { + "commit": { + "properties": { + "sha": { + "type": "string" + }, + "url": { + "type": "string" + } + }, + "type": "object" + }, + "name": { + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + }, + "codeFrequencyStats": { + "items": { + "type": "integer" + }, + "type": "array" + }, + "comment": { + "properties": { + "body": { + "type": "string" + } + }, + "type": "object" + }, + "commentBody": { + "properties": { + "body": { + "type": "string" + } + }, + "required": ["body"], + "type": "object" + }, + "comments": { + "items": { + "properties": { + "body": { + "type": "string" + }, + "created_at": { + "description": "ISO 8601.", + "type": "string" + }, + "id": { + "type": "integer" + }, + "url": { + "type": "string" + }, + "user": { + "$ref": "#/definitions/user" + } + }, + "type": "object" + }, + "type": "array" + }, + "commit": { + "properties": { + "author": { + "$ref": "#/definitions/user" + }, + "commit": { + "properties": { + "author": { + "properties": { + "date": { + "description": "ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ", + "type": "string" + }, + "email": { + "type": "string" + }, + "name": { + "type": "string" + } + }, + "type": "object" + }, + "committer": { + "properties": { + "date": { + "description": "ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ", + "type": "string" + }, + "email": { + "type": "string" + }, + "name": { + "type": "string" + } + }, + "type": "object" + }, + "message": { + "type": "string" + }, + "tree": { + "properties": { + "sha": { + "type": "string" + }, + "url": { + "type": "string" + } + }, + "type": "object" + }, + "url": { + "type": "string" + } + }, + "type": "object" + }, + "committer": { + "$ref": "#/definitions/user" + }, + "files": { + "items": { + "properties": { + "additions": { + "type": "integer" + }, + "blob_url": { + "type": "string" + }, + "changes": { + "type": "integer" + }, + "deletions": { + "type": "integer" + }, + "filename": { + "type": "string" + }, + "patch": { + "type": "string" + }, + "raw_url": { + "type": "string" + }, + "status": { + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + }, + "parents": { + "items": { + "properties": { + "sha": { + "type": "string" + }, + "url": { + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + }, + "sha": { + "type": "string" + }, + "stats": { + "properties": { + "additions": { + "type": "integer" + }, + "deletions": { + "type": "integer" + }, + "total": { + "type": "integer" + } + }, + "type": "object" + }, + "url": { + "type": "string" + } + }, + "type": "object" + }, + "commitActivityStats": { + "items": { + "properties": { + "days": { + "items": { + "type": "integer" + }, + "type": "array" + }, + "total": { + "type": "integer" + }, + "week": { + "type": "integer" + } + }, + "type": "object" + }, + "type": "array" + }, + "commitComment": { + "properties": { + "body": { + "type": "string" + }, + "commit_id": { + "type": "string" + }, + "created_at": { + "description": "ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ", + "type": "string" + }, + "html_url": { + "type": "string" + }, + "id": { + "type": "integer" + }, + "line": { + "type": "integer" + }, + "path": { + "type": "string" + }, + "position": { + "type": "integer" + }, + "updated_at": { + "description": "ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ", + "type": "string" + }, + "url": { + "type": "string" + }, + "user": { + "$ref": "#/definitions/user" + } + }, + "type": "object" + }, + "commitCommentBody": { + "properties": { + "body": { + "type": "string" + }, + "line": { + "description": "Deprecated - Use position parameter instead.", + "type": "string" + }, + "number": { + "description": "Line number in the file to comment on. Defaults to null.", + "type": "string" + }, + "path": { + "description": "Relative path of the file to comment on.", + "type": "string" + }, + "position": { + "description": "Line index in the diff to comment on.", + "type": "integer" + }, + "sha": { + "description": "SHA of the commit to comment on.", + "type": "string" + } + }, + "required": ["sha", "body"], + "type": "object" + }, + "commits": { + "items": { + "properties": { + "author": { + "$ref": "#/definitions/user" + }, + "commit": { + "properties": { + "author": { + "properties": { + "date": { + "description": "ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ", + "type": "string" + }, + "email": { + "type": "string" + }, + "name": { + "type": "string" + } + }, + "type": "object" + }, + "committer": { + "properties": { + "date": { + "description": "ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ", + "type": "string" + }, + "email": { + "type": "string" + }, + "name": { + "type": "string" + } + }, + "type": "object" + }, + "message": { + "type": "string" + }, + "tree": { + "properties": { + "sha": { + "type": "string" + }, + "url": { + "type": "string" + } + }, + "type": "object" + }, + "url": { + "type": "string" + } + }, + "type": "object" + }, + "committer": { + "$ref": "#/definitions/user" + }, + "parents": { + "items": { + "properties": { + "sha": { + "type": "string" + }, + "url": { + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + }, + "sha": { + "type": "string" + }, + "url": { + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + }, + "compare-commits": { + "properties": { + "ahead_by": { + "type": "integer" + }, + "base_commit": { + "properties": { + "author": { + "$ref": "#/definitions/user" + }, + "commit": { + "properties": { + "author": { + "properties": { + "date": { + "type": "string" + }, + "email": { + "type": "string" + }, + "name": { + "type": "string" + } + }, + "type": "object" + }, + "committer": { + "properties": { + "date": { + "type": "string" + }, + "email": { + "type": "string" + }, + "name": { + "type": "string" + } + }, + "type": "object" + }, + "message": { + "type": "string" + }, + "tree": { + "properties": { + "sha": { + "type": "string" + }, + "url": { + "type": "string" + } + }, + "type": "object" + }, + "url": { + "type": "string" + } + }, + "type": "object" + }, + "committer": { + "$ref": "#/definitions/user" + }, + "parents": { + "items": { + "properties": { + "sha": { + "type": "string" + }, + "url": { + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + }, + "sha": { + "type": "string" + }, + "url": { + "type": "string" + } + }, + "type": "object" + }, + "behind_by": { + "type": "integer" + }, + "commits": { + "items": { + "properties": { + "author": { + "$ref": "#/definitions/user" + }, + "commit": { + "properties": { + "author": { + "properties": { + "date": { + "type": "string" + }, + "email": { + "type": "string" + }, + "name": { + "type": "string" + } + }, + "type": "object" + }, + "committer": { + "properties": { + "date": { + "type": "string" + }, + "email": { + "type": "string" + }, + "name": { + "type": "string" + } + }, + "type": "object" + }, + "message": { + "type": "string" + }, + "tree": { + "properties": { + "sha": { + "type": "string" + }, + "url": { + "type": "string" + } + }, + "type": "object" + }, + "url": { + "type": "string" + } + }, + "type": "object" + }, + "committer": { + "$ref": "#/definitions/user" + }, + "parents": { + "items": { + "properties": { + "sha": { + "type": "string" + }, + "url": { + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + }, + "sha": { + "type": "string" + }, + "url": { + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + }, + "diff_url": { + "type": "string" + }, + "files": { + "items": { + "properties": { + "additions": { + "type": "integer" + }, + "blob_url": { + "type": "string" + }, + "changes": { + "type": "integer" + }, + "contents_url": { + "type": "string" + }, + "deletions": { + "type": "integer" + }, + "filename": { + "type": "string" + }, + "patch": { + "type": "string" + }, + "raw_url": { + "type": "string" + }, + "sha": { + "type": "string" + }, + "status": { + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + }, + "html_url": { + "type": "string" + }, + "patch_url": { + "type": "string" + }, + "permalink_url": { + "type": "string" + }, + "status": { + "type": "string" + }, + "total_commits": { + "type": "integer" + }, + "url": { + "type": "string" + } + }, + "type": "object" + }, + "contents-path": { + "properties": { + "_links": { + "properties": { + "git": { + "type": "string" + }, + "html": { + "type": "string" + }, + "self": { + "type": "string" + } + }, + "type": "object" + }, + "content": { + "type": "string" + }, + "encoding": { + "type": "string" + }, + "git_url": { + "type": "string" + }, + "html_url": { + "type": "string" + }, + "name": { + "type": "string" + }, + "path": { + "type": "string" + }, + "sha": { + "type": "string" + }, + "size": { + "type": "integer" + }, + "type": { + "type": "string" + }, + "url": { + "type": "string" + } + }, + "type": "object" + }, + "contributorsStats": { + "items": { + "properties": { + "author": { + "properties": { + "avatar_url": { + "type": "string" + }, + "gravatar_id": { + "type": "string" + }, + "id": { + "type": "integer" + }, + "login": { + "type": "string" + }, + "url": { + "type": "string" + } + }, + "type": "object" + }, + "total": { + "description": "The Total number of commits authored by the contributor.", + "type": "integer" + }, + "weeks": { + "items": { + "properties": { + "a": { + "description": "Number of additions.", + "type": "integer" + }, + "c": { + "description": "Number of commits.", + "type": "integer" + }, + "d": { + "description": "Number of deletions.", + "type": "integer" + }, + "w": { + "description": "Start of the week.", + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + }, + "type": "array" + }, + "createFile": { + "properties": { + "commit": { + "properties": { + "author": { + "properties": { + "date": { + "type": "string" + }, + "email": { + "type": "string" + }, + "name": { + "type": "string" + } + }, + "type": "object" + }, + "committer": { + "properties": { + "date": { + "type": "string" + }, + "email": { + "type": "string" + }, + "name": { + "type": "string" + } + }, + "type": "object" + }, + "html_url": { + "type": "string" + }, + "message": { + "type": "string" + }, + "parents": { + "items": { + "properties": { + "html_url": { + "type": "string" + }, + "sha": { + "type": "string" + }, + "url": { + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + }, + "sha": { + "type": "string" + }, + "tree": { + "properties": { + "sha": { + "type": "string" + }, + "url": { + "type": "string" + } + }, + "type": "object" + }, + "url": { + "type": "string" + } + }, + "type": "object" + }, + "content": { + "properties": { + "_links": { + "properties": { + "git": { + "type": "string" + }, + "html": { + "type": "string" + }, + "self": { + "type": "string" + } + }, + "type": "object" + }, + "git_url": { + "type": "string" + }, + "html_url": { + "type": "string" + }, + "name": { + "type": "string" + }, + "path": { + "type": "string" + }, + "sha": { + "type": "string" + }, + "size": { + "type": "integer" + }, + "type": { + "type": "string" + }, + "url": { + "type": "string" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "createFileBody": { + "properties": { + "committer": { + "properties": { + "email": { + "type": "string" + }, + "name": { + "type": "string" + } + }, + "type": "object" + }, + "content": { + "type": "string" + }, + "message": { + "type": "string" + } + }, + "type": "object" + }, + "deleteFile": { + "properties": { + "commit": { + "properties": { + "author": { + "properties": { + "date": { + "type": "string" + }, + "email": { + "type": "string" + }, + "name": { + "type": "string" + } + }, + "type": "object" + }, + "committer": { + "properties": { + "date": { + "type": "string" + }, + "email": { + "type": "string" + }, + "name": { + "type": "string" + } + } + }, + "html_url": { + "type": "string" + }, + "message": { + "type": "string" + }, + "parents": { + "properties": { + "html_url": { + "type": "string" + }, + "sha": { + "type": "string" + }, + "url": { + "type": "string" + } + }, + "type": "object" + }, + "sha": { + "type": "string" + }, + "tree": { + "properties": { + "sha": { + "type": "string" + }, + "url": { + "type": "string" + } + }, + "type": "object" + }, + "url": { + "type": "string" + } + }, + "type": "object" + }, + "content": { + "type": "string" + } + }, + "type": "object" + }, + "deleteFileBody": { + "properties": { + "committer": { + "properties": { + "email": { + "type": "string" + }, + "name": { + "type": "string" + } + }, + "type": "object" + }, + "message": { + "type": "string" + }, + "sha": { + "type": "string" + } + }, + "type": "object" + }, + "deployment": { + "properties": { + "description": { + "type": "string" + }, + "payload": { + "properties": { + "deploy_user": { + "type": "string" + }, + "environment": { + "type": "string" + }, + "room_id": { + "type": "number" + } + }, + "type": "object" + }, + "ref": { + "type": "string" + } + }, + "type": "object" + }, + "deployment-resp": { + "properties": { + "created_at": { + "type": "string" + }, + "creator": { + "$ref": "#/definitions/user" + }, + "description": { + "type": "string" + }, + "id": { + "type": "integer" + }, + "payload": { + "type": "string" + }, + "sha": { + "type": "string" + }, + "statuses_url": { + "type": "string" + }, + "updated_at": { + "type": "string" + }, + "url": { + "type": "string" + } + }, + "type": "object" + }, + "deployment-statuses": { + "items": { + "properties": { + "created_at": { + "type": "string" + }, + "creator": { + "$ref": "#/definitions/user" + }, + "description": { + "type": "string" + }, + "id": { + "type": "integer" + }, + "payload": { + "type": "string" + }, + "state": { + "type": "string" + }, + "target_url": { + "type": "string" + }, + "updated_at": { + "type": "string" + }, + "url": { + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + }, + "deployment-statuses-create": { + "properties": { + "description": { + "type": "string" + }, + "state": { + "type": "string" + }, + "target_url": { + "type": "string" + } + }, + "type": "object" + }, + "download": { + "properties": { + "content_type": { + "type": "string" + }, + "description": { + "type": "string" + }, + "download_count": { + "type": "integer" + }, + "html_url": { + "type": "string" + }, + "id": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "size": { + "type": "integer" + }, + "url": { + "type": "string" + } + }, + "type": "object" + }, + "downloads": { + "items": { + "$ref": "#/definitions/download" + }, + "type": "array" + }, + "editTeam": { + "properties": { + "name": { + "type": "string" + }, + "permission": { + "enum": ["pull", "push", "admin"] + } + }, + "required": ["name"], + "type": "object" + }, + "emailsPost": { + "items": { + "type": "string" + }, + "type": "array" + }, + "emojis": { + "additionalProperties": { + "description": "A URL for an image representing this emoji", + "type": "string" + }, + "type": "object" + }, + "event": { + "properties": { + "actor": { + "$ref": "#/definitions/actor" + }, + "created_at": { + "type": "object" + }, + "id": { + "type": "integer" + }, + "org": { + "$ref": "#/definitions/organization" + }, + "payload": { + "properties": {}, + "type": "object" + }, + "public": { + "type": "boolean" + }, + "repo": { + "properties": { + "id": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "url": { + "type": "string" + } + }, + "type": "object" + }, + "type": { + "type": "string" + } + }, + "type": "object" + }, + "events": { + "items": { + "$ref": "#/definitions/event" + }, + "type": "array" + }, + "feeds": { + "properties": { + "_links": { + "properties": { + "current_user": { + "properties": { + "href": { + "type": "string" + }, + "type": { + "type": "string" + } + }, + "type": "object" + }, + "current_user_actor": { + "properties": { + "href": { + "type": "string" + }, + "type": { + "type": "string" + } + }, + "type": "object" + }, + "current_user_organization": { + "properties": { + "href": { + "type": "string" + }, + "type": { + "type": "string" + } + }, + "type": "object" + }, + "current_user_public": { + "properties": { + "href": { + "type": "string" + }, + "type": { + "type": "string" + } + }, + "type": "object" + }, + "timeline": { + "properties": { + "href": { + "type": "string" + }, + "type": { + "type": "string" + } + }, + "type": "object" + }, + "user": { + "properties": { + "href": { + "type": "string" + }, + "type": { + "type": "string" + } + }, + "type": "object" + } + } + }, + "current_user_actor_url": { + "type": "string" + }, + "current_user_organization_url": { + "type": "string" + }, + "current_user_public": { + "type": "string" + }, + "current_user_url": { + "type": "string" + }, + "timeline_url": { + "type": "string" + }, + "user_url": { + "type": "string" + } + }, + "type": "object" + }, + "forkBody": { + "properties": { + "organization": { + "type": "string" + } + }, + "type": "object" + }, + "forks": { + "$ref": "#/definitions/repos" + }, + "gist": { + "properties": { + "comments": { + "type": "integer" + }, + "comments_url": { + "type": "string" + }, + "created_at": { + "description": "Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ.", + "type": "string" + }, + "description": { + "type": "string" + }, + "files": { + "properties": { + "ring.erl": { + "properties": { + "filename": { + "type": "string" + }, + "raw_url": { + "type": "string" + }, + "size": { + "type": "integer" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "forks": { + "items": { + "properties": { + "created_at": { + "description": "Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ.", + "type": "string" + }, + "url": { + "type": "string" + }, + "user": { + "$ref": "#/definitions/user" + } + }, + "type": "object" + }, + "type": "array" + }, + "git_pull_url": { + "type": "string" + }, + "git_push_url": { + "type": "string" + }, + "history": { + "items": { + "properties": { + "change_status": { + "properties": { + "additions": { + "type": "integer" + }, + "deletions": { + "type": "integer" + }, + "total": { + "type": "integer" + } + }, + "type": "object" + }, + "committed_at": { + "description": "Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ.", + "type": "string" + }, + "url": { + "type": "string" + }, + "user": { + "$ref": "#/definitions/user" + }, + "version": { + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + }, + "html_url": { + "type": "string" + }, + "id": { + "type": "string" + }, + "public": { + "type": "boolean" + }, + "url": { + "type": "string" + }, + "user": { + "$ref": "#/definitions/user" + } + }, + "type": "object" + }, + "gists": { + "items": { + "properties": { + "comments": { + "type": "integer" + }, + "comments_url": { + "type": "string" + }, + "created_at": { + "type": "string" + }, + "description": { + "type": "string" + }, + "files": { + "properties": { + "ring.erl": { + "properties": { + "filename": { + "type": "string" + }, + "raw_url": { + "type": "string" + }, + "size": { + "type": "integer" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "git_pull_url": { + "type": "string" + }, + "git_push_url": { + "type": "string" + }, + "html_url": { + "type": "string" + }, + "id": { + "type": "string" + }, + "public": { + "type": "boolean" + }, + "url": { + "type": "string" + }, + "user": { + "$ref": "#/definitions/user" + } + }, + "type": "object" + }, + "type": "array" + }, + "gitCommit": { + "properties": { + "author": { + "properties": { + "date": { + "type": "string" + }, + "email": { + "type": "string" + }, + "name": { + "type": "string" + } + }, + "type": "object" + }, + "message": { + "type": "string" + }, + "parents": { + "type": "string" + }, + "tree": { + "type": "string" + } + }, + "type": "object" + }, + "gitRefPatch": { + "properties": { + "force": { + "type": "boolean" + }, + "sha": { + "type": "string" + } + }, + "type": "object" + }, + "gitignore": { + "items": {}, + "type": "array" + }, + "gitignore-lang": { + "properties": { + "name": { + "type": "string" + }, + "source": { + "type": "string" + } + }, + "type": "object" + }, + "headBranch": { + "properties": { + "object": { + "properties": { + "sha": { + "type": "string" + }, + "type": { + "type": "string" + }, + "url": { + "type": "string" + } + }, + "type": "object" + }, + "ref": { + "type": "string" + }, + "url": { + "type": "string" + } + }, + "type": "object" + }, + "hook": { + "items": { + "properties": { + "active": { + "type": "boolean" + }, + "config": { + "properties": { + "content_type": { + "type": "string" + }, + "url": { + "type": "string" + } + }, + "type": "object" + }, + "created_at": { + "description": "ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ", + "type": "string" + }, + "events": { + "items": { + "enum": [ + "push", + "issues", + "issue_comment", + "commit_comment", + "pull_request", + "pull_request_review_comment", + "gollum", + "watch", + "download", + "fork", + "fork_apply", + "member", + "public", + "team_add", + "status" + ] + }, + "type": "array" + }, + "id": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "updated_at": { + "description": "ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ", + "type": "string" + }, + "url": { + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + }, + "hookBody": { + "properties": { + "active": { + "type": "boolean" + }, + "add_events": { + "items": { + "type": "string" + }, + "type": "array" + } + }, + "type": "object" + }, + "issue": { + "properties": { + "assignee": { + "type": "string" + }, + "body": { + "type": "string" + }, + "labels": { + "items": { + "type": "string" + }, + "type": "array" + }, + "milestone": { + "type": "number" + }, + "title": { + "type": "string" + } + }, + "type": "object" + }, + "issueEvent": { + "properties": { + "actor": { + "$ref": "#/definitions/actor" + }, + "commit_id": { + "type": "string" + }, + "created_at": { + "description": "ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ", + "type": "string" + }, + "event": { + "type": "string" + }, + "issue": { + "properties": { + "assignee": { + "$ref": "#/definitions/user" + }, + "body": { + "type": "string" + }, + "closed_at": { + "description": "ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ", + "type": "string" + }, + "comments": { + "type": "integer" + }, + "created_at": { + "description": "ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ", + "type": "string" + }, + "html_url": { + "type": "string" + }, + "labels": { + "items": { + "properties": { + "color": { + "type": "string" + }, + "name": { + "type": "string" + }, + "url": { + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + }, + "milestone": { + "properties": { + "closed_issues": { + "type": "integer" + }, + "created_at": { + "description": "ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ", + "type": "string" + }, + "creator": { + "$ref": "#/definitions/user" + }, + "description": { + "type": "string" + }, + "due_on": { + "description": "ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ", + "type": "string" + }, + "number": { + "type": "integer" + }, + "open_issues": { + "type": "integer" + }, + "state": { + "enum": ["open", "closed"] + }, + "title": { + "type": "string" + }, + "url": { + "type": "string" + } + }, + "type": "object" + }, + "number": { + "type": "integer" + }, + "pull_request": { + "properties": { + "diff_url": { + "type": "string" + }, + "html_url": { + "type": "string" + }, + "patch_url": { + "type": "string" + } + }, + "type": "object" + }, + "state": { + "enum": ["open", "closed"] + }, + "title": { + "type": "string" + }, + "updated_at": { + "description": "ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ", + "type": "string" + }, + "url": { + "type": "string" + }, + "user": { + "$ref": "#/definitions/user" + } + }, + "type": "object" + }, + "url": { + "type": "string" + } + }, + "type": "object" + }, + "issueEvents": { + "items": { + "$ref": "#/definitions/issueEvent" + }, + "type": "array" + }, + "issues": { + "items": { + "properties": { + "assignee": { + "$ref": "#/definitions/user" + }, + "body": { + "type": "string" + }, + "closed_at": { + "description": "ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ", + "type": "string" + }, + "comments": { + "type": "integer" + }, + "created_at": { + "description": "ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ", + "type": "string" + }, + "html_url": { + "type": "string" + }, + "labels": { + "items": { + "properties": { + "color": { + "type": "string" + }, + "name": { + "type": "string" + }, + "url": { + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + }, + "milestone": { + "properties": { + "closed_issues": { + "type": "integer" + }, + "created_at": { + "description": "ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ", + "type": "string" + }, + "creator": { + "$ref": "#/definitions/user" + }, + "description": { + "type": "string" + }, + "due_on": { + "description": "ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ", + "type": "string" + }, + "number": { + "type": "integer" + }, + "open_issues": { + "type": "integer" + }, + "state": { + "enum": ["open", "closed"] + }, + "title": { + "type": "string" + }, + "url": { + "type": "string" + } + }, + "type": "object" + }, + "number": { + "type": "integer" + }, + "pull_request": { + "properties": { + "diff_url": { + "type": "string" + }, + "html_url": { + "type": "string" + }, + "patch_url": { + "type": "string" + } + }, + "type": "object" + }, + "state": { + "enum": ["open", "closed"] + }, + "title": { + "type": "string" + }, + "updated_at": { + "description": "ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ", + "type": "string" + }, + "url": { + "type": "string" + }, + "user": { + "$ref": "#/definitions/user" + } + }, + "type": "object" + }, + "type": "array" + }, + "issuesComment": { + "properties": { + "body": { + "type": "string" + }, + "created_at": { + "description": "ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ", + "type": "string" + }, + "html_url": { + "type": "string" + }, + "id": { + "type": "integer" + }, + "updated_at": { + "description": "ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ", + "type": "string" + }, + "url": { + "type": "string" + }, + "user": { + "$ref": "#/definitions/user" + } + }, + "type": "object" + }, + "issuesComments": { + "items": { + "properties": { + "_links": { + "properties": { + "html": { + "properties": { + "href": { + "type": "string" + } + }, + "type": "object" + }, + "pull_request": { + "properties": { + "href": { + "type": "string" + } + }, + "type": "object" + }, + "self": { + "properties": { + "href": { + "type": "string" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "body": { + "type": "string" + }, + "commit_id": { + "type": "string" + }, + "created_at": { + "description": "ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ", + "type": "string" + }, + "id": { + "type": "integer" + }, + "path": { + "type": "string" + }, + "position": { + "type": "integer" + }, + "updated_at": { + "description": "ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ", + "type": "string" + }, + "url": { + "type": "string" + }, + "user": { + "$ref": "#/definitions/user" + } + }, + "type": "object" + }, + "type": "array" + }, + "keys": { + "items": { + "properties": { + "id": { + "type": "integer" + }, + "key": { + "type": "string" + }, + "title": { + "type": "string" + }, + "url": { + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + }, + "label": { + "properties": { + "color": { + "maxLength": 6, + "minLength": 6, + "type": "string" + }, + "name": { + "type": "string" + }, + "url": { + "type": "string" + } + }, + "type": "object" + }, + "labels": { + "items": { + "properties": { + "color": { + "maxLength": 6, + "minLength": 6, + "type": "string" + }, + "name": { + "type": "string" + }, + "url": { + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + }, + "languages": { + "additionalProperties": { + "type": "integer" + }, + "type": "object" + }, + "markdown": { + "properties": { + "context": { + "type": "string" + }, + "mode": { + "type": "string" + }, + "text": { + "type": "string" + } + }, + "type": "object" + }, + "merge": { + "properties": { + "merged": { + "type": "boolean" + }, + "message": { + "type": "string" + }, + "sha": { + "type": "string" + } + }, + "type": "object" + }, + "mergePullBody": { + "properties": { + "commit_message": { + "type": "string" + } + }, + "type": "object" + }, + "mergesBody": { + "properties": { + "base": { + "type": "string" + }, + "commit_message": { + "type": "string" + }, + "head": { + "type": "string" + } + }, + "type": "object" + }, + "mergesConflict": { + "properties": { + "message": { + "description": "Error message", + "type": "string" + } + }, + "type": "object" + }, + "mergesSuccessful": { + "properties": { + "author": { + "$ref": "#/definitions/user" + }, + "comments_url": { + "type": "string" + }, + "commit": { + "properties": { + "author": { + "properties": { + "date": { + "type": "string" + }, + "email": { + "type": "string" + }, + "name": { + "type": "string" + } + }, + "type": "object" + }, + "comment_count": { + "type": "integer" + }, + "committer": { + "properties": { + "date": { + "type": "string" + }, + "email": { + "type": "string" + }, + "name": { + "type": "string" + } + }, + "type": "object" + }, + "message": { + "type": "string" + }, + "tree": { + "properties": { + "sha": { + "type": "string" + }, + "url": { + "type": "string" + } + }, + "type": "object" + }, + "url": { + "type": "string" + } + }, + "type": "object" + }, + "committer": { + "$ref": "#/definitions/user" + }, + "merged": { + "type": "boolean" + }, + "message": { + "type": "string" + }, + "parents": { + "items": { + "properties": { + "sha": { + "type": "string" + }, + "url": { + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + }, + "sha": { + "type": "string" + }, + "url": { + "type": "string" + } + }, + "type": "object" + }, + "meta": { + "properties": { + "git": { + "items": { + "description": "An Array of IP addresses in CIDR format specifying the Git servers at GitHub.", + "type": "string" + }, + "type": "array" + }, + "hooks": { + "items": { + "description": "An Array of IP addresses in CIDR format specifying the addresses that incoming service hooks will originate from.", + "type": "string" + }, + "type": "array" + } + }, + "type": "object" + }, + "milestone": { + "properties": { + "closed_issues": { + "type": "integer" + }, + "created_at": { + "description": "ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ", + "type": "string" + }, + "creator": { + "$ref": "#/definitions/user" + }, + "description": { + "type": "string" + }, + "due_on": { + "description": "ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ", + "type": "string" + }, + "number": { + "type": "integer" + }, + "open_issues": { + "type": "integer" + }, + "state": { + "enum": ["open", "closed"] + }, + "title": { + "type": "string" + }, + "url": { + "type": "string" + } + }, + "type": "object" + }, + "milestoneUpdate": { + "properties": { + "description": { + "type": "string" + }, + "due_on": { + "type": "string" + }, + "state": { + "type": "string" + }, + "title": { + "type": "string" + } + }, + "type": "object" + }, + "notificationMarkRead": { + "properties": { + "last_read_at": { + "type": "string" + } + }, + "type": "object" + }, + "notifications": { + "properties": { + "id": { + "type": "integer" + }, + "last_read_at": { + "type": "string" + }, + "reason": { + "type": "string" + }, + "repository": { + "properties": { + "description": { + "type": "string" + }, + "fork": { + "type": "boolean" + }, + "full_name": { + "type": "string" + }, + "html_url": { + "type": "string" + }, + "id": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "owner": { + "$ref": "#/definitions/actor" + }, + "private": { + "type": "boolean" + }, + "url": { + "type": "string" + } + }, + "type": "object" + }, + "subject": { + "properties": { + "latest_comment_url": { + "type": "string" + }, + "title": { + "type": "string" + }, + "type": { + "type": "string" + }, + "url": { + "type": "string" + } + }, + "type": "object" + }, + "unread": { + "type": "boolean" + }, + "updated_at": { + "type": "string" + }, + "url": { + "type": "string" + } + }, + "type": "object" + }, + "orgTeamsPost": { + "properties": { + "name": { + "type": "string" + }, + "permission": { + "enum": ["pull", "push", "admin"] + }, + "repo_names": { + "items": { + "type": "string" + }, + "type": "array" + } + }, + "required": ["name"], + "type": "object" + }, + "organization": { + "allOf": [ + { + "$ref": "#/definitions/actor" + }, + { + "description": "A GitHub organization" + } + ], + "type": "object" + }, + "organizationAsTeamMember": { + "properties": { + "errors": { + "items": { + "properties": { + "code": { + "type": "string" + }, + "field": { + "type": "string" + }, + "resource": { + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + }, + "message": { + "type": "string" + } + }, + "type": "object" + }, + "participationStats": { + "properties": { + "all": { + "items": { + "type": "integer" + }, + "type": "array" + }, + "owner": { + "items": { + "type": "integer" + }, + "type": "array" + } + }, + "type": "object" + }, + "patchGist": { + "properties": { + "description": { + "type": "string" + }, + "files": { + "properties": { + "delete_this_file.txt": { + "type": "string" + }, + "file1.txt": { + "properties": { + "content": { + "type": "string" + } + }, + "type": "object" + }, + "new_file.txt": { + "properties": { + "content": { + "type": "string" + } + }, + "type": "object" + }, + "old_name.txt": { + "properties": { + "content": { + "type": "string" + }, + "filename": { + "type": "string" + } + }, + "type": "object" + } + } + } + }, + "type": "object" + }, + "patchOrg": { + "properties": { + "billing_email": { + "description": "Billing email address. This address is not publicized.", + "type": "string" + }, + "company": { + "type": "string" + }, + "email": { + "description": "Publicly visible email address.", + "type": "string" + }, + "location": { + "type": "string" + }, + "name": { + "type": "string" + } + }, + "type": "object" + }, + "postGist": { + "properties": { + "description": { + "type": "string" + }, + "files": { + "properties": { + "file1.txt": { + "properties": { + "content": { + "type": "string" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "public": { + "type": "boolean" + } + }, + "type": "object" + }, + "postRepo": { + "properties": { + "auto_init": { + "description": "True to create an initial commit with empty README. Default is false.", + "type": "boolean" + }, + "description": { + "type": "string" + }, + "gitignore_template": { + "description": "Desired language or platform .gitignore template to apply. Use the name of the template without the extension. For example, \"Haskell\" Ignored if auto_init parameter is not provided. ", + "type": "string" + }, + "has_downloads": { + "description": "True to enable downloads for this repository, false to disable them. Default is true.", + "type": "boolean" + }, + "has_issues": { + "description": "True to enable issues for this repository, false to disable them. Default is true.", + "type": "boolean" + }, + "has_wiki": { + "description": "True to enable the wiki for this repository, false to disable it. Default is true.", + "type": "boolean" + }, + "homepage": { + "type": "string" + }, + "name": { + "type": "string" + }, + "private": { + "description": "True to create a private repository, false to create a public one. Creating private repositories requires a paid GitHub account.", + "type": "boolean" + }, + "team_id": { + "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.", + "type": "integer" + } + }, + "required": ["name"], + "type": "object" + }, + "pullRequest": { + "properties": { + "_links": { + "properties": { + "comments": { + "properties": { + "href": { + "type": "string" + } + }, + "type": "object" + }, + "html": { + "properties": { + "href": { + "type": "string" + } + }, + "type": "object" + }, + "review_comments": { + "properties": { + "href": { + "type": "string" + } + }, + "type": "object" + }, + "self": { + "properties": { + "href": { + "type": "string" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "additions": { + "type": "integer" + }, + "base": { + "properties": { + "label": { + "type": "string" + }, + "ref": { + "type": "string" + }, + "repo": { + "$ref": "#/definitions/repo" + }, + "sha": { + "type": "string" + }, + "user": { + "properties": { + "avatar_url": { + "type": "string" + }, + "gravatar_id": { + "type": "string" + }, + "id": { + "type": "integer" + }, + "login": { + "type": "string" + }, + "url": { + "type": "string" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "body": { + "type": "string" + }, + "changed_files": { + "type": "integer" + }, + "closed_at": { + "type": "string" + }, + "comments": { + "type": "integer" + }, + "commits": { + "type": "integer" + }, + "created_at": { + "type": "string" + }, + "deletions": { + "type": "integer" + }, + "diff_url": { + "type": "string" + }, + "head": { + "properties": { + "label": { + "type": "string" + }, + "ref": { + "type": "string" + }, + "repo": { + "$ref": "#/definitions/repo" + }, + "sha": { + "type": "string" + }, + "user": { + "properties": { + "avatar_url": { + "type": "string" + }, + "gravatar_id": { + "type": "string" + }, + "id": { + "type": "integer" + }, + "login": { + "type": "string" + }, + "url": { + "type": "string" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "html_url": { + "type": "string" + }, + "issue_url": { + "type": "string" + }, + "merge_commit_sha": { + "type": "string" + }, + "mergeable": { + "type": "boolean" + }, + "merged": { + "type": "boolean" + }, + "merged_at": { + "type": "string" + }, + "merged_by": { + "properties": { + "avatar_url": { + "type": "string" + }, + "gravatar_id": { + "type": "string" + }, + "id": { + "type": "integer" + }, + "login": { + "type": "string" + }, + "url": { + "type": "string" + } + }, + "type": "object" + }, + "number": { + "type": "integer" + }, + "patch_url": { + "type": "string" + }, + "state": { + "type": "string" + }, + "title": { + "type": "string" + }, + "updated_at": { + "type": "string" + }, + "url": { + "type": "string" + }, + "user": { + "properties": { + "avatar_url": { + "type": "string" + }, + "gravatar_id": { + "type": "string" + }, + "id": { + "type": "integer" + }, + "login": { + "type": "string" + }, + "url": { + "type": "string" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "pullUpdate": { + "properties": { + "body": { + "type": "string" + }, + "state": { + "type": "string" + }, + "title": { + "type": "string" + } + }, + "type": "object" + }, + "pulls": { + "items": { + "properties": { + "_links": { + "properties": { + "comments": { + "properties": { + "href": { + "type": "string" + } + }, + "type": "object" + }, + "html": { + "properties": { + "href": { + "type": "string" + } + }, + "type": "object" + }, + "review_comments": { + "properties": { + "href": { + "type": "string" + } + }, + "type": "object" + }, + "self": { + "properties": { + "href": { + "type": "string" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "base": { + "properties": { + "label": { + "type": "string" + }, + "ref": { + "type": "string" + }, + "repo": { + "$ref": "#/definitions/repo" + }, + "sha": { + "type": "string" + }, + "user": { + "properties": { + "avatar_url": { + "type": "string" + }, + "gravatar_id": { + "type": "string" + }, + "id": { + "type": "integer" + }, + "login": { + "type": "string" + }, + "url": { + "type": "string" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "body": { + "type": "string" + }, + "closed_at": { + "description": "ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ", + "type": "string" + }, + "created_at": { + "description": "ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ", + "type": "string" + }, + "diff_url": { + "type": "string" + }, + "head": { + "properties": { + "label": { + "type": "string" + }, + "ref": { + "type": "string" + }, + "repo": { + "$ref": "#/definitions/repo" + }, + "sha": { + "type": "string" + }, + "user": { + "properties": { + "avatar_url": { + "type": "string" + }, + "gravatar_id": { + "type": "string" + }, + "id": { + "type": "integer" + }, + "login": { + "type": "string" + }, + "url": { + "type": "string" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "html_url": { + "type": "string" + }, + "issue_url": { + "type": "string" + }, + "merged_at": { + "description": "ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ", + "type": "string" + }, + "number": { + "type": "integer" + }, + "patch_url": { + "type": "string" + }, + "state": { + "enum": ["open", "closed"] + }, + "title": { + "type": "string" + }, + "updated_at": { + "description": "ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ", + "type": "string" + }, + "url": { + "type": "string" + }, + "user": { + "properties": { + "avatar_url": { + "type": "string" + }, + "gravatar_id": { + "type": "string" + }, + "id": { + "type": "integer" + }, + "login": { + "type": "string" + }, + "url": { + "type": "string" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "type": "array" + }, + "pullsComment": { + "properties": { + "_links": { + "properties": { + "html": { + "properties": { + "href": { + "type": "string" + } + }, + "type": "object" + }, + "pull_request": { + "properties": { + "href": { + "type": "string" + } + }, + "type": "object" + }, + "self": { + "properties": { + "href": { + "type": "string" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "body": { + "type": "string" + }, + "commit_id": { + "type": "string" + }, + "created_at": { + "description": "ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ", + "type": "string" + }, + "id": { + "type": "integer" + }, + "path": { + "type": "string" + }, + "position": { + "type": "integer" + }, + "updated_at": { + "description": "ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ", + "type": "string" + }, + "url": { + "type": "string" + }, + "user": { + "properties": { + "avatar_url": { + "type": "string" + }, + "gravatar_id": { + "type": "string" + }, + "id": { + "type": "integer" + }, + "login": { + "type": "string" + }, + "url": { + "type": "string" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "pullsCommentPost": { + "properties": { + "body": { + "type": "string" + }, + "commit_id": { + "type": "string" + }, + "path": { + "type": "string" + }, + "position": { + "type": "number" + } + }, + "type": "object" + }, + "pullsComments": { + "items": { + "properties": { + "_links": { + "properties": { + "html": { + "properties": { + "href": { + "type": "string" + } + }, + "type": "object" + }, + "pull_request": { + "properties": { + "href": { + "type": "string" + } + }, + "type": "object" + }, + "self": { + "properties": { + "href": { + "type": "string" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "body": { + "type": "string" + }, + "commit_id": { + "type": "string" + }, + "created_at": { + "description": "ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ", + "type": "string" + }, + "id": { + "type": "integer" + }, + "path": { + "type": "string" + }, + "position": { + "type": "integer" + }, + "updated_at": { + "description": "ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ", + "type": "string" + }, + "url": { + "type": "string" + }, + "user": { + "properties": { + "avatar_url": { + "type": "string" + }, + "gravatar_id": { + "type": "string" + }, + "id": { + "type": "integer" + }, + "login": { + "type": "string" + }, + "url": { + "type": "string" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "type": "array" + }, + "pullsPost": { + "properties": { + "base": { + "type": "string" + }, + "body": { + "type": "string" + }, + "head": { + "type": "string" + }, + "title": { + "type": "string" + } + }, + "type": "object" + }, + "putSubscription": { + "properties": { + "created_at": { + "type": "string" + }, + "ignored": { + "type": "boolean" + }, + "reason": { + "type": "object" + }, + "subscribed": { + "type": "boolean" + }, + "thread_url": { + "type": "string" + }, + "url": { + "type": "string" + } + }, + "type": "object" + }, + "rate_limit": { + "properties": { + "rate": { + "properties": { + "limit": { + "type": "integer" + }, + "remaining": { + "type": "integer" + }, + "reset": { + "type": "integer" + } + } + } + }, + "type": "object" + }, + "ref": { + "items": { + "properties": { + "created_at": { + "description": "ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ", + "type": "string" + }, + "creator": { + "properties": { + "avatar_url": { + "type": "string" + }, + "gravatar_id": { + "type": "string" + }, + "id": { + "type": "integer" + }, + "login": { + "type": "string" + }, + "url": { + "type": "string" + } + }, + "type": "object" + }, + "description": { + "type": "string" + }, + "id": { + "type": "integer" + }, + "state": { + "type": "string" + }, + "target_url": { + "type": "string" + }, + "updated_at": { + "description": "ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ", + "type": "string" + }, + "url": { + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + }, + "refStatus": { + "items": { + "properties": { + "commit_url": { + "type": "string" + }, + "name": { + "type": "string" + }, + "repository_url": { + "type": "string" + }, + "sha": { + "type": "string" + }, + "state": { + "type": "string" + }, + "statuses": { + "items": { + "properties": { + "context": { + "type": "string" + }, + "created_at": { + "type": "string" + }, + "description": { + "type": "string" + }, + "id": { + "type": "number" + }, + "state": { + "type": "string" + }, + "target_url": { + "type": "string" + }, + "updated_at": { + "type": "string" + }, + "url": { + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + }, + "type": "array" + }, + "refs": { + "items": { + "properties": { + "object": { + "properties": { + "sha": { + "type": "string" + }, + "type": { + "type": "string" + }, + "url": { + "type": "string" + } + }, + "type": "object" + }, + "ref": { + "type": "string" + }, + "url": { + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + }, + "refsBody": { + "properties": { + "ref": { + "type": "string" + }, + "sha": { + "type": "string" + } + }, + "type": "object" + }, + "release": { + "properties": { + "assets": { + "items": { + "properties": { + "content_type": { + "type": "string" + }, + "created_at": { + "type": "string" + }, + "download_count": { + "type": "integer" + }, + "id": { + "type": "integer" + }, + "label": { + "type": "string" + }, + "name": { + "type": "string" + }, + "size": { + "type": "integer" + }, + "state": { + "type": "string" + }, + "updated_at": { + "type": "string" + }, + "uploader": { + "$ref": "#/definitions/user" + }, + "url": { + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + }, + "assets_url": { + "type": "string" + }, + "author": { + "$ref": "#/definitions/user" + }, + "body": { + "type": "string" + }, + "created_at": { + "type": "string" + }, + "draft": { + "type": "boolean" + }, + "html_url": { + "type": "string" + }, + "id": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "prerelease": { + "type": "boolean" + }, + "published_at": { + "type": "string" + }, + "tag_name": { + "type": "string" + }, + "tarball_url": { + "type": "string" + }, + "target_commitish": { + "type": "string" + }, + "upload_url": { + "type": "string" + }, + "url": { + "type": "string" + }, + "zipball_url": { + "type": "string" + } + }, + "type": "object" + }, + "release-create": { + "properties": { + "body": { + "type": "string" + }, + "draft": { + "type": "boolean" + }, + "name": { + "type": "string" + }, + "prerelease": { + "type": "boolean" + }, + "tag_name": { + "type": "string" + }, + "target_commitish": { + "type": "string" + } + }, + "type": "object" + }, + "releases": { + "items": { + "properties": { + "assets": { + "items": { + "properties": { + "content_type": { + "type": "string" + }, + "created_at": { + "type": "string" + }, + "download_count": { + "type": "integer" + }, + "id": { + "type": "integer" + }, + "label": { + "type": "string" + }, + "name": { + "type": "string" + }, + "size": { + "type": "integer" + }, + "state": { + "type": "string" + }, + "updated_at": { + "type": "string" + }, + "uploader": { + "$ref": "#/definitions/user" + }, + "url": { + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + }, + "assets_url": { + "type": "string" + }, + "author": { + "$ref": "#/definitions/user" + }, + "body": { + "type": "string" + }, + "created_at": { + "type": "string" + }, + "draft": { + "type": "boolean" + }, + "html_url": { + "type": "string" + }, + "id": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "prerelease": { + "type": "boolean" + }, + "published_at": { + "type": "string" + }, + "tag_name": { + "type": "string" + }, + "tarball_url": { + "type": "string" + }, + "target_commitish": { + "type": "string" + }, + "upload_url": { + "type": "string" + }, + "url": { + "type": "string" + }, + "zipball_url": { + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + }, + "repo": { + "properties": { + "clone_url": { + "type": "string" + }, + "created_at": { + "description": "ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ", + "type": "string" + }, + "description": { + "type": "string" + }, + "fork": { + "type": "boolean" + }, + "forks": { + "type": "integer" + }, + "forks_count": { + "type": "integer" + }, + "full_name": { + "type": "string" + }, + "git_url": { + "type": "string" + }, + "has_downloads": { + "type": "boolean" + }, + "has_issues": { + "type": "boolean" + }, + "has_wiki": { + "type": "boolean" + }, + "homepage": { + "type": "string" + }, + "html_url": { + "type": "string" + }, + "id": { + "type": "integer" + }, + "language": { + "type": "string" + }, + "master_branch": { + "type": "string" + }, + "mirror_url": { + "type": "string" + }, + "name": { + "type": "string" + }, + "open_issues": { + "type": "integer" + }, + "open_issues_count": { + "type": "integer" + }, + "organization": { + "$ref": "#/definitions/organization" + }, + "owner": { + "$ref": "#/definitions/actor" + }, + "parent": { + "allOf": [ + { + "$ref": "#/definitions/repo" + }, + { + "description": "Is present when the repo is a fork. Parent is the repo this repo was forked from." + } + ] + }, + "private": { + "type": "boolean" + }, + "pushed_at": { + "description": "ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ", + "type": "string" + }, + "size": { + "type": "integer" + }, + "source": { + "allOf": [ + { + "$ref": "#/definitions/repo" + }, + { + "description": "Is present when the repo is a fork. Source is the ultimate source for the network." + } + ] + }, + "ssh_url": { + "type": "string" + }, + "svn_url": { + "type": "string" + }, + "updated_at": { + "description": "ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ", + "type": "string" + }, + "url": { + "type": "string" + }, + "watchers": { + "type": "integer" + }, + "watchers_count": { + "type": "integer" + } + }, + "type": "object" + }, + "repo-deployments": { + "items": { + "properties": { + "created_at": { + "type": "string" + }, + "creator": { + "$ref": "#/definitions/user" + }, + "description": { + "type": "string" + }, + "id": { + "type": "integer" + }, + "payload": { + "type": "string" + }, + "sha": { + "type": "string" + }, + "statuses_url": { + "type": "string" + }, + "updated_at": { + "type": "string" + }, + "url": { + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + }, + "repoComments": { + "items": { + "properties": { + "body": { + "type": "string" + }, + "commit_id": { + "type": "string" + }, + "created_at": { + "description": "ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ", + "type": "string" + }, + "html_url": { + "type": "string" + }, + "id": { + "type": "integer" + }, + "line": { + "type": "integer" + }, + "path": { + "type": "string" + }, + "position": { + "type": "integer" + }, + "updated_at": { + "description": "ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ", + "type": "string" + }, + "url": { + "type": "string" + }, + "user": { + "$ref": "#/definitions/user" + } + }, + "type": "object" + }, + "type": "array" + }, + "repoCommit": { + "properties": { + "author": { + "properties": { + "date": { + "description": "ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ", + "type": "string" + }, + "email": { + "type": "string" + }, + "name": { + "type": "string" + } + }, + "type": "object" + }, + "committer": { + "properties": { + "date": { + "description": "ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ", + "type": "string" + }, + "email": { + "type": "string" + }, + "name": { + "type": "string" + } + }, + "type": "object" + }, + "message": { + "type": "string" + }, + "parents": { + "items": { + "properties": { + "sha": { + "type": "string" + }, + "url": { + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + }, + "sha": { + "type": "string" + }, + "tree": { + "properties": { + "sha": { + "type": "string" + }, + "url": { + "type": "string" + } + }, + "type": "object" + }, + "url": { + "type": "string" + } + }, + "type": "object" + }, + "repoCommitBody": { + "properties": { + "author": { + "properties": { + "date": { + "type": "string" + }, + "email": { + "type": "string" + }, + "name": { + "type": "string" + } + }, + "type": "object" + }, + "message": { + "type": "string" + }, + "parents": { + "items": { + "type": "string" + }, + "type": "array" + }, + "tree": { + "type": "string" + } + }, + "required": ["message", "parents", "tree"], + "type": "object" + }, + "repoEdit": { + "properties": { + "description": { + "type": "string" + }, + "has_downloads": { + "type": "boolean" + }, + "has_issues": { + "type": "boolean" + }, + "has_wiki": { + "type": "boolean" + }, + "homepage": { + "type": "string" + }, + "name": { + "type": "string" + }, + "private": { + "type": "boolean" + } + }, + "type": "object" + }, + "repos": { + "items": { + "$ref": "#/definitions/repo" + }, + "type": "array" + }, + "search-code": { + "properties": { + "items": { + "items": { + "properties": { + "git_url": { + "type": "string" + }, + "html_url": { + "type": "string" + }, + "name": { + "type": "string" + }, + "path": { + "type": "string" + }, + "repository": { + "properties": { + "archive_url": { + "type": "string" + }, + "assignees_url": { + "type": "string" + }, + "blobs_url": { + "type": "string" + }, + "branches_url": { + "type": "string" + }, + "collaborators_url": { + "type": "string" + }, + "comments_url": { + "type": "string" + }, + "commits_url": { + "type": "string" + }, + "compare_url": { + "type": "string" + }, + "contents_url": { + "type": "string" + }, + "contributors_url": { + "type": "string" + }, + "description": { + "type": "string" + }, + "downloads_url": { + "type": "string" + }, + "events_url": { + "type": "string" + }, + "fork": { + "type": "boolean" + }, + "forks_url": { + "type": "string" + }, + "full_name": { + "type": "string" + }, + "git_commits_url": { + "type": "string" + }, + "git_refs_url": { + "type": "string" + }, + "git_tags_url": { + "type": "string" + }, + "hooks_url": { + "type": "string" + }, + "html_url": { + "type": "string" + }, + "id": { + "type": "integer" + }, + "issue_comment_url": { + "type": "string" + }, + "issue_events_url": { + "type": "string" + }, + "issues_url": { + "type": "string" + }, + "keys_url": { + "type": "string" + }, + "labels_url": { + "type": "string" + }, + "languages_url": { + "type": "string" + }, + "merges_url": { + "type": "string" + }, + "milestones_url": { + "type": "string" + }, + "name": { + "type": "string" + }, + "notifications_url": { + "type": "string" + }, + "owner": { + "$ref": "#/definitions/actor" + }, + "private": { + "type": "boolean" + }, + "pulls_url": { + "type": "string" + }, + "stargazers_url": { + "type": "string" + }, + "statuses_url": { + "type": "string" + }, + "subscribers_url": { + "type": "string" + }, + "subscription_url": { + "type": "string" + }, + "tags_url": { + "type": "string" + }, + "teams_url": { + "type": "string" + }, + "trees_url": { + "type": "string" + }, + "url": { + "type": "string" + } + }, + "type": "object" + }, + "score": { + "type": "number" + }, + "sha": { + "type": "string" + }, + "url": { + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + }, + "total_count": { + "type": "integer" + } + }, + "type": "object" + }, + "search-issues": { + "properties": { + "items": { + "items": { + "properties": { + "assignee": { + "type": "null" + }, + "body": { + "type": "string" + }, + "closed_at": { + "type": "null" + }, + "comments": { + "type": "integer" + }, + "comments_url": { + "type": "string" + }, + "created_at": { + "type": "string" + }, + "events_url": { + "type": "string" + }, + "html_url": { + "type": "string" + }, + "id": { + "type": "integer" + }, + "labels": { + "items": { + "properties": { + "color": { + "type": "string" + }, + "name": { + "type": "string" + }, + "url": { + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + }, + "labels_url": { + "type": "string" + }, + "milestone": { + "type": "null" + }, + "number": { + "type": "integer" + }, + "pull_request": { + "properties": { + "diff_url": { + "type": "null" + }, + "html_url": { + "type": "null" + }, + "patch_url": { + "type": "null" + } + }, + "type": "object" + }, + "score": { + "type": "number" + }, + "state": { + "type": "string" + }, + "title": { + "type": "string" + }, + "updated_at": { + "type": "string" + }, + "url": { + "type": "string" + }, + "user": { + "$ref": "#/definitions/user" + } + }, + "type": "object" + }, + "type": "array" + }, + "total_count": { + "type": "integer" + } + }, + "type": "object" + }, + "search-issues-by-keyword": { + "properties": { + "issues": { + "items": { + "properties": { + "body": { + "type": "string" + }, + "comments": { + "type": "integer" + }, + "created_at": { + "type": "string" + }, + "gravatar_id": { + "type": "string" + }, + "html_url": { + "type": "string" + }, + "labels": { + "items": { + "type": "string" + }, + "type": "array" + }, + "number": { + "type": "integer" + }, + "position": { + "type": "integer" + }, + "state": { + "type": "string" + }, + "title": { + "type": "string" + }, + "updated_at": { + "type": "string" + }, + "user": { + "type": "string" + }, + "votes": { + "type": "integer" + } + }, + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + }, + "search-repositories": { + "properties": { + "items": { + "items": { + "$ref": "#/definitions/repo" + }, + "type": "array" + }, + "total_count": { + "type": "integer" + } + }, + "type": "object" + }, + "search-repositories-by-keyword": { + "properties": { + "repositories": { + "items": { + "$ref": "#/definitions/repo" + }, + "type": "array" + } + }, + "type": "object" + }, + "search-user-by-email": { + "properties": { + "user": { + "$ref": "#/definitions/user" + } + }, + "type": "object" + }, + "search-users": { + "properties": { + "items": { + "$ref": "#/definitions/users" + }, + "total_count": { + "type": "integer" + } + }, + "type": "object" + }, + "search-users-by-keyword": { + "properties": { + "users": { + "$ref": "#/definitions/users" + } + }, + "type": "object" + }, + "subscription": { + "properties": { + "created_at": { + "description": "ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ", + "type": "string" + }, + "ignored": { + "type": "boolean" + }, + "reason": { + "type": "string" + }, + "repository_url": { + "type": "string" + }, + "subscribed": { + "type": "boolean" + }, + "thread_url": { + "type": "string" + }, + "url": { + "type": "string" + } + }, + "type": "object" + }, + "subscriptionBody": { + "properties": { + "ignored": { + "type": "boolean" + }, + "subscribed": { + "type": "boolean" + } + }, + "type": "object" + }, + "tag": { + "properties": { + "message": { + "description": "String of the tag message.", + "type": "string" + }, + "object": { + "properties": { + "sha": { + "type": "string" + }, + "type": { + "description": "String of the type of the tagged object. Normally this is a commit but it can also be a tree or a blob.", + "enum": ["commit", "tree", "blob"] + }, + "url": { + "type": "string" + } + }, + "type": "object" + }, + "sha": { + "type": "string" + }, + "tag": { + "description": "The tag's name. This is typically a version (e.g., \"v0.0.1\").", + "type": "string" + }, + "tagger": { + "properties": { + "date": { + "description": "Timestamp of when this object was tagged, in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ", + "type": "string" + }, + "email": { + "description": "String of the email of the author of the tag.", + "type": "string" + }, + "name": { + "description": "String of the name of the author of the tag.", + "type": "string" + } + }, + "type": "object" + }, + "url": { + "type": "string" + } + }, + "type": "object" + }, + "tagBody": { + "properties": { + "message": { + "description": "String of the tag message.", + "type": "string" + }, + "object": { + "description": "String of the SHA of the git object this is tagging.", + "type": "string" + }, + "tag": { + "description": "The tag's name. This is typically a version (e.g., \"v0.0.1\").", + "type": "string" + }, + "tagger": { + "properties": { + "date": { + "description": "Timestamp of when this object was tagged, in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ", + "type": "string" + }, + "email": { + "description": "String of the email of the author of the tag.", + "type": "string" + }, + "name": { + "description": "String of the name of the author of the tag.", + "type": "string" + } + }, + "type": "object" + }, + "type": { + "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.", + "enum": ["commit", "tree", "blob"] + } + }, + "required": ["tag", "message", "object", "type", "tagger"], + "type": "object" + }, + "tags": { + "items": { + "$ref": "#/definitions/tag" + }, + "type": "array" + }, + "team": { + "properties": { + "id": { + "type": "integer" + }, + "members_count": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "permission": { + "type": "string" + }, + "repos_count": { + "type": "integer" + }, + "url": { + "type": "string" + } + }, + "type": "object" + }, + "teamMembership": { + "properties": { + "state": { + "type": "string" + }, + "url": { + "type": "string" + } + }, + "type": "object" + }, + "teamRepos": { + "$ref": "#/definitions/repos" + }, + "teams": { + "items": { + "properties": { + "id": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "url": { + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + }, + "teams-list": { + "items": { + "properties": { + "id": { + "type": "integer" + }, + "members_count": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "organization": { + "properties": { + "avatar_url": { + "type": "string" + }, + "id": { + "type": "integer" + }, + "login": { + "type": "string" + }, + "url": { + "type": "string" + } + }, + "type": "object" + }, + "permission": { + "type": "string" + }, + "repos_count": { + "type": "integer" + }, + "url": { + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + }, + "tree": { + "properties": { + "sha": { + "type": "string" + }, + "tree": { + "items": { + "properties": { + "mode": { + "description": "One of 100644 for file (blob), 100755 for executable (blob), 040000 for subdirectory (tree), 160000 for submodule (commit) or 120000 for a blob that specifies the path of a symlink.", + "enum": ["100644", "100755", "040000", "160000", "120000"], + "type": "string" + }, + "path": { + "type": "string" + }, + "sha": { + "description": "SHA1 checksum ID of the object in the tree.", + "type": "string" + }, + "size": { + "type": "integer" + }, + "type": { + "enum": ["blob", "tree", "commit"], + "type": "string" + }, + "url": { + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + }, + "url": { + "type": "string" + } + }, + "type": "object" + }, + "trees": { + "properties": { + "base_tree": { + "type": "string" + }, + "sha": { + "description": "SHA1 checksum ID of the object in the tree.", + "type": "string" + }, + "tree": { + "items": { + "$ref": "#/definitions/tree" + }, + "type": "array" + }, + "url": { + "type": "string" + } + }, + "type": "object" + }, + "user": { + "allOf": [ + { + "$ref": "#/definitions/actor" + }, + { + "description": "A GitHub user" + } + ], + "type": "object" + }, + "user-emails": { + "items": { + "type": "string" + }, + "type": "array" + }, + "user-keys-keyId": { + "properties": { + "id": { + "type": "integer" + }, + "key": { + "type": "string" + }, + "title": { + "type": "string" + }, + "url": { + "type": "string" + } + }, + "type": "object" + }, + "user-keys-post": { + "properties": { + "key": { + "type": "string" + }, + "title": { + "type": "string" + } + }, + "type": "object" + }, + "user-update": { + "properties": { + "bio": { + "type": "string" + }, + "blog": { + "type": "string" + }, + "company": { + "type": "string" + }, + "email": { + "type": "string" + }, + "hireable": { + "type": "boolean" + }, + "location": { + "type": "string" + }, + "name": { + "type": "string" + } + }, + "type": "object" + }, + "users": { + "items": { + "$ref": "#/definitions/user" + }, + "type": "array" + } + } +} diff --git a/tests/spec/patch/schema.ts b/tests/spec/patch/schema.ts new file mode 100644 index 000000000..569cd6d72 --- /dev/null +++ b/tests/spec/patch/schema.ts @@ -0,0 +1,5405 @@ +/* eslint-disable */ +/* tslint:disable */ +/* + * --------------------------------------------------------------- + * ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ## + * ## ## + * ## AUTHOR: acacode ## + * ## SOURCE: https://github.com/acacode/swagger-typescript-api ## + * --------------------------------------------------------------- + */ + +/** + * A user or organization + */ +export interface Actor { + avatar_url?: string; + bio?: string; + + /** The website URL from the profile page */ + blog?: string; + collaborators?: number; + company?: string; + + /** ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ */ + created_at?: string; + disk_usage?: number; + + /** Note: The returned email is the user’s publicly visible email address (or null if the user has not specified a public email address in their profile). */ + email?: string; + followers?: number; + followers_url?: string; + following?: number; + following_url?: string; + gists_url?: string; + gravatar_id?: string; + hireable?: boolean; + html_url?: string; + id?: number; + location?: string; + + /** The account username */ + login?: string; + + /** The full account name */ + name?: string; + organizations_url?: string; + owned_private_repos?: number; + plan?: { collaborators?: number; name?: string; private_repos?: number; space?: number }; + private_gists?: number; + public_gists?: number; + public_repos?: number; + starred_url?: string; + subscriptions_url?: string; + total_private_repos?: number; + type?: "User" | "Organization"; + + /** ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ */ + updated_at?: string; + url?: string; +} + +export interface Asset { + content_type?: string; + created_at?: string; + download_count?: number; + id?: number; + label?: string; + name?: string; + size?: number; + state?: string; + updated_at?: string; + + /** A GitHub user */ + uploader?: User; + url?: string; +} + +export interface AssetPatch { + label?: string; + name: string; +} + +export type Assets = Asset[]; + +export type Assignees = User[]; + +export interface Blob { + content?: string; + encoding?: "utf-8" | "base64"; + sha?: string; + size?: number; +} + +export interface Blobs { + sha?: string; +} + +export interface Branch { + _links?: { html?: string; self?: string }; + commit?: { + author?: User; + commit?: { + author?: { date?: string; email?: string; name?: string }; + committer?: { date?: string; email?: string; name?: string }; + message?: string; + tree?: { sha?: string; url?: string }; + url?: string; + }; + committer?: User; + parents?: { sha?: string; url?: string }[]; + sha?: string; + url?: string; + }; + name?: string; +} + +export type Branches = { commit?: { sha?: string; url?: string }; name?: string }[]; + +export type CodeFrequencyStats = number[]; + +export interface Comment { + body?: string; +} + +export interface CommentBody { + body: string; +} + +export type Comments = { body?: string; created_at?: string; id?: number; url?: string; user?: User }[]; + +export interface Commit { + /** A GitHub user */ + author?: User; + commit?: { + author?: { date?: string; email?: string; name?: string }; + committer?: { date?: string; email?: string; name?: string }; + message?: string; + tree?: { sha?: string; url?: string }; + url?: string; + }; + + /** A GitHub user */ + committer?: User; + files?: { + additions?: number; + blob_url?: string; + changes?: number; + deletions?: number; + filename?: string; + patch?: string; + raw_url?: string; + status?: string; + }[]; + parents?: { sha?: string; url?: string }[]; + sha?: string; + stats?: { additions?: number; deletions?: number; total?: number }; + url?: string; +} + +export type CommitActivityStats = { days?: number[]; total?: number; week?: number }[]; + +export interface CommitComment { + body?: string; + commit_id?: string; + + /** ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ */ + created_at?: string; + html_url?: string; + id?: number; + line?: number; + path?: string; + position?: number; + + /** ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ */ + updated_at?: string; + url?: string; + + /** A GitHub user */ + user?: User; +} + +export interface CommitCommentBody { + body: string; + + /** Deprecated - Use position parameter instead. */ + line?: string; + + /** Line number in the file to comment on. Defaults to null. */ + number?: string; + + /** Relative path of the file to comment on. */ + path?: string; + + /** Line index in the diff to comment on. */ + position?: number; + + /** SHA of the commit to comment on. */ + sha: string; +} + +export type Commits = { + author?: User; + commit?: { + author?: { date?: string; email?: string; name?: string }; + committer?: { date?: string; email?: string; name?: string }; + message?: string; + tree?: { sha?: string; url?: string }; + url?: string; + }; + committer?: User; + parents?: { sha?: string; url?: string }[]; + sha?: string; + url?: string; +}[]; + +export interface CompareCommits { + ahead_by?: number; + base_commit?: { + author?: User; + commit?: { + author?: { date?: string; email?: string; name?: string }; + committer?: { date?: string; email?: string; name?: string }; + message?: string; + tree?: { sha?: string; url?: string }; + url?: string; + }; + committer?: User; + parents?: { sha?: string; url?: string }[]; + sha?: string; + url?: string; + }; + behind_by?: number; + commits?: { + author?: User; + commit?: { + author?: { date?: string; email?: string; name?: string }; + committer?: { date?: string; email?: string; name?: string }; + message?: string; + tree?: { sha?: string; url?: string }; + url?: string; + }; + committer?: User; + parents?: { sha?: string; url?: string }[]; + sha?: string; + url?: string; + }[]; + diff_url?: string; + files?: { + additions?: number; + blob_url?: string; + changes?: number; + contents_url?: string; + deletions?: number; + filename?: string; + patch?: string; + raw_url?: string; + sha?: string; + status?: string; + }[]; + html_url?: string; + patch_url?: string; + permalink_url?: string; + status?: string; + total_commits?: number; + url?: string; +} + +export interface ContentsPath { + _links?: { git?: string; html?: string; self?: string }; + content?: string; + encoding?: string; + git_url?: string; + html_url?: string; + name?: string; + path?: string; + sha?: string; + size?: number; + type?: string; + url?: string; +} + +export type ContributorsStats = { + author?: { avatar_url?: string; gravatar_id?: string; id?: number; login?: string; url?: string }; + total?: number; + weeks?: { a?: number; c?: number; d?: number; w?: string }[]; +}[]; + +export interface CreateFile { + commit?: { + author?: { date?: string; email?: string; name?: string }; + committer?: { date?: string; email?: string; name?: string }; + html_url?: string; + message?: string; + parents?: { html_url?: string; sha?: string; url?: string }[]; + sha?: string; + tree?: { sha?: string; url?: string }; + url?: string; + }; + content?: { + _links?: { git?: string; html?: string; self?: string }; + git_url?: string; + html_url?: string; + name?: string; + path?: string; + sha?: string; + size?: number; + type?: string; + url?: string; + }; +} + +export interface CreateFileBody { + committer?: { email?: string; name?: string }; + content?: string; + message?: string; +} + +export interface DeleteFile { + commit?: { + author?: { date?: string; email?: string; name?: string }; + committer?: { date?: string; email?: string; name?: string }; + html_url?: string; + message?: string; + parents?: { html_url?: string; sha?: string; url?: string }; + sha?: string; + tree?: { sha?: string; url?: string }; + url?: string; + }; + content?: string; +} + +export interface DeleteFileBody { + committer?: { email?: string; name?: string }; + message?: string; + sha?: string; +} + +export interface Deployment { + description?: string; + payload?: { deploy_user?: string; environment?: string; room_id?: number }; + ref?: string; +} + +export interface DeploymentResp { + created_at?: string; + + /** A GitHub user */ + creator?: User; + description?: string; + id?: number; + payload?: string; + sha?: string; + statuses_url?: string; + updated_at?: string; + url?: string; +} + +export type DeploymentStatuses = { + created_at?: string; + creator?: User; + description?: string; + id?: number; + payload?: string; + state?: string; + target_url?: string; + updated_at?: string; + url?: string; +}[]; + +export interface DeploymentStatusesCreate { + description?: string; + state?: string; + target_url?: string; +} + +export interface Download { + content_type?: string; + description?: string; + download_count?: number; + html_url?: string; + id?: number; + name?: string; + size?: number; + url?: string; +} + +export type Downloads = Download[]; + +export interface EditTeam { + name: string; + permission?: "pull" | "push" | "admin"; +} + +export type EmailsPost = string[]; + +export type Emojis = Record; + +export interface Event { + /** A user or organization */ + actor?: Actor; + created_at?: object; + id?: number; + + /** A GitHub organization */ + org?: Organization; + payload?: object; + public?: boolean; + repo?: { id?: number; name?: string; url?: string }; + type?: string; +} + +export type Events = Event[]; + +export interface Feeds { + _links?: { + current_user?: { href?: string; type?: string }; + current_user_actor?: { href?: string; type?: string }; + current_user_organization?: { href?: string; type?: string }; + current_user_public?: { href?: string; type?: string }; + timeline?: { href?: string; type?: string }; + user?: { href?: string; type?: string }; + }; + current_user_actor_url?: string; + current_user_organization_url?: string; + current_user_public?: string; + current_user_url?: string; + timeline_url?: string; + user_url?: string; +} + +export interface ForkBody { + organization?: string; +} + +export type Forks = Repos; + +export interface Gist { + comments?: number; + comments_url?: string; + + /** Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ. */ + created_at?: string; + description?: string; + files?: { "ring.erl"?: { filename?: string; raw_url?: string; size?: number } }; + forks?: { created_at?: string; url?: string; user?: User }[]; + git_pull_url?: string; + git_push_url?: string; + history?: { + change_status?: { additions?: number; deletions?: number; total?: number }; + committed_at?: string; + url?: string; + user?: User; + version?: string; + }[]; + html_url?: string; + id?: string; + public?: boolean; + url?: string; + + /** A GitHub user */ + user?: User; +} + +export type Gists = { + comments?: number; + comments_url?: string; + created_at?: string; + description?: string; + files?: { "ring.erl"?: { filename?: string; raw_url?: string; size?: number } }; + git_pull_url?: string; + git_push_url?: string; + html_url?: string; + id?: string; + public?: boolean; + url?: string; + user?: User; +}[]; + +export interface GitCommit { + author?: { date?: string; email?: string; name?: string }; + message?: string; + parents?: string; + tree?: string; +} + +export interface GitRefPatch { + force?: boolean; + sha?: string; +} + +export type Gitignore = any[]; + +export interface GitignoreLang { + name?: string; + source?: string; +} + +export interface HeadBranch { + object?: { sha?: string; type?: string; url?: string }; + ref?: string; + url?: string; +} + +export type Hook = { + active?: boolean; + config?: { content_type?: string; url?: string }; + created_at?: string; + events?: ( + | "push" + | "issues" + | "issue_comment" + | "commit_comment" + | "pull_request" + | "pull_request_review_comment" + | "gollum" + | "watch" + | "download" + | "fork" + | "fork_apply" + | "member" + | "public" + | "team_add" + | "status" + )[]; + id?: number; + name?: string; + updated_at?: string; + url?: string; +}[]; + +export interface HookBody { + active?: boolean; + add_events?: string[]; +} + +export interface Issue { + assignee?: string; + body?: string; + labels?: string[]; + milestone?: number; + title?: string; +} + +export interface IssueEvent { + /** A user or organization */ + actor?: Actor; + commit_id?: string; + + /** ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ */ + created_at?: string; + event?: string; + issue?: { + assignee?: User; + body?: string; + closed_at?: string; + comments?: number; + created_at?: string; + html_url?: string; + labels?: { color?: string; name?: string; url?: string }[]; + milestone?: { + closed_issues?: number; + created_at?: string; + creator?: User; + description?: string; + due_on?: string; + number?: number; + open_issues?: number; + state?: "open" | "closed"; + title?: string; + url?: string; + }; + number?: number; + pull_request?: { diff_url?: string; html_url?: string; patch_url?: string }; + state?: "open" | "closed"; + title?: string; + updated_at?: string; + url?: string; + user?: User; + }; + url?: string; +} + +export type IssueEvents = IssueEvent[]; + +export type Issues = { + assignee?: User; + body?: string; + closed_at?: string; + comments?: number; + created_at?: string; + html_url?: string; + labels?: { color?: string; name?: string; url?: string }[]; + milestone?: { + closed_issues?: number; + created_at?: string; + creator?: User; + description?: string; + due_on?: string; + number?: number; + open_issues?: number; + state?: "open" | "closed"; + title?: string; + url?: string; + }; + number?: number; + pull_request?: { diff_url?: string; html_url?: string; patch_url?: string }; + state?: "open" | "closed"; + title?: string; + updated_at?: string; + url?: string; + user?: User; +}[]; + +export interface IssuesComment { + body?: string; + + /** ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ */ + created_at?: string; + html_url?: string; + id?: number; + + /** ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ */ + updated_at?: string; + url?: string; + + /** A GitHub user */ + user?: User; +} + +export type IssuesComments = { + _links?: { html?: { href?: string }; pull_request?: { href?: string }; self?: { href?: string } }; + body?: string; + commit_id?: string; + created_at?: string; + id?: number; + path?: string; + position?: number; + updated_at?: string; + url?: string; + user?: User; +}[]; + +export type Keys = { id?: number; key?: string; title?: string; url?: string }[]; + +export interface Label { + color?: string; + name?: string; + url?: string; +} + +export type Labels = { color?: string; name?: string; url?: string }[]; + +export type Languages = Record; + +export interface Markdown { + context?: string; + mode?: string; + text?: string; +} + +export interface Merge { + merged?: boolean; + message?: string; + sha?: string; +} + +export interface MergePullBody { + commit_message?: string; +} + +export interface MergesBody { + base?: string; + commit_message?: string; + head?: string; +} + +export interface MergesConflict { + /** Error message */ + message?: string; +} + +export interface MergesSuccessful { + /** A GitHub user */ + author?: User; + comments_url?: string; + commit?: { + author?: { date?: string; email?: string; name?: string }; + comment_count?: number; + committer?: { date?: string; email?: string; name?: string }; + message?: string; + tree?: { sha?: string; url?: string }; + url?: string; + }; + + /** A GitHub user */ + committer?: User; + merged?: boolean; + message?: string; + parents?: { sha?: string; url?: string }[]; + sha?: string; + url?: string; +} + +export interface Meta { + git?: string[]; + hooks?: string[]; +} + +export interface Milestone { + closed_issues?: number; + + /** ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ */ + created_at?: string; + + /** A GitHub user */ + creator?: User; + description?: string; + + /** ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ */ + due_on?: string; + number?: number; + open_issues?: number; + state?: "open" | "closed"; + title?: string; + url?: string; +} + +export interface MilestoneUpdate { + description?: string; + due_on?: string; + state?: string; + title?: string; +} + +export interface NotificationMarkRead { + last_read_at?: string; +} + +export interface Notifications { + id?: number; + last_read_at?: string; + reason?: string; + repository?: { + description?: string; + fork?: boolean; + full_name?: string; + html_url?: string; + id?: number; + name?: string; + owner?: Actor; + private?: boolean; + url?: string; + }; + subject?: { latest_comment_url?: string; title?: string; type?: string; url?: string }; + unread?: boolean; + updated_at?: string; + url?: string; +} + +export interface OrgTeamsPost { + name: string; + permission?: "pull" | "push" | "admin"; + repo_names?: string[]; +} + +/** + * A GitHub organization + */ +export type Organization = Actor; + +export interface OrganizationAsTeamMember { + errors?: { code?: string; field?: string; resource?: string }[]; + message?: string; +} + +export interface ParticipationStats { + all?: number[]; + owner?: number[]; +} + +export interface PatchGist { + description?: string; + files?: { + "delete_this_file.txt"?: string; + "file1.txt"?: { content?: string }; + "new_file.txt"?: { content?: string }; + "old_name.txt"?: { content?: string; filename?: string }; + }; +} + +export interface PatchOrg { + /** Billing email address. This address is not publicized. */ + billing_email?: string; + company?: string; + + /** Publicly visible email address. */ + email?: string; + location?: string; + name?: string; +} + +export interface PostGist { + description?: string; + files?: { "file1.txt"?: { content?: string } }; + public?: boolean; +} + +export interface PostRepo { + /** True to create an initial commit with empty README. Default is false. */ + auto_init?: boolean; + description?: string; + + /** Desired language or platform .gitignore template to apply. Use the name of the template without the extension. For example, "Haskell" Ignored if auto_init parameter is not provided. */ + gitignore_template?: string; + + /** True to enable downloads for this repository, false to disable them. Default is true. */ + has_downloads?: boolean; + + /** True to enable issues for this repository, false to disable them. Default is true. */ + has_issues?: boolean; + + /** True to enable the wiki for this repository, false to disable it. Default is true. */ + has_wiki?: boolean; + homepage?: string; + name: string; + + /** True to create a private repository, false to create a public one. Creating private repositories requires a paid GitHub account. */ + private?: boolean; + + /** The id of the team that will be granted access to this repository. This is only valid when creating a repo in an organization. */ + team_id?: number; +} + +export interface PullRequest { + _links?: { + comments?: { href?: string }; + html?: { href?: string }; + review_comments?: { href?: string }; + self?: { href?: string }; + }; + additions?: number; + base?: { + label?: string; + ref?: string; + repo?: Repo; + sha?: string; + user?: { avatar_url?: string; gravatar_id?: string; id?: number; login?: string; url?: string }; + }; + body?: string; + changed_files?: number; + closed_at?: string; + comments?: number; + commits?: number; + created_at?: string; + deletions?: number; + diff_url?: string; + head?: { + label?: string; + ref?: string; + repo?: Repo; + sha?: string; + user?: { avatar_url?: string; gravatar_id?: string; id?: number; login?: string; url?: string }; + }; + html_url?: string; + issue_url?: string; + merge_commit_sha?: string; + mergeable?: boolean; + merged?: boolean; + merged_at?: string; + merged_by?: { avatar_url?: string; gravatar_id?: string; id?: number; login?: string; url?: string }; + number?: number; + patch_url?: string; + state?: string; + title?: string; + updated_at?: string; + url?: string; + user?: { avatar_url?: string; gravatar_id?: string; id?: number; login?: string; url?: string }; +} + +export interface PullUpdate { + body?: string; + state?: string; + title?: string; +} + +export type Pulls = { + _links?: { + comments?: { href?: string }; + html?: { href?: string }; + review_comments?: { href?: string }; + self?: { href?: string }; + }; + base?: { + label?: string; + ref?: string; + repo?: Repo; + sha?: string; + user?: { avatar_url?: string; gravatar_id?: string; id?: number; login?: string; url?: string }; + }; + body?: string; + closed_at?: string; + created_at?: string; + diff_url?: string; + head?: { + label?: string; + ref?: string; + repo?: Repo; + sha?: string; + user?: { avatar_url?: string; gravatar_id?: string; id?: number; login?: string; url?: string }; + }; + html_url?: string; + issue_url?: string; + merged_at?: string; + number?: number; + patch_url?: string; + state?: "open" | "closed"; + title?: string; + updated_at?: string; + url?: string; + user?: { avatar_url?: string; gravatar_id?: string; id?: number; login?: string; url?: string }; +}[]; + +export interface PullsComment { + _links?: { html?: { href?: string }; pull_request?: { href?: string }; self?: { href?: string } }; + body?: string; + commit_id?: string; + + /** ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ */ + created_at?: string; + id?: number; + path?: string; + position?: number; + + /** ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ */ + updated_at?: string; + url?: string; + user?: { avatar_url?: string; gravatar_id?: string; id?: number; login?: string; url?: string }; +} + +export interface PullsCommentPost { + body?: string; + commit_id?: string; + path?: string; + position?: number; +} + +export type PullsComments = { + _links?: { html?: { href?: string }; pull_request?: { href?: string }; self?: { href?: string } }; + body?: string; + commit_id?: string; + created_at?: string; + id?: number; + path?: string; + position?: number; + updated_at?: string; + url?: string; + user?: { avatar_url?: string; gravatar_id?: string; id?: number; login?: string; url?: string }; +}[]; + +export interface PullsPost { + base?: string; + body?: string; + head?: string; + title?: string; +} + +export interface PutSubscription { + created_at?: string; + ignored?: boolean; + reason?: object; + subscribed?: boolean; + thread_url?: string; + url?: string; +} + +export interface RateLimit { + rate?: { limit?: number; remaining?: number; reset?: number }; +} + +export type Ref = { + created_at?: string; + creator?: { avatar_url?: string; gravatar_id?: string; id?: number; login?: string; url?: string }; + description?: string; + id?: number; + state?: string; + target_url?: string; + updated_at?: string; + url?: string; +}[]; + +export type RefStatus = { + commit_url?: string; + name?: string; + repository_url?: string; + sha?: string; + state?: string; + statuses?: { + context?: string; + created_at?: string; + description?: string; + id?: number; + state?: string; + target_url?: string; + updated_at?: string; + url?: string; + }[]; +}[]; + +export type Refs = { object?: { sha?: string; type?: string; url?: string }; ref?: string; url?: string }[]; + +export interface RefsBody { + ref?: string; + sha?: string; +} + +export interface Release { + assets?: { + content_type?: string; + created_at?: string; + download_count?: number; + id?: number; + label?: string; + name?: string; + size?: number; + state?: string; + updated_at?: string; + uploader?: User; + url?: string; + }[]; + assets_url?: string; + + /** A GitHub user */ + author?: User; + body?: string; + created_at?: string; + draft?: boolean; + html_url?: string; + id?: number; + name?: string; + prerelease?: boolean; + published_at?: string; + tag_name?: string; + tarball_url?: string; + target_commitish?: string; + upload_url?: string; + url?: string; + zipball_url?: string; +} + +export interface ReleaseCreate { + body?: string; + draft?: boolean; + name?: string; + prerelease?: boolean; + tag_name?: string; + target_commitish?: string; +} + +export type Releases = { + assets?: { + content_type?: string; + created_at?: string; + download_count?: number; + id?: number; + label?: string; + name?: string; + size?: number; + state?: string; + updated_at?: string; + uploader?: User; + url?: string; + }[]; + assets_url?: string; + author?: User; + body?: string; + created_at?: string; + draft?: boolean; + html_url?: string; + id?: number; + name?: string; + prerelease?: boolean; + published_at?: string; + tag_name?: string; + tarball_url?: string; + target_commitish?: string; + upload_url?: string; + url?: string; + zipball_url?: string; +}[]; + +export interface Repo { + clone_url?: string; + + /** ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ */ + created_at?: string; + description?: string; + fork?: boolean; + forks?: number; + forks_count?: number; + full_name?: string; + git_url?: string; + has_downloads?: boolean; + has_issues?: boolean; + has_wiki?: boolean; + homepage?: string; + html_url?: string; + id?: number; + language?: string; + master_branch?: string; + mirror_url?: string; + name?: string; + open_issues?: number; + open_issues_count?: number; + + /** A GitHub organization */ + organization?: Organization; + + /** A user or organization */ + owner?: Actor; + + /** Is present when the repo is a fork. Parent is the repo this repo was forked from. */ + parent?: Repo; + private?: boolean; + + /** ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ */ + pushed_at?: string; + size?: number; + + /** Is present when the repo is a fork. Source is the ultimate source for the network. */ + source?: Repo; + ssh_url?: string; + svn_url?: string; + + /** ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ */ + updated_at?: string; + url?: string; + watchers?: number; + watchers_count?: number; +} + +export type RepoDeployments = { + created_at?: string; + creator?: User; + description?: string; + id?: number; + payload?: string; + sha?: string; + statuses_url?: string; + updated_at?: string; + url?: string; +}[]; + +export type RepoComments = { + body?: string; + commit_id?: string; + created_at?: string; + html_url?: string; + id?: number; + line?: number; + path?: string; + position?: number; + updated_at?: string; + url?: string; + user?: User; +}[]; + +export interface RepoCommit { + author?: { date?: string; email?: string; name?: string }; + committer?: { date?: string; email?: string; name?: string }; + message?: string; + parents?: { sha?: string; url?: string }[]; + sha?: string; + tree?: { sha?: string; url?: string }; + url?: string; +} + +export interface RepoCommitBody { + author?: { date?: string; email?: string; name?: string }; + message: string; + parents: string[]; + tree: string; +} + +export interface RepoEdit { + description?: string; + has_downloads?: boolean; + has_issues?: boolean; + has_wiki?: boolean; + homepage?: string; + name?: string; + private?: boolean; +} + +export type Repos = Repo[]; + +export interface SearchCode { + items?: { + git_url?: string; + html_url?: string; + name?: string; + path?: string; + repository?: { + archive_url?: string; + assignees_url?: string; + blobs_url?: string; + branches_url?: string; + collaborators_url?: string; + comments_url?: string; + commits_url?: string; + compare_url?: string; + contents_url?: string; + contributors_url?: string; + description?: string; + downloads_url?: string; + events_url?: string; + fork?: boolean; + forks_url?: string; + full_name?: string; + git_commits_url?: string; + git_refs_url?: string; + git_tags_url?: string; + hooks_url?: string; + html_url?: string; + id?: number; + issue_comment_url?: string; + issue_events_url?: string; + issues_url?: string; + keys_url?: string; + labels_url?: string; + languages_url?: string; + merges_url?: string; + milestones_url?: string; + name?: string; + notifications_url?: string; + owner?: Actor; + private?: boolean; + pulls_url?: string; + stargazers_url?: string; + statuses_url?: string; + subscribers_url?: string; + subscription_url?: string; + tags_url?: string; + teams_url?: string; + trees_url?: string; + url?: string; + }; + score?: number; + sha?: string; + url?: string; + }[]; + total_count?: number; +} + +export interface SearchIssues { + items?: { + assignee?: any; + body?: string; + closed_at?: any; + comments?: number; + comments_url?: string; + created_at?: string; + events_url?: string; + html_url?: string; + id?: number; + labels?: { color?: string; name?: string; url?: string }[]; + labels_url?: string; + milestone?: any; + number?: number; + pull_request?: { diff_url?: any; html_url?: any; patch_url?: any }; + score?: number; + state?: string; + title?: string; + updated_at?: string; + url?: string; + user?: User; + }[]; + total_count?: number; +} + +export interface SearchIssuesByKeyword { + issues?: { + body?: string; + comments?: number; + created_at?: string; + gravatar_id?: string; + html_url?: string; + labels?: string[]; + number?: number; + position?: number; + state?: string; + title?: string; + updated_at?: string; + user?: string; + votes?: number; + }[]; +} + +export interface SearchRepositories { + items?: Repo[]; + total_count?: number; +} + +export interface SearchRepositoriesByKeyword { + repositories?: Repo[]; +} + +export interface SearchUserByEmail { + /** A GitHub user */ + user?: User; +} + +export interface SearchUsers { + items?: Users; + total_count?: number; +} + +export interface SearchUsersByKeyword { + users?: Users; +} + +export interface Subscription { + /** ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ */ + created_at?: string; + ignored?: boolean; + reason?: string; + repository_url?: string; + subscribed?: boolean; + thread_url?: string; + url?: string; +} + +export interface SubscriptionBody { + ignored?: boolean; + subscribed?: boolean; +} + +export interface Tag { + /** String of the tag message. */ + message?: string; + object?: { sha?: string; type?: "commit" | "tree" | "blob"; url?: string }; + sha?: string; + + /** The tag's name. This is typically a version (e.g., "v0.0.1"). */ + tag?: string; + tagger?: { date?: string; email?: string; name?: string }; + url?: string; +} + +export interface TagBody { + /** String of the tag message. */ + message: string; + + /** String of the SHA of the git object this is tagging. */ + object: string; + + /** The tag's name. This is typically a version (e.g., "v0.0.1"). */ + tag: string; + tagger: { date?: string; email?: string; name?: string }; + + /** 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. */ + type: "commit" | "tree" | "blob"; +} + +export type Tags = Tag[]; + +export interface Team { + id?: number; + members_count?: number; + name?: string; + permission?: string; + repos_count?: number; + url?: string; +} + +export interface TeamMembership { + state?: string; + url?: string; +} + +export type TeamRepos = Repos; + +export type Teams = { id?: number; name?: string; url?: string }[]; + +export type TeamsList = { + id?: number; + members_count?: number; + name?: string; + organization?: { avatar_url?: string; id?: number; login?: string; url?: string }; + permission?: string; + repos_count?: number; + url?: string; +}[]; + +export interface Tree { + sha?: string; + tree?: { + mode?: "100644" | "100755" | "040000" | "160000" | "120000"; + path?: string; + sha?: string; + size?: number; + type?: "blob" | "tree" | "commit"; + url?: string; + }[]; + url?: string; +} + +export interface Trees { + base_tree?: string; + + /** SHA1 checksum ID of the object in the tree. */ + sha?: string; + tree?: Tree[]; + url?: string; +} + +/** + * A GitHub user + */ +export type User = Actor; + +export type UserEmails = string[]; + +export interface UserKeysKeyId { + id?: number; + key?: string; + title?: string; + url?: string; +} + +export interface UserKeysPost { + key?: string; + title?: string; +} + +export interface UserUpdate { + bio?: string; + blog?: string; + company?: string; + email?: string; + hireable?: boolean; + location?: string; + name?: string; +} + +export type Users = User[]; + +export type QueryParamsType = Record; +export type ResponseFormat = keyof Omit; + +export interface FullRequestParams extends Omit { + /** set parameter to `true` for call `securityWorker` for this request */ + secure?: boolean; + /** request path */ + path: string; + /** content type of request body */ + type?: ContentType; + /** query params */ + query?: QueryParamsType; + /** format of response (i.e. response.json() -> format: "json") */ + format?: ResponseFormat; + /** request body */ + body?: unknown; + /** base url */ + baseUrl?: string; + /** request cancellation token */ + cancelToken?: CancelToken; +} + +export type RequestParams = Omit; + +export interface ApiConfig { + baseUrl?: string; + baseApiParams?: Omit; + securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; + customFetch?: typeof fetch; +} + +export interface HttpResponse extends Response { + data: D; + error: E; +} + +type CancelToken = Symbol | string | number; + +export enum ContentType { + Json = "application/json", + FormData = "multipart/form-data", + UrlEncoded = "application/x-www-form-urlencoded", +} + +export class HttpClient { + public baseUrl: string = "https://api.github.com"; + private securityData: SecurityDataType | null = null; + private securityWorker?: ApiConfig["securityWorker"]; + private abortControllers = new Map(); + private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); + + private baseApiParams: RequestParams = { + credentials: "same-origin", + headers: {}, + redirect: "follow", + referrerPolicy: "no-referrer", + }; + + constructor(apiConfig: ApiConfig = {}) { + Object.assign(this, apiConfig); + } + + public setSecurityData = (data: SecurityDataType | null) => { + this.securityData = data; + }; + + protected encodeQueryParam(key: string, value: any) { + const encodedKey = encodeURIComponent(key); + return `${encodedKey}=${encodeURIComponent(typeof value === "number" ? value : `${value}`)}`; + } + + protected addQueryParam(query: QueryParamsType, key: string) { + return this.encodeQueryParam(key, query[key]); + } + + protected addArrayQueryParam(query: QueryParamsType, key: string) { + const value = query[key]; + return value.map((v: any) => this.encodeQueryParam(key, v)).join("&"); + } + + protected toQueryString(rawQuery?: QueryParamsType): string { + const query = rawQuery || {}; + const keys = Object.keys(query).filter((key) => "undefined" !== typeof query[key]); + return keys + .map((key) => (Array.isArray(query[key]) ? this.addArrayQueryParam(query, key) : this.addQueryParam(query, key))) + .join("&"); + } + + protected addQueryParams(rawQuery?: QueryParamsType): string { + const queryString = this.toQueryString(rawQuery); + return queryString ? `?${queryString}` : ""; + } + + private contentFormatters: Record any> = { + [ContentType.Json]: (input: any) => + input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, + [ContentType.FormData]: (input: any) => + Object.keys(input || {}).reduce((formData, key) => { + const property = input[key]; + formData.append( + key, + property instanceof Blob + ? property + : typeof property === "object" && property !== null + ? JSON.stringify(property) + : `${property}`, + ); + return formData; + }, new FormData()), + [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), + }; + + protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + return { + ...this.baseApiParams, + ...params1, + ...(params2 || {}), + headers: { + ...(this.baseApiParams.headers || {}), + ...(params1.headers || {}), + ...((params2 && params2.headers) || {}), + }, + }; + } + + protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + if (this.abortControllers.has(cancelToken)) { + const abortController = this.abortControllers.get(cancelToken); + if (abortController) { + return abortController.signal; + } + return void 0; + } + + const abortController = new AbortController(); + this.abortControllers.set(cancelToken, abortController); + return abortController.signal; + }; + + public abortRequest = (cancelToken: CancelToken) => { + const abortController = this.abortControllers.get(cancelToken); + + if (abortController) { + abortController.abort(); + this.abortControllers.delete(cancelToken); + } + }; + + public request = async ({ + body, + secure, + path, + type, + query, + format, + baseUrl, + cancelToken, + ...params + }: FullRequestParams): Promise> => { + const secureParams = + ((typeof secure === "boolean" ? secure : this.baseApiParams.secure) && + this.securityWorker && + (await this.securityWorker(this.securityData))) || + {}; + const requestParams = this.mergeRequestParams(params, secureParams); + const queryString = query && this.toQueryString(query); + const payloadFormatter = this.contentFormatters[type || ContentType.Json]; + const responseFormat = format || requestParams.format; + + return this.customFetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, { + ...requestParams, + headers: { + ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), + ...(requestParams.headers || {}), + }, + signal: cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal, + body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), + }).then(async (response) => { + const r = response as HttpResponse; + r.data = null as unknown as T; + r.error = null as unknown as E; + + const data = !responseFormat + ? r + : await response[responseFormat]() + .then((data) => { + if (r.ok) { + r.data = data; + } else { + r.error = data; + } + return r; + }) + .catch((e) => { + r.error = e; + return r; + }); + + if (cancelToken) { + this.abortControllers.delete(cancelToken); + } + + if (!response.ok) throw data; + return data; + }); + }; +} + +/** + * @title GitHub + * @version v3 + * @baseUrl https://api.github.com + * @externalDocs https://developer.github.com/v3/ + * + * Powerful collaboration, code review, and code management for open source and private projects. + */ +export class Api extends HttpClient { + emojis = { + /** + * @description Lists all the emojis available to use on GitHub. + * + * @name EmojisList + * @request GET:/emojis + */ + emojisList: (params: RequestParams = {}) => + this.request({ + path: `/emojis`, + method: "GET", + format: "json", + ...params, + }), + }; + events = { + /** + * @description List public events. + * + * @name EventsList + * @request GET:/events + */ + eventsList: (params: RequestParams = {}) => + this.request({ + path: `/events`, + method: "GET", + format: "json", + ...params, + }), + }; + feeds = { + /** + * @description List Feeds. GitHub provides several timeline resources in Atom format. The Feeds API lists all the feeds available to the authenticating user. + * + * @name FeedsList + * @request GET:/feeds + */ + feedsList: (params: RequestParams = {}) => + this.request({ + path: `/feeds`, + method: "GET", + format: "json", + ...params, + }), + }; + gists = { + /** + * @description List the authenticated user's gists or if called anonymously, this will return all public gists. + * + * @name GistsList + * @request GET:/gists + */ + gistsList: (query?: { since?: string }, params: RequestParams = {}) => + this.request({ + path: `/gists`, + method: "GET", + query: query, + format: "json", + ...params, + }), + + /** + * @description Create a gist. + * + * @name GistsCreate + * @request POST:/gists + */ + gistsCreate: (body: PostGist, params: RequestParams = {}) => + this.request({ + path: `/gists`, + method: "POST", + body: body, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description List all public gists. + * + * @name PublicList + * @request GET:/gists/public + */ + publicList: (query?: { since?: string }, params: RequestParams = {}) => + this.request({ + path: `/gists/public`, + method: "GET", + query: query, + format: "json", + ...params, + }), + + /** + * @description List the authenticated user's starred gists. + * + * @name StarredList + * @request GET:/gists/starred + */ + starredList: (query?: { since?: string }, params: RequestParams = {}) => + this.request({ + path: `/gists/starred`, + method: "GET", + query: query, + format: "json", + ...params, + }), + + /** + * @description Delete a gist. + * + * @name GistsDelete + * @request DELETE:/gists/{id} + */ + gistsDelete: (id: number, params: RequestParams = {}) => + this.request({ + path: `/gists/${id}`, + method: "DELETE", + ...params, + }), + + /** + * @description Get a single gist. + * + * @name GistsDetail + * @request GET:/gists/{id} + */ + gistsDetail: (id: number, params: RequestParams = {}) => + this.request({ + path: `/gists/${id}`, + method: "GET", + format: "json", + ...params, + }), + + /** + * @description Edit a gist. + * + * @name GistsPartialUpdate + * @request PATCH:/gists/{id} + */ + gistsPartialUpdate: (id: number, body: PatchGist, params: RequestParams = {}) => + this.request({ + path: `/gists/${id}`, + method: "PATCH", + body: body, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description List comments on a gist. + * + * @name CommentsDetail + * @request GET:/gists/{id}/comments + */ + commentsDetail: (id: number, params: RequestParams = {}) => + this.request({ + path: `/gists/${id}/comments`, + method: "GET", + format: "json", + ...params, + }), + + /** + * @description Create a commen + * + * @name CommentsCreate + * @request POST:/gists/{id}/comments + */ + commentsCreate: (id: number, body: CommentBody, params: RequestParams = {}) => + this.request({ + path: `/gists/${id}/comments`, + method: "POST", + body: body, + format: "json", + ...params, + }), + + /** + * @description Delete a comment. + * + * @name CommentsDelete + * @request DELETE:/gists/{id}/comments/{commentId} + */ + commentsDelete: (id: number, commentId: number, params: RequestParams = {}) => + this.request({ + path: `/gists/${id}/comments/${commentId}`, + method: "DELETE", + ...params, + }), + + /** + * @description Get a single comment. + * + * @name CommentsDetail2 + * @request GET:/gists/{id}/comments/{commentId} + * @originalName commentsDetail + * @duplicate + */ + commentsDetail2: (id: number, commentId: number, params: RequestParams = {}) => + this.request({ + path: `/gists/${id}/comments/${commentId}`, + method: "GET", + format: "json", + ...params, + }), + + /** + * @description Edit a comment. + * + * @name CommentsPartialUpdate + * @request PATCH:/gists/{id}/comments/{commentId} + */ + commentsPartialUpdate: (id: number, commentId: number, body: Comment, params: RequestParams = {}) => + this.request({ + path: `/gists/${id}/comments/${commentId}`, + method: "PATCH", + body: body, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Fork a gist. + * + * @name ForksCreate + * @request POST:/gists/{id}/forks + */ + forksCreate: (id: number, params: RequestParams = {}) => + this.request({ + path: `/gists/${id}/forks`, + method: "POST", + ...params, + }), + + /** + * @description Unstar a gist. + * + * @name StarDelete + * @request DELETE:/gists/{id}/star + */ + starDelete: (id: number, params: RequestParams = {}) => + this.request({ + path: `/gists/${id}/star`, + method: "DELETE", + ...params, + }), + + /** + * @description Check if a gist is starred. + * + * @name StarDetail + * @request GET:/gists/{id}/star + */ + starDetail: (id: number, params: RequestParams = {}) => + this.request({ + path: `/gists/${id}/star`, + method: "GET", + ...params, + }), + + /** + * @description Star a gist. + * + * @name StarUpdate + * @request PUT:/gists/{id}/star + */ + starUpdate: (id: number, params: RequestParams = {}) => + this.request({ + path: `/gists/${id}/star`, + method: "PUT", + ...params, + }), + }; + gitignore = { + /** + * @description Listing available templates. List all templates available to pass as an option when creating a repository. + * + * @name TemplatesList + * @request GET:/gitignore/templates + */ + templatesList: (params: RequestParams = {}) => + this.request({ + path: `/gitignore/templates`, + method: "GET", + format: "json", + ...params, + }), + + /** + * @description Get a single template. + * + * @name TemplatesDetail + * @request GET:/gitignore/templates/{language} + */ + templatesDetail: (language: string, params: RequestParams = {}) => + this.request({ + path: `/gitignore/templates/${language}`, + method: "GET", + format: "json", + ...params, + }), + }; + issues = { + /** + * @description List issues. List all issues across all the authenticated user's visible repositories. + * + * @name IssuesList + * @request GET:/issues + */ + issuesList: ( + query: { + filter: "assigned" | "created" | "mentioned" | "subscribed" | "all"; + state: "open" | "closed"; + labels: string; + sort: "created" | "updated" | "comments"; + direction: "asc" | "desc"; + since?: string; + }, + params: RequestParams = {}, + ) => + this.request({ + path: `/issues`, + method: "GET", + query: query, + format: "json", + ...params, + }), + }; + legacy = { + /** + * @description Find issues by state and keyword. + * + * @name IssuesSearchDetail + * @request GET:/legacy/issues/search/{owner}/{repository}/{state}/{keyword} + * @deprecated + */ + issuesSearchDetail: ( + keyword: string, + state: "open" | "closed", + owner: string, + repository: string, + params: RequestParams = {}, + ) => + this.request({ + path: `/legacy/issues/search/${owner}/${repository}/${state}/${keyword}`, + method: "GET", + format: "json", + ...params, + }), + + /** + * @description Find repositories by keyword. Note, this legacy method does not follow the v3 pagination pattern. This method returns up to 100 results per page and pages can be fetched using the start_page parameter. + * + * @name ReposSearchDetail + * @request GET:/legacy/repos/search/{keyword} + * @deprecated + */ + reposSearchDetail: ( + keyword: string, + query?: { order?: "desc" | "asc"; language?: string; start_page?: string; sort?: "updated" | "stars" | "forks" }, + params: RequestParams = {}, + ) => + this.request({ + path: `/legacy/repos/search/${keyword}`, + method: "GET", + query: query, + format: "json", + ...params, + }), + + /** + * @description This API call is added for compatibility reasons only. + * + * @name UserEmailDetail + * @request GET:/legacy/user/email/{email} + * @deprecated + */ + userEmailDetail: (email: string, params: RequestParams = {}) => + this.request({ + path: `/legacy/user/email/${email}`, + method: "GET", + format: "json", + ...params, + }), + + /** + * @description Find users by keyword. + * + * @name UserSearchDetail + * @request GET:/legacy/user/search/{keyword} + * @deprecated + */ + userSearchDetail: ( + keyword: string, + query?: { order?: "desc" | "asc"; start_page?: string; sort?: "updated" | "stars" | "forks" }, + params: RequestParams = {}, + ) => + this.request({ + path: `/legacy/user/search/${keyword}`, + method: "GET", + query: query, + format: "json", + ...params, + }), + }; + markdown = { + /** + * @description Render an arbitrary Markdown document + * + * @name MarkdownCreate + * @request POST:/markdown + */ + markdownCreate: (body: Markdown, params: RequestParams = {}) => + this.request({ + path: `/markdown`, + method: "POST", + body: body, + type: ContentType.Json, + ...params, + }), + + /** + * @description Render a Markdown document in raw mode + * + * @name PostMarkdown + * @request POST:/markdown/raw + */ + postMarkdown: (params: RequestParams = {}) => + this.request({ + path: `/markdown/raw`, + method: "POST", + ...params, + }), + }; + meta = { + /** + * @description This gives some information about GitHub.com, the service. + * + * @name MetaList + * @request GET:/meta + */ + metaList: (params: RequestParams = {}) => + this.request({ + path: `/meta`, + method: "GET", + format: "json", + ...params, + }), + }; + networks = { + /** + * @description List public events for a network of repositories. + * + * @name EventsDetail + * @request GET:/networks/{owner}/{repo}/events + */ + eventsDetail: (owner: string, repo: string, params: RequestParams = {}) => + this.request({ + path: `/networks/${owner}/${repo}/events`, + method: "GET", + format: "json", + ...params, + }), + }; + notifications = { + /** + * @description List your notifications. List all notifications for the current user, grouped by repository. + * + * @name NotificationsList + * @request GET:/notifications + */ + notificationsList: ( + query?: { all?: boolean; participating?: boolean; since?: string }, + params: RequestParams = {}, + ) => + this.request({ + path: `/notifications`, + method: "GET", + query: query, + format: "json", + ...params, + }), + + /** + * @description Mark as read. Marking a notification as "read" removes it from the default view on GitHub.com. + * + * @name NotificationsUpdate + * @request PUT:/notifications + */ + notificationsUpdate: (body: NotificationMarkRead, params: RequestParams = {}) => + this.request({ + path: `/notifications`, + method: "PUT", + body: body, + ...params, + }), + + /** + * @description View a single thread. + * + * @name ThreadsDetail + * @request GET:/notifications/threads/{id} + */ + threadsDetail: (id: number, params: RequestParams = {}) => + this.request({ + path: `/notifications/threads/${id}`, + method: "GET", + format: "json", + ...params, + }), + + /** + * @description Mark a thread as read + * + * @name ThreadsPartialUpdate + * @request PATCH:/notifications/threads/{id} + */ + threadsPartialUpdate: (id: number, params: RequestParams = {}) => + this.request({ + path: `/notifications/threads/${id}`, + method: "PATCH", + ...params, + }), + + /** + * @description Delete a Thread Subscription. + * + * @name ThreadsSubscriptionDelete + * @request DELETE:/notifications/threads/{id}/subscription + */ + threadsSubscriptionDelete: (id: number, params: RequestParams = {}) => + this.request({ + path: `/notifications/threads/${id}/subscription`, + method: "DELETE", + ...params, + }), + + /** + * @description Get a Thread Subscription. + * + * @name ThreadsSubscriptionDetail + * @request GET:/notifications/threads/{id}/subscription + */ + threadsSubscriptionDetail: (id: number, params: RequestParams = {}) => + this.request({ + path: `/notifications/threads/${id}/subscription`, + method: "GET", + format: "json", + ...params, + }), + + /** + * @description Set a Thread Subscription. This lets you subscribe to a thread, or ignore it. Subscribing to a thread is unnecessary if the user is already subscribed to the repository. Ignoring a thread will mute all future notifications (until you comment or get @mentioned). + * + * @name ThreadsSubscriptionUpdate + * @request PUT:/notifications/threads/{id}/subscription + */ + threadsSubscriptionUpdate: (id: number, body: PutSubscription, params: RequestParams = {}) => + this.request({ + path: `/notifications/threads/${id}/subscription`, + method: "PUT", + body: body, + type: ContentType.Json, + format: "json", + ...params, + }), + }; + orgs = { + /** + * @description Get an Organization. + * + * @name OrgsDetail + * @request GET:/orgs/{org} + */ + orgsDetail: (org: string, params: RequestParams = {}) => + this.request({ + path: `/orgs/${org}`, + method: "GET", + format: "json", + ...params, + }), + + /** + * @description Edit an Organization. + * + * @name OrgsPartialUpdate + * @request PATCH:/orgs/{org} + */ + orgsPartialUpdate: (org: string, body: PatchOrg, params: RequestParams = {}) => + this.request({ + path: `/orgs/${org}`, + method: "PATCH", + body: body, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description List public events for an organization. + * + * @name EventsDetail + * @request GET:/orgs/{org}/events + */ + eventsDetail: (org: string, params: RequestParams = {}) => + this.request({ + path: `/orgs/${org}/events`, + method: "GET", + format: "json", + ...params, + }), + + /** + * @description List issues. List all issues for a given organization for the authenticated user. + * + * @name IssuesDetail + * @request GET:/orgs/{org}/issues + */ + issuesDetail: ( + org: string, + query: { + filter: "assigned" | "created" | "mentioned" | "subscribed" | "all"; + state: "open" | "closed"; + labels: string; + sort: "created" | "updated" | "comments"; + direction: "asc" | "desc"; + since?: string; + }, + params: RequestParams = {}, + ) => + this.request({ + path: `/orgs/${org}/issues`, + method: "GET", + query: query, + format: "json", + ...params, + }), + + /** + * @description Members list. List all users who are members of an organization. A member is a user tha belongs to at least 1 team in the organization. If the authenticated user is also an owner of this organization then both concealed and public members will be returned. If the requester is not an owner of the organization the query will be redirected to the public members list. + * + * @name MembersDetail + * @request GET:/orgs/{org}/members + */ + membersDetail: (org: string, params: RequestParams = {}) => + this.request({ + path: `/orgs/${org}/members`, + method: "GET", + format: "json", + ...params, + }), + + /** + * @description Remove a member. Removing a user from this list will remove them from all teams and they will no longer have any access to the organization's repositories. + * + * @name MembersDelete + * @request DELETE:/orgs/{org}/members/{username} + */ + membersDelete: (org: string, username: string, params: RequestParams = {}) => + this.request({ + path: `/orgs/${org}/members/${username}`, + method: "DELETE", + ...params, + }), + + /** + * @description Check if a user is, publicly or privately, a member of the organization. + * + * @name MembersDetail2 + * @request GET:/orgs/{org}/members/{username} + * @originalName membersDetail + * @duplicate + */ + membersDetail2: (org: string, username: string, params: RequestParams = {}) => + this.request({ + path: `/orgs/${org}/members/${username}`, + method: "GET", + ...params, + }), + + /** + * @description Public members list. Members of an organization can choose to have their membership publicized or not. + * + * @name PublicMembersDetail + * @request GET:/orgs/{org}/public_members + */ + publicMembersDetail: (org: string, params: RequestParams = {}) => + this.request({ + path: `/orgs/${org}/public_members`, + method: "GET", + format: "json", + ...params, + }), + + /** + * @description Conceal a user's membership. + * + * @name PublicMembersDelete + * @request DELETE:/orgs/{org}/public_members/{username} + */ + publicMembersDelete: (org: string, username: string, params: RequestParams = {}) => + this.request({ + path: `/orgs/${org}/public_members/${username}`, + method: "DELETE", + ...params, + }), + + /** + * @description Check public membership. + * + * @name PublicMembersDetail2 + * @request GET:/orgs/{org}/public_members/{username} + * @originalName publicMembersDetail + * @duplicate + */ + publicMembersDetail2: (org: string, username: string, params: RequestParams = {}) => + this.request({ + path: `/orgs/${org}/public_members/${username}`, + method: "GET", + ...params, + }), + + /** + * @description Publicize a user's membership. + * + * @name PublicMembersUpdate + * @request PUT:/orgs/{org}/public_members/{username} + */ + publicMembersUpdate: (org: string, username: string, params: RequestParams = {}) => + this.request({ + path: `/orgs/${org}/public_members/${username}`, + method: "PUT", + ...params, + }), + + /** + * @description List repositories for the specified org. + * + * @name ReposDetail + * @request GET:/orgs/{org}/repos + */ + reposDetail: ( + org: string, + query?: { type?: "all" | "public" | "private" | "forks" | "sources" | "member" }, + params: RequestParams = {}, + ) => + this.request({ + path: `/orgs/${org}/repos`, + method: "GET", + query: query, + format: "json", + ...params, + }), + + /** + * @description Create a new repository for the authenticated user. OAuth users must supply repo scope. + * + * @name ReposCreate + * @request POST:/orgs/{org}/repos + */ + reposCreate: (org: string, body: PostRepo, params: RequestParams = {}) => + this.request({ + path: `/orgs/${org}/repos`, + method: "POST", + body: body, + format: "json", + ...params, + }), + + /** + * @description List teams. + * + * @name TeamsDetail + * @request GET:/orgs/{org}/teams + */ + teamsDetail: (org: string, params: RequestParams = {}) => + this.request({ + path: `/orgs/${org}/teams`, + method: "GET", + format: "json", + ...params, + }), + + /** + * @description Create team. In order to create a team, the authenticated user must be an owner of organization. + * + * @name TeamsCreate + * @request POST:/orgs/{org}/teams + */ + teamsCreate: (org: string, body: OrgTeamsPost, params: RequestParams = {}) => + this.request({ + path: `/orgs/${org}/teams`, + method: "POST", + body: body, + type: ContentType.Json, + format: "json", + ...params, + }), + }; + rateLimit = { + /** + * @description Get your current rate limit status Note: Accessing this endpoint does not count against your rate limit. + * + * @name RateLimitList + * @request GET:/rate_limit + */ + rateLimitList: (params: RequestParams = {}) => + this.request({ + path: `/rate_limit`, + method: "GET", + format: "json", + ...params, + }), + }; + repos = { + /** + * @description Delete a Repository. Deleting a repository requires admin access. If OAuth is used, the delete_repo scope is required. + * + * @name ReposDelete + * @request DELETE:/repos/{owner}/{repo} + */ + reposDelete: (owner: string, repo: string, params: RequestParams = {}) => + this.request({ + path: `/repos/${owner}/${repo}`, + method: "DELETE", + ...params, + }), + + /** + * @description Get repository. + * + * @name ReposDetail + * @request GET:/repos/{owner}/{repo} + */ + reposDetail: (owner: string, repo: string, params: RequestParams = {}) => + this.request({ + path: `/repos/${owner}/${repo}`, + method: "GET", + format: "json", + ...params, + }), + + /** + * @description Edit repository. + * + * @name ReposPartialUpdate + * @request PATCH:/repos/{owner}/{repo} + */ + reposPartialUpdate: (owner: string, repo: string, body: RepoEdit, params: RequestParams = {}) => + this.request({ + path: `/repos/${owner}/${repo}`, + method: "PATCH", + body: body, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description List assignees. This call lists all the available assignees (owner + collaborators) to which issues may be assigned. + * + * @name AssigneesDetail + * @request GET:/repos/{owner}/{repo}/assignees + */ + assigneesDetail: (owner: string, repo: string, params: RequestParams = {}) => + this.request({ + path: `/repos/${owner}/${repo}/assignees`, + method: "GET", + format: "json", + ...params, + }), + + /** + * @description Check assignee. You may also check to see if a particular user is an assignee for a repository. + * + * @name AssigneesDetail2 + * @request GET:/repos/{owner}/{repo}/assignees/{assignee} + * @originalName assigneesDetail + * @duplicate + */ + assigneesDetail2: (owner: string, repo: string, assignee: string, params: RequestParams = {}) => + this.request({ + path: `/repos/${owner}/${repo}/assignees/${assignee}`, + method: "GET", + ...params, + }), + + /** + * @description Get list of branches + * + * @name BranchesDetail + * @request GET:/repos/{owner}/{repo}/branches + */ + branchesDetail: (owner: string, repo: string, params: RequestParams = {}) => + this.request({ + path: `/repos/${owner}/${repo}/branches`, + method: "GET", + format: "json", + ...params, + }), + + /** + * @description Get Branch + * + * @name BranchesDetail2 + * @request GET:/repos/{owner}/{repo}/branches/{branch} + * @originalName branchesDetail + * @duplicate + */ + branchesDetail2: (owner: string, repo: string, branch: string, params: RequestParams = {}) => + this.request({ + path: `/repos/${owner}/${repo}/branches/${branch}`, + method: "GET", + format: "json", + ...params, + }), + + /** + * @description List. When authenticating as an organization owner of an organization-owned repository, all organization owners are included in the list of collaborators. Otherwise, only users with access to the repository are returned in the collaborators list. + * + * @name CollaboratorsDetail + * @request GET:/repos/{owner}/{repo}/collaborators + */ + collaboratorsDetail: (owner: string, repo: string, params: RequestParams = {}) => + this.request({ + path: `/repos/${owner}/${repo}/collaborators`, + method: "GET", + format: "json", + ...params, + }), + + /** + * @description Remove collaborator. + * + * @name CollaboratorsDelete + * @request DELETE:/repos/{owner}/{repo}/collaborators/{user} + */ + collaboratorsDelete: (owner: string, repo: string, user: string, params: RequestParams = {}) => + this.request({ + path: `/repos/${owner}/${repo}/collaborators/${user}`, + method: "DELETE", + ...params, + }), + + /** + * @description Check if user is a collaborator + * + * @name CollaboratorsDetail2 + * @request GET:/repos/{owner}/{repo}/collaborators/{user} + * @originalName collaboratorsDetail + * @duplicate + */ + collaboratorsDetail2: (owner: string, repo: string, user: string, params: RequestParams = {}) => + this.request({ + path: `/repos/${owner}/${repo}/collaborators/${user}`, + method: "GET", + ...params, + }), + + /** + * @description Add collaborator. + * + * @name CollaboratorsUpdate + * @request PUT:/repos/{owner}/{repo}/collaborators/{user} + */ + collaboratorsUpdate: (owner: string, repo: string, user: string, params: RequestParams = {}) => + this.request({ + path: `/repos/${owner}/${repo}/collaborators/${user}`, + method: "PUT", + ...params, + }), + + /** + * @description List commit comments for a repository. Comments are ordered by ascending ID. + * + * @name CommentsDetail + * @request GET:/repos/{owner}/{repo}/comments + */ + commentsDetail: (owner: string, repo: string, params: RequestParams = {}) => + this.request({ + path: `/repos/${owner}/${repo}/comments`, + method: "GET", + format: "json", + ...params, + }), + + /** + * @description Delete a commit comment + * + * @name CommentsDelete + * @request DELETE:/repos/{owner}/{repo}/comments/{commentId} + */ + commentsDelete: (owner: string, repo: string, commentId: number, params: RequestParams = {}) => + this.request({ + path: `/repos/${owner}/${repo}/comments/${commentId}`, + method: "DELETE", + ...params, + }), + + /** + * @description Get a single commit comment. + * + * @name CommentsDetail2 + * @request GET:/repos/{owner}/{repo}/comments/{commentId} + * @originalName commentsDetail + * @duplicate + */ + commentsDetail2: (owner: string, repo: string, commentId: number, params: RequestParams = {}) => + this.request({ + path: `/repos/${owner}/${repo}/comments/${commentId}`, + method: "GET", + format: "json", + ...params, + }), + + /** + * @description Update a commit comment. + * + * @name CommentsPartialUpdate + * @request PATCH:/repos/{owner}/{repo}/comments/{commentId} + */ + commentsPartialUpdate: ( + owner: string, + repo: string, + commentId: number, + body: CommentBody, + params: RequestParams = {}, + ) => + this.request({ + path: `/repos/${owner}/${repo}/comments/${commentId}`, + method: "PATCH", + body: body, + format: "json", + ...params, + }), + + /** + * @description List commits on a repository. + * + * @name CommitsDetail + * @request GET:/repos/{owner}/{repo}/commits + */ + commitsDetail: ( + owner: string, + repo: string, + query?: { since?: string; sha?: string; path?: string; author?: string; until?: string }, + params: RequestParams = {}, + ) => + this.request({ + path: `/repos/${owner}/${repo}/commits`, + method: "GET", + query: query, + format: "json", + ...params, + }), + + /** + * @description Get the combined Status for a specific Ref The Combined status endpoint is currently available for developers to preview. During the preview period, the API may change without advance notice. Please see the blog post for full details. To access this endpoint during the preview period, you must provide a custom media type in the Accept header: application/vnd.github.she-hulk-preview+json + * + * @name CommitsStatusDetail + * @request GET:/repos/{owner}/{repo}/commits/{ref}/status + */ + commitsStatusDetail: (owner: string, repo: string, ref: string, params: RequestParams = {}) => + this.request({ + path: `/repos/${owner}/${repo}/commits/${ref}/status`, + method: "GET", + format: "json", + ...params, + }), + + /** + * @description Get a single commit. + * + * @name CommitsDetail2 + * @request GET:/repos/{owner}/{repo}/commits/{shaCode} + * @originalName commitsDetail + * @duplicate + */ + commitsDetail2: (owner: string, repo: string, shaCode: string, params: RequestParams = {}) => + this.request({ + path: `/repos/${owner}/${repo}/commits/${shaCode}`, + method: "GET", + format: "json", + ...params, + }), + + /** + * @description List comments for a single commitList comments for a single commit. + * + * @name CommitsCommentsDetail + * @request GET:/repos/{owner}/{repo}/commits/{shaCode}/comments + */ + commitsCommentsDetail: (owner: string, repo: string, shaCode: string, params: RequestParams = {}) => + this.request({ + path: `/repos/${owner}/${repo}/commits/${shaCode}/comments`, + method: "GET", + format: "json", + ...params, + }), + + /** + * @description Create a commit comment. + * + * @name CommitsCommentsCreate + * @request POST:/repos/{owner}/{repo}/commits/{shaCode}/comments + */ + commitsCommentsCreate: ( + owner: string, + repo: string, + shaCode: string, + body: CommitCommentBody, + params: RequestParams = {}, + ) => + this.request({ + path: `/repos/${owner}/${repo}/commits/${shaCode}/comments`, + method: "POST", + body: body, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Compare two commits + * + * @name CompareDetail + * @request GET:/repos/{owner}/{repo}/compare/{baseId}...{headId} + */ + compareDetail: (owner: string, repo: string, baseId: string, headId: string, params: RequestParams = {}) => + this.request({ + path: `/repos/${owner}/${repo}/compare/${baseId}...${headId}`, + method: "GET", + format: "json", + ...params, + }), + + /** + * @description Delete a file. This method deletes a file in a repository. + * + * @name ContentsDelete + * @request DELETE:/repos/{owner}/{repo}/contents/{path} + */ + contentsDelete: (owner: string, repo: string, path: string, body: DeleteFileBody, params: RequestParams = {}) => + this.request({ + path: `/repos/${owner}/${repo}/contents/${path}`, + method: "DELETE", + body: body, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Get contents. This method returns the contents of a file or directory in a repository. Files and symlinks support a custom media type for getting the raw content. Directories and submodules do not support custom media types. Note: This API supports files up to 1 megabyte in size. Here can be many outcomes. For details see "http://developer.github.com/v3/repos/contents/" + * + * @name ContentsDetail + * @request GET:/repos/{owner}/{repo}/contents/{path} + */ + contentsDetail: ( + owner: string, + repo: string, + path: string, + query?: { path?: string; ref?: string }, + params: RequestParams = {}, + ) => + this.request({ + path: `/repos/${owner}/${repo}/contents/${path}`, + method: "GET", + query: query, + format: "json", + ...params, + }), + + /** + * @description Create a file. + * + * @name ContentsUpdate + * @request PUT:/repos/{owner}/{repo}/contents/{path} + */ + contentsUpdate: (owner: string, repo: string, path: string, body: CreateFileBody, params: RequestParams = {}) => + this.request({ + path: `/repos/${owner}/${repo}/contents/${path}`, + method: "PUT", + body: body, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Get list of contributors. + * + * @name ContributorsDetail + * @request GET:/repos/{owner}/{repo}/contributors + */ + contributorsDetail: (owner: string, repo: string, query: { anon: string }, params: RequestParams = {}) => + this.request({ + path: `/repos/${owner}/${repo}/contributors`, + method: "GET", + query: query, + format: "json", + ...params, + }), + + /** + * @description Users with pull access can view deployments for a repository + * + * @name DeploymentsDetail + * @request GET:/repos/{owner}/{repo}/deployments + */ + deploymentsDetail: (owner: string, repo: string, params: RequestParams = {}) => + this.request({ + path: `/repos/${owner}/${repo}/deployments`, + method: "GET", + format: "json", + ...params, + }), + + /** + * @description Users with push access can create a deployment for a given ref + * + * @name DeploymentsCreate + * @request POST:/repos/{owner}/{repo}/deployments + */ + deploymentsCreate: (owner: string, repo: string, body: Deployment, params: RequestParams = {}) => + this.request({ + path: `/repos/${owner}/${repo}/deployments`, + method: "POST", + body: body, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Users with pull access can view deployment statuses for a deployment + * + * @name DeploymentsStatusesDetail + * @request GET:/repos/{owner}/{repo}/deployments/{id}/statuses + */ + deploymentsStatusesDetail: (owner: string, repo: string, id: number, params: RequestParams = {}) => + this.request({ + path: `/repos/${owner}/${repo}/deployments/${id}/statuses`, + method: "GET", + format: "json", + ...params, + }), + + /** + * @description Create a Deployment Status Users with push access can create deployment statuses for a given deployment: + * + * @name DeploymentsStatusesCreate + * @request POST:/repos/{owner}/{repo}/deployments/{id}/statuses + */ + deploymentsStatusesCreate: ( + owner: string, + repo: string, + id: number, + body: DeploymentStatusesCreate, + params: RequestParams = {}, + ) => + this.request({ + path: `/repos/${owner}/${repo}/deployments/${id}/statuses`, + method: "POST", + body: body, + type: ContentType.Json, + ...params, + }), + + /** + * @description Deprecated. List downloads for a repository. + * + * @name DownloadsDetail + * @request GET:/repos/{owner}/{repo}/downloads + * @deprecated + */ + downloadsDetail: (owner: string, repo: string, params: RequestParams = {}) => + this.request({ + path: `/repos/${owner}/${repo}/downloads`, + method: "GET", + format: "json", + ...params, + }), + + /** + * @description Deprecated. Delete a download. + * + * @name DownloadsDelete + * @request DELETE:/repos/{owner}/{repo}/downloads/{downloadId} + * @deprecated + */ + downloadsDelete: (owner: string, repo: string, downloadId: number, params: RequestParams = {}) => + this.request({ + path: `/repos/${owner}/${repo}/downloads/${downloadId}`, + method: "DELETE", + ...params, + }), + + /** + * @description Deprecated. Get a single download. + * + * @name DownloadsDetail2 + * @request GET:/repos/{owner}/{repo}/downloads/{downloadId} + * @deprecated + * @originalName downloadsDetail + * @duplicate + */ + downloadsDetail2: (owner: string, repo: string, downloadId: number, params: RequestParams = {}) => + this.request({ + path: `/repos/${owner}/${repo}/downloads/${downloadId}`, + method: "GET", + format: "json", + ...params, + }), + + /** + * @description Get list of repository events. + * + * @name EventsDetail + * @request GET:/repos/{owner}/{repo}/events + */ + eventsDetail: (owner: string, repo: string, params: RequestParams = {}) => + this.request({ + path: `/repos/${owner}/${repo}/events`, + method: "GET", + format: "json", + ...params, + }), + + /** + * @description List forks. + * + * @name ForksDetail + * @request GET:/repos/{owner}/{repo}/forks + */ + forksDetail: ( + owner: string, + repo: string, + query?: { sort?: "newes" | "oldes" | "watchers" }, + params: RequestParams = {}, + ) => + this.request({ + path: `/repos/${owner}/${repo}/forks`, + method: "GET", + query: query, + format: "json", + ...params, + }), + + /** + * @description Create a fork. Forking a Repository happens asynchronously. Therefore, you may have to wai a short period before accessing the git objects. If this takes longer than 5 minutes, be sure to contact Support. + * + * @name ForksCreate + * @request POST:/repos/{owner}/{repo}/forks + */ + forksCreate: (owner: string, repo: string, body: ForkBody, params: RequestParams = {}) => + this.request({ + path: `/repos/${owner}/${repo}/forks`, + method: "POST", + body: body, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Create a Blob. + * + * @name GitBlobsCreate + * @request POST:/repos/{owner}/{repo}/git/blobs + */ + gitBlobsCreate: (owner: string, repo: string, body: Blob, params: RequestParams = {}) => + this.request({ + path: `/repos/${owner}/${repo}/git/blobs`, + method: "POST", + body: body, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Get a Blob. Since blobs can be any arbitrary binary data, the input and responses for the blob API takes an encoding parameter that can be either utf-8 or base64. If your data cannot be losslessly sent as a UTF-8 string, you can base64 encode it. + * + * @name GitBlobsDetail + * @request GET:/repos/{owner}/{repo}/git/blobs/{shaCode} + */ + gitBlobsDetail: (owner: string, repo: string, shaCode: string, params: RequestParams = {}) => + this.request({ + path: `/repos/${owner}/${repo}/git/blobs/${shaCode}`, + method: "GET", + format: "json", + ...params, + }), + + /** + * @description Create a Commit. + * + * @name GitCommitsCreate + * @request POST:/repos/{owner}/{repo}/git/commits + */ + gitCommitsCreate: (owner: string, repo: string, body: RepoCommitBody, params: RequestParams = {}) => + this.request({ + path: `/repos/${owner}/${repo}/git/commits`, + method: "POST", + body: body, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Get a Commit. + * + * @name GitCommitsDetail + * @request GET:/repos/{owner}/{repo}/git/commits/{shaCode} + */ + gitCommitsDetail: (owner: string, repo: string, shaCode: string, params: RequestParams = {}) => + this.request({ + path: `/repos/${owner}/${repo}/git/commits/${shaCode}`, + method: "GET", + format: "json", + ...params, + }), + + /** + * @description Get all References + * + * @name GitRefsDetail + * @request GET:/repos/{owner}/{repo}/git/refs + */ + gitRefsDetail: (owner: string, repo: string, params: RequestParams = {}) => + this.request({ + path: `/repos/${owner}/${repo}/git/refs`, + method: "GET", + format: "json", + ...params, + }), + + /** + * @description Create a Reference + * + * @name GitRefsCreate + * @request POST:/repos/{owner}/{repo}/git/refs + */ + gitRefsCreate: (owner: string, repo: string, body: RefsBody, params: RequestParams = {}) => + this.request({ + path: `/repos/${owner}/${repo}/git/refs`, + method: "POST", + body: body, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Delete a Reference Example: Deleting a branch: DELETE /repos/octocat/Hello-World/git/refs/heads/feature-a Example: Deleting a tag: DELETE /repos/octocat/Hello-World/git/refs/tags/v1.0 + * + * @name GitRefsDelete + * @request DELETE:/repos/{owner}/{repo}/git/refs/{ref} + */ + gitRefsDelete: (owner: string, repo: string, ref: string, params: RequestParams = {}) => + this.request({ + path: `/repos/${owner}/${repo}/git/refs/${ref}`, + method: "DELETE", + ...params, + }), + + /** + * @description Get a Reference + * + * @name GitRefsDetail2 + * @request GET:/repos/{owner}/{repo}/git/refs/{ref} + * @originalName gitRefsDetail + * @duplicate + */ + gitRefsDetail2: (owner: string, repo: string, ref: string, params: RequestParams = {}) => + this.request({ + path: `/repos/${owner}/${repo}/git/refs/${ref}`, + method: "GET", + format: "json", + ...params, + }), + + /** + * @description Update a Reference + * + * @name GitRefsPartialUpdate + * @request PATCH:/repos/{owner}/{repo}/git/refs/{ref} + */ + gitRefsPartialUpdate: (owner: string, repo: string, ref: string, body: GitRefPatch, params: RequestParams = {}) => + this.request({ + path: `/repos/${owner}/${repo}/git/refs/${ref}`, + method: "PATCH", + body: body, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Create a Tag Object. Note that creating a tag object does not create the reference that makes a tag in Git. If you want to create an annotated tag in Git, you have to do this call to create the tag object, and then create the refs/tags/[tag] reference. If you want to create a lightweight tag, you only have to create the tag reference - this call would be unnecessary. + * + * @name GitTagsCreate + * @request POST:/repos/{owner}/{repo}/git/tags + */ + gitTagsCreate: (owner: string, repo: string, body: TagBody, params: RequestParams = {}) => + this.request({ + path: `/repos/${owner}/${repo}/git/tags`, + method: "POST", + body: body, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Get a Tag. + * + * @name GitTagsDetail + * @request GET:/repos/{owner}/{repo}/git/tags/{shaCode} + */ + gitTagsDetail: (owner: string, repo: string, shaCode: string, params: RequestParams = {}) => + this.request({ + path: `/repos/${owner}/${repo}/git/tags/${shaCode}`, + method: "GET", + format: "json", + ...params, + }), + + /** + * @description Create a Tree. The tree creation API will take nested entries as well. If both a tree and a nested path modifying that tree are specified, it will overwrite the contents of that tree with the new path contents and write a new tree out. + * + * @name GitTreesCreate + * @request POST:/repos/{owner}/{repo}/git/trees + */ + gitTreesCreate: (owner: string, repo: string, body: Tree, params: RequestParams = {}) => + this.request({ + path: `/repos/${owner}/${repo}/git/trees`, + method: "POST", + body: body, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Get a Tree. + * + * @name GitTreesDetail + * @request GET:/repos/{owner}/{repo}/git/trees/{shaCode} + */ + gitTreesDetail: ( + owner: string, + repo: string, + shaCode: string, + query?: { recursive?: number }, + params: RequestParams = {}, + ) => + this.request({ + path: `/repos/${owner}/${repo}/git/trees/${shaCode}`, + method: "GET", + query: query, + format: "json", + ...params, + }), + + /** + * @description Get list of hooks. + * + * @name HooksDetail + * @request GET:/repos/{owner}/{repo}/hooks + */ + hooksDetail: (owner: string, repo: string, params: RequestParams = {}) => + this.request({ + path: `/repos/${owner}/${repo}/hooks`, + method: "GET", + format: "json", + ...params, + }), + + /** + * @description Create a hook. + * + * @name HooksCreate + * @request POST:/repos/{owner}/{repo}/hooks + */ + hooksCreate: (owner: string, repo: string, body: HookBody, params: RequestParams = {}) => + this.request({ + path: `/repos/${owner}/${repo}/hooks`, + method: "POST", + body: body, + format: "json", + ...params, + }), + + /** + * @description Delete a hook. + * + * @name HooksDelete + * @request DELETE:/repos/{owner}/{repo}/hooks/{hookId} + */ + hooksDelete: (owner: string, repo: string, hookId: number, params: RequestParams = {}) => + this.request({ + path: `/repos/${owner}/${repo}/hooks/${hookId}`, + method: "DELETE", + ...params, + }), + + /** + * @description Get single hook. + * + * @name HooksDetail2 + * @request GET:/repos/{owner}/{repo}/hooks/{hookId} + * @originalName hooksDetail + * @duplicate + */ + hooksDetail2: (owner: string, repo: string, hookId: number, params: RequestParams = {}) => + this.request({ + path: `/repos/${owner}/${repo}/hooks/${hookId}`, + method: "GET", + format: "json", + ...params, + }), + + /** + * @description Edit a hook. + * + * @name HooksPartialUpdate + * @request PATCH:/repos/{owner}/{repo}/hooks/{hookId} + */ + hooksPartialUpdate: (owner: string, repo: string, hookId: number, body: HookBody, params: RequestParams = {}) => + this.request({ + path: `/repos/${owner}/${repo}/hooks/${hookId}`, + method: "PATCH", + body: body, + format: "json", + ...params, + }), + + /** + * @description Test a push hook. This will trigger the hook with the latest push to the current repository if the hook is subscribed to push events. If the hook is not subscribed to push events, the server will respond with 204 but no test POST will be generated. Note: Previously /repos/:owner/:repo/hooks/:id/tes + * + * @name HooksTestsCreate + * @request POST:/repos/{owner}/{repo}/hooks/{hookId}/tests + */ + hooksTestsCreate: (owner: string, repo: string, hookId: number, params: RequestParams = {}) => + this.request({ + path: `/repos/${owner}/${repo}/hooks/${hookId}/tests`, + method: "POST", + ...params, + }), + + /** + * @description List issues for a repository. + * + * @name IssuesDetail + * @request GET:/repos/{owner}/{repo}/issues + */ + issuesDetail: ( + owner: string, + repo: string, + query: { + filter: "assigned" | "created" | "mentioned" | "subscribed" | "all"; + state: "open" | "closed"; + labels: string; + sort: "created" | "updated" | "comments"; + direction: "asc" | "desc"; + since?: string; + }, + params: RequestParams = {}, + ) => + this.request({ + path: `/repos/${owner}/${repo}/issues`, + method: "GET", + query: query, + format: "json", + ...params, + }), + + /** + * @description Create an issue. Any user with pull access to a repository can create an issue. + * + * @name IssuesCreate + * @request POST:/repos/{owner}/{repo}/issues + */ + issuesCreate: (owner: string, repo: string, body: Issue, params: RequestParams = {}) => + this.request({ + path: `/repos/${owner}/${repo}/issues`, + method: "POST", + body: body, + format: "json", + ...params, + }), + + /** + * @description List comments in a repository. + * + * @name IssuesCommentsDetail + * @request GET:/repos/{owner}/{repo}/issues/comments + */ + issuesCommentsDetail: ( + owner: string, + repo: string, + query?: { direction?: string; sort?: "created" | "updated"; since?: string }, + params: RequestParams = {}, + ) => + this.request({ + path: `/repos/${owner}/${repo}/issues/comments`, + method: "GET", + query: query, + format: "json", + ...params, + }), + + /** + * @description Delete a comment. + * + * @name IssuesCommentsDelete + * @request DELETE:/repos/{owner}/{repo}/issues/comments/{commentId} + */ + issuesCommentsDelete: (owner: string, repo: string, commentId: number, params: RequestParams = {}) => + this.request({ + path: `/repos/${owner}/${repo}/issues/comments/${commentId}`, + method: "DELETE", + ...params, + }), + + /** + * @description Get a single comment. + * + * @name IssuesCommentsDetail2 + * @request GET:/repos/{owner}/{repo}/issues/comments/{commentId} + * @originalName issuesCommentsDetail + * @duplicate + */ + issuesCommentsDetail2: (owner: string, repo: string, commentId: number, params: RequestParams = {}) => + this.request({ + path: `/repos/${owner}/${repo}/issues/comments/${commentId}`, + method: "GET", + format: "json", + ...params, + }), + + /** + * @description Edit a comment. + * + * @name IssuesCommentsPartialUpdate + * @request PATCH:/repos/{owner}/{repo}/issues/comments/{commentId} + */ + issuesCommentsPartialUpdate: ( + owner: string, + repo: string, + commentId: number, + body: CommentBody, + params: RequestParams = {}, + ) => + this.request({ + path: `/repos/${owner}/${repo}/issues/comments/${commentId}`, + method: "PATCH", + body: body, + format: "json", + ...params, + }), + + /** + * @description List issue events for a repository. + * + * @name IssuesEventsDetail + * @request GET:/repos/{owner}/{repo}/issues/events + */ + issuesEventsDetail: (owner: string, repo: string, params: RequestParams = {}) => + this.request({ + path: `/repos/${owner}/${repo}/issues/events`, + method: "GET", + format: "json", + ...params, + }), + + /** + * @description Get a single event. + * + * @name IssuesEventsDetail2 + * @request GET:/repos/{owner}/{repo}/issues/events/{eventId} + * @originalName issuesEventsDetail + * @duplicate + */ + issuesEventsDetail2: (owner: string, repo: string, eventId: number, params: RequestParams = {}) => + this.request({ + path: `/repos/${owner}/${repo}/issues/events/${eventId}`, + method: "GET", + format: "json", + ...params, + }), + + /** + * @description Get a single issue + * + * @name IssuesDetail2 + * @request GET:/repos/{owner}/{repo}/issues/{number} + * @originalName issuesDetail + * @duplicate + */ + issuesDetail2: (owner: string, repo: string, number: number, params: RequestParams = {}) => + this.request({ + path: `/repos/${owner}/${repo}/issues/${number}`, + method: "GET", + format: "json", + ...params, + }), + + /** + * @description Edit an issue. Issue owners and users with push access can edit an issue. + * + * @name IssuesPartialUpdate + * @request PATCH:/repos/{owner}/{repo}/issues/{number} + */ + issuesPartialUpdate: (owner: string, repo: string, number: number, body: Issue, params: RequestParams = {}) => + this.request({ + path: `/repos/${owner}/${repo}/issues/${number}`, + method: "PATCH", + body: body, + format: "json", + ...params, + }), + + /** + * @description List comments on an issue. + * + * @name IssuesCommentsDetail3 + * @request GET:/repos/{owner}/{repo}/issues/{number}/comments + * @originalName issuesCommentsDetail + * @duplicate + */ + issuesCommentsDetail3: (owner: string, repo: string, number: number, params: RequestParams = {}) => + this.request({ + path: `/repos/${owner}/${repo}/issues/${number}/comments`, + method: "GET", + format: "json", + ...params, + }), + + /** + * @description Create a comment. + * + * @name IssuesCommentsCreate + * @request POST:/repos/{owner}/{repo}/issues/{number}/comments + */ + issuesCommentsCreate: ( + owner: string, + repo: string, + number: number, + body: CommentBody, + params: RequestParams = {}, + ) => + this.request({ + path: `/repos/${owner}/${repo}/issues/${number}/comments`, + method: "POST", + body: body, + format: "json", + ...params, + }), + + /** + * @description List events for an issue. + * + * @name IssuesEventsDetail3 + * @request GET:/repos/{owner}/{repo}/issues/{number}/events + * @originalName issuesEventsDetail + * @duplicate + */ + issuesEventsDetail3: (owner: string, repo: string, number: number, params: RequestParams = {}) => + this.request({ + path: `/repos/${owner}/${repo}/issues/${number}/events`, + method: "GET", + format: "json", + ...params, + }), + + /** + * @description Remove all labels from an issue. + * + * @name IssuesLabelsDelete + * @request DELETE:/repos/{owner}/{repo}/issues/{number}/labels + */ + issuesLabelsDelete: (owner: string, repo: string, number: number, params: RequestParams = {}) => + this.request({ + path: `/repos/${owner}/${repo}/issues/${number}/labels`, + method: "DELETE", + ...params, + }), + + /** + * @description List labels on an issue. + * + * @name IssuesLabelsDetail + * @request GET:/repos/{owner}/{repo}/issues/{number}/labels + */ + issuesLabelsDetail: (owner: string, repo: string, number: number, params: RequestParams = {}) => + this.request({ + path: `/repos/${owner}/${repo}/issues/${number}/labels`, + method: "GET", + format: "json", + ...params, + }), + + /** + * @description Add labels to an issue. + * + * @name IssuesLabelsCreate + * @request POST:/repos/{owner}/{repo}/issues/{number}/labels + */ + issuesLabelsCreate: (owner: string, repo: string, number: number, body: EmailsPost, params: RequestParams = {}) => + this.request({ + path: `/repos/${owner}/${repo}/issues/${number}/labels`, + method: "POST", + body: body, + format: "json", + ...params, + }), + + /** + * @description Replace all labels for an issue. Sending an empty array ([]) will remove all Labels from the Issue. + * + * @name IssuesLabelsUpdate + * @request PUT:/repos/{owner}/{repo}/issues/{number}/labels + */ + issuesLabelsUpdate: (owner: string, repo: string, number: number, body: EmailsPost, params: RequestParams = {}) => + this.request({ + path: `/repos/${owner}/${repo}/issues/${number}/labels`, + method: "PUT", + body: body, + format: "json", + ...params, + }), + + /** + * @description Remove a label from an issue. + * + * @name IssuesLabelsDelete2 + * @request DELETE:/repos/{owner}/{repo}/issues/{number}/labels/{name} + * @originalName issuesLabelsDelete + * @duplicate + */ + issuesLabelsDelete2: (owner: string, repo: string, number: number, name: string, params: RequestParams = {}) => + this.request({ + path: `/repos/${owner}/${repo}/issues/${number}/labels/${name}`, + method: "DELETE", + ...params, + }), + + /** + * @description Get list of keys. + * + * @name KeysDetail + * @request GET:/repos/{owner}/{repo}/keys + */ + keysDetail: (owner: string, repo: string, params: RequestParams = {}) => + this.request({ + path: `/repos/${owner}/${repo}/keys`, + method: "GET", + format: "json", + ...params, + }), + + /** + * @description Create a key. + * + * @name KeysCreate + * @request POST:/repos/{owner}/{repo}/keys + */ + keysCreate: (owner: string, repo: string, body: UserKeysPost, params: RequestParams = {}) => + this.request({ + path: `/repos/${owner}/${repo}/keys`, + method: "POST", + body: body, + format: "json", + ...params, + }), + + /** + * @description Delete a key. + * + * @name KeysDelete + * @request DELETE:/repos/{owner}/{repo}/keys/{keyId} + */ + keysDelete: (owner: string, repo: string, keyId: number, params: RequestParams = {}) => + this.request({ + path: `/repos/${owner}/${repo}/keys/${keyId}`, + method: "DELETE", + ...params, + }), + + /** + * @description Get a key + * + * @name KeysDetail2 + * @request GET:/repos/{owner}/{repo}/keys/{keyId} + * @originalName keysDetail + * @duplicate + */ + keysDetail2: (owner: string, repo: string, keyId: number, params: RequestParams = {}) => + this.request({ + path: `/repos/${owner}/${repo}/keys/${keyId}`, + method: "GET", + format: "json", + ...params, + }), + + /** + * @description List all labels for this repository. + * + * @name LabelsDetail + * @request GET:/repos/{owner}/{repo}/labels + */ + labelsDetail: (owner: string, repo: string, params: RequestParams = {}) => + this.request({ + path: `/repos/${owner}/${repo}/labels`, + method: "GET", + format: "json", + ...params, + }), + + /** + * @description Create a label. + * + * @name LabelsCreate + * @request POST:/repos/{owner}/{repo}/labels + */ + labelsCreate: (owner: string, repo: string, body: EmailsPost, params: RequestParams = {}) => + this.request({ + path: `/repos/${owner}/${repo}/labels`, + method: "POST", + body: body, + format: "json", + ...params, + }), + + /** + * @description Delete a label. + * + * @name LabelsDelete + * @request DELETE:/repos/{owner}/{repo}/labels/{name} + */ + labelsDelete: (owner: string, repo: string, name: string, params: RequestParams = {}) => + this.request({ + path: `/repos/${owner}/${repo}/labels/${name}`, + method: "DELETE", + ...params, + }), + + /** + * @description Get a single label. + * + * @name LabelsDetail2 + * @request GET:/repos/{owner}/{repo}/labels/{name} + * @originalName labelsDetail + * @duplicate + */ + labelsDetail2: (owner: string, repo: string, name: string, params: RequestParams = {}) => + this.request({ + path: `/repos/${owner}/${repo}/labels/${name}`, + method: "GET", + format: "json", + ...params, + }), + + /** + * @description Update a label. + * + * @name LabelsPartialUpdate + * @request PATCH:/repos/{owner}/{repo}/labels/{name} + */ + labelsPartialUpdate: (owner: string, repo: string, name: string, body: EmailsPost, params: RequestParams = {}) => + this.request({ + path: `/repos/${owner}/${repo}/labels/${name}`, + method: "PATCH", + body: body, + format: "json", + ...params, + }), + + /** + * @description List languages. List languages for the specified repository. The value on the right of a language is the number of bytes of code written in that language. + * + * @name LanguagesDetail + * @request GET:/repos/{owner}/{repo}/languages + */ + languagesDetail: (owner: string, repo: string, params: RequestParams = {}) => + this.request({ + path: `/repos/${owner}/${repo}/languages`, + method: "GET", + format: "json", + ...params, + }), + + /** + * @description Perform a merge. + * + * @name MergesCreate + * @request POST:/repos/{owner}/{repo}/merges + */ + mergesCreate: (owner: string, repo: string, body: MergesBody, params: RequestParams = {}) => + this.request({ + path: `/repos/${owner}/${repo}/merges`, + method: "POST", + body: body, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description List milestones for a repository. + * + * @name MilestonesDetail + * @request GET:/repos/{owner}/{repo}/milestones + */ + milestonesDetail: ( + owner: string, + repo: string, + query?: { state?: "open" | "closed"; direction?: string; sort?: "due_date" | "completeness" }, + params: RequestParams = {}, + ) => + this.request({ + path: `/repos/${owner}/${repo}/milestones`, + method: "GET", + query: query, + format: "json", + ...params, + }), + + /** + * @description Create a milestone. + * + * @name MilestonesCreate + * @request POST:/repos/{owner}/{repo}/milestones + */ + milestonesCreate: (owner: string, repo: string, body: MilestoneUpdate, params: RequestParams = {}) => + this.request({ + path: `/repos/${owner}/${repo}/milestones`, + method: "POST", + body: body, + format: "json", + ...params, + }), + + /** + * @description Delete a milestone. + * + * @name MilestonesDelete + * @request DELETE:/repos/{owner}/{repo}/milestones/{number} + */ + milestonesDelete: (owner: string, repo: string, number: number, params: RequestParams = {}) => + this.request({ + path: `/repos/${owner}/${repo}/milestones/${number}`, + method: "DELETE", + ...params, + }), + + /** + * @description Get a single milestone. + * + * @name MilestonesDetail2 + * @request GET:/repos/{owner}/{repo}/milestones/{number} + * @originalName milestonesDetail + * @duplicate + */ + milestonesDetail2: (owner: string, repo: string, number: number, params: RequestParams = {}) => + this.request({ + path: `/repos/${owner}/${repo}/milestones/${number}`, + method: "GET", + format: "json", + ...params, + }), + + /** + * @description Update a milestone. + * + * @name MilestonesPartialUpdate + * @request PATCH:/repos/{owner}/{repo}/milestones/{number} + */ + milestonesPartialUpdate: ( + owner: string, + repo: string, + number: number, + body: MilestoneUpdate, + params: RequestParams = {}, + ) => + this.request({ + path: `/repos/${owner}/${repo}/milestones/${number}`, + method: "PATCH", + body: body, + format: "json", + ...params, + }), + + /** + * @description Get labels for every issue in a milestone. + * + * @name MilestonesLabelsDetail + * @request GET:/repos/{owner}/{repo}/milestones/{number}/labels + */ + milestonesLabelsDetail: (owner: string, repo: string, number: number, params: RequestParams = {}) => + this.request({ + path: `/repos/${owner}/${repo}/milestones/${number}/labels`, + method: "GET", + format: "json", + ...params, + }), + + /** + * @description List your notifications in a repository List all notifications for the current user. + * + * @name NotificationsDetail + * @request GET:/repos/{owner}/{repo}/notifications + */ + notificationsDetail: ( + owner: string, + repo: string, + query?: { all?: boolean; participating?: boolean; since?: string }, + params: RequestParams = {}, + ) => + this.request({ + path: `/repos/${owner}/${repo}/notifications`, + method: "GET", + query: query, + format: "json", + ...params, + }), + + /** + * @description Mark notifications as read in a repository. Marking all notifications in a repository as "read" removes them from the default view on GitHub.com. + * + * @name NotificationsUpdate + * @request PUT:/repos/{owner}/{repo}/notifications + */ + notificationsUpdate: (owner: string, repo: string, body: NotificationMarkRead, params: RequestParams = {}) => + this.request({ + path: `/repos/${owner}/${repo}/notifications`, + method: "PUT", + body: body, + ...params, + }), + + /** + * @description List pull requests. + * + * @name PullsDetail + * @request GET:/repos/{owner}/{repo}/pulls + */ + pullsDetail: ( + owner: string, + repo: string, + query?: { state?: "open" | "closed"; head?: string; base?: string }, + params: RequestParams = {}, + ) => + this.request({ + path: `/repos/${owner}/${repo}/pulls`, + method: "GET", + query: query, + format: "json", + ...params, + }), + + /** + * @description Create a pull request. + * + * @name PullsCreate + * @request POST:/repos/{owner}/{repo}/pulls + */ + pullsCreate: (owner: string, repo: string, body: PullsPost, params: RequestParams = {}) => + this.request({ + path: `/repos/${owner}/${repo}/pulls`, + method: "POST", + body: body, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description List comments in a repository. By default, Review Comments are ordered by ascending ID. + * + * @name PullsCommentsDetail + * @request GET:/repos/{owner}/{repo}/pulls/comments + */ + pullsCommentsDetail: ( + owner: string, + repo: string, + query?: { direction?: string; sort?: "created" | "updated"; since?: string }, + params: RequestParams = {}, + ) => + this.request({ + path: `/repos/${owner}/${repo}/pulls/comments`, + method: "GET", + query: query, + format: "json", + ...params, + }), + + /** + * @description Delete a comment. + * + * @name PullsCommentsDelete + * @request DELETE:/repos/{owner}/{repo}/pulls/comments/{commentId} + */ + pullsCommentsDelete: (owner: string, repo: string, commentId: number, params: RequestParams = {}) => + this.request({ + path: `/repos/${owner}/${repo}/pulls/comments/${commentId}`, + method: "DELETE", + ...params, + }), + + /** + * @description Get a single comment. + * + * @name PullsCommentsDetail2 + * @request GET:/repos/{owner}/{repo}/pulls/comments/{commentId} + * @originalName pullsCommentsDetail + * @duplicate + */ + pullsCommentsDetail2: (owner: string, repo: string, commentId: number, params: RequestParams = {}) => + this.request({ + path: `/repos/${owner}/${repo}/pulls/comments/${commentId}`, + method: "GET", + format: "json", + ...params, + }), + + /** + * @description Edit a comment. + * + * @name PullsCommentsPartialUpdate + * @request PATCH:/repos/{owner}/{repo}/pulls/comments/{commentId} + */ + pullsCommentsPartialUpdate: ( + owner: string, + repo: string, + commentId: number, + body: CommentBody, + params: RequestParams = {}, + ) => + this.request({ + path: `/repos/${owner}/${repo}/pulls/comments/${commentId}`, + method: "PATCH", + body: body, + format: "json", + ...params, + }), + + /** + * @description Get a single pull request. + * + * @name PullsDetail2 + * @request GET:/repos/{owner}/{repo}/pulls/{number} + * @originalName pullsDetail + * @duplicate + */ + pullsDetail2: (owner: string, repo: string, number: number, params: RequestParams = {}) => + this.request({ + path: `/repos/${owner}/${repo}/pulls/${number}`, + method: "GET", + format: "json", + ...params, + }), + + /** + * @description Update a pull request. + * + * @name PullsPartialUpdate + * @request PATCH:/repos/{owner}/{repo}/pulls/{number} + */ + pullsPartialUpdate: (owner: string, repo: string, number: number, body: PullUpdate, params: RequestParams = {}) => + this.request({ + path: `/repos/${owner}/${repo}/pulls/${number}`, + method: "PATCH", + body: body, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description List comments on a pull request. + * + * @name PullsCommentsDetail3 + * @request GET:/repos/{owner}/{repo}/pulls/{number}/comments + * @originalName pullsCommentsDetail + * @duplicate + */ + pullsCommentsDetail3: (owner: string, repo: string, number: number, params: RequestParams = {}) => + this.request({ + path: `/repos/${owner}/${repo}/pulls/${number}/comments`, + method: "GET", + format: "json", + ...params, + }), + + /** + * @description Create a comment. #TODO Alternative input ( http://developer.github.com/v3/pulls/comments/ ) description: | Alternative Input. Instead of passing commit_id, path, and position you can reply to an existing Pull Request Comment like this: body Required string in_reply_to Required number - Comment id to reply to. + * + * @name PullsCommentsCreate + * @request POST:/repos/{owner}/{repo}/pulls/{number}/comments + */ + pullsCommentsCreate: ( + owner: string, + repo: string, + number: number, + body: PullsCommentPost, + params: RequestParams = {}, + ) => + this.request({ + path: `/repos/${owner}/${repo}/pulls/${number}/comments`, + method: "POST", + body: body, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description List commits on a pull request. + * + * @name PullsCommitsDetail + * @request GET:/repos/{owner}/{repo}/pulls/{number}/commits + */ + pullsCommitsDetail: (owner: string, repo: string, number: number, params: RequestParams = {}) => + this.request({ + path: `/repos/${owner}/${repo}/pulls/${number}/commits`, + method: "GET", + format: "json", + ...params, + }), + + /** + * @description List pull requests files. + * + * @name PullsFilesDetail + * @request GET:/repos/{owner}/{repo}/pulls/{number}/files + */ + pullsFilesDetail: (owner: string, repo: string, number: number, params: RequestParams = {}) => + this.request({ + path: `/repos/${owner}/${repo}/pulls/${number}/files`, + method: "GET", + format: "json", + ...params, + }), + + /** + * @description Get if a pull request has been merged. + * + * @name PullsMergeDetail + * @request GET:/repos/{owner}/{repo}/pulls/{number}/merge + */ + pullsMergeDetail: (owner: string, repo: string, number: number, params: RequestParams = {}) => + this.request({ + path: `/repos/${owner}/${repo}/pulls/${number}/merge`, + method: "GET", + ...params, + }), + + /** + * @description Merge a pull request (Merge Button's) + * + * @name PullsMergeUpdate + * @request PUT:/repos/{owner}/{repo}/pulls/{number}/merge + */ + pullsMergeUpdate: (owner: string, repo: string, number: number, body: MergePullBody, params: RequestParams = {}) => + this.request({ + path: `/repos/${owner}/${repo}/pulls/${number}/merge`, + method: "PUT", + body: body, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Get the README. This method returns the preferred README for a repository. + * + * @name ReadmeDetail + * @request GET:/repos/{owner}/{repo}/readme + */ + readmeDetail: (owner: string, repo: string, query?: { ref?: string }, params: RequestParams = {}) => + this.request({ + path: `/repos/${owner}/${repo}/readme`, + method: "GET", + query: query, + format: "json", + ...params, + }), + + /** + * @description Users with push access to the repository will receive all releases (i.e., published releases and draft releases). Users with pull access will receive published releases only + * + * @name ReleasesDetail + * @request GET:/repos/{owner}/{repo}/releases + */ + releasesDetail: (owner: string, repo: string, params: RequestParams = {}) => + this.request({ + path: `/repos/${owner}/${repo}/releases`, + method: "GET", + format: "json", + ...params, + }), + + /** + * @description Create a release Users with push access to the repository can create a release. + * + * @name ReleasesCreate + * @request POST:/repos/{owner}/{repo}/releases + */ + releasesCreate: (owner: string, repo: string, body: ReleaseCreate, params: RequestParams = {}) => + this.request({ + path: `/repos/${owner}/${repo}/releases`, + method: "POST", + body: body, + format: "json", + ...params, + }), + + /** + * @description Delete a release asset + * + * @name ReleasesAssetsDelete + * @request DELETE:/repos/{owner}/{repo}/releases/assets/{id} + */ + releasesAssetsDelete: (owner: string, repo: string, id: string, params: RequestParams = {}) => + this.request({ + path: `/repos/${owner}/${repo}/releases/assets/${id}`, + method: "DELETE", + ...params, + }), + + /** + * @description Get a single release asset + * + * @name ReleasesAssetsDetail + * @request GET:/repos/{owner}/{repo}/releases/assets/{id} + */ + releasesAssetsDetail: (owner: string, repo: string, id: string, params: RequestParams = {}) => + this.request({ + path: `/repos/${owner}/${repo}/releases/assets/${id}`, + method: "GET", + format: "json", + ...params, + }), + + /** + * @description Edit a release asset Users with push access to the repository can edit a release asset. + * + * @name ReleasesAssetsPartialUpdate + * @request PATCH:/repos/{owner}/{repo}/releases/assets/{id} + */ + releasesAssetsPartialUpdate: ( + owner: string, + repo: string, + id: string, + body: AssetPatch, + params: RequestParams = {}, + ) => + this.request({ + path: `/repos/${owner}/${repo}/releases/assets/${id}`, + method: "PATCH", + body: body, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Users with push access to the repository can delete a release. + * + * @name ReleasesDelete + * @request DELETE:/repos/{owner}/{repo}/releases/{id} + */ + releasesDelete: (owner: string, repo: string, id: string, params: RequestParams = {}) => + this.request({ + path: `/repos/${owner}/${repo}/releases/${id}`, + method: "DELETE", + ...params, + }), + + /** + * @description Get a single release + * + * @name ReleasesDetail2 + * @request GET:/repos/{owner}/{repo}/releases/{id} + * @originalName releasesDetail + * @duplicate + */ + releasesDetail2: (owner: string, repo: string, id: string, params: RequestParams = {}) => + this.request({ + path: `/repos/${owner}/${repo}/releases/${id}`, + method: "GET", + format: "json", + ...params, + }), + + /** + * @description Users with push access to the repository can edit a release + * + * @name ReleasesPartialUpdate + * @request PATCH:/repos/{owner}/{repo}/releases/{id} + */ + releasesPartialUpdate: (owner: string, repo: string, id: string, body: ReleaseCreate, params: RequestParams = {}) => + this.request({ + path: `/repos/${owner}/${repo}/releases/${id}`, + method: "PATCH", + body: body, + format: "json", + ...params, + }), + + /** + * @description List assets for a release + * + * @name ReleasesAssetsDetail2 + * @request GET:/repos/{owner}/{repo}/releases/{id}/assets + * @originalName releasesAssetsDetail + * @duplicate + */ + releasesAssetsDetail2: (owner: string, repo: string, id: string, params: RequestParams = {}) => + this.request({ + path: `/repos/${owner}/${repo}/releases/${id}/assets`, + method: "GET", + format: "json", + ...params, + }), + + /** + * @description List Stargazers. + * + * @name StargazersDetail + * @request GET:/repos/{owner}/{repo}/stargazers + */ + stargazersDetail: (owner: string, repo: string, params: RequestParams = {}) => + this.request({ + path: `/repos/${owner}/${repo}/stargazers`, + method: "GET", + format: "json", + ...params, + }), + + /** + * @description Get the number of additions and deletions per week. Returns a weekly aggregate of the number of additions and deletions pushed to a repository. + * + * @name StatsCodeFrequencyDetail + * @request GET:/repos/{owner}/{repo}/stats/code_frequency + */ + statsCodeFrequencyDetail: (owner: string, repo: string, params: RequestParams = {}) => + this.request({ + path: `/repos/${owner}/${repo}/stats/code_frequency`, + method: "GET", + format: "json", + ...params, + }), + + /** + * @description Get the last year of commit activity data. Returns the last year of commit activity grouped by week. The days array is a group of commits per day, starting on Sunday. + * + * @name StatsCommitActivityDetail + * @request GET:/repos/{owner}/{repo}/stats/commit_activity + */ + statsCommitActivityDetail: (owner: string, repo: string, params: RequestParams = {}) => + this.request({ + path: `/repos/${owner}/${repo}/stats/commit_activity`, + method: "GET", + format: "json", + ...params, + }), + + /** + * @description Get contributors list with additions, deletions, and commit counts. + * + * @name StatsContributorsDetail + * @request GET:/repos/{owner}/{repo}/stats/contributors + */ + statsContributorsDetail: (owner: string, repo: string, params: RequestParams = {}) => + this.request({ + path: `/repos/${owner}/${repo}/stats/contributors`, + method: "GET", + format: "json", + ...params, + }), + + /** + * @description Get the weekly commit count for the repo owner and everyone else. + * + * @name StatsParticipationDetail + * @request GET:/repos/{owner}/{repo}/stats/participation + */ + statsParticipationDetail: (owner: string, repo: string, params: RequestParams = {}) => + this.request({ + path: `/repos/${owner}/${repo}/stats/participation`, + method: "GET", + format: "json", + ...params, + }), + + /** + * @description Get the number of commits per hour in each day. Each array contains the day number, hour number, and number of commits 0-6 Sunday - Saturday 0-23 Hour of day Number of commits For example, [2, 14, 25] indicates that there were 25 total commits, during the 2.00pm hour on Tuesdays. All times are based on the time zone of individual commits. + * + * @name StatsPunchCardDetail + * @request GET:/repos/{owner}/{repo}/stats/punch_card + */ + statsPunchCardDetail: (owner: string, repo: string, params: RequestParams = {}) => + this.request({ + path: `/repos/${owner}/${repo}/stats/punch_card`, + method: "GET", + format: "json", + ...params, + }), + + /** + * @description List Statuses for a specific Ref. + * + * @name StatusesDetail + * @request GET:/repos/{owner}/{repo}/statuses/{ref} + */ + statusesDetail: (owner: string, repo: string, ref: string, params: RequestParams = {}) => + this.request({ + path: `/repos/${owner}/${repo}/statuses/${ref}`, + method: "GET", + format: "json", + ...params, + }), + + /** + * @description Create a Status. + * + * @name StatusesCreate + * @request POST:/repos/{owner}/{repo}/statuses/{ref} + */ + statusesCreate: (owner: string, repo: string, ref: string, body: HeadBranch, params: RequestParams = {}) => + this.request({ + path: `/repos/${owner}/${repo}/statuses/${ref}`, + method: "POST", + body: body, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description List watchers. + * + * @name SubscribersDetail + * @request GET:/repos/{owner}/{repo}/subscribers + */ + subscribersDetail: (owner: string, repo: string, params: RequestParams = {}) => + this.request({ + path: `/repos/${owner}/${repo}/subscribers`, + method: "GET", + format: "json", + ...params, + }), + + /** + * @description Delete a Repository Subscription. + * + * @name SubscriptionDelete + * @request DELETE:/repos/{owner}/{repo}/subscription + */ + subscriptionDelete: (owner: string, repo: string, params: RequestParams = {}) => + this.request({ + path: `/repos/${owner}/${repo}/subscription`, + method: "DELETE", + ...params, + }), + + /** + * @description Get a Repository Subscription. + * + * @name SubscriptionDetail + * @request GET:/repos/{owner}/{repo}/subscription + */ + subscriptionDetail: (owner: string, repo: string, params: RequestParams = {}) => + this.request({ + path: `/repos/${owner}/${repo}/subscription`, + method: "GET", + format: "json", + ...params, + }), + + /** + * @description Set a Repository Subscription + * + * @name SubscriptionUpdate + * @request PUT:/repos/{owner}/{repo}/subscription + */ + subscriptionUpdate: (owner: string, repo: string, body: SubscriptionBody, params: RequestParams = {}) => + this.request({ + path: `/repos/${owner}/${repo}/subscription`, + method: "PUT", + body: body, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Get list of tags. + * + * @name TagsDetail + * @request GET:/repos/{owner}/{repo}/tags + */ + tagsDetail: (owner: string, repo: string, params: RequestParams = {}) => + this.request({ + path: `/repos/${owner}/${repo}/tags`, + method: "GET", + format: "json", + ...params, + }), + + /** + * @description Get list of teams + * + * @name TeamsDetail + * @request GET:/repos/{owner}/{repo}/teams + */ + teamsDetail: (owner: string, repo: string, params: RequestParams = {}) => + this.request({ + path: `/repos/${owner}/${repo}/teams`, + method: "GET", + format: "json", + ...params, + }), + + /** + * @description List Stargazers. New implementation. + * + * @name WatchersDetail + * @request GET:/repos/{owner}/{repo}/watchers + */ + watchersDetail: (owner: string, repo: string, params: RequestParams = {}) => + this.request({ + path: `/repos/${owner}/${repo}/watchers`, + method: "GET", + format: "json", + ...params, + }), + + /** + * @description Get archive link. This method will return a 302 to a URL to download a tarball or zipball archive for a repository. Please make sure your HTTP framework is configured to follow redirects or you will need to use the Location header to make a second GET request. Note: For private repositories, these links are temporary and expire quickly. + * + * @name ReposDetail2 + * @request GET:/repos/{owner}/{repo}/{archive_format}/{path} + * @originalName reposDetail + * @duplicate + */ + reposDetail2: ( + owner: string, + repo: string, + archiveFormat: "tarball" | "zipball", + path: string, + params: RequestParams = {}, + ) => + this.request({ + path: `/repos/${owner}/${repo}/${archiveFormat}/${path}`, + method: "GET", + ...params, + }), + }; + repositories = { + /** + * @description List all public repositories. This provides a dump of every public repository, in the order that they were created. Note: Pagination is powered exclusively by the since parameter. is the Link header to get the URL for the next page of repositories. + * + * @name RepositoriesList + * @request GET:/repositories + */ + repositoriesList: (query?: { since?: string }, params: RequestParams = {}) => + this.request({ + path: `/repositories`, + method: "GET", + query: query, + format: "json", + ...params, + }), + }; + search = { + /** + * @description Search code. + * + * @name CodeList + * @request GET:/search/code + */ + codeList: (query: { order?: "desc" | "asc"; q: string; sort?: "indexed" }, params: RequestParams = {}) => + this.request({ + path: `/search/code`, + method: "GET", + query: query, + format: "json", + ...params, + }), + + /** + * @description Find issues by state and keyword. (This method returns up to 100 results per page.) + * + * @name IssuesList + * @request GET:/search/issues + */ + issuesList: ( + query: { order?: "desc" | "asc"; q: string; sort?: "updated" | "created" | "comments" }, + params: RequestParams = {}, + ) => + this.request({ + path: `/search/issues`, + method: "GET", + query: query, + format: "json", + ...params, + }), + + /** + * @description Search repositories. + * + * @name RepositoriesList + * @request GET:/search/repositories + */ + repositoriesList: ( + query: { order?: "desc" | "asc"; q: string; sort?: "stars" | "forks" | "updated" }, + params: RequestParams = {}, + ) => + this.request({ + path: `/search/repositories`, + method: "GET", + query: query, + format: "json", + ...params, + }), + + /** + * @description Search users. + * + * @name UsersList + * @request GET:/search/users + */ + usersList: ( + query: { order?: "desc" | "asc"; q: string; sort?: "followers" | "repositories" | "joined" }, + params: RequestParams = {}, + ) => + this.request({ + path: `/search/users`, + method: "GET", + query: query, + format: "json", + ...params, + }), + }; + teams = { + /** + * @description Delete team. In order to delete a team, the authenticated user must be an owner of the org that the team is associated with. + * + * @name TeamsDelete + * @request DELETE:/teams/{teamId} + */ + teamsDelete: (teamId: number, params: RequestParams = {}) => + this.request({ + path: `/teams/${teamId}`, + method: "DELETE", + ...params, + }), + + /** + * @description Get team. + * + * @name TeamsDetail + * @request GET:/teams/{teamId} + */ + teamsDetail: (teamId: number, params: RequestParams = {}) => + this.request({ + path: `/teams/${teamId}`, + method: "GET", + format: "json", + ...params, + }), + + /** + * @description Edit team. In order to edit a team, the authenticated user must be an owner of the org that the team is associated with. + * + * @name TeamsPartialUpdate + * @request PATCH:/teams/{teamId} + */ + teamsPartialUpdate: (teamId: number, body: EditTeam, params: RequestParams = {}) => + this.request({ + path: `/teams/${teamId}`, + method: "PATCH", + body: body, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description List team members. In order to list members in a team, the authenticated user must be a member of the team. + * + * @name MembersDetail + * @request GET:/teams/{teamId}/members + */ + membersDetail: (teamId: number, params: RequestParams = {}) => + this.request({ + path: `/teams/${teamId}/members`, + method: "GET", + format: "json", + ...params, + }), + + /** + * @description The "Remove team member" API is deprecated and is scheduled for removal in the next major version of the API. We recommend using the Remove team membership API instead. It allows you to remove both active and pending memberships. Remove team member. In order to remove a user from a team, the authenticated user must have 'admin' permissions to the team or be an owner of the org that the team is associated with. NOTE This does not delete the user, it just remove them from the team. + * + * @name MembersDelete + * @request DELETE:/teams/{teamId}/members/{username} + * @deprecated + */ + membersDelete: (teamId: number, username: string, params: RequestParams = {}) => + this.request({ + path: `/teams/${teamId}/members/${username}`, + method: "DELETE", + ...params, + }), + + /** + * @description The "Get team member" API is deprecated and is scheduled for removal in the next major version of the API. We recommend using the Get team membership API instead. It allows you to get both active and pending memberships. Get team member. In order to get if a user is a member of a team, the authenticated user mus be a member of the team. + * + * @name MembersDetail2 + * @request GET:/teams/{teamId}/members/{username} + * @deprecated + * @originalName membersDetail + * @duplicate + */ + membersDetail2: (teamId: number, username: string, params: RequestParams = {}) => + this.request({ + path: `/teams/${teamId}/members/${username}`, + method: "GET", + ...params, + }), + + /** + * @description The API (described below) is deprecated and is scheduled for removal in the next major version of the API. We recommend using the Add team membership API instead. It allows you to invite new organization members to your teams. Add team member. In order to add a user to a team, the authenticated user must have 'admin' permissions to the team or be an owner of the org that the team is associated with. + * + * @name MembersUpdate + * @request PUT:/teams/{teamId}/members/{username} + * @deprecated + */ + membersUpdate: (teamId: number, username: string, params: RequestParams = {}) => + this.request({ + path: `/teams/${teamId}/members/${username}`, + method: "PUT", + ...params, + }), + + /** + * @description Remove team membership. In order to remove a membership between a user and a team, the authenticated user must have 'admin' permissions to the team or be an owner of the organization that the team is associated with. NOTE: This does not delete the user, it just removes their membership from the team. + * + * @name MembershipsDelete + * @request DELETE:/teams/{teamId}/memberships/{username} + */ + membershipsDelete: (teamId: number, username: string, params: RequestParams = {}) => + this.request({ + path: `/teams/${teamId}/memberships/${username}`, + method: "DELETE", + ...params, + }), + + /** + * @description Get team membership. In order to get a user's membership with a team, the authenticated user must be a member of the team or an owner of the team's organization. + * + * @name MembershipsDetail + * @request GET:/teams/{teamId}/memberships/{username} + */ + membershipsDetail: (teamId: number, username: string, params: RequestParams = {}) => + this.request({ + path: `/teams/${teamId}/memberships/${username}`, + method: "GET", + format: "json", + ...params, + }), + + /** + * @description Add team membership. In order to add a membership between a user and a team, the authenticated user must have 'admin' permissions to the team or be an owner of the organization that the team is associated with. If the user is already a part of the team's organization (meaning they're on at least one other team in the organization), this endpoint will add the user to the team. If the user is completely unaffiliated with the team's organization (meaning they're on none of the organization's teams), this endpoint will send an invitation to the user via email. This newly-created membership will be in the 'pending' state until the user accepts the invitation, at which point the membership will transition to the 'active' state and the user will be added as a member of the team. + * + * @name MembershipsUpdate + * @request PUT:/teams/{teamId}/memberships/{username} + */ + membershipsUpdate: (teamId: number, username: string, params: RequestParams = {}) => + this.request({ + path: `/teams/${teamId}/memberships/${username}`, + method: "PUT", + format: "json", + ...params, + }), + + /** + * @description List team repos + * + * @name ReposDetail + * @request GET:/teams/{teamId}/repos + */ + reposDetail: (teamId: number, params: RequestParams = {}) => + this.request({ + path: `/teams/${teamId}/repos`, + method: "GET", + format: "json", + ...params, + }), + + /** + * @description In order to remove a repository from a team, the authenticated user must be an owner of the org that the team is associated with. NOTE: This does not delete the repository, it just removes it from the team. + * + * @name ReposDelete + * @request DELETE:/teams/{teamId}/repos/{owner}/{repo} + */ + reposDelete: (teamId: number, owner: string, repo: string, params: RequestParams = {}) => + this.request({ + path: `/teams/${teamId}/repos/${owner}/${repo}`, + method: "DELETE", + ...params, + }), + + /** + * @description Check if a team manages a repository + * + * @name ReposDetail2 + * @request GET:/teams/{teamId}/repos/{owner}/{repo} + * @originalName reposDetail + * @duplicate + */ + reposDetail2: (teamId: number, owner: string, repo: string, params: RequestParams = {}) => + this.request({ + path: `/teams/${teamId}/repos/${owner}/${repo}`, + method: "GET", + ...params, + }), + + /** + * @description In order to add a repository to a team, the authenticated user must be an owner of the org that the team is associated with. Also, the repository must be owned by the organization, or a direct fork of a repository owned by the organization. + * + * @name ReposUpdate + * @request PUT:/teams/{teamId}/repos/{owner}/{repo} + */ + reposUpdate: (teamId: number, owner: string, repo: string, params: RequestParams = {}) => + this.request({ + path: `/teams/${teamId}/repos/${owner}/${repo}`, + method: "PUT", + ...params, + }), + }; + user = { + /** + * @description Get the authenticated user. + * + * @name UserList + * @request GET:/user + */ + userList: (params: RequestParams = {}) => + this.request({ + path: `/user`, + method: "GET", + format: "json", + ...params, + }), + + /** + * @description Update the authenticated user. + * + * @name UserPartialUpdate + * @request PATCH:/user + */ + userPartialUpdate: (body: UserUpdate, params: RequestParams = {}) => + this.request({ + path: `/user`, + method: "PATCH", + body: body, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Delete email address(es). You can include a single email address or an array of addresses. + * + * @name EmailsDelete + * @request DELETE:/user/emails + */ + emailsDelete: (body: UserEmails, params: RequestParams = {}) => + this.request({ + path: `/user/emails`, + method: "DELETE", + body: body, + type: ContentType.Json, + ...params, + }), + + /** + * @description List email addresses for a user. In the final version of the API, this method will return an array of hashes with extended information for each email address indicating if the address has been verified and if it's primary email address for GitHub. Until API v3 is finalized, use the application/vnd.github.v3 media type to get other response format. + * + * @name EmailsList + * @request GET:/user/emails + */ + emailsList: (params: RequestParams = {}) => + this.request({ + path: `/user/emails`, + method: "GET", + ...params, + }), + + /** + * @description Add email address(es). You can post a single email address or an array of addresses. + * + * @name EmailsCreate + * @request POST:/user/emails + */ + emailsCreate: (body: EmailsPost, params: RequestParams = {}) => + this.request({ + path: `/user/emails`, + method: "POST", + body: body, + ...params, + }), + + /** + * @description List the authenticated user's followers + * + * @name FollowersList + * @request GET:/user/followers + */ + followersList: (params: RequestParams = {}) => + this.request({ + path: `/user/followers`, + method: "GET", + format: "json", + ...params, + }), + + /** + * @description List who the authenticated user is following. + * + * @name FollowingList + * @request GET:/user/following + */ + followingList: (params: RequestParams = {}) => + this.request({ + path: `/user/following`, + method: "GET", + format: "json", + ...params, + }), + + /** + * @description Unfollow a user. Unfollowing a user requires the user to be logged in and authenticated with basic auth or OAuth with the user:follow scope. + * + * @name FollowingDelete + * @request DELETE:/user/following/{username} + */ + followingDelete: (username: string, params: RequestParams = {}) => + this.request({ + path: `/user/following/${username}`, + method: "DELETE", + ...params, + }), + + /** + * @description Check if you are following a user. + * + * @name FollowingDetail + * @request GET:/user/following/{username} + */ + followingDetail: (username: string, params: RequestParams = {}) => + this.request({ + path: `/user/following/${username}`, + method: "GET", + ...params, + }), + + /** + * @description Follow a user. Following a user requires the user to be logged in and authenticated with basic auth or OAuth with the user:follow scope. + * + * @name FollowingUpdate + * @request PUT:/user/following/{username} + */ + followingUpdate: (username: string, params: RequestParams = {}) => + this.request({ + path: `/user/following/${username}`, + method: "PUT", + ...params, + }), + + /** + * @description List issues. List all issues across owned and member repositories for the authenticated user. + * + * @name IssuesList + * @request GET:/user/issues + */ + issuesList: ( + query: { + filter: "assigned" | "created" | "mentioned" | "subscribed" | "all"; + state: "open" | "closed"; + labels: string; + sort: "created" | "updated" | "comments"; + direction: "asc" | "desc"; + since?: string; + }, + params: RequestParams = {}, + ) => + this.request({ + path: `/user/issues`, + method: "GET", + query: query, + format: "json", + ...params, + }), + + /** + * @description List your public keys. Lists the current user's keys. Management of public keys via the API requires that you are authenticated through basic auth, or OAuth with the 'user', 'write:public_key' scopes. + * + * @name KeysList + * @request GET:/user/keys + */ + keysList: (params: RequestParams = {}) => + this.request({ + path: `/user/keys`, + method: "GET", + format: "json", + ...params, + }), + + /** + * @description Create a public key. + * + * @name KeysCreate + * @request POST:/user/keys + */ + keysCreate: (body: UserKeysPost, params: RequestParams = {}) => + this.request({ + path: `/user/keys`, + method: "POST", + body: body, + format: "json", + ...params, + }), + + /** + * @description Delete a public key. Removes a public key. Requires that you are authenticated via Basic Auth or via OAuth with at least admin:public_key scope. + * + * @name KeysDelete + * @request DELETE:/user/keys/{keyId} + */ + keysDelete: (keyId: number, params: RequestParams = {}) => + this.request({ + path: `/user/keys/${keyId}`, + method: "DELETE", + ...params, + }), + + /** + * @description Get a single public key. + * + * @name KeysDetail + * @request GET:/user/keys/{keyId} + */ + keysDetail: (keyId: number, params: RequestParams = {}) => + this.request({ + path: `/user/keys/${keyId}`, + method: "GET", + format: "json", + ...params, + }), + + /** + * @description List public and private organizations for the authenticated user. + * + * @name OrgsList + * @request GET:/user/orgs + */ + orgsList: (params: RequestParams = {}) => + this.request({ + path: `/user/orgs`, + method: "GET", + format: "json", + ...params, + }), + + /** + * @description List repositories for the authenticated user. Note that this does not include repositories owned by organizations which the user can access. You can lis user organizations and list organization repositories separately. + * + * @name ReposList + * @request GET:/user/repos + */ + reposList: ( + query?: { type?: "all" | "public" | "private" | "forks" | "sources" | "member" }, + params: RequestParams = {}, + ) => + this.request({ + path: `/user/repos`, + method: "GET", + query: query, + format: "json", + ...params, + }), + + /** + * @description Create a new repository for the authenticated user. OAuth users must supply repo scope. + * + * @name ReposCreate + * @request POST:/user/repos + */ + reposCreate: (body: PostRepo, params: RequestParams = {}) => + this.request({ + path: `/user/repos`, + method: "POST", + body: body, + format: "json", + ...params, + }), + + /** + * @description List repositories being starred by the authenticated user. + * + * @name StarredList + * @request GET:/user/starred + */ + starredList: (query?: { direction?: string; sort?: "created" | "updated" }, params: RequestParams = {}) => + this.request({ + path: `/user/starred`, + method: "GET", + query: query, + format: "json", + ...params, + }), + + /** + * @description Unstar a repository + * + * @name StarredDelete + * @request DELETE:/user/starred/{owner}/{repo} + */ + starredDelete: (owner: string, repo: string, params: RequestParams = {}) => + this.request({ + path: `/user/starred/${owner}/${repo}`, + method: "DELETE", + ...params, + }), + + /** + * @description Check if you are starring a repository. + * + * @name StarredDetail + * @request GET:/user/starred/{owner}/{repo} + */ + starredDetail: (owner: string, repo: string, params: RequestParams = {}) => + this.request({ + path: `/user/starred/${owner}/${repo}`, + method: "GET", + ...params, + }), + + /** + * @description Star a repository. + * + * @name StarredUpdate + * @request PUT:/user/starred/{owner}/{repo} + */ + starredUpdate: (owner: string, repo: string, params: RequestParams = {}) => + this.request({ + path: `/user/starred/${owner}/${repo}`, + method: "PUT", + ...params, + }), + + /** + * @description List repositories being watched by the authenticated user. + * + * @name SubscriptionsList + * @request GET:/user/subscriptions + */ + subscriptionsList: (params: RequestParams = {}) => + this.request({ + path: `/user/subscriptions`, + method: "GET", + format: "json", + ...params, + }), + + /** + * @description Stop watching a repository + * + * @name SubscriptionsDelete + * @request DELETE:/user/subscriptions/{owner}/{repo} + * @deprecated + */ + subscriptionsDelete: (owner: string, repo: string, params: RequestParams = {}) => + this.request({ + path: `/user/subscriptions/${owner}/${repo}`, + method: "DELETE", + ...params, + }), + + /** + * @description Check if you are watching a repository. + * + * @name SubscriptionsDetail + * @request GET:/user/subscriptions/{owner}/{repo} + * @deprecated + */ + subscriptionsDetail: (owner: string, repo: string, params: RequestParams = {}) => + this.request({ + path: `/user/subscriptions/${owner}/${repo}`, + method: "GET", + ...params, + }), + + /** + * @description Watch a repository. + * + * @name SubscriptionsUpdate + * @request PUT:/user/subscriptions/{owner}/{repo} + * @deprecated + */ + subscriptionsUpdate: (owner: string, repo: string, params: RequestParams = {}) => + this.request({ + path: `/user/subscriptions/${owner}/${repo}`, + method: "PUT", + ...params, + }), + + /** + * @description List all of the teams across all of the organizations to which the authenticated user belongs. This method requires user or repo scope when authenticating via OAuth. + * + * @name TeamsList + * @request GET:/user/teams + */ + teamsList: (params: RequestParams = {}) => + this.request({ + path: `/user/teams`, + method: "GET", + format: "json", + ...params, + }), + }; + users = { + /** + * @description Get all users. This provides a dump of every user, in the order that they signed up for GitHub. Note: Pagination is powered exclusively by the since parameter. Use the Link header to get the URL for the next page of users. + * + * @name UsersList + * @request GET:/users + */ + usersList: (query?: { since?: number }, params: RequestParams = {}) => + this.request({ + path: `/users`, + method: "GET", + query: query, + format: "json", + ...params, + }), + + /** + * @description Get a single user. + * + * @name UsersDetail + * @request GET:/users/{username} + */ + usersDetail: (username: string, params: RequestParams = {}) => + this.request({ + path: `/users/${username}`, + method: "GET", + format: "json", + ...params, + }), + + /** + * @description If you are authenticated as the given user, you will see your private events. Otherwise, you'll only see public events. + * + * @name EventsDetail + * @request GET:/users/{username}/events + */ + eventsDetail: (username: string, params: RequestParams = {}) => + this.request({ + path: `/users/${username}/events`, + method: "GET", + ...params, + }), + + /** + * @description This is the user's organization dashboard. You must be authenticated as the user to view this. + * + * @name EventsOrgsDetail + * @request GET:/users/{username}/events/orgs/{org} + */ + eventsOrgsDetail: (username: string, org: string, params: RequestParams = {}) => + this.request({ + path: `/users/${username}/events/orgs/${org}`, + method: "GET", + ...params, + }), + + /** + * @description List a user's followers + * + * @name FollowersDetail + * @request GET:/users/{username}/followers + */ + followersDetail: (username: string, params: RequestParams = {}) => + this.request({ + path: `/users/${username}/followers`, + method: "GET", + format: "json", + ...params, + }), + + /** + * @description Check if one user follows another. + * + * @name FollowingDetail + * @request GET:/users/{username}/following/{targetUser} + */ + followingDetail: (username: string, targetUser: string, params: RequestParams = {}) => + this.request({ + path: `/users/${username}/following/${targetUser}`, + method: "GET", + ...params, + }), + + /** + * @description List a users gists. + * + * @name GistsDetail + * @request GET:/users/{username}/gists + */ + gistsDetail: (username: string, query?: { since?: string }, params: RequestParams = {}) => + this.request({ + path: `/users/${username}/gists`, + method: "GET", + query: query, + format: "json", + ...params, + }), + + /** + * @description List public keys for a user. Lists the verified public keys for a user. This is accessible by anyone. + * + * @name KeysDetail + * @request GET:/users/{username}/keys + */ + keysDetail: (username: string, params: RequestParams = {}) => + this.request({ + path: `/users/${username}/keys`, + method: "GET", + format: "json", + ...params, + }), + + /** + * @description List all public organizations for a user. + * + * @name OrgsDetail + * @request GET:/users/{username}/orgs + */ + orgsDetail: (username: string, params: RequestParams = {}) => + this.request({ + path: `/users/${username}/orgs`, + method: "GET", + format: "json", + ...params, + }), + + /** + * @description These are events that you'll only see public events. + * + * @name ReceivedEventsDetail + * @request GET:/users/{username}/received_events + */ + receivedEventsDetail: (username: string, params: RequestParams = {}) => + this.request({ + path: `/users/${username}/received_events`, + method: "GET", + ...params, + }), + + /** + * @description List public events that a user has received + * + * @name ReceivedEventsPublicDetail + * @request GET:/users/{username}/received_events/public + */ + receivedEventsPublicDetail: (username: string, params: RequestParams = {}) => + this.request({ + path: `/users/${username}/received_events/public`, + method: "GET", + ...params, + }), + + /** + * @description List public repositories for the specified user. + * + * @name ReposDetail + * @request GET:/users/{username}/repos + */ + reposDetail: ( + username: string, + query?: { type?: "all" | "public" | "private" | "forks" | "sources" | "member" }, + params: RequestParams = {}, + ) => + this.request({ + path: `/users/${username}/repos`, + method: "GET", + query: query, + format: "json", + ...params, + }), + + /** + * @description List repositories being starred by a user. + * + * @name StarredDetail + * @request GET:/users/{username}/starred + */ + starredDetail: (username: string, params: RequestParams = {}) => + this.request({ + path: `/users/${username}/starred`, + method: "GET", + ...params, + }), + + /** + * @description List repositories being watched by a user. + * + * @name SubscriptionsDetail + * @request GET:/users/{username}/subscriptions + */ + subscriptionsDetail: (username: string, params: RequestParams = {}) => + this.request({ + path: `/users/${username}/subscriptions`, + method: "GET", + ...params, + }), + }; +} diff --git a/tests/spec/patch/test.js b/tests/spec/patch/test.js new file mode 100644 index 000000000..db24795d9 --- /dev/null +++ b/tests/spec/patch/test.js @@ -0,0 +1,19 @@ +const { generateApiForTest } = require("../../helpers/generateApiForTest"); +const { resolve } = require("path"); +const validateGeneratedModule = require("../../helpers/validateGeneratedModule"); +const createSchemaInfos = require("../../helpers/createSchemaInfos"); + +const schemas = createSchemaInfos({ absolutePathToSchemas: resolve(__dirname, "./") }); + +schemas.forEach(({ absolutePath, apiFileName }) => { + generateApiForTest({ + testName: "--patch option test", + silent: true, + name: apiFileName, + input: absolutePath, + output: resolve(__dirname, "./"), + patch: true, + }).then(() => { + validateGeneratedModule(resolve(__dirname, `./${apiFileName}`)); + }); +}); diff --git a/tests/spec/readonly/schema.json b/tests/spec/readonly/schema.json new file mode 100644 index 000000000..283278d59 --- /dev/null +++ b/tests/spec/readonly/schema.json @@ -0,0 +1,61 @@ +{ + "swagger": "2.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore", + "description": "A sample API that uses a petstore as an example to demonstrate features in the swagger-2.0 specification", + "termsOfService": "http://swagger.io/terms/", + "contact": { + "name": "Swagger API Team" + }, + "license": { + "name": "MIT" + } + }, + "host": "petstore.swagger.io", + "basePath": "/api", + "schemes": ["http"], + "consumes": ["application/json"], + "produces": ["application/json"], + "paths": { + "/pets": { + "get": { + "description": "Returns all pets from the system that the user has access to", + "produces": ["application/json"], + "responses": { + "200": { + "description": "A list of pets.", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/Pet" + } + } + } + } + } + } + }, + "definitions": { + "Pet": { + "type": "object", + "required": ["id", "name"], + "properties": { + "id": { + "type": "integer", + "readOnly": true, + "format": "int64" + }, + "name": { + "type": "string" + }, + "tag": { + "type": "string" + }, + "multiple": { + "type": ["string", "number"] + } + } + } + } +} diff --git a/tests/spec/readonly/schema.ts b/tests/spec/readonly/schema.ts new file mode 100644 index 000000000..a23fad81e --- /dev/null +++ b/tests/spec/readonly/schema.ts @@ -0,0 +1,18 @@ +/* eslint-disable */ +/* tslint:disable */ +/* + * --------------------------------------------------------------- + * ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ## + * ## ## + * ## AUTHOR: acacode ## + * ## SOURCE: https://github.com/acacode/swagger-typescript-api ## + * --------------------------------------------------------------- + */ + +export interface Pet { + /** @format int64 */ + readonly id: number; + name: string; + tag?: string; + multiple?: string | number; +} diff --git a/tests/spec/readonly/test.js b/tests/spec/readonly/test.js new file mode 100644 index 000000000..644074eb6 --- /dev/null +++ b/tests/spec/readonly/test.js @@ -0,0 +1,20 @@ +const { generateApiForTest } = require("../../helpers/generateApiForTest"); +const { resolve } = require("path"); +const validateGeneratedModule = require("../../helpers/validateGeneratedModule"); +const createSchemaInfos = require("../../helpers/createSchemaInfos"); + +const schemas = createSchemaInfos({ absolutePathToSchemas: resolve(__dirname, "./") }); + +schemas.forEach(({ absolutePath, apiFileName }) => { + generateApiForTest({ + testName: "--route-types option test", + silent: true, + name: apiFileName, + input: absolutePath, + output: resolve(__dirname, "./"), + addReadonly: true, + generateClient: false, + }).then(() => { + validateGeneratedModule(resolve(__dirname, `./${apiFileName}`)); + }); +}); diff --git a/tests/spec/responses/schema.ts b/tests/spec/responses/schema.ts index 8f53f8ec8..1c61d78bb 100644 --- a/tests/spec/responses/schema.ts +++ b/tests/spec/responses/schema.ts @@ -127,16 +127,16 @@ export class HttpClient { this.securityData = data; }; - private encodeQueryParam(key: string, value: any) { + protected encodeQueryParam(key: string, value: any) { const encodedKey = encodeURIComponent(key); return `${encodedKey}=${encodeURIComponent(typeof value === "number" ? value : `${value}`)}`; } - private addQueryParam(query: QueryParamsType, key: string) { + protected addQueryParam(query: QueryParamsType, key: string) { return this.encodeQueryParam(key, query[key]); } - private addArrayQueryParam(query: QueryParamsType, key: string) { + protected addArrayQueryParam(query: QueryParamsType, key: string) { const value = query[key]; return value.map((v: any) => this.encodeQueryParam(key, v)).join("&"); } @@ -173,7 +173,7 @@ export class HttpClient { [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), }; - private mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { return { ...this.baseApiParams, ...params1, @@ -186,7 +186,7 @@ export class HttpClient { }; } - private createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { if (this.abortControllers.has(cancelToken)) { const abortController = this.abortControllers.get(cancelToken); if (abortController) { @@ -236,12 +236,12 @@ export class HttpClient { ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), ...(requestParams.headers || {}), }, - signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0, + signal: cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal, body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), }).then(async (response) => { const r = response as HttpResponse; - r.data = (null as unknown) as T; - r.error = (null as unknown) as E; + r.data = null as unknown as T; + r.error = null as unknown as E; const data = !responseFormat ? r diff --git a/tests/spec/singleHttpClient/schema.ts b/tests/spec/singleHttpClient/schema.ts index a403aae77..a73b1f823 100644 --- a/tests/spec/singleHttpClient/schema.ts +++ b/tests/spec/singleHttpClient/schema.ts @@ -75,16 +75,16 @@ export class HttpClient { this.securityData = data; }; - private encodeQueryParam(key: string, value: any) { + protected encodeQueryParam(key: string, value: any) { const encodedKey = encodeURIComponent(key); return `${encodedKey}=${encodeURIComponent(typeof value === "number" ? value : `${value}`)}`; } - private addQueryParam(query: QueryParamsType, key: string) { + protected addQueryParam(query: QueryParamsType, key: string) { return this.encodeQueryParam(key, query[key]); } - private addArrayQueryParam(query: QueryParamsType, key: string) { + protected addArrayQueryParam(query: QueryParamsType, key: string) { const value = query[key]; return value.map((v: any) => this.encodeQueryParam(key, v)).join("&"); } @@ -121,7 +121,7 @@ export class HttpClient { [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), }; - private mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { return { ...this.baseApiParams, ...params1, @@ -134,7 +134,7 @@ export class HttpClient { }; } - private createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { if (this.abortControllers.has(cancelToken)) { const abortController = this.abortControllers.get(cancelToken); if (abortController) { @@ -184,12 +184,12 @@ export class HttpClient { ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), ...(requestParams.headers || {}), }, - signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0, + signal: cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal, body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), }).then(async (response) => { const r = response as HttpResponse; - r.data = (null as unknown) as T; - r.error = (null as unknown) as E; + r.data = null as unknown as T; + r.error = null as unknown as E; const data = !responseFormat ? r diff --git a/tests/spec/templates/schema.ts b/tests/spec/templates/schema.ts index 4e83a9c0b..77396e111 100644 --- a/tests/spec/templates/schema.ts +++ b/tests/spec/templates/schema.ts @@ -1512,16 +1512,16 @@ export class HttpClient { this.securityData = data; }; - private encodeQueryParam(key: string, value: any) { + protected encodeQueryParam(key: string, value: any) { const encodedKey = encodeURIComponent(key); return `${encodedKey}=${encodeURIComponent(typeof value === "number" ? value : `${value}`)}`; } - private addQueryParam(query: QueryParamsType, key: string) { + protected addQueryParam(query: QueryParamsType, key: string) { return this.encodeQueryParam(key, query[key]); } - private addArrayQueryParam(query: QueryParamsType, key: string) { + protected addArrayQueryParam(query: QueryParamsType, key: string) { const value = query[key]; return value.map((v: any) => this.encodeQueryParam(key, v)).join("&"); } @@ -1558,7 +1558,7 @@ export class HttpClient { [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), }; - private mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { return { ...this.baseApiParams, ...params1, @@ -1571,7 +1571,7 @@ export class HttpClient { }; } - private createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { if (this.abortControllers.has(cancelToken)) { const abortController = this.abortControllers.get(cancelToken); if (abortController) { @@ -1621,12 +1621,12 @@ export class HttpClient { ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), ...(requestParams.headers || {}), }, - signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0, + signal: cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal, body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), }).then(async (response) => { const r = response as HttpResponse; - r.data = (null as unknown) as T; - r.error = (null as unknown) as E; + r.data = null as unknown as T; + r.error = null as unknown as E; const data = !responseFormat ? r diff --git a/tests/spec/typeSuffixPrefix/schema.ts b/tests/spec/typeSuffixPrefix/schema.ts index d40c72851..311fd372d 100644 --- a/tests/spec/typeSuffixPrefix/schema.ts +++ b/tests/spec/typeSuffixPrefix/schema.ts @@ -1520,16 +1520,16 @@ export class HttpClient { this.securityData = data; }; - private encodeQueryParam(key: string, value: any) { + protected encodeQueryParam(key: string, value: any) { const encodedKey = encodeURIComponent(key); return `${encodedKey}=${encodeURIComponent(typeof value === "number" ? value : `${value}`)}`; } - private addQueryParam(query: QueryParamsType, key: string) { + protected addQueryParam(query: QueryParamsType, key: string) { return this.encodeQueryParam(key, query[key]); } - private addArrayQueryParam(query: QueryParamsType, key: string) { + protected addArrayQueryParam(query: QueryParamsType, key: string) { const value = query[key]; return value.map((v: any) => this.encodeQueryParam(key, v)).join("&"); } @@ -1566,7 +1566,7 @@ export class HttpClient { [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), }; - private mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { return { ...this.baseApiParams, ...params1, @@ -1579,7 +1579,7 @@ export class HttpClient { }; } - private createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { if (this.abortControllers.has(cancelToken)) { const abortController = this.abortControllers.get(cancelToken); if (abortController) { @@ -1629,12 +1629,12 @@ export class HttpClient { ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), ...(requestParams.headers || {}), }, - signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0, + signal: cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal, body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), }).then(async (response) => { const r = response as HttpResponse; - r.data = (null as unknown) as T; - r.error = (null as unknown) as E; + r.data = null as unknown as T; + r.error = null as unknown as E; const data = !responseFormat ? r diff --git a/tests/spec/unionEnums/schema.ts b/tests/spec/unionEnums/schema.ts index acf6b6ed3..43277c5ce 100644 --- a/tests/spec/unionEnums/schema.ts +++ b/tests/spec/unionEnums/schema.ts @@ -87,16 +87,16 @@ export class HttpClient { this.securityData = data; }; - private encodeQueryParam(key: string, value: any) { + protected encodeQueryParam(key: string, value: any) { const encodedKey = encodeURIComponent(key); return `${encodedKey}=${encodeURIComponent(typeof value === "number" ? value : `${value}`)}`; } - private addQueryParam(query: QueryParamsType, key: string) { + protected addQueryParam(query: QueryParamsType, key: string) { return this.encodeQueryParam(key, query[key]); } - private addArrayQueryParam(query: QueryParamsType, key: string) { + protected addArrayQueryParam(query: QueryParamsType, key: string) { const value = query[key]; return value.map((v: any) => this.encodeQueryParam(key, v)).join("&"); } @@ -133,7 +133,7 @@ export class HttpClient { [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), }; - private mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { return { ...this.baseApiParams, ...params1, @@ -146,7 +146,7 @@ export class HttpClient { }; } - private createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { if (this.abortControllers.has(cancelToken)) { const abortController = this.abortControllers.get(cancelToken); if (abortController) { @@ -196,12 +196,12 @@ export class HttpClient { ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), ...(requestParams.headers || {}), }, - signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0, + signal: cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal, body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), }).then(async (response) => { const r = response as HttpResponse; - r.data = (null as unknown) as T; - r.error = (null as unknown) as E; + r.data = null as unknown as T; + r.error = null as unknown as E; const data = !responseFormat ? r diff --git a/tsconfig.json b/tsconfig.json index e03c124b0..8fbd2c8e3 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -5,7 +5,10 @@ "noImplicitAny": true, "target": "esnext", "module": "esnext", + "moduleResolution": "node", "strict": true, - "noEmit": true + "noEmit": true, + "typeRoots": ["node_modules/@types"], + "types": [] } }